Commit 1d2c7495 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[gui] accomodate for the change in module name between OCamlgraph 1.8 and 2.0

parent 3dc87d94
......@@ -722,12 +722,24 @@ GENERATED+=src/plugins/gui/gtk_compat.ml
ifeq ($(HAS_DGRAPH),yes)
DGRAPHFILES:=debug_manager
src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.yes.ml
$(CP) $< $@
GENERATED+=src/plugins/gui/debug_manager.ml
ifeq ($(HAS_OCAMLGRAPH_2), yes)
DGRAPH_MODULE=Graph_gtk
DGRAPH_ERROR=Graph_gtk.DGraphMake.DotError
else
DGRAPH_MODULE=Dgraph
DGRAPH_ERROR=Dgraph.DGraphModel.DotError
endif
src/plugins/gui/debug_manager.ml \
src/plugins/gui/dgraph_helper.ml \
src/plugins/callgraph/cg_viewer.ml: %.ml: %.yes.ml Makefile
$(RM) $@
$(SED) -e 's/DGRAPH_MODULE/$(DGRAPH_MODULE)/g' \
-e 's/DGRAPH_ERROR/$(DGRAPH_ERROR)/g' $< > $@
$(CHMOD_RO) $@
else
DGRAPHFILES:=
src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.no.ml
src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.no.ml Makefile
$(CP) $< $@
$(CHMOD_RO) $@
endif
......@@ -794,6 +806,7 @@ PLUGIN_DIR:=src/plugins/callgraph
PLUGIN_CMO:= options journalize subgraph cg services uses register
ifeq ($(HAS_DGRAPH),yes)
PLUGIN_GUI_CMO:=cg_viewer
PLUGIN_GENERATED:=$(PLUGIN_DIR)/cg_viewer.ml
else
PLUGIN_GUI_CMO:=
PLUGIN_DISTRIB_EXTERNAL:=cg_viewer.ml
......
......@@ -20,7 +20,7 @@
(* *)
(**************************************************************************)
open Dgraph
open DGRAPH_MODULE
let ($) f x = f x
......
......@@ -20,9 +20,9 @@
(* *)
(**************************************************************************)
(* Require Dgraph included in Ocamlgraph, thus GnomeCanvas *)
(* Require Dgraph included in OCamlgraph/Ocamlgraph_gtk, thus GnomeCanvas *)
open Dgraph
open DGRAPH_MODULE
let graph_view ~packing mk_dot =
let f =
......
......@@ -20,6 +20,8 @@
(* *)
(**************************************************************************)
open DGRAPH_MODULE
let graph_window ~parent ~title make_view =
let height = int_of_float (float parent#default_height *. 3. /. 4.) in
let width = int_of_float (float parent#default_width *. 3. /. 4.) in
......@@ -46,13 +48,13 @@ let graph_window_through_dot ~parent ~title dot_formatter =
Format.pp_print_flush fmt ();
let view =
snd
(Dgraph.DGraphContainer.Dot.from_dot_with_commands ~packing temp_file)
(DGraphContainer.Dot.from_dot_with_commands ~packing temp_file)
in
view
in
try
graph_window ~parent ~title make_view
with Dgraph.DGraphModel.DotError _ as exn ->
with DGRAPH_ERROR _ as exn ->
Gui_parameters.error
"@[cannot display dot graph:@ %s@]"
(Printexc.to_string exn)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment