/*  %kw # %v    %n    %d    %t # */
/* Version # 28    METEXTRN.H    22-Jun-94    12:18:30 # */

/* ************************************************************* *
 *  METEXTRN.H  -  MetaWINDOW External Procedure Declarations    *
 *  Include after METCONST.H, METPORTS.H                         *      
 *  Copyright (c) 1987-1992 Metagraphics Software Corporation    * 
 * ************************************************************* */

#ifdef    WatcomC
#define SEQ cdecl
#endif /* WatcomC */

#ifdef    TopSpeedC
#define SEQ far cdecl
#endif /* TopSpeedC */

#ifdef    __cplusplus      /* If C++, disable "mangling" */
extern "C" {
#endif /* __cplusplus */

#ifndef SEQ
#define SEQ
#endif 

void  SEQ  AddPt          (point *mwSRCPT, point *mwDSTPT);
void  SEQ  AlignPattern   (int mwPATTERN, int mwPATX, int mwPATY);
void  SEQ  BackColor      (int mwCOLOR);
void  SEQ  BackColor32    (long mwCOLOR);
void  SEQ  BackPattern    (int mwPATTERN);
region * SEQ BitmapToRegion  ( rect *SRCRECT, int XPARCOLOR );
void  SEQ  BorderColor    (int mwCOLOR);
void  SEQ  BoundaryFill   (int mwSEEDX, int mwSEEDY, int mwBCOLOR, rect *mwLIMIT);
void  SEQ  BoundaryFill32 (int mwSEEDX, int mwSEEDY, long mwBCOLOR, rect *mwLIMIT);
void  SEQ  CenterRect     (point *mwPT, int mwWIDTHX, int mwHEIGHTY, rect *mwR);
int   SEQ  CharWidth      (char mwCH);
int   SEQ  CharWidth16    (Word mwCH);
void  SEQ  ClipRect       (rect *mwR);
void  SEQ  ClipRegion     (region *mwRGN);
int   SEQ  CloseBitmap    (grafMap *mwNEWMAP );
region * SEQ CloseRegion  (void);
int   SEQ  CopyBlit       (grafPort *mwSRC, grafPort *mwDST,
                           rect *mwSRCRECT, rect *mwDSTRECT);
grafPort * SEQ CreateBitmap( int MEMTYPE, int WIDTH, int HEIGHT );
void  SEQ  CursorBitmap   (grafMap *mwNEWMAP);
void  SEQ  CursorColor    (int mwFORECOLOR, int mwBACKCOLOR);
void  SEQ  CursorColor32  (long mwFORECOLOR, long mwBACKCOLOR);
void  SEQ  CursorStyle    (int mwCURSORNBR);
void  SEQ  DashStyle      (int mwDASHSTYL);
void  SEQ  DefineCursor   (int mwCURSORNBR, int mwHOTX, int mwHOTY,
                           cursor *mwSCREENMASK, cursor *mwCURSORMASK);
void  SEQ  DefineDash     (int mwDASHNBR, dashRcd *mwDASHARRAY);
void  SEQ  DefinePattern  (int mwPATTERN, patRcd *mwPATIMAGE);
void  SEQ  DestroyBitmap  ( grafPort *PORT );
void  SEQ  DestroyRegion  ( region *RGN );
void  SEQ  DrawChar       (char mwCH);
void  SEQ  DrawChar16     (Word mwCH);
void  SEQ  DrawString     (char *mwTEXTSTR);
void  SEQ  DrawString16   (Word *mwTEXTSTR);
void  SEQ  DrawText       (char *mwTEXTSTR, int mwINDEX, int mwCOUNT);
void  SEQ  DrawText16     (Word *mwTEXTSTR, int mwINDEX, int mwCOUNT);
void  SEQ  DupPt          (point *mwSRCPT, point *mwDSTPT);
void  SEQ  DupRect        (rect *mwSRCRECT, rect *mwDSTRECT);
region * SEQ DupRegion    (region *mwSRCRGN );
int   SEQ  EmptyRect      (rect *mwTESTRECT );
int   SEQ  EmptyRegion    (region *mwTESTREGION );
int   SEQ  EqualPt        (point *mwPT1, point *mwPT2);
int   SEQ  EqualRect      (rect *mwRECT1, rect *mwRECT2);
int   SEQ  EqualRegion    (region *mwRGN1, region *mwRGN2 );
void  SEQ  EraseArc       (rect *mwR, int mwBGNANGLE, int mwARCANGLE);
void  SEQ  EraseBezier    (point *mwBEZPTS, int mwPTCNT);
void  SEQ  EraseOval      (rect *mwR);
void  SEQ  ErasePoly      (int mwPOLYCNT, polyHead *mwPOLYHDR, point *mwPOLYPTS);
void  SEQ  EraseRect      (rect *mwR);
void  SEQ  EraseRegion    (region *mwRGN );
void  SEQ  EraseRoundRect (rect *mwR, int mwDIAX, int mwDIAY);
void  SEQ  EventQueue     (int mwTF);
int   SEQ  FileLoad       (char *mwFILENAME, void *mwDATAAREA, unsigned int mwAREASIZE);
int   SEQ  FileQuery      (char *mwFILESPEC, dirRec *mwDIRINFO, int mwDIRSIZE);
int   SEQ  FileStore      (char *mwFILENAME, void *mwDATAAREA, unsigned int mwAREASIZE);
void  SEQ  FillArc        (rect *mwR, int mwBGNANGLE, int mwARCANGLE, int mwPATTRN);
void  SEQ  FillBezier     (point *mwBEZPTS, int mwPTCNT, int mwPATT);
void  SEQ  FillOval       (rect *mwR, int mwPATTERN);
void  SEQ  FillPoly       (int mwPOLYCNT, polyHead *mwPOLYHDR,
                           point *mwPOLYPTS, int mwPATTERN);
void  SEQ  FillPolygon    (point *mwVERTICES, int mwVERTICOUNT,
                           int mwVERTIFORM, int mwPOLYSHAPE); 
void  SEQ  FillRect       (rect *mwR, int mwPATTERN);
void  SEQ  FillRegion     (region *mwRGN, int mwPATTERN ); 
void  SEQ  FillRoundRect  (rect *mwR, int mwDIAX, int mwDIAY, int mwPATTERN);
void  SEQ  FillRule       (int mwRULE);
int   SEQ  FindClosestRGB (palData *mwRGBCOLOR, palData *mwRGBPALETTE );
void  SEQ  FloodFill      (int mwSEEDX, int mwSEEDY, rect *mwLIMIT);
void  SEQ  FrameArc       (rect *mwR, int mwBGNANGLE, int mwARCANGLE);
void  SEQ  FrameBezier    (point *mwBEZPTS, int mwPTCNT);
void  SEQ  FrameOval      (rect *mwR);
void  SEQ  FramePoly      (int mwPOLYCNT, polyHead *mwPOLYHDR, point *mwPOLYPTS);
void  SEQ  FrameRect      (rect *mwR);
void  SEQ  FrameRoundRect (rect *mwR, int mwDIAX, int mwDIAY);
void  SEQ  Gbl2LclPt      (point *mwPT);
void  SEQ  Gbl2LclRect    (rect *mwR);
void  SEQ  Gbl2VirPt      (point *mwPT);
void  SEQ  Gbl2VirRect    (rect *mwR);
void  SEQ  GetPenState    (penState *mwSTATE);
int   SEQ  GetPixel       (int mwX, int mwY);
void  SEQ  GetPort        (grafPort **mwPORTPTR);
void * SEQ GrafAlloc      ( unsigned int mwSIZE );
void  SEQ  GrafFree       ( void *mwALLOC );
void  SEQ  GrafQueue      (int mwMSGCNT );
void  SEQ  GrafPool       (unsigned mwPOOLSIZE );
int   SEQ  HardCopy       ( grafPort *, HCInfoRec *, char *);
void  SEQ  HideCursor     (void);
void  SEQ  HidePen        (void);
long  SEQ  ImageSize      (rect *mwR);
int   SEQ  InceptRect     (rect *mwRECT1, rect *mwRECT2, rect *mwDSTRECT);
int   SEQ  InitBitmap     (int mwDEVICE, grafMap *mwGRAFMAP);
int   SEQ  InitGraphics   (int mwDEVMODE);
int   SEQ  InitMouse      (int mwDEVICE);
void  SEQ  InitPort       (grafPort *mwPORT);
void  SEQ  InitRowTable   (grafMap *mwNEWMAP, int mwINTERLEAVE,
                           int mwINTERSEG, int mwINTEROFF);
void  SEQ  InsetRect      (rect *mwR, int mwDX, int mwDY);
region * SEQ IntersectRegion (region *mwRGN1, region *mwRGN2	);
void  SEQ  InvertArc      (rect *mwR, int mwBGNANGLE, int mwARCANGLE);
void  SEQ  InvertBezier   (point *mwBEZPTS, int mwPTCNT);
void  SEQ  InvertOval     (rect *mwR);
void  SEQ  InvertPoly     (int mwPOLYCNT, polyHead *mwPOLYHDR, point *mwPOLYPTS);
void  SEQ  InvertRect     (rect *mwR);
void  SEQ  InvertRegion    (region *mwRGN );
void  SEQ  InvertRoundRect(rect *mwR, int mwDIAX, int mwDIAY);
int   SEQ  KeyEvent       (int mwWAIT, mwEvent *mwEVNT);
void  SEQ  Lcl2GblPt      (point *mwPT);
void  SEQ  Lcl2GblRect    (rect *mwR);
void  SEQ  Lcl2VirPt      (point *mwPT);
void  SEQ  Lcl2VirRect    (rect *mwR);
void  SEQ  LimitMouse     (int mwXMIN, int mwYMIN, int mwXMAX, int mwYMAX);
void  SEQ  LineRel        (int mwDLTX, int mwDLTY);
void  SEQ  LineTo         (int mwX, int mwY);
void  SEQ  MapPoly        (int mwPOLYCNT, polyHead *mwPOLYHDR,
                           point *mwPOLYPTS, rect *mwSRCR, rect *mwDSTR);
void  SEQ  MapPt          (point *mwPT, rect *mwSRCR, rect *mwDSTR);
void  SEQ  MapRect        (rect *mwR, rect *mwSRCR, rect *mwDSTR);
void  SEQ  MarkerAngle    (int mwANGLE);
void  SEQ  MarkerSize     (int mwWIDTH, int mwHEIGHT);
void  SEQ  MarkerType     (int mwMARKERNBR);
void  SEQ  MaskEvent      (int mwMASK);
void  SEQ  MaskMouse      (int mwMASK);
void  SEQ  MetaPath       (char *mwSTRING);
void  SEQ  MetaVersion    (char *mwSTRING);
void  SEQ  MiterLimit     (int mwLIMITANGLE);
void  SEQ  MoveCursor     (int mwX, int mwY);
void  SEQ  MovePortTo     (int mwGBLLEFT, int mwGBLTOP);
void  SEQ  MoveRel        (int mwDLTX, int mwDLTY);
void  SEQ  MoveTo         (int mwX, int mwY);
void  SEQ  NullRect       (rect *mwDSTRECT );
void  SEQ  NullRegion     (region *mwDSTRGN );
void  SEQ  OffsetPoly     (int mwPOLYCNT, polyHead *mwPOLYHDR,
                           point *mwPOLYPTS, int mwDX, int mwDY);
void  SEQ  OffsetRect     (rect *mwR, int mwDX, int mwDY);
void  SEQ  OffsetRegion   (region *mwRGN, int DX, int DY );
void  SEQ  OpenRegion     (void);
void  SEQ  OvalPt         (rect *mwR, int mwANGLE, point *mwPT);
void  SEQ  PaintArc       (rect *mwR, int mwBGNANGLE, int mwENDANGLE);
void  SEQ  PaintBezier    (point *mwBEZPTS, int mwPTCNT);
void  SEQ  PaintOval      (rect *mwR);
void  SEQ  PaintPoly      (int mwPOLYCNT, polyHead *mwPOLYHDR, point *mwPOLYPTS);
void  SEQ  PaintRect      (rect *mwR);
void  SEQ  PaintRegion    (region *mwRGN );
void  SEQ  PaintRoundRect (rect *mwR, int mwDIAX, int mwDIAY);
int   SEQ  PeekEvent      (int mwINDEX, mwEvent *mwEVNT);
void  SEQ  PenCap         (int mwCAPSTYLE);
void  SEQ  PenColor       (int mwCOLOR);
void  SEQ  PenColor32     (long mwCOLOR);
void  SEQ  PenDash        (int mwDASHNBR);
void  SEQ  PenJoin        (int mwJOINSTYLE);
void  SEQ  PenNormal      (void);
void  SEQ  PenOffset      (int mwDASHOFFSET);
void  SEQ  PenPattern     (int mwPATTERN);
void  SEQ  PenSize        (int mwDIAX, int mwDIAY);
void  SEQ  PenShape       (int mwPENSHAPE);
void  SEQ  PlaneMask      (long mwPMASK);
void  SEQ  PolyBezier     (point *mwBEZPTS, int mwPTCNT);
void  SEQ  PolyLine       (int mwPTCNT, point *mwPTS);
void  SEQ  PolyMarker     (int mwNPTS, point *mwXYPTS);
void  SEQ  PolySegment    (int mwSEGCNT, segPts *mwSEGLIST);
void  SEQ  PopGrafix      (pusharea *mwSAVEAREA);
void  SEQ  PortBitmap     (grafMap *mwNEWMAP);
void  SEQ  PortOrigin     (int mwTOPBOT);
void  SEQ  PortPattern    (patList *mwPATTERNLIST); 
void  SEQ  PortSize       (int mwPIXWIDTHX, int mwPIXHEIGHTY);
void  SEQ  ProtectRect    (rect *mwR);
void  SEQ  Pt2Rect        (point *mwPT1, point *mwPT2, rect *mwR);
int   SEQ  PtInArc        (point *mwTESTPT, rect *mwR,
                           int mwBGNANGLE, int mwARCANGLE, int mwSIZEX, int mwSIZEY);
int   SEQ  PtInBoundary	  (point *mwTESTPT, point *mwSEEDPT,
                           int mwBOUNDCOLOR, rect *mwSCANRECT,
                           int mwPIXWIDX, int mwPIXHGTY);
int   SEQ  PtInBoundary32 (point *mwTESTPT, point *mwSEEDPT,
                           long mwBOUNDCOLOR, rect *mwSCANRECT,
                           int mwPIXWIDX, int mwPIXHGTY);
int   SEQ  PtInFlood      (point *mwTESTPT, point *mwSEEDPT, 
                           rect *mwSCANRECT,
                           int mwPIXWIDX, int mwPIXHGTY);
int   SEQ  PtInOval       (point *mwTESTPT, rect *mwR, int mwSIZEX, int mwSIZEY);
int   SEQ  PtInPoly       (point *mwTESTPT, int mwPOLYCNT, polyHead *mwPOLYHDRS,
                           point *mwPOLYPTS, int mwpenX, int mwpenY);
int   SEQ  PtInRect       (point *mwTESTPT, rect *mwR, int mwSIZEX, int mwSIZEY);
int   SEQ  PtInRegion     (point *mwTESTPT, region *mwRGN,
                           int mwPIXWIDX, int mwPIXHGTY );
int   SEQ  PtInRoundRect  (point *mwTESTPT, rect *mwR, int mwDIAX, int mwDIAY,
                           int mwSIZEX, int mwSIZEY);
int   SEQ  PtOnArc        (point *mwTESTPT, rect *mwR,
                           int mwBGNANGLE, int mwARCANGLE,
                           int mwSIZEX, int mwSIZEY);
int   SEQ  PtOnLine       (point *mwTESTPT, point *mwPT1, point *mwPT2,
                           int mwSIZEX, int mwSIZEY);
int   SEQ  PtOnOval       (point *mwTESTPT, rect *mwR, int mwSIZEX, int mwSIZEY);
int   SEQ  PtOnPoly       (point *mwTESTPT, int mwPOLYCNT,polyHead *mwPOLYHDRS,
                           point *mwPOLYPTS, int penX,int penY);
int   SEQ  PtOnRect       (point *mwTESTPT, rect *mwR, int mwSIZEX, int mwSIZEY);
int   SEQ  PtOnRoundRect  (point *mwTESTPT, rect *mwR, int mwDIAX, int mwDIAY,
                           int mwSIZEX, int mwSIZEY);
int   SEQ  PtToAngle      (rect *mwR, point *mwPT);
void  SEQ  PushGrafix     (pusharea *mwSAVEAREA);
long  SEQ  QueryColors    (void);
void  SEQ  QueryCursor    (int *mwCURSORX, int *mwCURSORY,
                           int *mwCURSORLEVEL,int *mwBUTTONS);
int   SEQ  QueryError     (void);
int   SEQ  QueryGraphics  (int);
int   SEQ  QueryMouse     (int);
void  SEQ  QueryPosn      (int *X, int *Y);
void  SEQ  QueryRes       (int *mwRESX, int *mwRESY);
int   SEQ  QueryX         (void);
int   SEQ  QueryY         (void);
void  SEQ  RasterOp       (int mwRASOP);
void  SEQ  ReadImage      (rect *mwSRCR, image *mwDSTIMAGE);
void  SEQ  ReadMouse      (int *X, int *Y, int *mwSW);
void  SEQ  ReadPalette    (int mwPALNBR, int mwBGNINDEX, int mwENDINDEX,
                           palData *mwRGBCOLORS);
int   SEQ  RectInRegion   (rect *mwR, region *mwRGN ); 
region * SEQ RectListToRegion(int mwNUMRECTS, rect *mwRLIST );
region * SEQ RectRegion   (rect *mwSRCRECT );
int   SEQ  ResrcLoad      (char *mwFILENAME, void *mwDATAAREA, unsigned int mwAREASIZE);
int   SEQ  ResrcQuery     (char *mwFILESPEC, dirRec *mwDIRINFO, int mwDIRSIZE);
void  SEQ  ScaleMouse     (int mwFACTORX, int mwFACTORY);
void  SEQ  ScalePt        (point *mwPT, rect *mwSRCR, rect *mwDSTR);
void  SEQ  ScreenRect     (rect *mwSCRNR);
void  SEQ  ScrollRect     (rect *mwR, int mwDX, int mwDY);
void  SEQ  SetBitmap      (int mwPAGE, grafMap *mwNEWMAP );
void  SEQ  SetDisplay     (int mwPAGE);
void  SEQ  SetFont        (fontRcd *mwFONTBUFFER);
void  SEQ  SetLocal       (void);
void  SEQ  SetMouse       (mouseRcd *mwLOCATOR);
void  SEQ  SetOrigin      (int mwLCLX, int mwLCLY);
void  SEQ  SetPenState    (penState *mwSTATE);
void  SEQ  SetPixel       (int X, int Y);
void  SEQ  SetPort        (grafPort *mwNEWPORT);
void  SEQ  SetPt          (point *mwPT, int X, int Y);
void  SEQ  SetRect        (rect *mwR, int X1, int Y1, int X2, int Y2);
region * SEQ SetRegion    (int X1, int Y1, int X2, int Y2);
void  SEQ  SetVirtual     (void);
int   SEQ  ShiftRect      (rect *mwR, int DX, int DY, rect *R1, rect *R2);
void  SEQ  ShowCursor     (void);
void  SEQ  ShowPen        (void);
void  SEQ  StopEvent      (void);
int   SEQ  StopGraphics   (void);
int   SEQ  StopMouse      (void);
int   SEQ  StoreEvent     (mwEvent *mwEVNT);
int   SEQ  StringWidth    (char *mwTEXTSTR);
int   SEQ  StringWidth16  (Word *mwTEXTSTR);
void  SEQ  SubPt          (point *mwSRCPT, point *mwDSTPT);
region * SEQ SubtractRegion  (region *mwRGN1, region *mwRGN2 );
void  SEQ  TextAlign      (int mwHORZ, int mwVERT);
void  SEQ  TextAngle      (int mwANGLE);
void  SEQ  TextBold       (int mwPIXBOLD );
void  SEQ  TextExtra      (int mwSPACE);
void  SEQ  TextFace       (int mwFACE);
void  SEQ  TextMode       (int mwRASOP);
void  SEQ  TextPath       (int mwPATH);
void  SEQ  TextScore      (int mwGAP);
void  SEQ  TextSize       (int mwWIDTHX, int mwHEIGHTY);
void  SEQ  TextSlant      (int mwANGLE);
void  SEQ  TextSpace      (int mwSPACE);
void  SEQ  TextUnder      (int mwBELOW);
int   SEQ  TextWidth      (char *mwTEXTSTR, int mwINDEX, int mwCOUNT);
int   SEQ  TextWidth16    (Word *mwTEXTSTR, int mwINDEX, int mwCOUNT);
void  SEQ  TrackCursor    (int mwTF);
void  SEQ  UnionRect      (rect *mwRECT1, rect *mwRECT2, rect *mwDSTRECT);
region * SEQ UnionRegion  (region *mwRGN1, region *mwRGN2 ); 
void  SEQ  Vir2GblPt      (point *mwPT);
void  SEQ  Vir2GblRect    (rect *mwR);
void  SEQ  Vir2LclPt      (point *mwPT);
void  SEQ  Vir2LclRect    (rect *mwR);
void  SEQ  VirtualRect    (rect *mwR);
int   SEQ  WaitRetrace    (int mwWAIT );
void  SEQ  WriteImage     (rect *mwDSTR, image *mwSRCIMAGE);
void  SEQ  WritePalette   (int mwPALNBR, int mwBGNINDEX, int mwENDINDEX,
                           palData *mwRGBCOLORS);
long  SEQ  XlateImage     (image *mwSRCIMAGE, image *mwDSTIMAGE,
                           int mwDSTBITS, int mwDSTPLANES, long *mwXLTABLE);
region * SEQ XorRegion    (region *mwRGN1, region *mwRGN2 );
int   SEQ  XYInRect       (int X, int Y, rect *R);
int   SEQ  ZoomBlit       (grafPort *mwSRC, grafPort *mwDST,
                           rect *mwSRCRECT, rect *mwDSTRECT);

/* functions in metfind.c */
int      FindBestDisplay  ( int mwX, int mwY, long mwCOLORS );
char *   FindDisplayInfo  ( int mwDEVMODE, int *mwX, int *mwY, long *mwCLRS );
int      FindUserDisplay  ( int mwARGC, char *mwARGV[] );
int      FindBestMouse    (void);

/* functions in metquery.c */
void     MetQuery         (int mwARGC, char *mwARGV[]);
void     GrInitErr        (int); 

#ifdef __cplusplus
}
#endif
                           
/* End of File  -  METEXTRN.H */

