package mirage-qubes

  1. Overview
  2. Docs

The Qubes GUI agent

type t
type window_id
type window
type event =
  1. | UNIT of unit
  2. | Keypress of Formats.GUI.msg_keypress_t
  3. | Focus of Formats.GUI.msg_focus_t
  4. | Motion of Formats.GUI.msg_motion_t
  5. | Clipboard_request
  6. | Clipboard_data of string
  7. | Configure of Formats.GUI.msg_configure_t
  8. | Window_crossing of Formats.GUI.msg_crossing_t
  9. | Window_destroy
  10. | Window_close
  11. | Button of Formats.GUI.msg_button_t
val pp_event : Stdlib.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 -> string 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.

OCaml

Innovation. Community. Security.