13c1f2092a3d3eae908260059c12fa38a581d34c
[virt-top.git] / virt-ctrl / vc_connections.mli
1 (* virt-ctrl: A graphical management tool.
2    (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
3    http://libvirt.org/
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19    Handle connections and the complicated GtkTreeView which
20    displays the connections / domains.
21 *)
22
23 (** Get the list of current connections. *)
24 val get_conns : unit -> (int * Libvirt.rw Libvirt.Connect.t) list
25
26 (** The current/previous state last time repopulate was called.  The
27     repopulate function uses this state to determine what has changed
28     (eg. domains added, removed) since last time.
29 *)
30 type state
31
32 type columns = string GTree.column * string GTree.column * string GTree.column * string GTree.column * string GTree.column * int GTree.column
33
34 (** This function should be called once per second in order to
35     redraw the GtkTreeView.
36
37     Takes the previous state as a parameter and returns the new state.
38 *)
39 val repopulate : GTree.view -> GTree.tree_store -> columns -> state -> state
40
41 (** Create the GtkTreeView.  Returns the widget itself, the model,
42     the list of columns, and the initial state.
43 *)
44 val make_treeview : ?packing:(GObj.widget -> unit) -> unit -> GTree.view * GTree.tree_store * columns * state
45
46 (** This callback creates the Connect to hypervisor dialog. *)
47 val open_connection : unit -> unit