Add icon.
[guestfs-browser.git] / window.mli
1 (* Guestfs Browser.
2  * Copyright (C) 2010 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 (** The Window module handles all aspects of the main window, menus,
20     dialogs and so on. *)
21
22 type window_state
23
24 val open_main_window : unit -> window_state
25   (** Open the main Gtk window, set up the menus, callbacks and so on. *)
26
27 val failure : window_state -> exn -> unit
28   (** This is the global error handling function.  It is invoked in
29       the main thread for failures in the slave thread (see
30       {!Slave.set_failure_hook}). *)
31
32 val throbber_busy : window_state -> unit -> unit
33 val throbber_idle : window_state -> unit -> unit
34   (** These are callbacks from the slave thread (invoked in the main
35       thread) which are called whenever the throbber should be
36       animated/busy or idle.  *)
37
38 val set_statusbar : window_state -> string -> unit
39   (** This callback from the slave thread (invoked in the main thread)
40       updates the status bar when some slave operation starts or
41       stops. *)
42
43 val progress : window_state -> int64 * int64 -> unit
44   (** This called whenever the progress bar should move. *)
45
46 val run_cli_request : window_state -> Cmdline.cli_request -> unit
47   (** This function performs the {!Cmdline.cli_request} operation.
48       The actual operation happens asynchronously after this function
49       has returned. *)