lablgtk2: Use auto-init, don't list gtkThread.cm* twice.
[guestfs-browser.git] / window.mli
index 916bb15..670b94a 100644 (file)
 (** The Window module handles all aspects of the main window, menus,
     dialogs and so on. *)
 
-type display_state = {
-  window : GWindow.window;
-  throbber_busy : unit -> unit;
-  throbber_idle : unit -> unit;
-  set_statusbar : string -> unit;
-  clear_statusbar : unit -> unit;
-  set_vmlist : string list -> unit;
-  clear_vmlist : unit -> unit;
-  clear_notebook : unit -> unit;
-  filesystem : GPack.box;
-  notebook : GPack.notebook;
-}
-    (** This structure describes various variables and functions
-        for the main window.  It is returned from {!open_main_window}
-        and passed around to various other functions. *)
-
-val open_main_window : unit -> display_state
-  (** Open the main Gtk window, set up the menus, callbacks and so on. *)
-
-val failure : display_state -> exn -> unit
-  (** This is the global error handling function.  It is invoked in
-      the main thread for failures in the slave thread (see
-      {!Slave.set_failure_hook}). *)
-
-val run_cli_request : display_state -> Cmdline.cli_request -> unit
-  (** This function performs the {!Cmdline.cli_request} operation.
-      The actual operation happens asynchronously after this function
-      has returned. *)
+class window :
+object ('a)
+  method after : 'a
+  method disconnect : GtkSignal.id -> unit
+
+  (** Signals that can be emitted by window menu items. *)
+  method connect_kvm_signal : callback:(unit -> unit) -> GtkSignal.id
+  method connect_xen_signal : callback:(unit -> unit) -> GtkSignal.id
+  method connect_none_signal : callback:(unit -> unit) -> GtkSignal.id
+  method connect_uri_signal : callback:(unit -> unit) -> GtkSignal.id
+  method open_disk_signal : callback:(unit -> unit) -> GtkSignal.id
+  method reopen_signal : callback:(unit -> unit) -> GtkSignal.id
+  method inspection_signal : callback:(unit -> unit) -> GtkSignal.id
+  method about_signal : callback:(unit -> unit) -> GtkSignal.id
+
+  method failure : exn -> unit
+    (** This is the global error handling function.  It is invoked in
+        the main thread for failures in the slave thread (see
+        {!Slave.set_failure_hook}). *)
+
+  method throbber_busy : unit -> unit
+  method throbber_idle : unit -> unit
+    (** These are callbacks from the slave thread (invoked in the main
+        thread) which are called whenever the throbber should be
+        animated/busy or idle.  *)
+
+  method set_statusbar : string -> unit
+    (** This callback from the slave thread (invoked in the main thread)
+        updates the status bar when some slave operation starts or
+        stops. *)
+
+  method progress : int64 * int64 -> unit
+    (** This called whenever the progress bar should move. *)
+
+  method tree : Filetree.tree
+    (** Return the filetree contained in the window. *)
+
+  method connect_to : string option -> unit -> unit
+    (** Connect to the given libvirt URI. *)
+
+  method open_disk_images : (string * string option) list -> unit
+    (** Open disk image(s) directly.  The second part of each pair
+        is the optional disk format. *)
+
+  method reopen : unit -> unit
+    (** Reopen the libguestfs handle and current guest. *)
+
+  method run_cli_request : Cmdline.cli_request -> unit
+    (** This function performs the {!Cmdline.cli_request} operation.
+        The actual operation happens asynchronously after this function
+        has returned. *)
+
+end