</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="graphButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment17">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox26">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image908">
+ <property name="visible">True</property>
+ <property name="stock">gtk-zoom-fit</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Graph</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
<child>
<widget class="GtkButton" id="closeButton">
<property name="visible">True</property>
match get_devel_selected () with
| None -> ()
| Some d ->
- let clean = locker
- (fun () -> MatitamakeLib.publish_development_in_bg refresh d)
- in
- ignore(clean ())));
+ let publish = locker (fun () ->
+ MatitamakeLib.publish_development_in_bg refresh d) in
+ ignore(publish ())));
+ connect_button develList#graphButton (fun () ->
+ match get_devel_selected () with
+ | None -> ()
+ | Some d ->
+ (match MatitamakeLib.dot_for_development d with
+ | None -> ()
+ | Some _ ->
+ let browser = MatitaMathView.cicBrowser () in
+ browser#load (`Development
+ (MatitamakeLib.name_for_development d))));
connect_button develList#closeButton
(fun () -> develList#toplevel#misc#hide());
ignore(develList#toplevel#event#connect#delete
*)
method private _showMath = win#mathOrListNotebook#goto_page 0
method private _showList = win#mathOrListNotebook#goto_page 1
+ method private _showGviz = win#mathOrListNotebook#goto_page 3
method private back () =
try
| `About `Coercions -> self#coerchgraph ()
| `Check term -> self#_loadCheck term
| `Cic (term, metasenv) -> self#_loadTermCic term metasenv
+ | `Development d -> self#_showDevelDeps d
| `Dir dir -> self#_loadDir dir
| `Metadata (`Deps ((`Fwd | `Back) as dir, uri)) ->
self#dependencies dir uri ()
| `Back -> MetadataDeps.DepGraph.inverse_deps ~dbd uri in
gviz_graph <- graph; (** XXX check this for memory consuption *)
self#redraw_gviz ~center_on:uri ();
- win#mathOrListNotebook#goto_page 3
+ self#_showGviz
method private coerchgraph () =
load_coerchgraph ();
- win#mathOrListNotebook#goto_page 3
+ self#_showGviz
method private home () =
self#_showMath;
win#browserUri#entry#set_text (MatitaTypes.string_of_entry entry);
current_entry <- entry
+ method private _showDevelDeps d =
+ match MatitamakeLib.development_for_name d with
+ | None -> ()
+ | Some devel ->
+ (match MatitamakeLib.dot_for_development devel with
+ | None -> ()
+ | Some fname ->
+ gviz#load_graph_from_file ~gviz_cmd:"tred | dot" fname;
+ self#_showGviz)
+
method private _loadObj obj =
(* showMath must be done _before_ loading the document, since if the
* widget is not mapped (hidden by the notebook) the document is not
[ `About of abouts (* current proof *)
| `Check of string (* term *)
| `Cic of Cic.term * Cic.metasenv
+ | `Development of string
| `Dir of string (* "directory" in cic uris namespace *)
| `Metadata of [ `Deps of [`Fwd | `Back] * UriManager.uri ]
| `Uri of UriManager.uri (* cic object uri *)
| `About `Coercions -> "about:coercions"
| `Check _ -> "check:"
| `Cic (_, _) -> "term:"
+ | `Development d -> "devel:/" ^ d
| `Dir uri -> uri
| `Metadata meta ->
"metadata:/" ^
[ `About of abouts
| `Check of string
| `Cic of Cic.term * Cic.metasenv
+ | `Development of string
| `Dir of string
| `Metadata of [ `Deps of [`Fwd | `Back] * UriManager.uri ]
| `Uri of UriManager.uri
| `Warning -> HLog.warn
| `Debug -> HLog.debug
| `Message -> HLog.message
-;;
type development =
{ root: string ; name: string }
let makefile_for_development devel =
let develdir = pool () ^ devel.name in
develdir ^ "/makefile"
-;;
+
+let dot_for_development devel =
+ let dot_fname = pool () ^ devel.name ^ "/depend.dot" in
+ if Sys.file_exists dot_fname then Some dot_fname else None
(* given a dir finds a development that is radicated in it or below *)
let development_for_dir dir =
try
Some (List.find (fun d -> is_prefix_of d.root dir) !developments)
with Not_found -> None
-;;
let development_for_name name =
try
let devel_dir = pool () ^ devel.name in
HExtlib.mkdir devel_dir;
HExtlib.output_file ~filename:(devel_dir ^ rootfile) ~text:devel.root
-;;
let list_known_developments () =
List.map (fun r -> r.name,r.root) !developments
let build_development_in_bg ?matita_flags ?(target="all") refresh_cb development =
call_make ?matita_flags development target (mk_maker refresh_cb)
-;;
let clean_development ?matita_flags development =
call_make ?matita_flags development "clean" make
(* gives back the name *)
val name_for_development : development -> string
+(** @return dot file for a given development, if it exists *)
+val dot_for_development : development -> string option
+