]> matita.cs.unibo.it Git - helm.git/blob - matita/lablGraphviz.mli
ca5c7a02b5768856d6401d30cd701bac7dd24962
[helm.git] / matita / lablGraphviz.mli
1 (* Copyright (C) 2006, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 (* $Id$ *)
27
28 (** {1 LablGtk "widget" for rendering Graphviz graphs and connecting to clicks
29  * on nodes, edges, ...} *)
30
31 class type graphviz_widget =
32   object
33
34     (** Load graphviz markup from file and then:
35       * 1) render it to PNG, loading the risulting image in the embedded
36       *    GtkImage widget
37       * 2) render it to a (HTML) map, internalizing its data.
38       * Remember that map entries are generated only for nodes, (edges, ...)
39       * that have an "href" (or "URL", a synonym) attribute *)
40     method load_graph_from_file: string -> unit
41
42     (** Callback invoked when a click on a node listed in the map is received.
43      * @param gdk's button event
44      * @param attrs attributes of the node clicked on, as they appear on the map
45      * (e.g.: [ "shape","rect"; "href","http://foo.bar.com/";
46      *          "title","foo"; "alt","description"; "coords","41,6,113,54" ] *)
47     method connect_href:
48       (GdkEvent.Button.t -> (string * string) list -> unit) -> unit
49
50       (** {3 low level access to embedded widgets}
51        * Containment hierarchy:
52        *  viewport
53        *    \- image *)
54
55     method as_image: GMisc.image
56     method as_viewport: GBin.viewport
57   end
58
59 (** {2 Constructors} *)
60
61 val gDot: ?packing:(GObj.widget -> unit) -> unit -> graphviz_widget
62 val gNeato: ?packing:(GObj.widget -> unit) -> unit -> graphviz_widget
63 val gTwopi: ?packing:(GObj.widget -> unit) -> unit -> graphviz_widget
64 val gCirco: ?packing:(GObj.widget -> unit) -> unit -> graphviz_widget
65 val gFdp: ?packing:(GObj.widget -> unit) -> unit -> graphviz_widget
66