sig
  module Ming :
    sig
      external init : unit -> int = "ml_ming_init"
      external cleanup : unit -> unit = "ml_ming_cleanup"
      external collect_garbage : unit -> unit = "ml_ming_collectgarbage"
      external set_cubic_threshold : num:int -> unit
        = "ml_ming_setcubicthreshold"
      external set_scale : scale:float -> unit = "ml_ming_setscale"
      external get_scale : unit -> float = "ml_ming_getscale"
      external use_swf_version : version:int -> unit
        = "ml_ming_useswfversion"
      external set_swf_compression : level:int -> int
        = "ml_ming_setswfcompression"
    end
  type input
  module Input :
    sig
      external new_from_file : filename:string -> modes:string -> SWF.input
        = "ml_newswfinput_file"
      external destroy : input:SWF.input -> unit = "ml_destroyswfinput"
      external get_length : input:SWF.input -> int = "ml_swfinput_length"
    end
  type character
  module Character :
    sig
      external get_width : SWF.character -> float
        = "ml_swfcharacter_getwidth"
      external get_height : SWF.character -> float
        = "ml_swfcharacter_getheight"
    end
  type bitmap
  type shape
  type morph
  type sound
  type sprite
  external bitmap_of_character : SWF.character -> SWF.bitmap = "ml_id"
  external shape_of_character : SWF.character -> SWF.shape = "ml_id"
  external morph_of_character : SWF.character -> SWF.morph = "ml_id"
  external sound_of_character : SWF.character -> SWF.sound = "ml_id"
  external sprite_of_character : SWF.character -> SWF.sprite = "ml_id"
  external character_of_bitmap : SWF.bitmap -> SWF.character = "ml_id"
  external character_of_shape : SWF.shape -> SWF.character = "ml_id"
  external character_of_morph : SWF.morph -> SWF.character = "ml_id"
  external character_of_sound : SWF.sound -> SWF.character = "ml_id"
  external character_of_sprite : SWF.sprite -> SWF.character = "ml_id"
  module Bitmap :
    sig
      external new_from_input : input:SWF.input -> SWF.bitmap
        = "ml_newswfbitmap_frominput"
      external destroy : bitmap:SWF.bitmap -> unit = "ml_destroyswfbitmap"
      external get_width : bitmap:SWF.bitmap -> int = "ml_swfbitmap_getwidth"
      external get_height : bitmap:SWF.bitmap -> int
        = "ml_swfbitmap_getheight"
    end
  type jpeg_bitmap
  module JpegBitmap :
    sig
      external new_from_file :
        filename:string -> modes:string -> SWF.jpeg_bitmap
        = "ml_newswfjpegbitmap"
    end
  type gradient
  module Gradient :
    sig
      external new_gradient : unit -> SWF.gradient = "ml_newswfgradient"
      external destroy : gradient:SWF.gradient -> unit
        = "ml_destroyswfgradient"
      external add_entry :
        gradient:SWF.gradient ->
        ratio:float -> red:int -> green:int -> blue:int -> alpha:int -> unit
        = "ml_swfgradient_addentry_bytecode" "ml_swfgradient_addentry_native"
    end
  type fill_style
  module FillStyle :
    sig
      external new_solid :
        red:int -> green:int -> blue:int -> alpha:int -> SWF.fill_style
        = "ml_newswfsolidfillstyle"
    end
  type line_style
  module LineStyle :
    sig
      external new_line_style :
        width:int ->
        red:int -> green:int -> blue:int -> alpha:int -> SWF.line_style
        = "ml_newswflinestyle"
    end
  type fill
  module Shape :
    sig
      external new_shape : unit -> SWF.shape = "ml_newswfshape"
      external destroy : shape:SWF.shape -> unit = "ml_destroyswfshape"
      external move_pen_to : shape:SWF.shape -> x:float -> y:float -> unit
        = "ml_swfshape_movepento"
      external draw_line_to : shape:SWF.shape -> x:float -> y:float -> unit
        = "ml_swfshape_drawlineto"
      external draw_line : shape:SWF.shape -> dx:float -> dy:float -> unit
        = "ml_swfshape_drawline"
      external draw_curve_to :
        shape:SWF.shape ->
        controlx:float ->
        controly:float -> anchorx:float -> anchory:float -> unit
        = "ml_swfshape_drawcurveto"
      external set_left_fill_style :
        shape:SWF.shape -> fill_style:SWF.fill_style -> unit
        = "ml_swfshape_setleftfillstyle"
      external set_right_fill_style :
        shape:SWF.shape -> fill_style:SWF.fill_style -> unit
        = "ml_swfshape_setrightfillstyle"
      external add_solid_fill :
        shape:SWF.shape ->
        red:int -> green:int -> blue:int -> alpha:int -> SWF.fill
        = "ml_swfshape_addsolidfill"
      external set_right_fill : shape:SWF.shape -> fill:SWF.fill -> unit
        = "ml_swfshape_setrightfill"
    end
  type action
  module Action :
    sig
      external compile_code : script:string -> SWF.action
        = "ml_compileswfactioncode"
      external destroy : action:SWF.action -> unit = "ml_destroyswfaction"
    end
  type display_item
  module DisplayItem :
    sig
      external set_color_mult :
        display_item:SWF.display_item ->
        red:float -> green:float -> blue:float -> alpha:float -> unit
        = "ml_swfdisplayitem_setcolormult"
      external rotate_to :
        display_item:SWF.display_item -> degrees:float -> unit
        = "ml_swfdisplayitem_rotateto"
      external move_to :
        display_item:SWF.display_item -> x:float -> y:float -> unit
        = "ml_swfdisplayitem_moveto"
    end
  type movie_clip
  type block
  external block_of_shape : shape:SWF.shape -> SWF.block = "ml_id"
  module MovieClip :
    sig
      external new_movie_clip : unit -> SWF.movie_clip = "ml_newswfmovieclip"
      external add :
        movie_clip:SWF.movie_clip -> block:SWF.block -> SWF.display_item
        = "ml_swfmovieclip_add"
      external next_frame : movie_clip:SWF.movie_clip -> unit
        = "ml_swfmovieclip_nextframe"
    end
  type movie
  external block_of_movie_clip : movie_clip:SWF.movie_clip -> SWF.block
    = "ml_id"
  module Movie :
    sig
      external new_movie : unit -> SWF.movie = "ml_newswfmovie"
      external add : movie:SWF.movie -> block:SWF.block -> SWF.display_item
        = "ml_swfmovie_add"
      external set_background :
        movie:SWF.movie -> red:int -> green:int -> blue:int -> unit
        = "ml_swfmovie_setbackground"
      external set_dimension : movie:SWF.movie -> x:float -> y:float -> unit
        = "ml_swfmovie_setdimension"
      external save : movie:SWF.movie -> filename:string -> int
        = "ml_swfmovie_save"
    end
end