040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/***********************************************************
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncCopyright 1987, 1998 The Open Group
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncPermission to use, copy, modify, distribute, and sell this software and its
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncdocumentation for any purpose is hereby granted without fee, provided that
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncthe above copyright notice appear in all copies and that both that
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynccopyright notice and this permission notice appear in supporting
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncdocumentation.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncThe above copyright notice and this permission notice shall be included in
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncall copies or substantial portions of the Software.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncExcept as contained in this notice, the name of The Open Group shall not be
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncused in advertising or otherwise to promote the sale, use or other dealings
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncin this Software without prior written authorization from The Open Group.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync All Rights Reserved
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncPermission to use, copy, modify, and distribute this software and its
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncdocumentation for any purpose and without fee is hereby granted,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncprovided that the above copyright notice appear in all copies and that
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncboth that copyright notice and this permission notice appear in
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncsupporting documentation, and that the name of Digital not be
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncused in advertising or publicity pertaining to distribution of the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncsoftware without specific, written prior permission.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncSOFTWARE.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync******************************************************************/
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#ifndef __MIFPOLY_H__
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define __MIFPOLY_H__
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#include <X11/Xfuncproto.h>
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define EPSILON 0.000001
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync (b) - (a) <= 0.5)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define ISZERO(x) (Fabs((x)) <= EPSILON)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define NotEnd 0
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define FirstEnd 1
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define SecondEnd 2
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define D2SECANT 5.21671526231167 /* 1/2*sin(11/2) - max extension per width */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstatic _X_INLINE int ICEIL(double x)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync{
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int _cTmp = x;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync}
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* Point with sub-pixel positioning. In this case we use doubles, but
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * see mifpolycon.c for other suggestions
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef struct _SppPoint {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync double x, y;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} SppPointRec, *SppPointPtr;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef struct _SppArc {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync double x, y, width, height;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync double angle1, angle2;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} SppArcRec, *SppArcPtr;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/* mifpolycon.c */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncextern void miFillSppPoly(
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DrawablePtr /*dst*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync GCPtr /*pgc*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int /*count*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync SppPointPtr /*ptsIn*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int /*xTrans*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int /*yTrans*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync double /*xFtrans*/,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync double /*yFtrans*/
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#endif /* __MIFPOLY_H__ */