type gr_line =
{ ln_window : gr_window
; mutable ln_color : color
; mutable ln_point1 : int * int
; mutable ln_point2 : int * int
}
;;
type gr_ellipse =
{ el_window : gr_window
; mutable el_filled : bool
; mutable el_color : color
; mutable el_center : int * int
; mutable el_xray : int
; mutable el_yray : int
}
;;
type gr_rectangle =
{ re_window : gr_window
; mutable re_filled : bool
; mutable re_color : color
; mutable re_point : int * int
; mutable re_width : int
; mutable re_height : int
}
;;
This three objects are graphics objects. They perform
drawing and nothing else. These three objects are: lines,
rectangles and ellipses.
The line objects, of type gr_line, are
composed of:
- the attached window (ln_window),
- the start point coordinates (ln_point1),
- the end point coordinates (ln_point2),
- the line colour (ln_color).
The rectangle objects, of type gr_rectangle, are
composed of:
- the attached window (re_window),
- the rectangle is a filled or not (re_filled),
- the coordinates of upper left corner (re_left,re_top),
- the width (re_width),
- the height (re_height),
- the colour (re_color).
The ellipse objects, of type gr_ellipse, are composed of:
- the attached window (el_window),
- the ellipse is a filled or not (el_filled),
- the ellipse center coordinates (el_center),
- the horizontal ray (el_xray),
- the vertical ray (el_yray),
- the colour (el_color).
The drawing functions of this objects are:
gr_draw_line : gr_line -> unit
gr_draw_rectangle : gr_rectangle -> unit
gr_draw_ellipse : gr_ellipse -> unit