Module Wlc.Interface

module Interface: sig .. end


Interface records for communicating with wlc. A record of type Wlc.Interface.t should be instantiated with user-defined callbacks, then given to Wlc.init.
type output = {
   created : Wlc.Output.t -> bool; (*
An output was created. Return false if you want to destroy the output.
*)
   destroyed : Wlc.Output.t -> unit; (*
An output was destroyed.
*)
   focus : Wlc.Output.t -> bool -> unit; (*
An output got or lost focus.
*)
   resolution : Wlc.Output.t -> Wlc.Geometry.Size.t -> Wlc.Geometry.Size.t -> unit; (*
An output resolution changed.
*)
}
type view_request = {
   geometry : Wlc.View.t -> Wlc.Geometry.t -> unit; (*
Request to set a given geometry for a view. Apply using Wlc.View.set_geometry to agree.
*)
   state : Wlc.View.t -> Wlc.View.state_bit -> bool -> unit; (*
Request to disable or enable the given state for a view. Apply using Wlc.View.set_state to agree.
*)
}
type view = {
   created : Wlc.View.t -> bool; (*
A view was created. Return false if you want to destroy the view.
*)
   destroyed : Wlc.View.t -> unit; (*
A view was destroyed.
*)
   focus : Wlc.View.t -> bool -> unit; (*
A view got or lost focus.
*)
   move_to_output : Wlc.View.t -> Wlc.Output.t -> Wlc.Output.t -> unit; (*
A view was moved of output.
*)
   request : view_request;
}
type keyboard = {
   key : Wlc.View.t option ->
int -> Wlc.modifiers -> int -> Wlc.Keysym.t -> Wlc.key_state -> bool
;
(*
A key event was triggered, the first argument indicates the focused view.
*)
}
type pointer = {
   button : Wlc.View.t option -> int -> Wlc.modifiers -> int -> Wlc.button_state -> bool; (*
A button event was triggered, the first argument indicates the focused view.
*)
   scroll : Wlc.View.t option ->
int -> Wlc.modifiers -> Wlc.scroll_axis_bit list -> float * float -> bool
;
(*
A scroll event was triggered, the first argument indicates the focused view.
*)
   motion : Wlc.View.t option -> int -> Wlc.Geometry.Origin.t -> bool; (*
A motion event was triggered, the first argument indicates the focused view.
*)
}
type touch = {
   touch : Wlc.View.t option ->
int ->
Wlc.modifiers -> Wlc.touch_type -> int -> Wlc.Geometry.Origin.t -> bool
;
(*
A touch event was tiggered, the first argument indicates the focused view.
*)
}
type compositor = {
   ready : unit -> unit; (*
The compositor is ready to accept clients.
*)
}
type t = {
   output : output;
   view : view;
   keyboard : keyboard;
   pointer : pointer;
   touch : touch;
   compositor : compositor;
}
The toplevel interface record.
val dummy : t
A dummy interface, where each handler does nothing. Useful for picking default callbacks.