Initial import from CVS.
[virt-top.git] / mlvirtmanager / mlvirtmanager_helpers.mli
1 (* virt-manager-like graphical management tool.
2    (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
3    http://libvirt.org/
4    $Id: mlvirtmanager_helpers.mli,v 1.1 2007/08/06 10:16:53 rjones Exp $
5
6    Helper functions.
7 *)
8
9 (** Given two lists, xs and ys, return a list of items which have been
10     added to ys, items which are the same, and items which have been
11     removed from ys.
12     Returns a triplet (list of added, list of same, list of removed).
13 *)
14 val differences : 'a list -> 'a list -> 'a list * 'a list * 'a list
15
16 (** Convert libvirt domain state to a string. *)
17 val string_of_domain_state : Libvirt.Domain.state -> string
18
19 (** Filter top level rows (only) in a GtkTreeStore.  If function f returns
20     true then the row remains, but if it returns false then the row is
21     removed.
22 *)
23 val filter_top_level_rows : GTree.tree_store -> (Gtk.tree_iter -> bool) -> unit
24
25 (** Filter rows in a tree_store at a particular level. *)
26 val filter_rows : GTree.tree_store -> (Gtk.tree_iter -> bool) -> Gtk.tree_iter -> unit
27
28 (** Find the first top level row matching predicate and return it. *)
29 val find_top_level_row : GTree.tree_store -> (Gtk.tree_iter -> bool) -> Gtk.tree_iter
30
31 (** Find the first row matching predicate f at a particular level. *)
32 val find_row : GTree.tree_store -> (Gtk.tree_iter -> bool) -> Gtk.tree_iter -> Gtk.tree_iter
33
34 (** Iterate over top level rows (only) in a GtkTreeStore. *)
35 val iter_top_level_rows : GTree.tree_store -> (Gtk.tree_iter -> unit) -> unit
36
37 (** Iterate over rows in a tree_store at a particular level. *)
38 val iter_rows : GTree.tree_store -> (Gtk.tree_iter -> unit) -> Gtk.tree_iter -> unit