C
C fgraph.fi - declare constants and functions for graphics library
C
C   Copyright (c) 1987-1993 Microsoft Corporation.  All rights reserved.
C
C Purpose:
C   This file declares the graphics library functions and
C   the manifest constants that are used with them.
C

$NOTRUNCATE
$NOTSTRICT

C     User-visible declarations for FORTRAN Graphics Library

      INTERFACE TO FUNCTION arc(x1,y1,x2,y2,x3,y3,x4,y4)
      INTEGER*2 arc[C,ALIAS:"__arc"],x1,y1,x2,y2,x3,y3,x4,y4
      END

      INTERFACE TO FUNCTION arc_w(wx1,wy1,wx2,wy2,wx3,wy3,wx4,wy4)
      INTEGER*2 arc_w[C,ALIAS:"__arc_w"]
      DOUBLE PRECISION wx1,wy1,wx2,wy2,wx3,wy3,wx4,wy4
      END

      INTERFACE TO FUNCTION getarcinfo(lpstart,lpend,lppaint)
      INTEGER*2 getarcinfo[C,ALIAS:"__getarcinfo"]
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/lpstart[REFERENCE]
      RECORD/xycoord/lpend[REFERENCE]
      RECORD/xycoord/lppaint[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + clearscreen[C,ALIAS:"__clearscreen"](area)
      INTEGER*2 area
      END

      INTERFACE TO FUNCTION displaycursor(toggle)
      INTEGER*2 displaycursor[C,ALIAS:"__displaycursor"],toggle
      END

      INTERFACE TO FUNCTION ellipse(control,x1,y1,x2,y2)
      INTEGER*2 ellipse[C,ALIAS:"__ellipse"],control,x1,y1,x2,y2
      END

      INTERFACE TO FUNCTION ellipse_w(control,wx1,wy1,wx2,wy2)
      INTEGER*2 ellipse_w[C,ALIAS:"__ellipse_w"],control
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      END

      INTERFACE TO FUNCTION floodfill(x,y,boundary)
      INTEGER*2 floodfill[C,ALIAS:"__floodfill"],x,y,boundary
      END

      INTERFACE TO FUNCTION floodfill_w(wx1,wy1,boundary)
      INTEGER*2 floodfill_w[C,ALIAS:"__floodfill_w"],boundary
      DOUBLE PRECISION wx1,wy1
      END

      INTERFACE TO FUNCTION getactivepage()
      INTEGER*2 getactivepage[C,ALIAS:"__getactivepage"]
      END

      INTERFACE TO FUNCTION getbkcolor()
      INTEGER*4 getbkcolor[C,ALIAS:"__getbkcolor"]
      END

      INTERFACE TO FUNCTION getcolor()
      INTEGER*2 getcolor[C,ALIAS:"__getcolor"]
      END

      INTERFACE TO SUBROUTINE
     + getcurrentposition[ALIAS:"__f_getcurrentposition@4"](s)
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getcurrentposition_w[ALIAS:"__f_getcurrentposition_wxy@4"](s)
      STRUCTURE/wxycoord/
        DOUBLE PRECISION wx
        DOUBLE PRECISION wy
      END STRUCTURE
      RECORD/wxycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getfillmask[C,ALIAS:"__getfillmask"](mask)
      INTEGER*1 mask[REFERENCE](8)
      END

      INTERFACE TO SUBROUTINE
     + getimage[C,ALIAS:"__getimage"](x1,y1,x2,y2,image)
      INTEGER*2 x1,y1,x2,y2
      INTEGER*1 image[REFERENCE](*)
      END

      INTERFACE TO SUBROUTINE
     + getimage_w[C,ALIAS:"__getimage_w"](wx1,wy1,wx2,wy2,image)
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      INTEGER*1 image[REFERENCE](*)
      END

      INTERFACE TO FUNCTION getlinestyle()
      INTEGER*2 getlinestyle[C,ALIAS:"__getlinestyle"]
      END

      INTERFACE TO SUBROUTINE
     + getphyscoord[ALIAS:"__f_getphyscoord@12"](x,y,s)
      INTEGER*2 x,y
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO FUNCTION getpixel(x,y)
      INTEGER*2 getpixel[C,ALIAS:"__getpixel"],x,y
      END

      INTERFACE TO FUNCTION getpixel_w(wx,wy)
      INTEGER*2 getpixel_w[C,ALIAS:"__getpixel_w"]
      DOUBLE PRECISION wx,wy
      END

      INTERFACE TO FUNCTION gettextcolor()
      INTEGER*2 gettextcolor[C,ALIAS:"__gettextcolor"]
      END

      INTERFACE TO FUNCTION gettextcursor()
      INTEGER*2 gettextcursor[C,ALIAS:"__gettextcursor"]
      END

      INTERFACE TO SUBROUTINE
     + gettextposition[ALIAS:"__f_gettextposition@4"](s)
      STRUCTURE/rccoord/
        INTEGER*2 row
        INTEGER*2 col
      END STRUCTURE
      RECORD/rccoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + gettextwindow[C,ALIAS:"__gettextwindow"](r1,c1,r2,c2)
      INTEGER*2 r1[REFERENCE],c1[REFERENCE]
      INTEGER*2 r2[REFERENCE],c2[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getvideoconfig[C,ALIAS:"__getvideoconfig"](s)
      STRUCTURE/videoconfig/
        INTEGER*2 numxpixels       ! number of pixels on X axis
        INTEGER*2 numypixels       ! number of pixels on Y axis
        INTEGER*2 numtextcols      ! number of text columns available
        INTEGER*2 numtextrows      ! number of text rows available
        INTEGER*2 numcolors        ! number of actual colors
        INTEGER*2 bitsperpixel     ! number of bits per pixel
        INTEGER*2 numvideopages    ! number of available video pages
        INTEGER*2 mode             ! current video mode
        INTEGER*2 adapter          ! active display adapter
        INTEGER*2 monitor          ! active display monitor
        INTEGER*2 memory           ! adapter video memory in K bytes
      END STRUCTURE
      RECORD/videoconfig/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getviewcoord[ALIAS:"__f_getviewcoord@12"](x,y,s)
      INTEGER*2 x,y
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getviewcoord_w[ALIAS:"__f_getviewcoord_w@12"](wx,wy,s)
      DOUBLE PRECISION wx,wy
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO FUNCTION getvisualpage()
      INTEGER*2 getvisualpage[C,ALIAS:"__getvisualpage"]
      END

      INTERFACE TO SUBROUTINE
     + getwindowcoord[ALIAS:"__f_getwindowcoord@12"](x,y,s)
      INTEGER*2 x,y
      STRUCTURE/wxycoord/
        DOUBLE PRECISION wx
        DOUBLE PRECISION wy
      END STRUCTURE
      RECORD/wxycoord/s[REFERENCE]
      END

      INTERFACE TO FUNCTION getwritemode()
      INTEGER*2 getwritemode[C,ALIAS:"__getwritemode"]
      END

      INTERFACE TO FUNCTION grstatus()
      INTEGER*2 grstatus[C,ALIAS:"__grstatus"]
      END

      INTERFACE TO FUNCTION imagesize(x1,y1,x2,y2)
      INTEGER*4 imagesize[C,ALIAS:"__imagesize"]
      INTEGER*2 x1,y1,x2,y2
      END

      INTERFACE TO FUNCTION imagesize_w(wx1,wy1,wx2,wy2)
      INTEGER*4 imagesize_w[C,ALIAS:"__imagesize_w"]
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      END

      INTERFACE TO FUNCTION lineto(x,y)
      INTEGER*2 lineto[C,ALIAS:"__lineto"],x,y
      END

      INTERFACE TO FUNCTION lineto_w(wx,wy)
      INTEGER*2 lineto_w[C,ALIAS:"__lineto_w"]
      DOUBLE PRECISION wx,wy
      END

      INTERFACE TO INTEGER*2 FUNCTION
     + loadimage[ALIAS:"__f_loadimage@16"](fname,x,y)
      CHARACTER*(*) fname[REFERENCE]
      INTEGER*2 x,y
      END

      INTERFACE TO INTEGER*2 FUNCTION
     + loadimage_w[ALIAS:"__f_loadimage_w@16"](fname,wx,wy)
      CHARACTER*(*) fname[REFERENCE]
      DOUBLE PRECISION wx, wy
      END

      INTERFACE TO SUBROUTINE
     + moveto[ALIAS:"__f_moveto@12"](x,y,s)
      INTEGER*2 x,y
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + moveto_w[ALIAS:"__f_moveto_w@12"](wx,wy,s)
      DOUBLE PRECISION wx,wy
      STRUCTURE/wxycoord/
        DOUBLE PRECISION wx
        DOUBLE PRECISION wy
      END STRUCTURE
      RECORD/wxycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + outtext[ALIAS:"__f_outtext@8"](text)
      CHARACTER*(*) text[REFERENCE]
      END

      INTERFACE TO FUNCTION pie(i,x1,y1,x2,y2,x3,y3,x4,y4)
      INTEGER*2 pie[C,ALIAS:"__pie"],i,x1,y1,x2,y2,x3,y3,x4,y4
      END

      INTERFACE TO FUNCTION pie_w(i,wx1,wy1,wx2,wy2,wx3,wy3,wx4,wy4)
      INTEGER*2 pie_w[C,ALIAS:"__pie_w"],i
      DOUBLE PRECISION wx1,wy1,wx2,wy2,wx3,wy3,wx4,wy4
      END

      INTERFACE TO FUNCTION polygon(control,lppoints,cpoints)
      INTEGER*2 polygon[C,ALIAS:"__polygon"],control,cpoints
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/lppoints[REFERENCE](*)
      END

      INTERFACE TO FUNCTION polygon_w(control,lppoints,cpoints)
      INTEGER*2 polygon_w[C,ALIAS:"__polygon_w"],control,cpoints
      STRUCTURE/wxycoord/
        DOUBLE PRECISION wx
        DOUBLE PRECISION wy
      END STRUCTURE
      RECORD/wxycoord/lppoints[REFERENCE](*)
      END

      INTERFACE TO SUBROUTINE
     + putimage[C,ALIAS:"__putimage"](x,y,image,action)
      INTEGER*2 x,y,action
      INTEGER*1 image[REFERENCE](*)
      END

      INTERFACE TO SUBROUTINE
     + putimage_w[C,ALIAS:"__putimage_w"](wx,wy,image,action)
      DOUBLE PRECISION wx,wy
      INTEGER*1 image[REFERENCE](*)
      INTEGER*2 action
      END

      INTERFACE TO FUNCTION rectangle(control,x1,y1,x2,y2)
      INTEGER*2 rectangle[C,ALIAS:"__rectangle"]
      INTEGER*2 control,x1,y1,x2,y2
      END

      INTERFACE TO FUNCTION rectangle_w(control,wx1,wy1,wx2,wy2)
      INTEGER*2 rectangle_w[C,ALIAS:"__rectangle_w"],control
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      END

      INTERFACE TO FUNCTION remappalette(index,color)
      INTEGER*4 remappalette[C,ALIAS:"__remappalette"],color
      INTEGER*2 index
      END

      INTERFACE TO FUNCTION remapallpalette(colors)
      INTEGER*2 remapallpalette[C,ALIAS:"__remapallpalette"]
      INTEGER*4 colors[REFERENCE](*)
      END

      INTERFACE TO INTEGER*2 FUNCTION
     + saveimage[ALIAS:"__f_saveimage@24"](fname,x1,y1,x2,y2)
      CHARACTER*(*) fname[REFERENCE]
      INTEGER*2 x1,y1,x2,y2
      END

      INTERFACE TO INTEGER*2 FUNCTION
     + saveimage_w[ALIAS:"__f_saveimage_w@24"]
     + (fname,wx1,wy1,wx2,wy2)
      CHARACTER*(*) fname[REFERENCE]
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      END

      INTERFACE TO SUBROUTINE
     + scrolltextwindow[C,ALIAS:"__scrolltextwindow"](rows)
      INTEGER*2 rows
      END

      INTERFACE TO FUNCTION selectpalette(number)
      INTEGER*2 selectpalette[C,ALIAS:"__selectpalette"],number
      END

      INTERFACE TO FUNCTION setactivepage(page)
      INTEGER*2 setactivepage[C,ALIAS:"__setactivepage"],page
      END

      INTERFACE TO FUNCTION setbkcolor(color)
      INTEGER*4 setbkcolor[C,ALIAS:"__setbkcolor"],color
      END

      INTERFACE TO SUBROUTINE
     + setcliprgn[C,ALIAS:"__setcliprgn"](x1,y1,x2,y2)
      INTEGER*2 x1,y1,x2,y2
      END

      INTERFACE TO FUNCTION setcolor(color)
      INTEGER*2 setcolor[C,ALIAS:"__setcolor"]
      INTEGER*2 color
      END

      INTERFACE TO SUBROUTINE
     + setfillmask[C,ALIAS:"__setfillmask"](mask)
      INTEGER*1 mask[REFERENCE](8)
      END

      INTERFACE TO SUBROUTINE
     + setlinestyle[C,ALIAS:"__setlinestyle"](mask)
      INTEGER*2 mask
      END

      INTERFACE TO FUNCTION setpixel(x,y)
      INTEGER*2 setpixel[C,ALIAS:"__setpixel"],x,y
      END

      INTERFACE TO FUNCTION setpixel_w(wx,wy)
      INTEGER*2 setpixel_w[C,ALIAS:"__setpixel_w"]
      DOUBLE PRECISION wx,wy
      END

      INTERFACE TO FUNCTION settextcolor(index)
      INTEGER*2 settextcolor[C,ALIAS:"__settextcolor"],index
      END

      INTERFACE TO FUNCTION settextcursor(attr)
      INTEGER*2 settextcursor[C,ALIAS:"__settextcursor"],attr
      END

      INTERFACE TO SUBROUTINE
     + settextposition[ALIAS:"__f_settextposition@12"](row,col,s)
      INTEGER*2 row,col
      STRUCTURE/rccoord/
        INTEGER*2 row
        INTEGER*2 col
      END STRUCTURE
      RECORD/rccoord/s[REFERENCE]
      END

      INTERFACE TO FUNCTION settextrows(rows)
      INTEGER*2 settextrows[C,ALIAS:"__settextrows"],rows
      END

      INTERFACE TO SUBROUTINE
     + settextwindow[C,ALIAS:"__settextwindow"](r1,c1,r2,c2)
      INTEGER*2 r1,c1,r2,c2
      END

      INTERFACE TO FUNCTION setvideomode(mode)
      INTEGER*2 setvideomode[C,ALIAS:"__setvideomode"],mode
      END

      INTERFACE TO FUNCTION setvideomoderows(mode,rows)
      INTEGER*2 setvideomoderows[C,ALIAS:"__setvideomoderows"]
      INTEGER*2 mode,rows
      END

      INTERFACE TO SUBROUTINE
     + setvieworg[ALIAS:"__f_setvieworg@12"](x,y,s)
      INTEGER*2 x,y
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE
      RECORD/xycoord/s[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + setviewport[C,ALIAS:"__setviewport"](x1,y1,x2,y2)
      INTEGER*2 x1,y1,x2,y2
      END

      INTERFACE TO FUNCTION setvisualpage(page)
      INTEGER*2 setvisualpage[C,ALIAS:"__setvisualpage"],page
      END

      INTERFACE TO FUNCTION setwindow(finvert,wx1,wy1,wx2,wy2)
      INTEGER*2 setwindow[ALIAS:"__f_setwindow@20"]
      LOGICAL*2 finvert
      DOUBLE PRECISION wx1,wy1,wx2,wy2
      END

      INTERFACE TO FUNCTION setwritemode(wmode)
      INTEGER*2 setwritemode[C,ALIAS:"__setwritemode"],wmode
      END

      INTERFACE TO FUNCTION wrapon(option)
      INTEGER*2 wrapon[C,ALIAS:"__wrapon"],option
      END

* FONTS

      INTERFACE TO FUNCTION getfontinfo(fi)
      INTEGER*2 getfontinfo[ALIAS:"__f_getfontinfo@4"]
      STRUCTURE/fontinfo/
        INTEGER*4 type                ! b0 set = vector,clear = bit map
        INTEGER*4 ascent      ! pix dist from top to baseline
        INTEGER*4 pixwidth    ! character width in pixels, 0=prop
        INTEGER*4 pixheight   ! character height in pixels
        INTEGER*4 avgwidth    ! average character width in pixels
        CHARACTER*81 filename   ! file name including path
        CHARACTER*32 facename   ! font name
      END STRUCTURE
      RECORD/fontinfo/fi[REFERENCE]
      END

      INTERFACE TO FUNCTION getgtextextent(text)
      INTEGER*2 getgtextextent[ALIAS:"__f_getgtextextent@8"]
      CHARACTER*(*) text[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + getgtextvector[ALIAS:"__f_getgtextvector@8"](x,y)
      INTEGER*2 x[REFERENCE],y[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + outgtext[ALIAS:"__f_outgtext@8"](text)
      CHARACTER*(*) text[REFERENCE]
      END

      INTERFACE TO FUNCTION registerfonts(filename)
      INTEGER*2 registerfonts[ALIAS:"__f_registerfonts@8"]
      CHARACTER*(*) filename[REFERENCE]
      END

      INTERFACE TO FUNCTION setfont(options)
      INTEGER*2 setfont[ALIAS:"__f_setfont@8"]
      CHARACTER*(*) options[REFERENCE]
      END

      INTERFACE TO SUBROUTINE
     + setgtextvector[C,ALIAS:"__setgtextvector"](x,y)
      INTEGER*2 x,y
      END

      INTERFACE TO SUBROUTINE
     + unregisterfonts[C,ALIAS:"__unregisterfonts"]()
      END

      INTERFACE TO FUNCTION INCHARQQ()
      INTEGER*2 INCHARQQ[ALIAS:"_GETCHARQQ@0"]
      END
