sig
module Time :
sig
type span = float
val elapsed : unit -> Useri.Time.span
val tick : Useri.Time.span -> Useri.Time.span React.event
val count : until:'a React.event -> Useri.Time.span React.signal
val unit : span:Useri.Time.span -> float React.signal
type counter
val counter : unit -> Useri.Time.counter
val counter_value : Useri.Time.counter -> Useri.Time.span
val pp_s : Format.formatter -> Useri.Time.span -> unit
val pp_ms : Format.formatter -> Useri.Time.span -> unit
val pp_mus : Format.formatter -> Useri.Time.span -> unit
end
module Surface :
sig
type mode = [ `Fullscreen | `Windowed ]
val mode : Useri.Surface.mode React.signal
val set_mode_setter : Useri.Surface.mode React.event -> unit
val mode_flip : 'a React.event -> Useri.Surface.mode React.event
val pp_mode : Format.formatter -> Useri.Surface.mode -> unit
module Gl :
sig
type colors = [ `RGBA_8888 | `RGB_565 ]
type depth = [ `D_16 | `D_24 ]
type stencil = [ `S_8 ]
type t = {
accelerated : bool option;
multisample : int option;
doublebuffer : bool;
stereo : bool;
srgb : bool;
colors : Useri.Surface.Gl.colors;
depth : Useri.Surface.Gl.depth option;
stencil : Useri.Surface.Gl.stencil option;
version : int * int;
}
val default : Useri.Surface.Gl.t
end
type handle = Useri_base.Surface.handle
type kind = [ `Gl of Useri.Surface.Gl.t | `Other ]
type t
val create :
?hidpi:bool ->
?pos:Gg.p2 ->
?size:Gg.size2 ->
?kind:Useri.Surface.kind ->
?handle:Useri.Surface.handle ->
?mode:Useri.Surface.mode -> unit -> Useri.Surface.t
val pos : Gg.p2 React.signal
val raster_size : Gg.size2 React.signal
val size : Gg.size2 React.signal
val update : unit -> unit
val handle : unit -> Useri_base.Surface.handle
val refresh : float React.event
val request_refresh : unit -> unit
val set_refresher : 'a React.event -> unit
val steady_refresh : until:'a React.event -> unit
val refresh_hz : int React.signal
val set_refresh_hz : int -> unit
end
module Mouse :
sig
val pos : Gg.p2 React.signal
val dpos : Gg.v2 React.event
val left : bool React.signal
val left_down : Gg.p2 React.event
val left_up : Gg.p2 React.event
val middle : bool React.signal
val middle_down : Gg.p2 React.event
val middle_up : Gg.p2 React.event
val right : bool React.signal
val right_up : Gg.p2 React.event
val right_down : Gg.p2 React.event
end
module Touch :
sig
type t
val id : Useri.Touch.t -> int
val did : Useri.Touch.t -> int
val pos : Useri.Touch.t -> Gg.p2 React.signal
val dpos : Useri.Touch.t -> Gg.v2 React.event
val pressure : Useri.Touch.t -> float React.signal
val over : Useri.Touch.t -> [ `Cancel | `Up ] React.event
val start : Useri.Touch.t list React.event
end
module Key :
sig
type id =
[ `Alt of [ `Left | `Right ]
| `Arrow of [ `Down | `Left | `Right | `Up ]
| `Backspace
| `Ctrl of [ `Left | `Right ]
| `Digit of int
| `End
| `Enter
| `Escape
| `Function of int
| `Home
| `Meta of [ `Left | `Right ]
| `Page of [ `Down | `Up ]
| `Return
| `Shift of [ `Left | `Right ]
| `Space
| `Tab
| `Uchar of int
| `Unknown of int ]
val uchar : char -> [> `Uchar of int ]
val pp_id : Format.formatter -> Useri.Key.id -> unit
val any_down : Useri.Key.id React.event
val any_up : Useri.Key.id React.event
val any_holds : bool React.signal
val down : Useri.Key.id -> unit React.event
val up : Useri.Key.id -> unit React.event
val holds : Useri.Key.id -> bool React.signal
val alt : bool React.signal
val ctrl : bool React.signal
val meta : bool React.signal
val shift : bool React.signal
end
module Text :
sig
val set_input_enabled : bool React.signal -> unit
val input : string React.event
val editing : (string * int * int) React.event
val clipboard : string React.signal
val set_clipboard_setter : string React.event -> unit
end
module Drop :
sig
type file = Useri_base.Drop.file
module File :
sig
type t = Useri.Drop.file
val path : Useri.Drop.file -> string
val prepare :
Useri.Drop.file ->
(Useri.Drop.file ->
(unit, [ `Msg of string ]) Result.result -> unit) ->
unit
end
val file : Useri.Drop.file React.event
end
module Human :
sig
val noticed : Useri.Time.span
val interrupted : Useri.Time.span
val left : Useri.Time.span
val feel : unit -> [ `Interacting | `Interrupted | `Left ] React.signal
val touch_target_size : float
val touch_target_size_min : float
val touch_target_pad : float
val average_finger_width : float
end
module App :
sig
val env : string -> default:'a -> (string -> 'a) -> 'a
val prefs_path :
org:string ->
app:string -> (string, [ `Msg of string ]) Result.result
val quit : unit React.event
val init :
?name:string ->
?surface:Useri.Surface.t ->
unit -> (unit, [ `Msg of string ]) Result.result
val run_step : unit -> Useri.Time.span
val run : ?until:'a React.event -> unit -> unit
val release : ?sinks:bool -> unit -> unit
val start : unit React.event
val stop : unit React.event
val sink_event : 'a React.event -> unit
val sink_signal : 'a React.signal -> unit
val release_sinks : unit -> unit
type launch_context = [ `Browser | `Gui | `Terminal ]
val launch_context : Useri.App.launch_context
val pp_launch_context :
Format.formatter -> Useri.App.launch_context -> unit
val platform : string
type backend = [ `Jsoo | `Other of string | `Tsdl ]
val backend : Useri.App.backend
val pp_backend : Format.formatter -> Useri.App.backend -> unit
val set_backend_logger :
([ `Error | `Warning ] -> string -> unit) -> unit
type backend_scheme = [ `Async | `Sync ]
val backend_scheme : [ `Async | `Sync ]
val pp_backend_scheme :
Format.formatter -> Useri.App.backend_scheme -> unit
type cpu_count = [ `Known of int | `Unknown ]
val cpu_count : Useri.App.cpu_count
val pp_cpu_count : Format.formatter -> Useri.App.cpu_count -> unit
end
end