%option '-nons'

type

colourmap = packed array [0..255] of integer;
s255 = varying [255] of char;

const

black=0; red=1; green=2; blue=4;
yellow=red+green; magenta=red+blue; cyan=blue+green;
white=red+green+blue;

mouseleft=1; mousemiddle=2; mouseright=4;

function mousebuttons %alias 'FRED_GRAPHICS_MOUSEB':integer; extern;
function relmousex %alias 'FRED_GRAPHICS_MOUSEX':integer; extern;
function relmousey %alias 'FRED_GRAPHICS_MOUSEY':integer; extern;
procedure vline %alias 'FRED_GRAPHICS_VLINE' (x, y0, y1:integer); extern;
procedure hline %alias 'FRED_GRAPHICS_HLINE' (x0, x1, y:integer); extern;
procedure offset %alias 'FRED_GRAPHICS_OFFSET' (x, y:integer); extern;
procedure colour %alias 'FRED_GRAPHICS_COLOUR' (colour:integer); extern;
procedure enable %alias 'FRED_GRAPHICS_ENABLE' (planes:integer); extern;
procedure updatecolourmap %alias 'FRED_GRAPHICS_UPCMAP'(var z:colourmap); extern;
procedure clear %alias 'FRED_GRAPHICS_CLEAR'; extern;
procedure halfclear %alias 'FRED_GRAPHICS_HCLEAR' (h:integer); extern;
procedure line %alias 'FRED_GRAPHICS_LINE'
   (x0, y0, x1, y1:integer); extern;
procedure fill %alias 'FRED_GRAPHICS_FILL'
   (x0, y0, x1, y1:integer); extern;
procedure triangle %alias 'FRED_GRAPHICS_TRIANGLE'
   (x0, y0, x1, y1, x2, y2:integer); extern;
procedure trapeze %alias 'FRED_GRAPHICS_TRAPEZE'
   (x00, x01, y0, x10, x11, y1:integer); extern;
procedure disc %alias 'FRED_GRAPHICS_DISC' (x, y, r:integer); extern;
procedure ring %alias 'FRED_GRAPHICS_RING' (x, y, r:integer); extern;
procedure plot %alias 'FRED_GRAPHICS_PLOT' (x, y:integer); extern;
procedure textat %alias 'FRED_GRAPHICS_TEXTAT' (x,y:integer); extern;
procedure readfont %alias 'FRED_GRAPHICS_READFONT'
   (filename:s255; var font:integer); extern;
procedure showsymbol %alias 'FRED_GRAPHICS_SHOWSYM' (k:integer); extern;
procedure showstring %alias 'FRED_GRAPHICS_SHOWSTR' (s:s255); extern;
procedure font %alias 'FRED_GRAPHICS_FONT' (f:integer); extern;
function fontheight %alias 'FRED_GRAPHICS_FONTHT':integer; extern;
function fontdepth %alias 'FRED_GRAPHICS_FONTDP':integer; extern;
function maxfontwidth %alias 'FRED_GRAPHICS_FONTWX':integer; extern;
function minfontwidth %alias 'FRED_GRAPHICS_FONTWN':integer; extern;
function stringwidth %alias 'FRED_GRAPHICS_STRNGW' (s:s255):integer; extern;
function charheight %alias 'FRED_GRAPHICS_CHARHT' (c:integer):integer; extern;
function chardepth %alias 'FRED_GRAPHICS_CHARDP' (c:integer):integer; extern;
function charwidth %alias 'FRED_GRAPHICS_CHARWD' (c:integer):integer; extern;
function textxpos %alias 'FRED_GRAPHICS_XPOS':integer; extern;
function textypos %alias 'FRED_GRAPHICS_YPOS':integer; extern;
procedure poly %alias 'FRED_GRAPHICS_POLY' (x, y:integer); extern;
procedure closepoly %alias 'FRED_GRAPHICS_CLOSEPOLY'; extern;
