Version 0.0.1
[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 display_state = {
23   window : GWindow.window;
24   throbber_busy : unit -> unit;
25   throbber_idle : unit -> unit;
26   set_statusbar : string -> unit;
27   clear_statusbar : unit -> unit;
28   set_vmlist : string list -> unit;
29   clear_vmlist : unit -> unit;
30   clear_notebook : unit -> unit;
31   filesystem : GPack.box;
32   notebook : GPack.notebook;
33 }
34     (** This structure describes various variables and functions
35         for the main window.  It is returned from {!open_main_window}
36         and passed around to various other functions. *)
37
38 val open_main_window : unit -> display_state
39   (** Open the main Gtk window, set up the menus, callbacks and so on. *)
40
41 val failure : display_state -> exn -> unit
42   (** This is the global error handling function.  It is invoked in
43       the main thread for failures in the slave thread (see
44       {!Slave.set_failure_hook}). *)
45
46 val run_cli_request : display_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. *)