*fgraph2.fd - same as fgraph.fd except that INTEGER [EXTERNAL] are commented out
*fgraph.fd - declare constants and functions for graphics library
* 24 June 2004 - line 256 - corrected integer length of imagesize_w
* 21 June 2004 - line 46 - removed comma in incorrect syntax
*   Copyright (c) 1987-1989 Microsoft Corporation.  All rights reserved.
*Purpose:
*   This file declares the graphics library functions and
*   the manifest constants that are used with them.
*******************************************************************************

$NOTRUNCATE       ! required for some names to be significant
$NOTSTRICT         ! uses structures which are non-standard conforming

* user-visible declarations for FORTRAN Graphics Library

* structure for getvideoconfig() as visible to user
      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

* return value of setlogorg(), etc.
      STRUCTURE/xycoord/
        INTEGER*2 xcoord
        INTEGER*2 ycoord
      END STRUCTURE

* structure for text position
      STRUCTURE/rccoord/
        INTEGER*2 row
        INTEGER*2 col
      END STRUCTURE

* SETUP AND CONFIGURATION

* arguments to setvideomode()
      INTEGER*2  $MAXRESMODE, $MAXCOLORMODE, $DEFAULTMODE,$TEXTBW40, !21June2004
     +           $TEXTC40,$TEXTBW80,$TEXTC80, $MRES4COLOR,$MRESNOCOLOR,
     +           $HRESBW,$TEXTMONO,$HERCMONO, $MRES16COLOR,$HRES16COLOR,
     +           $ERESNOCOLOR,$ERESCOLOR, $VRES2COLOR,$VRES16COLOR,
     +           $MRES256COLOR,$ORESCOLOR
      PARAMETER($MAXRESMODE   =-3)    ! graphics mode with highest resolution
      PARAMETER($MAXCOLORMODE =-2)    ! graphics mode with most colors
      PARAMETER($DEFAULTMODE  =-1)    ! restore screen to original mode
      PARAMETER($TEXTBW40      =0)    ! 40 x 25 text, 16 grey
      PARAMETER($TEXTC40       =1)    ! 40 x 25 text, 16/8 color
      PARAMETER($TEXTBW80      =2)    ! 80 x 25 text, 16 grey
      PARAMETER($TEXTC80       =3)    ! 80 x 25 text, 16/8 color
      PARAMETER($MRES4COLOR    =4)    ! 320 x 200, 4 color
      PARAMETER($MRESNOCOLOR   =5)    ! 320 x 200, 4 grey
      PARAMETER($HRESBW        =6)    ! 640 x 200, BW
      PARAMETER($TEXTMONO      =7)    ! 80 x 25 text, BW
      PARAMETER($HERCMONO      =8)    ! 720 x 348, BW for HGC
      PARAMETER($MRES16COLOR   =13)   ! 320 x 200, 16 color
      PARAMETER($HRES16COLOR   =14)   ! 640 x 200, 16 color
      PARAMETER($ERESNOCOLOR   =15)   ! 640 x 350, BW 
      PARAMETER($ERESCOLOR     =16)   ! 640 x 350, 4 or 16 color 
      PARAMETER($VRES2COLOR    =17)   ! 640 x 480, BW 
      PARAMETER($VRES16COLOR   =18)   ! 640 x 480, 16 color 
      PARAMETER($MRES256COLOR  =19)   ! 320 x 200, 256 color
      PARAMETER($ORESCOLOR     =64)   ! 640 x 400, 1 of 16 colors (Olivetti)

* videoconfig adapter values 
* these manifest constants can be used to test adapter values for
* a particular adapter using the bitwise-AND operator
      INTEGER*4 $MDPA,$CGA,$EGA,$MCGA,$VGA,$HGC,$OCGA,$OEGA,$OVGA
      PARAMETER($MDPA     =#0001)    ! Monochrome Display Adapter (MDPA) 
      PARAMETER($CGA      =#0002)    ! Color Graphics Adapter     (CGA)
      PARAMETER($EGA      =#0004)    ! Enhanced Graphics Adapter  (EGA)
      PARAMETER($VGA      =#0008)    ! Video Graphics Array       (VGA) 
      PARAMETER($MCGA     =#0010)    ! MultiColor Graphics Array  (MCGA)
      PARAMETER($HGC      =#0020)    ! Hercules Graphics Card     (HGC)
      PARAMETER($OCGA     =#0042)    ! Olivetti Color Graphics Adapter (OCGA)
      PARAMETER($OEGA     =#0044)    ! Olivetti Enhanced Graphics Adapter (OEGA)
      PARAMETER($OVGA     =#0048)    ! Olivetti Video Graphics Array (OVGA)

* videoconfig monitor values
* these manifest constants can be used to test monitor values for
* a particular monitor using the bitwise-AND operator
      INTEGER*4 $MONO,$COLOR,$ENHCOLOR,$ANALOGMONO,$ANALOGCOLOR,$ANALOG
      PARAMETER($MONO       =#0001)     ! Monochrome
      PARAMETER($COLOR      =#0002)     ! Color (or Enhanced emulating color)
      PARAMETER($ENHCOLOR   =#0004)     ! Enhanced Color
      PARAMETER($ANALOGMONO =#0008)     ! Analog Monochrome only
      PARAMETER($ANALOGCOLOR=#0010)     ! Analog Color only
      PARAMETER($ANALOG     =#0018)     ! Analog

* COORDINATE SYSTEMS

* OUTPUT ROUTINES

* control parameters for Rectangle, Ellipse and Pie
      INTEGER*2 $GBORDER,$GFILLINTERIOR,
     +          $GCLEARSCREEN, $GVIEWPORT,$GWINDOW

      PARAMETER($GBORDER       =2)      ! draw outline only
      PARAMETER($GFILLINTERIOR =3)      ! fill using current fill mask

      PARAMETER($GCLEARSCREEN=0)
      PARAMETER($GVIEWPORT   =1)
      PARAMETER($GWINDOW     =2)

* TEXT
      INTEGER*4 $GCURSOROFF,$GCURSORON,$GWRAPOFF,$GWRAPON
      PARAMETER($GCURSOROFF=0)
      PARAMETER($GCURSORON =1)

      PARAMETER($GWRAPOFF  =0)
      PARAMETER($GWRAPON   =1)

      INTEGER*4 $GSCROLLUP, $GSCROLLDOWN
      PARAMETER($GSCROLLUP   =1)
      PARAMETER($GSCROLLDOWN =-1)

C request maximum number of rows in _settextrows and _setvideomoderows
      INTEGER*4 $MAXTEXTROWS
      PARAMETER($MAXTEXTROWS =-1)

* "action verbs" for putimage()
      INTEGER*4 $GPSET,$GPRESET,$GAND,$GOR,$GXOR
      PARAMETER($GPSET         =3)
      PARAMETER($GPRESET       =2)
      PARAMETER($GAND          =1)
      PARAMETER($GOR           =0)
      PARAMETER($GXOR          =4)

* universal color values:
      INTEGER*4 $BLACK,$BLUE,$GREEN,$CYAN,$RED,$MAGENTA,$BROWN,
     +          $WHITE,$GRAY, $LIGHTBLUE,$LIGHTGREEN,$LIGHTCYAN,
     +          $LIGHTRED,$LIGHTMAGENTA, $LIGHTYELLOW,$BRIGHTWHITE
      PARAMETER($BLACK         =#000000)
      PARAMETER($BLUE          =#2a0000)
      PARAMETER($GREEN         =#002a00)
      PARAMETER($CYAN          =#2a2a00)
      PARAMETER($RED           =#00002a)
      PARAMETER($MAGENTA       =#2a002a)
      PARAMETER($BROWN         =#00152a)
      PARAMETER($WHITE         =#2a2a2a)
      PARAMETER($GRAY          =#151515)
      PARAMETER($LIGHTBLUE     =#3F1515)
      PARAMETER($LIGHTGREEN    =#153f15)
      PARAMETER($LIGHTCYAN     =#3f3f15)
      PARAMETER($LIGHTRED      =#15153f)
      PARAMETER($LIGHTMAGENTA  =#3f153f)
      PARAMETER($LIGHTYELLOW   =#153f3f)
      PARAMETER($BRIGHTWHITE   =#3f3f3f)

* mono mode F color values:
      INTEGER*4 $MODEFOFF,$MODEFOFFTOON,$MODEFOFFTOHI,$MODEFONTOOFF,
     +          $MODEFON,$MODEFONTOHI,$MODEFHITOOFF,$MODEFHITOON,
     +          $MODEFHI
      PARAMETER($MODEFOFF      =0)
      PARAMETER($MODEFOFFTOON  =1)
      PARAMETER($MODEFOFFTOHI  =2)
      PARAMETER($MODEFONTOOFF  =3)
      PARAMETER($MODEFON       =4)
      PARAMETER($MODEFONTOHI   =5)
      PARAMETER($MODEFHITOOFF  =6)
      PARAMETER($MODEFHITOON   =7)
      PARAMETER($MODEFHI       =8)

* mono mode 7 color values:
      INTEGER*4 $MODE7OFF,$MODE7ON,$MODE7HI
      PARAMETER($MODE7OFF      =0)
      PARAMETER($MODE7ON       =1)
      PARAMETER($MODE7HI       =2)

* external function declarations

c      INTEGER*2 setvideomode[EXTERN] ! 26 June 2004
c      INTEGER*2 setvideomoderows[EXTERN] ! 26 June 2004
c      INTEGER*2 setactivepage[EXTERN] ! 26 June 2004
c      INTEGER*2 setvisualpage[EXTERN] ! 26 June 2004
c      INTEGER*2 getactivepage[EXTERN] ! 26 June 2004
c      INTEGER*2 getvisualpage[EXTERN] ! 26 June 2004
      EXTERNAL getvideoconfig
      EXTERNAL setvieworg
      EXTERNAL getviewcoord
      EXTERNAL getphyscoord
      EXTERNAL setcliprgn
      EXTERNAL setviewport
      EXTERNAL clearscreen
      EXTERNAL moveto
      EXTERNAL getcurrentposition
c      INTEGER*2 lineto[EXTERN] ! 26 June 2004
c      INTEGER*2 rectangle[EXTERN] ! 26 June 2004
c      INTEGER*2 ellipse[EXTERN] ! 26 June 2004
c      INTEGER*2 arc[EXTERN] ! 26 June 2004
c      INTEGER*2 pie[EXTERN] ! 26 June 2004
c      INTEGER*2 setpixel[EXTERN] ! 26 June 2004
c      INTEGER*2 getpixel[EXTERN] ! 26 June 2004
c      INTEGER*2 floodfill[EXTERN] ! 26 June 2004
c      INTEGER*2 setcolor[EXTERN] ! 26 June 2004
c      INTEGER*2 getcolor[EXTERN] ! 26 June 2004

      EXTERNAL setlinestyle
c      INTEGER*2 getlinestyle[EXTERN] ! 26 June 2004
      EXTERNAL setfillmask
      EXTERNAL getfillmask
c      INTEGER*4 setbkcolor[EXTERN] ! 26 June 2004
c      INTEGER*4 getbkcolor[EXTERN] ! 26 June 2004
c      INTEGER*4 remappalette[EXTERN] ! 26 June 2004
c      INTEGER*2 remapallpalette[EXTERN] ! 26 June 2004
c      INTEGER*2 selectpalette[EXTERN] ! 26 June 2004
c      INTEGER*2 settextrows[EXTERN] ! 26 June 2004
      EXTERNAL settextwindow
      EXTERNAL scrolltextwindow
      EXTERNAL outtext
c      INTEGER*2 wrapon[EXTERN] ! 26 June 2004
c      INTEGER*2 displaycursor[EXTERN] ! 26 June 2004
c      INTEGER*2 settextcursor[EXTERN] ! 26 June 2004
c      INTEGER*2 gettextcursor[EXTERN] ! 26 June 2004
      EXTERNAL settextposition
      EXTERNAL gettextposition
c      INTEGER*2 settextcolor[EXTERN] ! 26 June 2004
c      INTEGER*2 gettextcolor[EXTERN] ! 26 June 2004
      EXTERNAL getimage
      EXTERNAL putimage
c      INTEGER*4 imagesize[EXTERN] ! 26 June 2004

* WINDOW COORDINATE SYSTEM 

* structure for window coordinate pair 
      STRUCTURE/wxycoord/
        DOUBLE PRECISION wx	! window x coordinate
        DOUBLE PRECISION wy	! window y coordinate
      END STRUCTURE

c       INTEGER*2 setwindow[EXTERN] ! 26 June 2004

       EXTERNAL getwindowcoord
       EXTERNAL getviewcoord_w
       EXTERNAL getcurrentposition_w

* window coordinate entry points for graphics output routines

c      INTEGER*2 arc_w[EXTERN] ! 26 June 2004
c      INTEGER*2 ellipse_w[EXTERN] ! 26 June 2004
c      INTEGER*2 floodfill_w[EXTERN] ! 26 June 2004
c      INTEGER*2 getpixel_w[EXTERN] ! 26 June 2004
c      INTEGER*2 lineto_w[EXTERN] ! 26 June 2004
      EXTERNAL moveto_w
c      INTEGER*2 pie_w[EXTERN] ! 26 June 2004
c      INTEGER*2 rectangle_w[EXTERN] ! 26 June 2004
c      INTEGER*2 setpixel_w[EXTERN] ! 26 June 2004
      EXTERNAL getimage_w
c      INTEGER*4 imagesize_w[EXTERN] ! INTEGER*2 imagesize_w[EXTERN] 24 Jun 2004
      EXTERNAL putimage_w

      STRUCTURE/fontinfo/
        INTEGER*2 type		! b0 set = vector,clear = bit map
        INTEGER*2 ascent	! pix dist from top to baseline
        INTEGER*2 pixwidth	! character width in pixels, 0=prop
        INTEGER*2 pixheight	! character height in pixels
        INTEGER*2 avgwidth	! average character width in pixels
        CHARACTER*81 filename   ! file name including path
        CHARACTER*32 facename   ! font name
      END STRUCTURE

* Font parameters
      
      INTEGER*2 $NO_SPACE, $FIXED_SPACE, $PROP_SPACE
      PARAMETER ($NO_SPACE    = 0)
      PARAMETER ($FIXED_SPACE = 1)
      PARAMETER ($PROP_SPACE  = 2)

      INTEGER*2 $NO_FONT_MAP, $VECTOR_MAP, $BIT_MAP
      PARAMETER ($NO_FONT_MAP = 0)
      PARAMETER ($VECTOR_MAP  = 1)
      PARAMETER ($BIT_MAP     = 2)
      
c      INTEGER*2 registerfonts[EXTERN] ! 26 June 2004
      EXTERNAL unregisterfonts
c      INTEGER*2 setfont[EXTERN] ! 26 June 2004
c      INTEGER*2 getfontinfo[EXTERN] ! 26 June 2004
      EXTERNAL outgtext
c      INTEGER*2 getgtextextent[EXTERN] ! 26 June 2004
