123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- #include "sys-defines.h"
- #include "extern.h"
- #include "xmi.h"
- #include "mi_spans.h"
- #include "mi_gc.h"
- #include "mi_api.h"
- #define MI_SETUP_PAINTED_SET(paintedSet, pGC) \
- {\
- }
- #define MI_TEAR_DOWN_PAINTED_SET(paintedSet) \
- {\
- miUniquifyPaintedSet (paintedSet); \
- }
- void
- miDrawPoints (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miDrawPoints_internal (paintedSet, pGC, mode, npt, pPts);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miDrawLines (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miDrawLines_internal (paintedSet, pGC, mode, npt, pPts);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miFillPolygon (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int count, const miPoint *pPts)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miFillPolygon_internal (paintedSet, pGC, shape, mode, count, pPts);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miDrawRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *prectInit)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC);
- miDrawRectangles_internal (paintedSet, pGC, nrects, prectInit);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miFillRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrectFill, const miRectangle *prectInit)
- {
- fprintf (stderr, "miFillRectangles()\n");
- MI_SETUP_PAINTED_SET(paintedSet, pGC);
- miFillRectangles_internal (paintedSet, pGC, nrectFill, prectInit);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- #ifndef NO_NONREENTRANT_POLYARC_SUPPORT
- void
- miDrawArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miDrawArcs_internal (paintedSet, pGC, narcs, parcs);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- #endif
- void
- miFillArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miFillArcs_internal (paintedSet, pGC, narcs, parcs);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miDrawArcs_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache)
- {
- MI_SETUP_PAINTED_SET(paintedSet, pGC)
- miDrawArcs_r_internal (paintedSet, pGC, narcs, parcs, ellipseCache);
- MI_TEAR_DOWN_PAINTED_SET(paintedSet)
- }
- void
- miDrawArcs_r_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache)
- {
- if (pGC->lineWidth == 0)
-
- miZeroPolyArc_r (paintedSet, pGC, narcs, parcs, ellipseCache);
- else
- miPolyArc_r (paintedSet, pGC, narcs, parcs, ellipseCache);
- }
- #ifndef NO_NONREENTRANT_POLYARC_SUPPORT
- void
- miDrawArcs_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs)
- {
- if (pGC->lineWidth == 0)
-
- miZeroPolyArc (paintedSet, pGC, narcs, parcs);
- else
- miPolyArc (paintedSet, pGC, narcs, parcs);
- }
- #endif
- void
- miDrawLines_internal (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts)
- {
- if (pGC->lineWidth == 0)
- {
-
- if (pGC->lineStyle == (int)MI_LINE_SOLID)
- miZeroLine (paintedSet, pGC, mode, npt, pPts);
- else
- miZeroDash (paintedSet, pGC, mode, npt, pPts);
- }
- else
- {
- if (pGC->lineStyle == (int)MI_LINE_SOLID)
- miWideLine (paintedSet, pGC, mode, npt, pPts);
- else
- miWideDash (paintedSet, pGC, mode, npt, pPts);
- }
- }
- void
- miDrawRectangles_internal (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *prectInit)
- {
- const miRectangle *pR = prectInit;
- miPoint rect[5];
- int i;
- fprintf (stderr, "miDrawRectangles_internal()\n");
- for (i = 0; i < nrects; i++)
- {
- rect[0].x = pR->x;
- rect[0].y = pR->y;
-
- rect[1].x = pR->x + (int) pR->width;
- rect[1].y = rect[0].y;
-
- rect[2].x = rect[1].x;
- rect[2].y = pR->y + (int) pR->height;
-
- rect[3].x = rect[0].x;
- rect[3].y = rect[2].y;
-
-
- rect[4].x = rect[0].x;
- rect[4].y = rect[0].y;
-
- miDrawLines_internal (paintedSet, pGC, MI_COORD_MODE_ORIGIN, 5, rect);
- pR++;
- }
- }
|