(* Guestfs Browser. * Copyright (C) 2010 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) (** 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. *)