~ubuntu-branches/ubuntu/gutsy/plotutils/gutsy

« back to all changes in this revision

Viewing changes to libxmi/mi_zerarc.c

  • Committer: Bazaar Package Importer
  • Author(s): Floris Bruynooghe
  • Date: 2007-05-10 19:48:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070510194854-mrr3lgwzpxd8hovo
Tags: 2.5-2
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the GNU libxmi package.  
 
2
 
 
3
   Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium.  For an
 
4
   associated permission notice, see the accompanying file README-X.
 
5
   
 
6
   GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software
 
7
   Foundation, Inc.
 
8
 
 
9
   The GNU libxmi package is free software.  You may redistribute it
 
10
   and/or modify it under the terms of the GNU General Public License as
 
11
   published by the Free Software foundation; either version 2, or (at your
 
12
   option) any later version.
 
13
 
 
14
   The GNU libxmi package is distributed in the hope that it will be
 
15
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
   General Public License for more details.
 
18
 
 
19
   You should have received a copy of the GNU General Public License along
 
20
   with the GNU plotutils package; see the file COPYING.  If not, write to
 
21
   the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
 
22
   Boston, MA 02110-1301, USA. */
 
23
 
1
24
/* Original author:  Bob Scheifler, MIT X Consortium, mid 1980s.
2
25
   Hacked by Robert S. Maier <rsm@math.arizona.edu>, 1998-99 */
3
26
 
66
89
static const miZeroArcPt _oob_arc_pt = {INT_MAX, INT_MAX, 0};
67
90
 
68
91
/* forward references */
69
 
static bool miZeroArcSetup ____P((const miArc *arc, miZeroArc *info, bool ok360));
70
 
static miPoint * miZeroArcPts ____P((const miArc *arc, miPoint *pts));
71
 
static void miZeroArcDashPts ____P((const miGC *pGC, const miArc *arc, miDashInfo *dinfo, int maxPts, miPoint **pts));
 
92
static bool miZeroArcSetup (const miArc *arc, miZeroArc *info, bool ok360);
 
93
static miPoint * miZeroArcPts (const miArc *arc, miPoint *pts);
 
94
static void miZeroArcDashPts (const miGC *pGC, const miArc *arc, miDashInfo *dinfo, int maxPts, miPoint **pts);
72
95
 
73
96
 
74
97
/*
77
100
 * `rasterized ellipse' cache. */
78
101
 
79
102
void
80
 
#ifdef _HAVE_PROTOS
81
103
miZeroPolyArc_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache)
82
 
#else
83
 
miZeroPolyArc_r (paintedSet, pGC, narcs, parcs, ellipseCache)
84
 
     miPaintedSet *paintedSet;
85
 
     const miGC *pGC;
86
 
     int narcs;
87
 
     const miArc *parcs;
88
 
     miEllipseCache *ellipseCache;
89
 
#endif
90
104
{
91
105
  const miArc *arc;
92
106
  miDashInfo dinfo;
203
217
 
204
218
#ifndef NO_NONREENTRANT_POLYARC_SUPPORT
205
219
void
206
 
#ifdef _HAVE_PROTOS
207
220
miZeroPolyArc (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs)
208
 
#else
209
 
miZeroPolyArc (paintedSet, pGC, narcs, parcs)
210
 
     miPaintedSet *paintedSet;
211
 
     const miGC *pGC;
212
 
     int narcs;
213
 
     const miArc *parcs;
214
 
#endif
215
221
{
216
222
  if (_mi_ellipseCache == (miEllipseCache *)NULL)
217
223
    _mi_ellipseCache = miNewEllipseCache ();
234
240
   pre-allocated storage; return pointer to miPoint after last-generated
235
241
   point.  Storage supplied by caller, should be sufficiently large. */
236
242
static miPoint *
237
 
#ifdef _HAVE_PROTOS
238
243
miZeroArcPts (const miArc *arc, miPoint *pts)
239
 
#else
240
 
miZeroArcPts (arc, pts)
241
 
     const miArc *arc;
242
 
     miPoint *pts;
243
 
#endif
244
244
{
245
245
  miZeroArc info;
246
246
  int x, y, a, b, d;
349
349
/* Generate the points that make up a dashed zero-width arc, possibly
350
350
   multicolored; write them to pre-allocated storage, indexed by paint
351
351
   type. */
 
352
 
 
353
/* ARGS: dinfo = updated vars (e.g. dashNum, dashIndex),
 
354
         pts[i] = storage for paint type #i */
352
355
static void
353
 
#ifdef _HAVE_PROTOS
354
356
miZeroArcDashPts (const miGC *pGC, const miArc *arc, miDashInfo *dinfo, int maxPts, miPoint **pts)
355
 
#else
356
 
miZeroArcDashPts (pGC, arc, dinfo, maxPts, pts)
357
 
     const miGC *pGC;
358
 
     const miArc *arc;
359
 
     miDashInfo *dinfo;         /* updated vars (e.g. dashNum, dashIndex) */
360
 
     int maxPts;
361
 
     miPoint **pts;             /* pts[i] is storage for paint type #i */
362
 
#endif
363
357
{
364
358
  miZeroArc info;
365
359
  int x, y, a, b, d;
585
579
   Generates a miZeroArc struct for any specified arc. */
586
580
 
587
581
static bool
588
 
#ifdef _HAVE_PROTOS
589
582
miZeroArcSetup (const miArc *arc, miZeroArc *info, bool ok360)
590
 
#else
591
 
miZeroArcSetup (arc, info, ok360)
592
 
     const miArc *arc;
593
 
     miZeroArc *info;
594
 
     bool ok360;
595
 
#endif
596
583
{
597
584
  int l, i;
598
585
  int angle1, angle2;