65fea56f17cd614bc8908264df980a62e1931468vboxsync/***********************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987, 1998 The Open Group
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncthe above copyright notice appear in all copies and that both that
65fea56f17cd614bc8908264df980a62e1931468vboxsynccopyright notice and this permission notice appear in supporting
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncThe above copyright notice and this permission notice shall be included in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncall copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65fea56f17cd614bc8908264df980a62e1931468vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
65fea56f17cd614bc8908264df980a62e1931468vboxsyncin this Software without prior written authorization from The Open Group.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync All Rights Reserved
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, and distribute this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose and without fee is hereby granted,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncprovided that the above copyright notice appear in all copies and that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncboth that copyright notice and this permission notice appear in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsupporting documentation, and that the name of Digital not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or publicity pertaining to distribution of the
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsoftware without specific, written prior permission.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
65fea56f17cd614bc8908264df980a62e1931468vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
65fea56f17cd614bc8908264df980a62e1931468vboxsyncSOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync******************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef __MIFPOLY_H__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define __MIFPOLY_H__
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <X11/Xfuncproto.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define EPSILON 0.000001
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (b) - (a) <= 0.5)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define ISZERO(x) (fabs((x)) <= EPSILON)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define NotEnd 0
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define FirstEnd 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SecondEnd 2
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define D2SECANT 5.21671526231167 /* 1/2*sin(11/2) - max extension per width */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncstatic _X_INLINE int
65fea56f17cd614bc8908264df980a62e1931468vboxsyncICEIL(double x)
65fea56f17cd614bc8908264df980a62e1931468vboxsync{
65fea56f17cd614bc8908264df980a62e1931468vboxsync int _cTmp = x;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp + 1;
65fea56f17cd614bc8908264df980a62e1931468vboxsync}
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Point with sub-pixel positioning. In this case we use doubles, but
65fea56f17cd614bc8908264df980a62e1931468vboxsync * see mifpolycon.c for other suggestions
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _SppPoint {
65fea56f17cd614bc8908264df980a62e1931468vboxsync double x, y;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} SppPointRec, *SppPointPtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _SppArc {
65fea56f17cd614bc8908264df980a62e1931468vboxsync double x, y, width, height;
65fea56f17cd614bc8908264df980a62e1931468vboxsync double angle1, angle2;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} SppArcRec, *SppArcPtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* mifpolycon.c */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void miFillSppPoly(DrawablePtr /*dst */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync GCPtr /*pgc */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*count */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync SppPointPtr /*ptsIn */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*xTrans */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int /*yTrans */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync double /*xFtrans */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync double /*yFtrans */
65fea56f17cd614bc8908264df980a62e1931468vboxsync );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __MIFPOLY_H__ */