dos_compilers/Microsoft Fortran v51/INCLUDE/FGRAPH.FD

335 lines
12 KiB
Plaintext
Raw Normal View History

2024-07-23 21:13:45 +02:00
*fgraph.fd - declare constants and functions for graphics library
*
* Copyright (c) 1987-1991 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 getcurrentposition(), 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
* ERROR HANDLING
* status info returned by grstatus()
INTEGER*2 $GRPARAMETERALTERED,$GRCLIPPED,$GRNOOUTPUT,$GROK,
+ $GRERROR,$GRMODENOTSUPPORTED,$GRNOTINPROPERMODE,
+ $GRINVALIDPARAMETER,$GRFONTFILENOTFOUND,
+ $GRINVALIDFONTFILE,$GRCORRUPTEDFONTFILE,
+ $GRINSUFFICIENTMEMORY,$GRINVALIDIMAGEBUFFER
* successful
PARAMETER($GROK = 0) ! success
* warnings
PARAMETER($GRNOOUTPUT = 1) ! nothing drawn
PARAMETER($GRCLIPPED = 2) ! output was partially clipped
PARAMETER($GRPARAMETERALTERED = 3) ! input parameters adjusted
* errors
PARAMETER($GRERROR = -1) ! generic graphics error
PARAMETER($GRMODENOTSUPPORTED = -2) ! video mode not supported
PARAMETER($GRNOTINPROPERMODE = -3) ! not supported in current mode
PARAMETER($GRINVALIDPARAMETER = -4) ! bad parameter
PARAMETER($GRFONTFILENOTFOUND = -5) ! font file not found
PARAMETER($GRINVALIDFONTFILE = -6) ! not a font file
PARAMETER($GRCORRUPTEDFONTFILE = -7) ! inconsistent font file
PARAMETER($GRINSUFFICIENTMEMORY = -8) ! out of memory
PARAMETER($GRINVALIDIMAGEBUFFER = -9) ! bad image buffer detected
* SETUP AND CONFIGURATION
* arguments to setvideomode()
INTEGER*2 $MAXRESMODE,$MAXCOLORMODE,$DEFAULTMODE,$TEXTBW40,
+ $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 determine the type of the active
* adapter, using either simple comparisons or the bitwise-AND operator
INTEGER*2 $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 determine the type of monitor in
* use, using either simple comparisons or the bitwise-AND operator
INTEGER*2 $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(), polygon(), ellipse(), and pie()
INTEGER*2 $GBORDER,$GFILLINTERIOR
PARAMETER($GBORDER =2) ! draw outline only
PARAMETER($GFILLINTERIOR =3) ! fill using current fill mask
* parameters for clearscreen()
INTEGER*2 $GCLEARSCREEN,$GVIEWPORT,$GWINDOW
PARAMETER($GCLEARSCREEN =0)
PARAMETER($GVIEWPORT =1)
PARAMETER($GWINDOW =2)
* TEXT
* parameters for displaycursor()
INTEGER*2 $GCURSOROFF,$GCURSORON
PARAMETER($GCURSOROFF =0)
PARAMETER($GCURSORON =1)
* parameters for wrapon()
INTEGER*2 $GWRAPOFF,$GWRAPON
PARAMETER($GWRAPOFF =0)
PARAMETER($GWRAPON =1)
* parameters for scrolltextwindow()
INTEGER*2 $GSCROLLUP,$GSCROLLDOWN
PARAMETER($GSCROLLUP =1)
PARAMETER($GSCROLLDOWN =-1)
* request maximum number of rows in _settextrows() and _setvideomoderows()
INTEGER*2 $MAXTEXTROWS
PARAMETER($MAXTEXTROWS =-1)
* "action verbs" for putimage(), setwritemode()
INTEGER*2 $GPSET,$GPRESET,$GAND,$GOR,$GXOR
PARAMETER($GPSET =3)
PARAMETER($GPRESET =2)
PARAMETER($GAND =1)
PARAMETER($GOR =0)
PARAMETER($GXOR =4)
* Color values are used with setbkcolor in graphics modes and also by
* remappalette abd remapallpalette. Also known as palette colors.
* Not to be confused with color indices (aka. color attributes).
* universal color values (all color modes):
INTEGER*4 $BLACK,$BLUE,$GREEN,$CYAN,$RED,$MAGENTA,$BROWN,
+ $WHITE,$GRAY,$LIGHTBLUE,$LIGHTGREEN,$LIGHTCYAN,
+ $LIGHTRED,$LIGHTMAGENTA,$YELLOW,$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($YELLOW =#153f3f)
PARAMETER($BRIGHTWHITE =#3f3f3f)
* the following is obsolescent and defined only for backwards compatibility
INTEGER*4 $LIGHTYELLOW
PARAMETER($LIGHTYELLOW =#153f3f)
* mono mode F ($ERESNOCOLOR) 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 ($TEXTMONO) color values:
INTEGER*4 $MODE7OFF,$MODE7ON,$MODE7HI
PARAMETER($MODE7OFF =0)
PARAMETER($MODE7ON =1)
PARAMETER($MODE7HI =2)
* external function declarations
INTEGER*2 grstatus[EXTERN]
INTEGER*2 setvideomode[EXTERN]
INTEGER*2 setvideomoderows[EXTERN]
INTEGER*2 setactivepage[EXTERN]
INTEGER*2 setvisualpage[EXTERN]
INTEGER*2 getactivepage[EXTERN]
INTEGER*2 getvisualpage[EXTERN]
EXTERNAL getvideoconfig
EXTERNAL setvieworg
EXTERNAL getviewcoord
EXTERNAL getphyscoord
EXTERNAL setcliprgn
EXTERNAL setviewport
EXTERNAL clearscreen
EXTERNAL moveto
EXTERNAL getcurrentposition
INTEGER*2 lineto[EXTERN]
INTEGER*2 rectangle[EXTERN]
INTEGER*2 polygon[EXTERN]
INTEGER*2 ellipse[EXTERN]
INTEGER*2 arc[EXTERN]
INTEGER*2 pie[EXTERN]
INTEGER*2 getarcinfo[EXTERN]
INTEGER*2 setpixel[EXTERN]
INTEGER*2 getpixel[EXTERN]
INTEGER*2 floodfill[EXTERN]
INTEGER*2 setcolor[EXTERN]
INTEGER*2 getcolor[EXTERN]
EXTERNAL setlinestyle
INTEGER*2 getlinestyle[EXTERN]
INTEGER*2 setwritemode[EXTERN]
INTEGER*2 getwritemode[EXTERN]
EXTERNAL setfillmask
EXTERNAL getfillmask
INTEGER*4 setbkcolor[EXTERN]
INTEGER*4 getbkcolor[EXTERN]
INTEGER*4 remappalette[EXTERN]
INTEGER*2 remapallpalette[EXTERN]
INTEGER*2 selectpalette[EXTERN]
INTEGER*2 settextrows[EXTERN]
EXTERNAL settextwindow
EXTERNAL gettextwindow
EXTERNAL scrolltextwindow
EXTERNAL outtext
INTEGER*2 wrapon[EXTERN]
INTEGER*2 displaycursor[EXTERN]
INTEGER*2 settextcursor[EXTERN]
INTEGER*2 gettextcursor[EXTERN]
EXTERNAL settextposition
EXTERNAL gettextposition
INTEGER*2 settextcolor[EXTERN]
INTEGER*2 gettextcolor[EXTERN]
EXTERNAL getimage
EXTERNAL putimage
INTEGER*4 imagesize[EXTERN]
* WINDOW COORDINATE SYSTEM
* structure for window coordinate pair
STRUCTURE/wxycoord/
DOUBLE PRECISION wx ! window x coordinate
DOUBLE PRECISION wy ! window y coordinate
END STRUCTURE
INTEGER*2 setwindow[EXTERN]
EXTERNAL getwindowcoord
EXTERNAL getviewcoord_w
EXTERNAL getcurrentposition_w
* window coordinate entry points for graphics output routines
INTEGER*2 arc_w[EXTERN]
INTEGER*2 ellipse_w[EXTERN]
INTEGER*2 floodfill_w[EXTERN]
INTEGER*2 getpixel_w[EXTERN]
INTEGER*2 lineto_w[EXTERN]
EXTERNAL moveto_w
INTEGER*2 pie_w[EXTERN]
INTEGER*2 rectangle_w[EXTERN]
INTEGER*2 polygon_w[EXTERN]
INTEGER*2 setpixel_w[EXTERN]
EXTERNAL getimage_w
INTEGER*4 imagesize_w[EXTERN]
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)
INTEGER*2 registerfonts[EXTERN]
EXTERNAL unregisterfonts
INTEGER*2 setfont[EXTERN]
INTEGER*2 getfontinfo[EXTERN]
EXTERNAL outgtext
INTEGER*2 getgtextextent[EXTERN]
EXTERNAL setgtextvector
EXTERNAL getgtextvector