#ifndef EGADEFS_H 
#define EGADEFS_H 
void clearbytes(unsigned char *pdst,unsigned char *psrc,int  n);
void andbytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void andReversebytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void  copybytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void andInvertedbytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void  noopbytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void  xorbytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void orbytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void norbytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void equivbytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void invertbytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void orReversebytes(unsigned char *pdst,unsigned char  *psrc,int  n);
void copyInvertedbytes(unsigned char  *pdst,unsigned char  *psrc,int  n);
void orInvertedbytes(unsigned char *pdst,unsigned char *psrc,int  n);
void  nandbytes(unsigned char  *pdst,unsigned char *psrc,int  n);
void setbytes(unsigned char *pdst,unsigned char *psrc,int  n);

void clearbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void andbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void andReversebyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void  copybyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void andInvertedbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void  noopbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void  xorbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void orbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void norbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void equivbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void invertbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void orReversebyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void copyInvertedbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void orInvertedbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
void  nandbyte(unsigned char  *pdst,unsigned char src,int  n, unsigned char pmask);
void setbyte(unsigned char *pdst,unsigned char src,int  n, unsigned char pmask);
struct  _Region *mxCopyArea(struct  _Drawable *pSrcDrawable,struct  _Drawable *pDstDrawable,struct  _GC *pGC,int  xIn,int  yIn,int  widthSrc,int  heightSrc,int  xOut,int  yOut);
struct  _Region *mxCopyPlane(struct  _Drawable *pSrcDrawable,struct  _Drawable *pDstDrawable,struct  _GC *pGC,int  srcx,int  srcy,int  width,int  height,int  dstx,int  dsty,unsigned long  bitPlane);
int  mouseRealizeCursor(struct  _Screen *pScr,struct  _Cursor *pCur);
int  mouseUnrealizeCursor(struct  _Screen *pScr,struct  _Cursor *pCur);
int  mouseDisplayCursor(struct  _Screen *pScr,struct  _Cursor *pCur);
void  mouseBlockHandler(void);
void  mouseSetCursor(int  x,int  y);
void  HideCursor(void);
void  mxRecolorCursor(struct  _Screen *pScr,struct  _Cursor *pCurs,int  displayed);
int  mxprobe(int  i,struct  _ScreenInfo *pScreenInfo,int  argc,char  * *argv);
int  mxClose(int  index,struct  _Screen *pScreen);
int  mxSaveScreen(struct  _Screen *pScr,int  on);
void  mxQueryBestSize(int  kind,unsigned short  *pWidth,unsigned short  *pHeight);
void InitOutput(struct _ScreenInfo *pScreenInfo,int argc,char * *argv);
void mxPutImage(struct _Drawable *pDraw,struct _GC *pGC,int depth,int x,int y,int w,int h,int leftPad,int format,unsigned char *pImage);
void  mxGetImage(struct  _Drawable *pDraw,unsigned int sx,unsigned int sy,int  w,int  h,unsigned int  format,unsigned long  planeMask,unsigned char  *pdstLine);
int  mxinit(int  iScreen,struct  _Screen *pScreen,int  argc,char  * *argv);
void  screen_abort(void);
int  mxListInstalledColormaps(struct  _Screen *pScreen,unsigned long  *pmaps);
void  mxInstallColormap(struct  _ColormapRec *pmap);
void  mxUninstallColormap(struct  _ColormapRec *pmap);
void  mxResolveColor(unsigned short  *pred,unsigned short  *pgreen,unsigned short  *pblue,struct  _Visual *pVisual);
int  mxCreateColormap(struct  _ColormapRec *pmap);
void  mxDestroyColormap(struct  _ColormapRec *pmap);
void  mxStoreColors(struct  _ColormapRec *pmap,int  ndef,struct  _xColorItem *pdefs);
void mxReinstallColormap(void);
int  mxRealizeFont(struct  _Screen *pscr,struct  _Font *pFont);
int  mxUnrealizeFont(struct  _Screen *pscr,struct  _Font *pFont);
int  mxCreateGC(struct  _GC *pGC);
void  mxChangeGC(struct  _GC *pGC,unsigned long  changes);
void  mxValidateGC(struct  _GC *pGC,unsigned long  changes,struct  _Drawable *pDrawable);
void  mxCopyGC(struct  _GC *pGC,unsigned long  mask,struct  _GC *srcGC);
void  mxDestroyGC(struct  _GC *pGC);
void  mxChangeClip(struct  _GC *pGC,int  type,unsigned char  *pvalue,int  nrects);
void  mxCopyClip(struct  _GC *pgcDst,struct  _GC *pgcSrc);
void  mxDestroyClip(struct  _GC *pGC);
void  mxGetSpans(struct  _Drawable *pDrawable,int  wMax,struct  _DDXPoint *ppt,int *pwidth,int nspans,unsigned char  *pdst);
void  mxPolyGlyphBlt(struct  _Drawable *pDrawable,struct  _GC *pGC,int  x,int  y,unsigned int  nglyph,struct  _CharInfo * *ppci,unsigned char  *pglyphBase);
void mxImageGlyphBlt(struct  _Drawable *pDrawable,struct  _GC *pGC,int  x,int  y,unsigned int  nglyph,struct  _CharInfo * *ppci,unsigned char  *pglyphBase);
void  mxPaintWindow(struct  _Window *pWin,struct  _Region *prgn,int  what);
struct  _Pixmap *mxCreatePixmap(struct  _Screen *pScreen,int  width,int  height,int  depth);
int  mxDestroyPixmap(struct  _Pixmap *pPixmap);
void  mxPushPixels(struct  _GC *pGC,struct  _Pixmap *pBitMap,struct  _Drawable *pDrawable,int  dx,int  dy,int  xOrg,int  yOrg);
void  mxSetSpans(struct  _Drawable *pDrawable,struct  _GC *pGC,unsigned char  *psrc,struct  _DDXPoint *ppt,int *pwidth,int  nspans,int  fSorted,struct  _Box *limits);
void  mxFillSpans(struct  _Drawable *pDrawable,struct  _GC *pGC,int  nspans,struct  _DDXPoint *ppt,int *pwidth,int  fSorted,struct  _Box *limits);
void svgaFillRect(struct _Pixmap *pPixmap, int xoff, int yoff, struct _Box rect);
int  mxCreateWindow(struct  _Window *pWin);
int  mxDestroyWindow(struct  _Window *pWin);
int  mxPositionWindow(struct  _Window *pWin,int  x,int  y);
int  mxMapWindow(struct  _Window *pWin);
int  mxUnmapWindow(struct  _Window *pWin);
void  mxCopyWindow(struct  _Window *pWin,struct  _DDXPoint ptOldOrg,struct  _Region *prgnSrc);
int  mxChangeWindowAttributes(struct  _Window *pWin,unsigned long  mask);
int VGAOpen(int mode);
void VGAClose(void);
void VGASetPage(unsigned short);
void VGACopy(int, int, int, int, int, int, int, unsigned char);
void VGAstipple(int, int, int, int, u_char *, int, int, int, u_char, u_char);
struct _Region *mfbPixmapToRegion(struct _Pixmap *pPix);

void mxSaveAreas(struct _Pixmap *, struct _Region *, int, int);
void mxRestoreAreas(struct _Pixmap *, struct _Region *, int, int);
void mxSetClipmaskRgn(struct _GC *, struct _Region *);
struct _Pixmap *mxGetImagePixmap(void);
struct _Pixmap *mxGetSpansPixmap(void);
#endif 
