sig
  module Theme :
    sig
      val room_margin : int
      val scale_int : int -> int
      val set_text_font : string -> unit
      val set_label_font : string -> unit
      val set_scale : float -> unit
      val set_integer_scale : bool -> unit
      val find_share : string -> string -> string option
    end
  module Utils :
    sig
      val printd : int -> ('a, unit, string, unit) Stdlib.format4 -> 'a
      val debug : bool Stdlib.ref
      val debug_code : int Stdlib.ref
      val debug_thread : int
      val debug_warning : int
      val debug_graphics : int
      val debug_error : int
      val debug_io : int
      val debug_memory : int
      val debug_board : int
      val debug_event : int
      val debug_custom : int
      val pi : float
      val round : float -> int
      val imax : int -> int -> int
      val imin : int -> int -> int
      val go : 'Tsdl.Sdl.result -> 'a
      val map_option : 'a option -> ('-> 'b) -> 'b option
      val do_option : 'a option -> ('-> unit) -> unit
      val default : 'a option -> '-> 'a
      exception None_option
      val remove_option : 'a option -> 'a
      val ( let@ ) : ('-> 'b) -> '-> 'b
      val run : (unit -> 'a) -> 'a
    end
  module Time :
    sig
      type t = int
      val now : unit -> Bogue.Time.t
      val adaptive_fps : int -> (unit -> unit) * (unit -> unit)
    end
  module Var :
    sig
      type 'a t
      val create : '-> 'Bogue.Var.t
      val get : 'Bogue.Var.t -> 'a
      val set : 'Bogue.Var.t -> '-> unit
      val with_protect : 'Bogue.Var.t -> ('-> 'b) -> 'b
      val protect_fn : 'Bogue.Var.t -> ('-> 'b) -> 'b
    end
  module Timeout :
    sig
      type t
      val add : int -> (unit -> unit) -> Bogue.Timeout.t
      val cancel : Bogue.Timeout.t -> unit
    end
  module Trigger :
    sig
      type t = Tsdl.Sdl.event_type
      val text_input : Bogue.Trigger.t
      val key_down : Bogue.Trigger.t
      val key_up : Bogue.Trigger.t
      val startup : Bogue.Trigger.t
      val mouse_enter : Bogue.Trigger.t
      val mouse_leave : Bogue.Trigger.t
      val mouse_at_rest : Bogue.Trigger.t
      val var_changed : Bogue.Trigger.t
      val update : Bogue.Trigger.t
      val user_event : Bogue.Trigger.t
      val buttons_down : Bogue.Trigger.t list
      val buttons_up : Bogue.Trigger.t list
      val pointer_motion : Bogue.Trigger.t list
      val should_exit : Tsdl.Sdl.event -> bool
      val will_exit : Tsdl.Sdl.event -> unit
      val nice_delay : Tsdl.Sdl.event -> float -> unit
      val push_quit : unit -> unit
      val wait_for :
        ?timeout:float -> ?ev:Tsdl.Sdl.event -> (unit -> bool) -> unit
      type sdl_event =
          [ `App_did_enter_background
          | `App_did_enter_foreground
          | `App_low_memory
          | `App_terminating
          | `App_will_enter_background
          | `App_will_enter_foreground
          | `Clipboard_update
          | `Controller_axis_motion
          | `Controller_button_down
          | `Controller_button_up
          | `Controller_device_added
          | `Controller_device_remapped
          | `Controller_device_removed
          | `Display_event
          | `Dollar_gesture
          | `Dollar_record
          | `Drop_file
          | `Finger_down
          | `Finger_motion
          | `Finger_up
          | `Joy_axis_motion
          | `Joy_ball_motion
          | `Joy_button_down
          | `Joy_button_up
          | `Joy_device_added
          | `Joy_device_removed
          | `Joy_hat_motion
          | `Key_down
          | `Key_up
          | `Mouse_button_down
          | `Mouse_button_up
          | `Mouse_motion
          | `Mouse_wheel
          | `Multi_gesture
          | `Quit
          | `Sensor_update
          | `Sys_wm_event
          | `Text_editing
          | `Text_input
          | `Unknown of int
          | `User_event
          | `Window_event ]
      type bogue_event =
          [ `Bogue_destroy_window
          | `Bogue_keyboard_focus
          | `Bogue_keymap_changed
          | `Bogue_mouse_at_rest
          | `Bogue_mouse_enter
          | `Bogue_mouse_focus
          | `Bogue_mouse_leave
          | `Bogue_redraw
          | `Bogue_remove_layout
          | `Bogue_startup
          | `Bogue_stop
          | `Bogue_stopped
          | `Bogue_sync_action
          | `Bogue_update
          | `Bogue_var_changed ]
      val event_kind :
        Tsdl.Sdl.event ->
        [ `App_did_enter_background
        | `App_did_enter_foreground
        | `App_low_memory
        | `App_terminating
        | `App_will_enter_background
        | `App_will_enter_foreground
        | `Bogue_destroy_window
        | `Bogue_keyboard_focus
        | `Bogue_keymap_changed
        | `Bogue_mouse_at_rest
        | `Bogue_mouse_enter
        | `Bogue_mouse_focus
        | `Bogue_mouse_leave
        | `Bogue_redraw
        | `Bogue_remove_layout
        | `Bogue_startup
        | `Bogue_stop
        | `Bogue_stopped
        | `Bogue_sync_action
        | `Bogue_update
        | `Bogue_var_changed
        | `Clipboard_update
        | `Controller_axis_motion
        | `Controller_button_down
        | `Controller_button_up
        | `Controller_device_added
        | `Controller_device_remapped
        | `Controller_device_removed
        | `Display_event
        | `Dollar_gesture
        | `Dollar_record
        | `Drop_file
        | `Finger_down
        | `Finger_motion
        | `Finger_up
        | `Joy_axis_motion
        | `Joy_ball_motion
        | `Joy_button_down
        | `Joy_button_up
        | `Joy_device_added
        | `Joy_device_removed
        | `Joy_hat_motion
        | `Key_down
        | `Key_up
        | `Mouse_button_down
        | `Mouse_button_up
        | `Mouse_motion
        | `Mouse_wheel
        | `Multi_gesture
        | `Quit
        | `Sensor_update
        | `Sys_wm_event
        | `Text_editing
        | `Text_input
        | `Unknown of int
        | `User_event
        | `Window_event ]
    end
  module Mixer :
    sig
      type t
      type sound = (int, Stdlib.Bigarray.int16_signed_elt) Tsdl.Sdl.bigarray
      type repeat = Repeat of int | Forever
      val test : unit -> unit
      val init : unit -> string option
      val create_mixer :
        ?tracks:int -> ?freq:int -> string option -> Bogue.Mixer.t
      val load_chunk : Bogue.Mixer.t -> string -> Bogue.Mixer.sound
      val play_chunk :
        ?track:int ->
        ?effects:(Bogue.Mixer.sound -> unit) list ->
        ?volume:float ->
        ?repeat:Bogue.Mixer.repeat ->
        Bogue.Mixer.t -> Bogue.Mixer.sound -> int option
      val change_volume : float -> Bogue.Mixer.sound -> unit
      val pause : Bogue.Mixer.t -> unit
      val unpause : Bogue.Mixer.t -> unit
      val close : Bogue.Mixer.t -> unit
    end
  module Sync : sig val push : (unit -> unit) -> unit end
  module Draw :
    sig
      type canvas
      type texture = Tsdl.Sdl.texture
      val video_init : unit -> unit
      val quit : unit -> unit
      type rgb = int * int * int
      type color = int * int * int * int
      type fill = Pattern of Bogue.Draw.texture | Solid of Bogue.Draw.color
      val black : Bogue.Draw.rgb
      val grey : Bogue.Draw.rgb
      val pale_grey : Bogue.Draw.rgb
      val dark_grey : Bogue.Draw.rgb
      val white : Bogue.Draw.rgb
      val red : Bogue.Draw.rgb
      val blue : Bogue.Draw.rgb
      val green : Bogue.Draw.rgb
      val magenta : Bogue.Draw.rgb
      val cyan : Bogue.Draw.rgb
      val yellow : Bogue.Draw.rgb
      val sienna : Bogue.Draw.rgb
      val label_color : Bogue.Draw.rgb
      val none : Bogue.Draw.color
      val opaque : Bogue.Draw.rgb -> Bogue.Draw.color
      val transp : Bogue.Draw.rgb -> Bogue.Draw.color
      val lighter : Bogue.Draw.color -> Bogue.Draw.color
      val darker : Bogue.Draw.color -> Bogue.Draw.color
      val set_alpha : int -> Bogue.Draw.rgb -> Bogue.Draw.color
      val random_color : unit -> Bogue.Draw.color
      val find_color : string -> Bogue.Draw.rgb
      val pale : Bogue.Draw.rgb -> Bogue.Draw.rgb
      val set_color : Tsdl.Sdl.renderer -> Bogue.Draw.color -> unit
      val set_text_color : Bogue.Draw.rgb -> unit
      val to_pixels : int * int -> int * int
      val line :
        ?thick:int ->
        Tsdl.Sdl.renderer ->
        color:Bogue.Draw.color ->
        x0:int -> y0:int -> x1:int -> y1:int -> unit
      val rectangle :
        ?thick:int ->
        Tsdl.Sdl.renderer ->
        color:Bogue.Draw.color -> w:int -> h:int -> x:int -> y:int -> unit
      val circle :
        ?thick:int ->
        Tsdl.Sdl.renderer ->
        color:Bogue.Draw.color -> radius:int -> x:int -> y:int -> unit
      type layer
      val use_new_layer : unit -> unit
      type align = Min | Center | Max
      val unscale_size : int * int -> int * int
      val set_system_cursor : Tsdl.Sdl.System_cursor.t -> unit
    end
  module Mouse :
    sig
      val pointer_pos : Tsdl.Sdl.event -> int * int
      val pos : unit -> int * int
      val window_pos : Tsdl.Sdl.window -> int * int
      val button_pos : Tsdl.Sdl.event -> int * int
      val finger_pos : Tsdl.Sdl.event -> float * float
    end
  module Tvar :
    sig
      type ('a, 'b) t
      val create :
        'Bogue.Var.t ->
        t_from:('-> 'b) -> t_to:('-> 'a) -> ('a, 'b) Bogue.Tvar.t
      val get : ('a, 'b) Bogue.Tvar.t -> 'b
      val set : ('a, 'b) Bogue.Tvar.t -> '-> unit
    end
  module Avar :
    sig
      type 'a t
      type callback = unit -> unit
      val create :
        ?duration:Bogue.Time.t ->
        ?init:Bogue.Avar.callback ->
        ?ending:Bogue.Avar.callback ->
        ?finished:bool ->
        ?update:('Bogue.Avar.t -> float -> 'a) -> '-> 'Bogue.Avar.t
      val apply : ('-> 'b) -> 'Bogue.Avar.t -> 'Bogue.Avar.t
      val fromto :
        ?duration:int ->
        ?ending:Bogue.Avar.callback -> int -> int -> int Bogue.Avar.t
      val fromto_unif :
        ?duration:int ->
        ?ending:Bogue.Avar.callback -> int -> int -> int Bogue.Avar.t
      val oscillate :
        ?duration:int -> ?frequency:float -> int -> int -> int Bogue.Avar.t
      val var : '-> 'Bogue.Avar.t
      val get : 'Bogue.Avar.t -> 'a
      val progress : 'Bogue.Avar.t -> float
      type direction =
          No
        | Left
        | Right
        | Top
        | Bottom
        | TopLeft
        | TopRight
        | BottomLeft
        | BottomRight
        | Random
    end
  module Selection :
    sig
      type t
      val to_list : Bogue.Selection.t -> (int * int) list
      val of_list : (int * int) list -> Bogue.Selection.t
      val mem : Bogue.Selection.t -> int -> bool
      val toggle : Bogue.Selection.t -> int -> Bogue.Selection.t
      val remove : Bogue.Selection.t -> int -> Bogue.Selection.t
      val add : Bogue.Selection.t -> int -> Bogue.Selection.t
      val union : Bogue.Selection.t -> Bogue.Selection.t -> Bogue.Selection.t
      val intersect :
        Bogue.Selection.t -> Bogue.Selection.t -> Bogue.Selection.t
      val sprint : Bogue.Selection.t -> string
      val iter : (int -> unit) -> Bogue.Selection.t -> unit
    end
  module Image :
    sig
      type t
      val create :
        ?width:int ->
        ?height:int ->
        ?noscale:bool ->
        ?bg:Bogue.Draw.color -> ?angle:float -> string -> Bogue.Image.t
      val create_from_svg :
        ?width:int ->
        ?height:int -> ?bg:Bogue.Draw.color -> string -> Bogue.Image.t
    end
  module Style :
    sig
      type t
      type line_style = Solid | Dotted of (int * int)
      type line
      type border
      type shadow
      type gradient
      type background =
          Image of Bogue.Image.t
        | Solid of Bogue.Draw.color
        | Gradient of Bogue.Style.gradient
      val create :
        ?background:Bogue.Style.background ->
        ?border:Bogue.Style.border ->
        ?shadow:Bogue.Style.shadow -> unit -> Bogue.Style.t
      val empty : Bogue.Style.t
      val of_bg : Bogue.Style.background -> Bogue.Style.t
      val of_border : Bogue.Style.border -> Bogue.Style.t
      val of_shadow : Bogue.Style.shadow -> Bogue.Style.t
      val with_bg : Bogue.Style.background -> Bogue.Style.t -> Bogue.Style.t
      val with_border : Bogue.Style.border -> Bogue.Style.t -> Bogue.Style.t
      val with_shadow : Bogue.Style.shadow -> Bogue.Style.t -> Bogue.Style.t
      val theme_bg : Bogue.Style.background
      val color_bg : Bogue.Draw.color -> Bogue.Style.background
      val opaque_bg : Bogue.Draw.rgb -> Bogue.Style.background
      val image_bg : Bogue.Image.t -> Bogue.Style.background
      val gradient :
        ?angle:float -> Bogue.Draw.color list -> Bogue.Style.background
      val hgradient : Bogue.Draw.color list -> Bogue.Style.background
      val vgradient : Bogue.Draw.color list -> Bogue.Style.background
      val mk_line :
        ?color:Bogue.Draw.color ->
        ?width:int ->
        ?style:Bogue.Style.line_style -> unit -> Bogue.Style.line
      val mk_border : ?radius:int -> Bogue.Style.line -> Bogue.Style.border
      val mk_shadow :
        ?offset:int * int ->
        ?size:int -> ?width:int -> ?radius:int -> unit -> Bogue.Style.shadow
    end
  module Label :
    sig
      type t
      type font
      type style
      val create :
        ?size:int ->
        ?font:Bogue.Label.font ->
        ?style:Bogue.Label.style ->
        ?fg:Bogue.Draw.color ->
        ?align:Bogue.Draw.align -> string -> Bogue.Label.t
      val icon : ?size:int -> ?fg:Bogue.Draw.color -> string -> Bogue.Label.t
      val set : Bogue.Label.t -> string -> unit
      val set_fg_color : Bogue.Label.t -> Bogue.Draw.color -> unit
      val size : Bogue.Label.t -> int * int
    end
  module Button :
    sig
      type t
      type kind = Trigger | Switch
      val create :
        ?size:int ->
        ?border_radius:int ->
        ?border_color:Bogue.Draw.color ->
        ?fg:Bogue.Draw.color ->
        ?bg_on:Bogue.Style.background ->
        ?bg_off:Bogue.Style.background ->
        ?bg_over:Bogue.Style.background option ->
        ?label:Bogue.Label.t ->
        ?label_on:Bogue.Label.t ->
        ?label_off:Bogue.Label.t ->
        ?state:bool ->
        ?action:(bool -> unit) ->
        Bogue.Button.kind -> string -> Bogue.Button.t
      val state : Bogue.Button.t -> bool
      val reset : Bogue.Button.t -> unit
      val is_pressed : Bogue.Button.t -> bool
    end
  module Slider :
    sig
      type t
      type kind = Horizontal | HBar | Vertical | Circular
      val triggers : Bogue.Trigger.t list
      val size : Bogue.Slider.t -> int * int
      val value : Bogue.Slider.t -> int
      val get_max : Bogue.Slider.t -> int
      val set : Bogue.Slider.t -> int -> unit
    end
  module Check :
    sig
      type t
      type style
      val create :
        ?state:bool -> ?style:Bogue.Check.style -> unit -> Bogue.Check.t
      val state : Bogue.Check.t -> bool
    end
  module Text_display :
    sig
      type t
      type words
      val example : Bogue.Text_display.words
      val raw : string -> Bogue.Text_display.words
      val bold : Bogue.Text_display.words -> Bogue.Text_display.words
      val italic : Bogue.Text_display.words -> Bogue.Text_display.words
      val normal : Bogue.Text_display.words -> Bogue.Text_display.words
      val underline : Bogue.Text_display.words -> Bogue.Text_display.words
      val strikethrough :
        Bogue.Text_display.words -> Bogue.Text_display.words
      val page :
        Bogue.Text_display.words list -> Bogue.Text_display.words list
      val para : string -> Bogue.Text_display.words
      val paragraphs_of_string : string -> Bogue.Text_display.words list
      val replace : by:Bogue.Text_display.t -> Bogue.Text_display.t -> unit
      val update_verbatim : Bogue.Text_display.t -> string -> unit
    end
  module Text_input :
    sig
      type t
      type filter = string -> bool
      val triggers : Bogue.Trigger.t list
      val uint_filter : Bogue.Text_input.filter
      val text : Bogue.Text_input.t -> string
      val activate : Bogue.Text_input.t -> unit
    end
  module Box :
    sig
      type t
      val create :
        ?width:int ->
        ?height:int -> ?style:Bogue.Style.t -> unit -> Bogue.Box.t
      val set_background : Bogue.Box.t -> Bogue.Style.background -> unit
      val set_style : Bogue.Box.t -> Bogue.Style.t -> unit
      val get_style : Bogue.Box.t -> Bogue.Style.t
    end
  module Sdl_area :
    sig
      type t
      val create :
        width:int ->
        height:int ->
        ?style:Bogue.Style.t -> ?timeout:int -> unit -> Bogue.Sdl_area.t
      val update : Bogue.Sdl_area.t -> unit
      val clear : Bogue.Sdl_area.t -> unit
      val add :
        Bogue.Sdl_area.t ->
        ?name:string -> (Tsdl.Sdl.renderer -> unit) -> unit
      val cache : Bogue.Sdl_area.t -> unit
      val clear_cache : Bogue.Sdl_area.t -> unit
      val drawing_size : Bogue.Sdl_area.t -> int * int
      val pointer_pos : Bogue.Sdl_area.t -> Tsdl.Sdl.event -> int * int
      val to_pixels : int * int -> int * int
      val draw_line :
        Bogue.Sdl_area.t ->
        color:Bogue.Draw.color -> thick:int -> int * int -> int * int -> unit
      val draw_rectangle :
        Bogue.Sdl_area.t ->
        color:Bogue.Draw.color ->
        thick:int -> w:int -> h:int -> int * int -> unit
      val fill_rectangle :
        Bogue.Sdl_area.t ->
        color:Bogue.Draw.color -> w:int -> h:int -> int * int -> unit
      val draw_circle :
        Bogue.Sdl_area.t ->
        color:Bogue.Draw.color ->
        thick:int -> radius:int -> int * int -> unit
      val fill_circle :
        Bogue.Sdl_area.t ->
        color:Bogue.Draw.color -> radius:int -> int * int -> unit
      type draw_element
      val add_get :
        Bogue.Sdl_area.t ->
        ?name:string ->
        ?disable:bool ->
        (Tsdl.Sdl.renderer -> unit) -> Bogue.Sdl_area.draw_element
      val disable : Bogue.Sdl_area.draw_element -> unit
      val enable : Bogue.Sdl_area.draw_element -> unit
      val remove_element :
        Bogue.Sdl_area.t -> Bogue.Sdl_area.draw_element -> unit
      val add_element :
        Bogue.Sdl_area.t -> Bogue.Sdl_area.draw_element -> unit
      val has_element :
        Bogue.Sdl_area.t -> Bogue.Sdl_area.draw_element -> bool
      val get_texture : Bogue.Sdl_area.t -> Tsdl.Sdl.texture option
      val set_texture : Bogue.Sdl_area.t -> Tsdl.Sdl.texture -> unit
    end
  module Widget :
    sig
      type t
      type connection
      type action =
          Bogue.Widget.t -> Bogue.Widget.t -> Tsdl.Sdl.event -> unit
      type action_priority = Forget | Join | Replace | Main
      val connect :
        Bogue.Widget.t ->
        Bogue.Widget.t ->
        Bogue.Widget.action ->
        ?priority:Bogue.Widget.action_priority ->
        ?update_target:bool ->
        ?join:Bogue.Widget.connection ->
        Bogue.Trigger.t list -> Bogue.Widget.connection
      val connect_main :
        Bogue.Widget.t ->
        Bogue.Widget.t ->
        Bogue.Widget.action ->
        ?update_target:bool ->
        ?join:Bogue.Widget.connection ->
        Bogue.Trigger.t list -> Bogue.Widget.connection
      val add_connection : Bogue.Widget.t -> Bogue.Widget.connection -> unit
      val update : Bogue.Widget.t -> unit
      val on_release :
        release:(Bogue.Widget.t -> unit) -> Bogue.Widget.t -> unit
      val on_button_release :
        release:(Bogue.Widget.t -> unit) -> Bogue.Widget.t -> unit
      val on_click : click:(Bogue.Widget.t -> unit) -> Bogue.Widget.t -> unit
      val mouse_over :
        ?enter:(Bogue.Widget.t -> unit) ->
        ?leave:(Bogue.Widget.t -> unit) -> Bogue.Widget.t -> unit
      val box :
        ?w:int -> ?h:int -> ?style:Bogue.Style.t -> unit -> Bogue.Widget.t
      val check_box :
        ?state:bool -> ?style:Bogue.Check.style -> unit -> Bogue.Widget.t
      val set_check_state : Bogue.Widget.t -> bool -> unit
      val text_display : ?w:int -> ?h:int -> string -> Bogue.Widget.t
      val rich_text :
        ?size:int ->
        ?w:int -> ?h:int -> Bogue.Text_display.words list -> Bogue.Widget.t
      val verbatim : string -> Bogue.Widget.t
      val html : ?w:int -> ?h:int -> string -> Bogue.Widget.t
      val label :
        ?size:int ->
        ?fg:Bogue.Draw.color ->
        ?font:Bogue.Label.font ->
        ?align:Bogue.Draw.align -> string -> Bogue.Widget.t
      val icon :
        ?size:int -> ?fg:Bogue.Draw.color -> string -> Bogue.Widget.t
      val empty : w:int -> h:int -> unit -> Bogue.Widget.t
      val image :
        ?w:int ->
        ?h:int ->
        ?bg:Bogue.Draw.color ->
        ?noscale:bool -> ?angle:float -> string -> Bogue.Widget.t
      val image_from_svg :
        ?w:int -> ?h:int -> ?bg:Bogue.Draw.color -> string -> Bogue.Widget.t
      val image_copy : ?rotate:float -> Bogue.Widget.t -> Bogue.Widget.t
      val text_input :
        ?text:string ->
        ?prompt:string ->
        ?size:int ->
        ?filter:Bogue.Text_input.filter ->
        ?max_size:int -> unit -> Bogue.Widget.t
      val button :
        ?kind:Bogue.Button.kind ->
        ?label:Bogue.Label.t ->
        ?label_on:Bogue.Label.t ->
        ?label_off:Bogue.Label.t ->
        ?fg:Bogue.Draw.color ->
        ?bg_on:Bogue.Style.background ->
        ?bg_off:Bogue.Style.background ->
        ?bg_over:Bogue.Style.background option ->
        ?state:bool ->
        ?border_radius:int ->
        ?border_color:Bogue.Draw.color ->
        ?action:(bool -> unit) -> string -> Bogue.Widget.t
      val slider :
        ?priority:Bogue.Widget.action_priority ->
        ?step:int ->
        ?value:int ->
        ?kind:Bogue.Slider.kind ->
        ?var:(int Bogue.Avar.t, int) Bogue.Tvar.t ->
        ?length:int ->
        ?thickness:int ->
        ?tick_size:int ->
        ?lock:bool -> ?w:int -> ?h:int -> int -> Bogue.Widget.t
      val slider_with_action :
        ?priority:Bogue.Widget.action_priority ->
        ?step:int ->
        ?kind:Bogue.Slider.kind ->
        value:int ->
        ?length:int ->
        ?thickness:int ->
        ?tick_size:int -> action:(int -> unit) -> int -> Bogue.Widget.t
      val sdl_area :
        w:int -> h:int -> ?style:Bogue.Style.t -> unit -> Bogue.Widget.t
      val check_box_with_label : string -> Bogue.Widget.t * Bogue.Widget.t
      val get_state : Bogue.Widget.t -> bool
      val get_text : Bogue.Widget.t -> string
      val size : Bogue.Widget.t -> int * int
      val set_state : Bogue.Widget.t -> bool -> unit
      val set_text : Bogue.Widget.t -> string -> unit
      val set_cursor : Bogue.Widget.t -> Tsdl.Sdl.cursor option -> unit
      val get_box : Bogue.Widget.t -> Bogue.Box.t
      val get_check : Bogue.Widget.t -> Bogue.Check.t
      val get_label : Bogue.Widget.t -> Bogue.Label.t
      val get_button : Bogue.Widget.t -> Bogue.Button.t
      val get_slider : Bogue.Widget.t -> Bogue.Slider.t
      val get_text_display : Bogue.Widget.t -> Bogue.Text_display.t
      val get_text_input : Bogue.Widget.t -> Bogue.Text_input.t
      val get_image : Bogue.Widget.t -> Bogue.Image.t
      val get_sdl_area : Bogue.Widget.t -> Bogue.Sdl_area.t
      val map_text : (string -> string) -> Bogue.Widget.action
    end
  module Update : sig val push : Bogue.Widget.t -> unit end
  module Layout :
    sig
      type t
      exception Fatal_error of (Bogue.Layout.t * string)
      type room_content =
          Rooms of Bogue.Layout.t list
        | Resident of Bogue.Widget.t
      type adjust = Fit | Width | Height | Nothing
      type background
      val color_bg : Bogue.Draw.color -> Bogue.Layout.background
      val opaque_bg : Bogue.Draw.rgb -> Bogue.Layout.background
      val style_bg : Bogue.Style.t -> Bogue.Layout.background
      val theme_bg : Bogue.Layout.background
      val set_background :
        Bogue.Layout.t -> Bogue.Layout.background option -> unit
      val unload_background : Bogue.Layout.t -> unit
      val empty :
        ?name:string ->
        ?background:Bogue.Layout.background ->
        w:int -> h:int -> unit -> Bogue.Layout.t
      val resident :
        ?name:string ->
        ?x:int ->
        ?y:int ->
        ?w:int ->
        ?h:int ->
        ?background:Bogue.Layout.background ->
        ?draggable:bool ->
        ?canvas:Bogue.Draw.canvas ->
        ?keyboard_focus:bool -> Bogue.Widget.t -> Bogue.Layout.t
      val flat_of_w :
        ?name:string ->
        ?sep:int ->
        ?h:int ->
        ?align:Bogue.Draw.align ->
        ?background:Bogue.Layout.background ->
        ?widget_bg:Bogue.Layout.background ->
        ?canvas:Bogue.Draw.canvas ->
        ?scale_content:bool -> Bogue.Widget.t list -> Bogue.Layout.t
      val tower_of_w :
        ?name:string ->
        ?sep:int ->
        ?w:int ->
        ?align:Bogue.Draw.align ->
        ?background:Bogue.Layout.background ->
        ?widget_bg:Bogue.Layout.background ->
        ?canvas:Bogue.Draw.canvas ->
        ?scale_content:bool -> Bogue.Widget.t list -> Bogue.Layout.t
      val flat :
        ?name:string ->
        ?sep:int ->
        ?adjust:Bogue.Layout.adjust ->
        ?hmargin:int ->
        ?vmargin:int ->
        ?margins:int ->
        ?align:Bogue.Draw.align ->
        ?background:Bogue.Layout.background ->
        ?shadow:Bogue.Style.shadow ->
        ?canvas:Bogue.Draw.canvas ->
        ?scale_content:bool -> Bogue.Layout.t list -> Bogue.Layout.t
      val tower :
        ?name:string ->
        ?sep:int ->
        ?margins:int ->
        ?hmargin:int ->
        ?vmargin:int ->
        ?align:Bogue.Draw.align ->
        ?adjust:Bogue.Layout.adjust ->
        ?background:Bogue.Layout.background ->
        ?shadow:Bogue.Style.shadow ->
        ?canvas:Bogue.Draw.canvas ->
        ?clip:bool ->
        ?scale_content:bool -> Bogue.Layout.t list -> Bogue.Layout.t
      val superpose :
        ?w:int ->
        ?h:int ->
        ?name:string ->
        ?background:Bogue.Layout.background ->
        ?canvas:Bogue.Draw.canvas ->
        ?center:bool ->
        ?scale_content:bool -> Bogue.Layout.t list -> Bogue.Layout.t
      val make_clip :
        ?w:int ->
        ?scrollbar:bool ->
        ?scrollbar_inside:bool ->
        ?scrollbar_width:int -> h:int -> Bogue.Layout.t -> Bogue.Layout.t
      val xpos : Bogue.Layout.t -> int
      val ypos : Bogue.Layout.t -> int
      val width : Bogue.Layout.t -> int
      val height : Bogue.Layout.t -> int
      val get_size : Bogue.Layout.t -> int * int
      val get_physical_size : Bogue.Layout.t -> int * int
      val getx : Bogue.Layout.t -> int
      val get_oldx : Bogue.Layout.t -> int
      val gety : Bogue.Layout.t -> int
      val get_oldy : Bogue.Layout.t -> int
      val widget : Bogue.Layout.t -> Bogue.Widget.t
      val top_house : Bogue.Layout.t -> Bogue.Layout.t
      val get_content : Bogue.Layout.t -> Bogue.Layout.room_content
      val get_rooms : Bogue.Layout.t -> Bogue.Layout.t list
      val has_resident : Bogue.Layout.t -> bool
      val auto_scale : Bogue.Layout.t -> unit
      val disable_resize : Bogue.Layout.t -> unit
      val on_resize : Bogue.Layout.t -> (unit -> unit) -> unit
      val set_width :
        ?keep_resize:bool ->
        ?check_window:bool ->
        ?update_bg:bool -> Bogue.Layout.t -> int -> unit
      val set_height :
        ?keep_resize:bool ->
        ?check_window:bool ->
        ?update_bg:bool -> Bogue.Layout.t -> int -> unit
      val set_size :
        ?keep_resize:bool ->
        ?check_window:bool ->
        ?update_bg:bool -> Bogue.Layout.t -> int * int -> unit
      val setx : ?keep_resize:bool -> Bogue.Layout.t -> int -> unit
      val sety : ?keep_resize:bool -> Bogue.Layout.t -> int -> unit
      val set_show : Bogue.Layout.t -> bool -> unit
      val set_shadow : Bogue.Layout.t -> Bogue.Style.shadow option -> unit
      val fix_content : Bogue.Layout.t -> unit
      val fit_content : ?sep:int -> Bogue.Layout.t -> unit
      val set_rooms :
        Bogue.Layout.t -> ?sync:bool -> Bogue.Layout.t list -> unit
      val replace_room : by:Bogue.Layout.t -> Bogue.Layout.t -> unit
      val unload_textures : Bogue.Layout.t -> unit
      val lock : Bogue.Layout.t -> unit
      val unlock : Bogue.Layout.t -> unit
      val animate_x : Bogue.Layout.t -> int Bogue.Avar.t -> unit
      val animate_y : Bogue.Layout.t -> int Bogue.Avar.t -> unit
      val stop_pos : Bogue.Layout.t -> unit
      val animate_w : Bogue.Layout.t -> int Bogue.Avar.t -> unit
      val animate_h : Bogue.Layout.t -> int Bogue.Avar.t -> unit
      val animate_alpha : Bogue.Layout.t -> float Bogue.Avar.t -> unit
      val animate_angle : Bogue.Layout.t -> float Bogue.Avar.t -> unit
      val hide :
        ?duration:int ->
        ?towards:Bogue.Avar.direction -> Bogue.Layout.t -> unit
      val show :
        ?duration:int -> ?from:Bogue.Avar.direction -> Bogue.Layout.t -> unit
      val fade_in :
        ?duration:int ->
        ?from_alpha:float -> ?to_alpha:float -> Bogue.Layout.t -> unit
      val fade_out :
        ?duration:int ->
        ?from_alpha:float ->
        ?to_alpha:float -> ?hide:bool -> Bogue.Layout.t -> unit
      val rotate :
        ?duration:int ->
        ?from_angle:float -> angle:float -> Bogue.Layout.t -> unit
      val slide_in :
        ?duration:int ->
        ?from:Bogue.Avar.direction ->
        ?dst:Bogue.Layout.t -> Bogue.Layout.t -> unit
      val slide_to : ?duration:int -> Bogue.Layout.t -> int * int -> unit
      val follow_mouse :
        ?dx:int ->
        ?dy:int ->
        ?modifierx:(int -> int) ->
        ?modifiery:(int -> int) -> Bogue.Layout.t -> unit
      val oscillate :
        ?duration:int -> ?frequency:float -> int -> Bogue.Layout.t -> unit
      val zoom :
        ?duration:int ->
        from_factor:float -> to_factor:float -> Bogue.Layout.t -> unit
      val reflat :
        ?align:Bogue.Draw.align ->
        ?hmargin:int ->
        ?vmargin:int ->
        ?margins:int -> ?duration:int -> Bogue.Layout.t -> unit
      val retower :
        ?align:Bogue.Draw.align ->
        ?hmargin:int ->
        ?vmargin:int ->
        ?margins:int -> ?duration:int -> Bogue.Layout.t -> unit
      val window_opt : Bogue.Layout.t -> Tsdl.Sdl.window option
      val show_window : Bogue.Layout.t -> unit
      val hide_window : Bogue.Layout.t -> unit
      val set_window_pos : Bogue.Layout.t -> int * int -> unit
      val get_window_pos : Bogue.Layout.t -> int option * int option
      val push_close : Bogue.Layout.t -> unit
      val destroy_window : Bogue.Layout.t -> unit
      val claim_keyboard_focus : Bogue.Layout.t -> unit
      val set_cursor : Bogue.Layout.t option -> unit
      val containing_widget : Bogue.Widget.t -> Bogue.Layout.t option
    end
  module Space :
    sig
      val hfill : ?right_margin:int -> unit -> Bogue.Layout.t
      val make_hfill : ?right_margin:int -> Bogue.Layout.t -> unit
      val full_width :
        ?right_margin:int -> ?left_margin:int -> Bogue.Layout.t -> unit
      val make_vfill : ?bottom_margin:int -> Bogue.Layout.t -> unit
      val vfill : ?bottom_margin:int -> unit -> Bogue.Layout.t
      val full_height :
        ?top_margin:int -> ?bottom_margin:int -> Bogue.Layout.t -> unit
      val keep_bottom :
        ?reset_scaling:bool -> ?margin:int -> Bogue.Layout.t -> unit
      val keep_right :
        ?reset_scaling:bool -> ?margin:int -> Bogue.Layout.t -> unit
    end
  module Print :
    sig
      val layout_down : ?indent:string -> Bogue.Layout.t -> string
      val layout_up : ?indent:string -> Bogue.Layout.t -> string
      val layout_error : Bogue.Layout.t -> string -> unit
    end
  module Snapshot :
    sig
      val create :
        ?border:Bogue.Style.border -> Bogue.Layout.t -> Bogue.Widget.t
    end
  module Long_list :
    sig
      type t
      val create :
        w:int ->
        h:int ->
        length:int ->
        ?first:int ->
        generate:(int -> Bogue.Layout.t) ->
        ?height_fn:(int -> int option) ->
        ?cleanup:(Bogue.Layout.t -> unit) ->
        ?max_memory:int ->
        ?linear:bool -> ?scrollbar_width:int -> unit -> Bogue.Layout.t
    end
  module Tabs :
    sig
      val create :
        ?slide:Bogue.Avar.direction ->
        ?adjust:Bogue.Layout.adjust ->
        ?expand:bool ->
        ?canvas:Bogue.Draw.canvas ->
        ?name:string -> (string * Bogue.Layout.t) list -> Bogue.Layout.t
    end
  module Popup :
    sig
      val add_screen :
        ?color:Bogue.Draw.color -> Bogue.Layout.t -> Bogue.Layout.t
      val attach :
        ?bg:Bogue.Draw.color ->
        ?show:bool -> Bogue.Layout.t -> Bogue.Layout.t -> Bogue.Layout.t
      val info :
        ?w:int ->
        ?h:int ->
        ?button_w:int ->
        ?button_h:int -> ?button:string -> string -> Bogue.Layout.t -> unit
      val yesno :
        ?w:int ->
        ?h:int ->
        ?button_w:int ->
        ?button_h:int ->
        ?yes:string ->
        ?no:string ->
        yes_action:(unit -> unit) ->
        no_action:(unit -> unit) -> string -> Bogue.Layout.t -> unit
      val one_button :
        ?w:int ->
        ?h:int ->
        ?on_close:(unit -> unit) ->
        button:string -> dst:Bogue.Layout.t -> Bogue.Layout.t -> unit
      val two_buttons :
        ?w:int ->
        ?h:int ->
        label1:string ->
        label2:string ->
        action1:(unit -> unit) ->
        action2:(unit -> unit) ->
        content:Bogue.Layout.t -> Bogue.Layout.t -> unit
      type position = LeftOf | RightOf | Above | Below | Mouse
      val tooltip :
        ?background:Bogue.Layout.background ->
        ?position:Bogue.Popup.position ->
        string ->
        target:Bogue.Layout.t -> Bogue.Widget.t -> Bogue.Layout.t -> unit
    end
  module Menu :
    sig
      type t
      type action = unit -> unit
      type label = Text of string | Layout of Bogue.Layout.t
      type entry = {
        label : Bogue.Menu.label;
        content : Bogue.Menu.content;
      }
      and content =
          Action of Bogue.Menu.action
        | Flat of Bogue.Menu.entry list
        | Tower of Bogue.Menu.entry list
        | Custom of Bogue.Menu.entry list
        | Separator
      val create : ?dst:Bogue.Layout.t -> Bogue.Menu.content -> Bogue.Menu.t
      val add_bar : dst:Bogue.Layout.t -> Bogue.Menu.entry list -> unit
      val bar : Bogue.Menu.entry list -> Bogue.Layout.t
      val separator : Bogue.Menu.entry
    end
  module Select :
    sig
      val create :
        ?dst:Bogue.Layout.t ->
        ?name:string ->
        ?action:(int -> unit) ->
        ?fg:Bogue.Draw.color -> string array -> int -> Bogue.Layout.t
    end
  module Radiolist :
    sig
      type t
      val vertical :
        ?name:string ->
        ?click_on_label:bool ->
        ?selected:int -> string array -> Bogue.Radiolist.t
      val of_widgets :
        ?selected:int -> Bogue.Widget.t list -> Bogue.Radiolist.t
      val layout : Bogue.Radiolist.t -> Bogue.Layout.t
      val get_index : Bogue.Radiolist.t -> int option
      val set_index : Bogue.Radiolist.t -> int option -> unit
      val active_widgets : Bogue.Radiolist.t -> Bogue.Widget.t list
    end
  module Table :
    sig
      type column = {
        title : string;
        length : int;
        rows : int -> Bogue.Layout.t;
        compare : (int -> int -> int) option;
        width : int option;
      }
      type t
      val create :
        ?w:int ->
        h:int ->
        ?row_height:int ->
        ?name:string ->
        Bogue.Table.column list ->
        Bogue.Layout.t * (Bogue.Selection.t, Bogue.Selection.t) Bogue.Tvar.t
      val of_array :
        ?w:int ->
        h:int ->
        ?widths:int option list ->
        ?row_height:int ->
        ?name:string ->
        string list ->
        string array array ->
        Bogue.Layout.t * (Bogue.Selection.t, Bogue.Selection.t) Bogue.Tvar.t
      val of_list :
        ?w:int ->
        h:int ->
        ?widths:int option list ->
        ?row_height:int ->
        ?name:string ->
        string list list ->
        Bogue.Layout.t * (Bogue.Selection.t, Bogue.Selection.t) Bogue.Tvar.t
    end
  module Window :
    sig
      type t
      val create :
        ?on_close:(Bogue.Window.t -> unit) ->
        Bogue.Layout.t -> Bogue.Window.t
      val on_close :
        Bogue.Window.t -> (Bogue.Window.t -> unit) option -> unit
      val destroy : Bogue.Window.t -> unit
      val set_size : w:int -> h:int -> Bogue.Window.t -> unit
      val maximize_width : Bogue.Window.t -> unit
    end
  module Main :
    sig
      type board
      type shortcuts
      exception Exit
      val exit_on_escape : int * int * (Bogue.Main.board -> unit)
      val create :
        ?shortcuts:Bogue.Main.shortcuts ->
        ?connections:Bogue.Widget.connection list ->
        ?on_user_event:(Tsdl.Sdl.event -> unit) ->
        Bogue.Window.t list -> Bogue.Main.board
      val of_windows :
        ?shortcuts:Bogue.Main.shortcuts ->
        ?connections:Bogue.Widget.connection list ->
        ?on_user_event:(Tsdl.Sdl.event -> unit) ->
        Bogue.Window.t list -> Bogue.Main.board
      val of_layouts :
        ?shortcuts:Bogue.Main.shortcuts ->
        ?connections:Bogue.Widget.connection list ->
        ?on_user_event:(Tsdl.Sdl.event -> unit) ->
        Bogue.Layout.t list -> Bogue.Main.board
      val of_layout :
        ?shortcuts:Bogue.Main.shortcuts ->
        ?connections:Bogue.Widget.connection list ->
        ?on_user_event:(Tsdl.Sdl.event -> unit) ->
        Bogue.Layout.t -> Bogue.Main.board
      val make :
        ?shortcuts:Bogue.Main.shortcuts ->
        Bogue.Widget.connection list ->
        Bogue.Layout.t list -> Bogue.Main.board
      val run :
        ?before_display:(unit -> unit) ->
        ?after_display:(unit -> unit) -> Bogue.Main.board -> unit
      type shortcut_action = Bogue.Main.board -> unit
      val shortcuts_empty : unit -> Bogue.Main.shortcuts
      val shortcuts_add :
        Bogue.Main.shortcuts ->
        ?keymod:Tsdl.Sdl.keymod ->
        int -> Bogue.Main.shortcut_action -> Bogue.Main.shortcuts
      val shortcuts_add_ctrl :
        Bogue.Main.shortcuts ->
        int -> Bogue.Main.shortcut_action -> Bogue.Main.shortcuts
      val shortcuts_add_ctrl_shift :
        Bogue.Main.shortcuts ->
        int -> Bogue.Main.shortcut_action -> Bogue.Main.shortcuts
      val shortcuts_of_list :
        (int * int * Bogue.Main.shortcut_action) list -> Bogue.Main.shortcuts
      val make_sdl_windows :
        ?windows:Tsdl.Sdl.window list -> Bogue.Main.board -> unit
      val refresh_custom_windows : Bogue.Main.board -> unit
      val one_step :
        ?before_display:(unit -> unit) ->
        bool ->
        (unit -> unit) * (unit -> unit) ->
        ?clear:bool -> Bogue.Main.board -> bool
      val get_frame : unit -> int
      val quit : unit -> unit
    end
  module Bogue = Main
end