Implementations of various Qubes protocols for MirageOS
Library mirage-qubes
Module Qubes . GUI
type t
type window_id
type window
type event =
| UNIT of unit
| Keypress of Formats.GUI.msg_keypress_t
| Focus of Formats.GUI.msg_focus_t
| Motion of Formats.GUI.msg_motion_t
| Clipboard_request
| Clipboard_data of Cstruct.t
| Configure of Formats.GUI.msg_configure_t
| Window_crossing of Formats.GUI.msg_crossing_t
| Window_destroy
| Window_close
| Button of Formats.GUI.msg_button_t
val pp_event : Format.formatter -> event -> unit

pp_event formatter event pretty-prints an event.

val connect : domid:int -> unit -> t Lwt.t

connect domid () connects to the guid in the given domid over Vchan.

val listen : t -> unit -> 'a Lwt.t

listen ti () is an event listener thread. It can be run with Lwt.async and will never return. Events are dispatched to windows created using create_window.

val set_title : window -> string -> unit S.or_eof Lwt.t
val int32_of_window : window -> int32
val create_window : ?parent:window_id -> x:Cstruct.uint32 -> y:Cstruct.uint32 -> title:string -> width:Cstruct.uint32 -> height:Cstruct.uint32 -> t -> window S.or_eof Lwt.t

create_window ?parent ~title ~width ~height t instantiates a new window. The window will have dimensions width * height, and be instantiated at coordinates x*y (relative to the screen's 0,0).

val send : t -> Cstruct.t list -> unit S.or_eof Lwt.t

send t messages synchronously sends messages to the Qubes GUId using t's established vchan

val recv_event : window -> event Lwt.t

recv_event is a blocking Lwt thread that can be called repeatedly to read new events coming in on window

val debug_window : window -> unit -> unit Lwt.t

debug_window is a window "handler" to be called with Lwt.async that pretty-prints the received events.