#ifndef MI_FUNCS_H 
#define MI_FUNCS_H 
void  miPolyArc(struct  _Drawable *pDraw,struct  _GC *pGC,int  narcs,struct  _xArc *parcs);
double  miDcos(double  a);
double  miDsin(double  a);
double  miDasin(double  v);
double  miDatan2(double  dy,double  dx);
struct  finalSpan *realAllocSpan(void);
struct  _Region *miCopyArea(struct  _Drawable *pSrcDrawable,struct  _Drawable *pDstDrawable,struct  _GC *pGC,int  xIn,int  yIn,int  widthSrc,int  heightSrc,int  xOut,int  yOut);
struct  _Region *miCopyPlane(struct  _Drawable *pSrcDrawable,struct  _Drawable *pDstDrawable,struct  _GC *pGC,int  srcx,int  srcy,int  width,int  height,int  dstx,int  dsty,unsigned long  bitPlane);
void  miGetImage(struct  _Drawable *pDraw,unsigned sx,unsigned sy,int  w,int  h,unsigned int  format,unsigned long  planeMask,unsigned char  *pdstLine);
void  miPutImage(struct  _Drawable *pDraw,struct  _GC *pGC,int  depth,unsigned x,unsigned y,int  w,int  h,int  leftPad,int  format,unsigned char  *pImage);
void  miRecolorCursor(struct  _Screen *pScr,struct  _Cursor *pCurs,int  displayed);
struct  _miDash *miDashLine(int  npt,struct  _DDXPoint *ppt,unsigned int  nDash,unsigned char  *pDash,unsigned int  offset,int  *pnseg);
void  miStepDash(int  dist,int  *pDashIndex,unsigned char  *pDash,int  numInDashList,int  *pDashOffset);
int  miDCInitialize(struct  _Screen *pScreen,struct  _miPointerCursorFunc *cursorFuncs);
int miPrintRegion(struct _Region *rgn);
struct  _Region *miHandleExposures(struct  _Drawable *pSrcDrawable,struct  _Drawable *pDstDrawable,struct  _GC *pGC,int  srcx,int  srcy,int  width,int  height,int  dstx,int  dsty,unsigned long  plane);
void  miSendGraphicsExpose(struct  _Client *client,struct  _Region *pRgn,unsigned long  drawable,int  major,int  minor);
void  miWindowExposures(struct  _Window *pWin,struct  _Region *prgn,struct  _Region *other_exposed);
void  miPaintWindow(struct  _Window *pWin,struct  _Region *prgn,int  what);
void  miClearDrawable(struct  _Drawable *pDraw,struct  _GC *pGC);
void  miFillArcSetup(struct  _xArc *arc,struct  _miFillArc *info);
void  miFillArcSliceSetup(struct  _xArc *arc,struct  _miArcSlice *slice,struct  _GC *pGC);
void  miPolyFillArc(struct  _Drawable *pDraw,struct  _GC *pGC,int  narcs,struct  _xArc *parcs);
void  miPolyFillRect(struct  _Drawable *pDrawable,struct  _GC *pGC,int  nrectFill,struct  _xRectangle *prectInit);
void  miPolyGlyphBlt(struct  _Drawable *pDrawable,struct  _GC *pGC,int  x,int  y,unsigned int  nglyph,struct  _CharInfo * *ppci,unsigned char  *pglyphBase);
void  miImageGlyphBlt(struct  _Drawable *pDrawable,struct  _GC *pGC,int  x,int  y,unsigned int  nglyph,struct  _CharInfo * *ppci,unsigned char  *pglyphBase);
void  InitExtensions(int  argc,char  * *argv);
int  miPointerInitialize(struct  _Screen *pScreen,struct  _miPointerSpriteFunc *spriteFuncs,struct  _miPointerCursorFunc *cursorFuncs);
void  miPointerDeltaCursor(struct  _Screen *pScreen,int  dx,int  dy,int  generateEvent);
void  miPointerMoveCursor(struct  _Screen *pScreen,int  x,int  y,int  generateEvent);
void  miPointerQueueEvent(struct  _XEvent *pxE,struct  _DeviceRec *pPointer,struct  _Screen *pScreen);
void  miPointerPosition(struct  _Screen *pScreen,short  *px,short  *py);
void  miRegisterPointerDevice(struct  _Screen *pScreen,struct  _DeviceRec *pDevice);
void  miFillPolygon(struct  _Drawable *dst,struct  _GC *pgc,int  shape,int  mode,int  count,struct  _DDXPoint *pPts);
int  miFillConvexPoly(struct  _Drawable *dst,struct  _GC *pgc,int  count,struct  _DDXPoint *ptsIn);
int  miFillGeneralPoly(struct  _Drawable *dst,struct  _GC *pgc,int  count,struct  _DDXPoint *ptsIn);
void  miPolyPoint(struct  _Drawable *pDrawable,struct  _GC *pGC,int  mode,int  npt,struct  _DDXPoint *pptInit);
void  miPolyRectangle(struct  _Drawable *pDraw,struct  _GC *pGC,int  nrects,struct  _xRectangle *pRects);
void  miPolySegment(struct  _Drawable *pDraw,struct  _GC *pGC,int  nseg,struct  _xSegment *pSegs);
int  miPolyText8(struct  _Drawable *pDraw,struct  _GC *pGC,int  x,int  y,int  count,unsigned char  *chars);
int  miPolyText16(struct  _Drawable *pDraw,struct  _GC *pGC,int  x,int  y,int  count,unsigned char  *chars);
void  miImageText8(struct  _Drawable *pDraw,struct  _GC *pGC,int  x,int  y,int  count,unsigned char  *chars);
void  miImageText16(struct  _Drawable *pDraw,struct  _GC *pGC,int  x,int  y,int  count,unsigned char  *chars);
int  miInsertEdgeInET(struct  _EdgeTable *ET,struct  _EdgeTableEntry *ETE,int  scanline,struct  _ScanLineListBlock * *SLLBlock,int  *iSLLBlock);
int  miCreateETandAET(int  count,struct  _DDXPoint *pts,struct  _EdgeTable *ET,struct  _EdgeTableEntry *AET,struct  _EdgeTableEntry *pETEs,struct  _ScanLineListBlock *pSLLBlock);
void  miloadAET(struct  _EdgeTableEntry *AET,struct  _EdgeTableEntry *ETEs);
void  micomputeWAET(struct  _EdgeTableEntry *AET);
int  miInsertionSort(struct  _EdgeTableEntry *AET);
void  miFreeStorage(struct  _ScanLineListBlock *pSLLBlock);
void  miPushPixels(struct  _GC *pGC,struct  _Pixmap *pBitMap,struct  _Drawable *pDrawable,int  dx,int  dy,int  xOrg,int  yOrg);
struct  _Region *miRegionCreate(struct  _Box *rect,int  size);
void  miRegionInit(struct  _Region *pReg,struct  _Box *rect,int  size);
void  miRegionDestroy(struct  _Region *pReg);
void  miRegionUninit(struct  _Region *pReg);
int  miRectAlloc(struct  _Region *pRgn,int  n);
int  miRegionCopy(struct  _Region *dst,struct  _Region *src);
void  miSetExtents(struct  _Region *pReg);
int  miIntersect(struct  _Region *newReg,struct  _Region *reg1,struct  _Region *reg2);
int  miUnion(struct  _Region *newReg,struct  _Region *reg1,struct  _Region *reg2);
int  miRegionAppend(struct  _Region *dstrgn,struct  _Region *rgn);
int  miRegionValidate(struct  _Region *badreg,int  *pOverlap);
struct  _Region *miRectsToRegion(int  nrects,struct  _xRectangle *prect,int  ctype);
int  miSubtract(struct  _Region *regD,struct  _Region *regM,struct  _Region *regS);
int  miInverse(struct  _Region *newReg,struct  _Region *reg1,struct  _Box *invRect);
int  miRectIn(struct  _Region *region,struct  _Box *prect);
void  miTranslateRegion(struct  _Region *pReg,int  x,int  y);
void  miRegionReset(struct  _Region *pReg,struct  _Box *pBox);
int  miPointInRegion(struct  _Region *pReg,int  x,int  y,struct  _Box *box);
int  miRegionNotEmpty(struct  _Region *pReg);
void  miRegionEmpty(struct  _Region *pReg);
struct  _Box *miRegionExtents(struct  _Region *pReg);
int  miClipSpans(struct  _Region *prgnDst,struct  _DDXPoint *ppt,int  *pwidth,int  nspans,struct  _DDXPoint *pptNew,int  *pwidthNew,int  fSorted);
int  miFindMaxBand(struct  _Region *prgn);
void  miInitSpanGroup(struct  _SpansGroup *spanGroup);
void  miAppendSpans(struct  _SpansGroup *spanGroup,struct  _Spans *spans);
void  miFreeSpanGroup(struct  _SpansGroup *spanGroup);
void  miDisposeSpanGroup(struct  _SpansGroup *spanGroup);
void  miFillUniqueSpanGroup(struct  _Drawable *pDraw,struct  _GC *pGC,struct  _SpansGroup *spanGroup);
void  miFillSpanGroup(struct  _Drawable *pDraw,struct  _GC *pGC,struct  _SpansGroup *spanGroup);
void  miClipNotify(void  (*func)(struct  _Window *,int  ,int  ));
void  miFillPolyHelper(struct  _Drawable *pDrawable,struct  _GC *pGC,unsigned long  pixel,struct  _SpanData *spanData,int  y,int  overall_height,struct  _PolyEdge *left,struct  _PolyEdge *right,int  left_count,int  right_count);
int  miRoundJoinFace(struct  _LineFace *face,struct  _PolyEdge *edge,int  *leftEdge);
void  miRoundJoinClip(struct  _LineFace *pLeft,struct  _LineFace *pRight,struct  _PolyEdge *edge1,struct  _PolyEdge *edge2,int  *y1,int  *y2,int  *left1,int  *left2);
int  miRoundCapClip(struct  _LineFace *face,int  isInt,struct  _PolyEdge *edge,int  *leftEdge);
void  miWideLine(struct  _Drawable *pDrawable,struct  _GC *pGC,int  mode,int  npt,struct  _DDXPoint *pPts);
void  miWideDash(struct  _Drawable *pDrawable,struct  _GC *pGC,int  mode,int  npt,struct  _DDXPoint *pPts);
void miMiter(struct _Drawable *pDrawable, struct _GC *pGC, int a, int b, struct _SppPoint *pPoint,int c, int d);
void  miNotMiter(void);
void  miClearToBackground(struct  _Window *pWin,int  x,int  y,unsigned int  w,unsigned int  h,int  generateExposures);
struct  _DDXPoint *miZeroArcPts(struct  _xArc *arc,struct  _DDXPoint *pts);
void  miZeroPolyArc(struct  _Drawable *pDraw,struct  _GC *pGC,int  narcs,struct  _xArc *parcs);
void  miZeroLine(struct  _Drawable *dst,struct  _GC *pgc,int  mode,int  nptInit,struct  _DDXPoint *pptInit);
void  miZeroDashLine(struct  _Drawable *dst,struct  _GC *pgc,int  mode,int  nptInit,struct  _DDXPoint *pptInit);
void miFreeBackingStore(struct _Window *pWin);
void miInitializeBackingStore (struct _Screen *pScreen, struct _miBSFunc *funcs);
#endif 
