Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

372 lines
14 KiB

  1. C fgraph.fd - declare constants and functions for graphics library
  2. C
  3. C Copyright (c) 1987-1993 Microsoft Corporation. All rights reserved.
  4. C
  5. C Purpose:
  6. C This file declares the graphics library functions and
  7. C the constants that are used with them.
  8. C
  9. C
  10. $NOTRUNCATE ! required for some names to be significant
  11. $NOTSTRICT ! uses structures which are non-standard conforming
  12. C User-visible declarations for FORTRAN Graphics Library
  13. C Structure for getvideoconfig() as visible to user
  14. STRUCTURE/videoconfig/
  15. INTEGER*2 numxpixels ! number of pixels on X axis
  16. INTEGER*2 numypixels ! number of pixels on Y axis
  17. INTEGER*2 numtextcols ! number of text columns available
  18. INTEGER*2 numtextrows ! number of text rows available
  19. INTEGER*2 numcolors ! number of actual colors
  20. INTEGER*2 bitsperpixel ! number of bits per pixel
  21. INTEGER*2 numvideopages ! number of available video pages
  22. INTEGER*2 mode ! current video mode
  23. INTEGER*2 adapter ! active display adapter
  24. INTEGER*2 monitor ! active display monitor
  25. INTEGER*2 memory ! adapter video memory in K bytes
  26. END STRUCTURE
  27. C Return value of getcurrentposition(), etc.
  28. STRUCTURE/xycoord/
  29. INTEGER*2 xcoord
  30. INTEGER*2 ycoord
  31. END STRUCTURE
  32. C Structure for text position
  33. STRUCTURE/rccoord/
  34. INTEGER*2 row
  35. INTEGER*2 col
  36. END STRUCTURE
  37. C ERROR HANDLING
  38. C Status info returned by grstatus()
  39. INTEGER*2 $GRPARAMETERALTERED,$GRCLIPPED,$GRNOOUTPUT,$GROK,
  40. + $GRERROR,$GRMODENOTSUPPORTED,$GRNOTINPROPERMODE,
  41. + $GRINVALIDPARAMETER,$GRFONTFILENOTFOUND,
  42. + $GRINVALIDFONTFILE,$GRCORRUPTEDFONTFILE,
  43. + $GRINSUFFICIENTMEMORY,$GRINVALIDIMAGEBUFFER
  44. C Successful
  45. PARAMETER($GROK = 0) ! success
  46. C Warnings
  47. PARAMETER($GRNOOUTPUT = 1) ! nothing drawn
  48. PARAMETER($GRCLIPPED = 2) ! output was partially clipped
  49. PARAMETER($GRPARAMETERALTERED = 3) ! input parameters adjusted
  50. PARAMETER($GRTEXTNOTSUPPORTED = 4) ! SuperVGA text output may fail
  51. C Errors
  52. PARAMETER($GRERROR = -1) ! generic graphics error
  53. PARAMETER($GRMODENOTSUPPORTED = -2) ! video mode not supported
  54. PARAMETER($GRNOTINPROPERMODE = -3) ! not supported in current mode
  55. PARAMETER($GRINVALIDPARAMETER = -4) ! bad parameter
  56. PARAMETER($GRFONTFILENOTFOUND = -5) ! font file not found
  57. PARAMETER($GRINVALIDFONTFILE = -6) ! not a font file
  58. PARAMETER($GRCORRUPTEDFONTFILE = -7) ! inconsistent font file
  59. PARAMETER($GRINSUFFICIENTMEMORY = -8) ! out of memory
  60. PARAMETER($GRINVALIDIMAGEBUFFER = -9) ! bad image buffer detected
  61. C SETUP AND CONFIGURATION
  62. C Arguments to setvideomode()
  63. INTEGER*2 $MAXRESMODE,$MAXCOLORMODE,$DEFAULTMODE,$TEXTBW40,
  64. + $TEXTC40,$TEXTBW80,$TEXTC80,$MRES4COLOR,$MRESNOCOLOR,
  65. + $HRESBW,$TEXTMONO,$HERCMONO,$MRES16COLOR,$HRES16COLOR,
  66. + $ERESNOCOLOR,$ERESCOLOR,$VRES2COLOR,$VRES16COLOR,
  67. + $MRES256COLOR,$ORESCOLOR,$SRES16COLOR,$SRES256COLOR,
  68. + $XRES16COLOR,$XRES256COLOR,$ZRES16COLOR,$ZRES256COLOR
  69. PARAMETER($MAXRESMODE =-3) ! graphics mode with highest resolution
  70. PARAMETER($MAXCOLORMODE =-2) ! graphics mode with most colors
  71. PARAMETER($DEFAULTMODE =-1) ! restore screen to original mode
  72. PARAMETER($TEXTBW40 =0) ! 40 x 25 text, 16 grey
  73. PARAMETER($TEXTC40 =1) ! 40 x 25 text, 16/8 color
  74. PARAMETER($TEXTBW80 =2) ! 80 x 25 text, 16 grey
  75. PARAMETER($TEXTC80 =3) ! 80 x 25 text, 16/8 color
  76. PARAMETER($MRES4COLOR =4) ! 320 x 200, 4 color
  77. PARAMETER($MRESNOCOLOR =5) ! 320 x 200, 4 grey
  78. PARAMETER($HRESBW =6) ! 640 x 200, BW
  79. PARAMETER($TEXTMONO =7) ! 80 x 25 text, BW
  80. PARAMETER($HERCMONO =8) ! 720 x 348, BW for HGC
  81. PARAMETER($MRES16COLOR =13) ! 320 x 200, 16 color
  82. PARAMETER($HRES16COLOR =14) ! 640 x 200, 16 color
  83. PARAMETER($ERESNOCOLOR =15) ! 640 x 350, BW
  84. PARAMETER($ERESCOLOR =16) ! 640 x 350, 4 or 16 color
  85. PARAMETER($VRES2COLOR =17) ! 640 x 480, BW
  86. PARAMETER($VRES16COLOR =18) ! 640 x 480, 16 color
  87. PARAMETER($MRES256COLOR =19) ! 320 x 200, 256 color
  88. PARAMETER($ORESCOLOR =64) ! 640 x 400, 1 of 16 colors (Olivetti)
  89. C The following 8 modes require VESA SuperVGA BIOS extensions
  90. PARAMETER($ORES256COLOR =#0100) ! 640 x 400, 256 color
  91. PARAMETER($VRES256COLOR =#0101) ! 640 x 480, 256 color
  92. C WARNING: DO NOT attempt to set the following modes without ensuring
  93. C that your monitor can safely handle that resolution. Otherwise, you
  94. C may risk damaging your display monitor! Consult your owner's manual
  95. C for details.
  96. C Note: _MAXRESMODE and _MAXCOLORMODE never select SRES, XRES, or ZRES
  97. C modes.
  98. C Requires NEC MultiSync 3D or equivalent, or better
  99. PARAMETER($SRES16COLOR =#0102) ! 800 x 600, 16 color
  100. PARAMETER($SRES256COLOR =#0103) ! 800 x 600, 256 color
  101. C Requires NEC MultiSync 4D or equivalent, or better
  102. PARAMETER($XRES16COLOR =#0104) ! 1024 x 768, 16 color
  103. PARAMETER($XRES256COLOR =#0105) ! 1024 x 768, 256 color
  104. C Requires NEC MultiSync 5D or equivalent, or better
  105. PARAMETER($ZRES16COLOR =#0106) ! 1280 x 1024, 16 color
  106. PARAMETER($ZRES256COLOR =#0107) ! 1280 x 1024, 256 color
  107. C VIDEOCONFIG adapter values
  108. C These constants can be used to determine the type of the active
  109. C adapter, using either simple comparisons or the bitwise-AND operator.
  110. INTEGER*2 $QUICKWIN, $MDPA,$CGA,$EGA,$MCGA,$VGA,$HGC,$OCGA,
  111. + $OEGA,$OVGA
  112. PARAMETER($QUICKWIN =#0000) ! QuickWin graphics
  113. PARAMETER($MDPA =#0001) ! Monochrome Display Adapter (MDPA)
  114. PARAMETER($CGA =#0002) ! Color Graphics Adapter (CGA)
  115. PARAMETER($EGA =#0004) ! Enhanced Graphics Adapter (EGA)
  116. PARAMETER($VGA =#0008) ! Video Graphics Array (VGA)
  117. PARAMETER($MCGA =#0010) ! MultiColor Graphics Array (MCGA)
  118. PARAMETER($HGC =#0020) ! Hercules Graphics Card (HGC)
  119. PARAMETER($OCGA =#0042) ! Olivetti Color Graphics Adapter (OCGA)
  120. PARAMETER($OEGA =#0044) ! Olivetti Enhanced Graphics Adapter (OEGA)
  121. PARAMETER($OVGA =#0048) ! Olivetti Video Graphics Array (OVGA)
  122. PARAMETER($SVGA =#0088) ! Super VGA with VESA BIOS support (SVGA)
  123. C VIDEOCONFIG monitor values
  124. C These constants can be used to determine the type of monitor in
  125. C use, using either simple comparisons or the bitwise-AND operator
  126. INTEGER*2 $MONO,$COLOR,$ENHCOLOR,$ANALOGMONO,
  127. + $ANALOGCOLOR,$ANALOG
  128. PARAMETER($MONO =#0001) ! Monochrome
  129. PARAMETER($COLOR =#0002) ! Color (or Enhanced emulating color)
  130. PARAMETER($ENHCOLOR =#0004) ! Enhanced Color
  131. PARAMETER($ANALOGMONO =#0008) ! Analog Monochrome only
  132. PARAMETER($ANALOGCOLOR=#0010) ! Analog Color only
  133. PARAMETER($ANALOG =#0018) ! Analog Color + Analog Monochrome
  134. C COORDINATE SYSTEMS
  135. C OUTPUT ROUTINES
  136. C Control parameters for rectangle(), polygon(), ellipse(), and pie()
  137. INTEGER*2 $GBORDER,$GFILLINTERIOR
  138. PARAMETER($GBORDER =2) ! draw outline only
  139. PARAMETER($GFILLINTERIOR =3) ! fill using current fill mask
  140. C Parameters for clearscreen()
  141. INTEGER*2 $GCLEARSCREEN,$GVIEWPORT,$GWINDOW
  142. PARAMETER($GCLEARSCREEN =0)
  143. PARAMETER($GVIEWPORT =1)
  144. PARAMETER($GWINDOW =2)
  145. C TEXT
  146. C Parameters for displaycursor()
  147. INTEGER*2 $GCURSOROFF,$GCURSORON
  148. PARAMETER($GCURSOROFF =0)
  149. PARAMETER($GCURSORON =1)
  150. C Parameters for wrapon()
  151. INTEGER*2 $GWRAPOFF,$GWRAPON
  152. PARAMETER($GWRAPOFF =0)
  153. PARAMETER($GWRAPON =1)
  154. C Parameters for scrolltextwindow()
  155. INTEGER*2 $GSCROLLUP,$GSCROLLDOWN
  156. PARAMETER($GSCROLLUP =1)
  157. PARAMETER($GSCROLLDOWN =-1)
  158. C Request maximum number of rows in _settextrows() and _setvideomoderows()
  159. INTEGER*2 $MAXTEXTROWS
  160. PARAMETER($MAXTEXTROWS =-1)
  161. C "Action verbs" for putimage(), setwritemode()
  162. INTEGER*2 $GPSET,$GPRESET,$GAND,$GOR,$GXOR
  163. PARAMETER($GPSET =3)
  164. PARAMETER($GPRESET =2)
  165. PARAMETER($GAND =1)
  166. PARAMETER($GOR =0)
  167. PARAMETER($GXOR =4)
  168. C Color values are used with setbkcolor in graphics modes and also by
  169. C remappalette abd remapallpalette. Also known as palette colors.
  170. C Not to be confused with color indices (aka. color attributes).
  171. C Universal color values (all color modes):
  172. INTEGER*4 $BLACK,$BLUE,$GREEN,$CYAN,$RED,$MAGENTA,$BROWN,
  173. + $WHITE,$GRAY,$LIGHTBLUE,$LIGHTGREEN,$LIGHTCYAN,
  174. + $LIGHTRED,$LIGHTMAGENTA,$YELLOW,$BRIGHTWHITE
  175. PARAMETER($BLACK =#000000)
  176. PARAMETER($BLUE =#2a0000)
  177. PARAMETER($GREEN =#002a00)
  178. PARAMETER($CYAN =#2a2a00)
  179. PARAMETER($RED =#00002a)
  180. PARAMETER($MAGENTA =#2a002a)
  181. PARAMETER($BROWN =#00152a)
  182. PARAMETER($WHITE =#2a2a2a)
  183. PARAMETER($GRAY =#151515)
  184. PARAMETER($LIGHTBLUE =#3F1515)
  185. PARAMETER($LIGHTGREEN =#153f15)
  186. PARAMETER($LIGHTCYAN =#3f3f15)
  187. PARAMETER($LIGHTRED =#15153f)
  188. PARAMETER($LIGHTMAGENTA =#3f153f)
  189. PARAMETER($YELLOW =#153f3f)
  190. PARAMETER($BRIGHTWHITE =#3f3f3f)
  191. C The following is obsolescent and defined only for backwards
  192. C compatibility.
  193. INTEGER*4 $LIGHTYELLOW
  194. PARAMETER($LIGHTYELLOW =#153f3f)
  195. C Mono mode F ($ERESNOCOLOR) color values:
  196. INTEGER*4 $MODEFOFF,$MODEFOFFTOON,$MODEFOFFTOHI,$MODEFONTOOFF,
  197. + $MODEFON,$MODEFONTOHI,$MODEFHITOOFF,$MODEFHITOON,
  198. + $MODEFHI
  199. PARAMETER($MODEFOFF =0)
  200. PARAMETER($MODEFOFFTOON =1)
  201. PARAMETER($MODEFOFFTOHI =2)
  202. PARAMETER($MODEFONTOOFF =3)
  203. PARAMETER($MODEFON =4)
  204. PARAMETER($MODEFONTOHI =5)
  205. PARAMETER($MODEFHITOOFF =6)
  206. PARAMETER($MODEFHITOON =7)
  207. PARAMETER($MODEFHI =8)
  208. C Mono mode 7 ($TEXTMONO) color values:
  209. INTEGER*4 $MODE7OFF,$MODE7ON,$MODE7HI
  210. PARAMETER($MODE7OFF =0)
  211. PARAMETER($MODE7ON =1)
  212. PARAMETER($MODE7HI =2)
  213. C External function declarations
  214. INTEGER*2 grstatus[EXTERN]
  215. INTEGER*2 setvideomode[EXTERN]
  216. INTEGER*2 setvideomoderows[EXTERN]
  217. INTEGER*2 setactivepage[EXTERN]
  218. INTEGER*2 setvisualpage[EXTERN]
  219. INTEGER*2 getactivepage[EXTERN]
  220. INTEGER*2 getvisualpage[EXTERN]
  221. EXTERNAL getvideoconfig
  222. EXTERNAL setvieworg
  223. EXTERNAL getviewcoord
  224. EXTERNAL getphyscoord
  225. EXTERNAL setcliprgn
  226. EXTERNAL setviewport
  227. EXTERNAL clearscreen
  228. EXTERNAL moveto
  229. EXTERNAL getcurrentposition
  230. INTEGER*2 lineto[EXTERN]
  231. INTEGER*2 rectangle[EXTERN]
  232. INTEGER*2 polygon[EXTERN]
  233. INTEGER*2 ellipse[EXTERN]
  234. INTEGER*2 arc[EXTERN]
  235. INTEGER*2 pie[EXTERN]
  236. INTEGER*2 getarcinfo[EXTERN]
  237. INTEGER*2 setpixel[EXTERN]
  238. INTEGER*2 getpixel[EXTERN]
  239. INTEGER*2 floodfill[EXTERN]
  240. INTEGER*2 setcolor[EXTERN]
  241. INTEGER*2 getcolor[EXTERN]
  242. EXTERNAL setlinestyle
  243. INTEGER*2 getlinestyle[EXTERN]
  244. INTEGER*2 setwritemode[EXTERN]
  245. INTEGER*2 getwritemode[EXTERN]
  246. EXTERNAL setfillmask
  247. EXTERNAL getfillmask
  248. INTEGER*4 setbkcolor[EXTERN]
  249. INTEGER*4 getbkcolor[EXTERN]
  250. INTEGER*4 remappalette[EXTERN]
  251. INTEGER*2 remapallpalette[EXTERN]
  252. INTEGER*2 selectpalette[EXTERN]
  253. INTEGER*2 settextrows[EXTERN]
  254. EXTERNAL settextwindow
  255. EXTERNAL gettextwindow
  256. EXTERNAL scrolltextwindow
  257. EXTERNAL outtext
  258. INTEGER*2 wrapon[EXTERN]
  259. INTEGER*2 displaycursor[EXTERN]
  260. INTEGER*2 settextcursor[EXTERN]
  261. INTEGER*2 gettextcursor[EXTERN]
  262. EXTERNAL settextposition
  263. EXTERNAL gettextposition
  264. INTEGER*2 settextcolor[EXTERN]
  265. INTEGER*2 gettextcolor[EXTERN]
  266. EXTERNAL getimage
  267. EXTERNAL putimage
  268. INTEGER*4 imagesize[EXTERN]
  269. C External function declarations for QuickWin Graphics API's
  270. INTEGER*2 INCHARQQ[EXTERN]
  271. INTEGER*2 WGOPENQQ[EXTERN]
  272. INTEGER*2 WGCLOSEQQ[EXTERN]
  273. INTEGER*2 WGSETACTIVEQQ[EXTERN]
  274. INTEGER*2 WGGETACTIVEQQ[EXTERN]
  275. C WINDOW COORDINATE SYSTEM
  276. C Structure for window coordinate pair
  277. STRUCTURE/wxycoord/
  278. DOUBLE PRECISION wx ! window x coordinate
  279. DOUBLE PRECISION wy ! window y coordinate
  280. END STRUCTURE
  281. INTEGER*2 setwindow[EXTERN]
  282. EXTERNAL getwindowcoord
  283. EXTERNAL getviewcoord_w
  284. EXTERNAL getcurrentposition_w
  285. C Window coordinate entry points for graphics output routines
  286. INTEGER*2 arc_w[EXTERN]
  287. INTEGER*2 ellipse_w[EXTERN]
  288. INTEGER*2 floodfill_w[EXTERN]
  289. INTEGER*2 getpixel_w[EXTERN]
  290. INTEGER*2 lineto_w[EXTERN]
  291. EXTERNAL moveto_w
  292. INTEGER*2 pie_w[EXTERN]
  293. INTEGER*2 rectangle_w[EXTERN]
  294. INTEGER*2 polygon_w[EXTERN]
  295. INTEGER*2 setpixel_w[EXTERN]
  296. EXTERNAL getimage_w
  297. INTEGER*4 imagesize_w[EXTERN]
  298. EXTERNAL putimage_w
  299. STRUCTURE/fontinfo/
  300. INTEGER*2 type ! b0 set = vector,clear = bit map
  301. INTEGER*2 ascent ! pix dist from top to baseline
  302. INTEGER*2 pixwidth ! character width in pixels, 0=prop
  303. INTEGER*2 pixheight ! character height in pixels
  304. INTEGER*2 avgwidth ! average character width in pixels
  305. CHARACTER*81 filename ! file name including path
  306. CHARACTER*32 facename ! font name
  307. END STRUCTURE
  308. C Font parameters
  309. INTEGER*2 $NO_SPACE,$FIXED_SPACE,$PROP_SPACE
  310. PARAMETER ($NO_SPACE = 0)
  311. PARAMETER ($FIXED_SPACE = 1)
  312. PARAMETER ($PROP_SPACE = 2)
  313. INTEGER*2 $NO_FONT_MAP,$VECTOR_MAP,$BIT_MAP
  314. PARAMETER ($NO_FONT_MAP = 0)
  315. PARAMETER ($VECTOR_MAP = 1)
  316. PARAMETER ($BIT_MAP = 2)
  317. INTEGER*2 registerfonts[EXTERN]
  318. EXTERNAL unregisterfonts
  319. INTEGER*2 setfont[EXTERN]
  320. INTEGER*2 getfontinfo[EXTERN]
  321. EXTERNAL outgtext
  322. INTEGER*2 getgtextextent[EXTERN]
  323. EXTERNAL setgtextvector
  324. EXTERNAL getgtextvector