diff --git a/.gitignore b/.gitignore index ddbe6066a1ef452f14dc3a431f990706c8db38a6..7bb9b259fc6d8927b0ccc15288d70e617fae5b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -198,3 +198,6 @@ hello-*.tar.gz # should remain empty # ####################### /src/plugins/gui/GSourceView2.mli +/src/plugins/gui/GSourceView2.ml +/src/plugins/gui/dgraph.ml +/src/plugins/gui/dgraph.mli diff --git a/Makefile b/Makefile index 24819a4a472d40a77cddbb9bcc5157f9de824643..e39c957906a25a35ee58b43db6c1617fd44fa47b 100644 --- a/Makefile +++ b/Makefile @@ -684,15 +684,31 @@ SOURCEVIEWCOMPAT:= ifeq ($(strip $(GTKSOURCEVIEW)),lablgtk2.sourceview3) SOURCEVIEWCOMPAT:=GSourceView2 -src/plugins/gui/GSourceView2.ml%: src/plugins/gui/GSourceView2.ml%.in +src/plugins/gui/GSourceView2.ml: src/plugins/gui/GSourceView2.ml.in $(CP) $< $@ $(CHMOD_RO) $@ +src/plugins/gui/GSourceView2.mli: src/plugins/gui/GSourceView2.mli.in + $(CP) $< $@ + $(CHMOD_RO) $@ + +endif + +DGRAPHCOMPAT:= +ifeq ($(HAS_GNOMECANVAS),no) +DGRAPHCOMPAT:=dgraph +src/plugins/gui/dgraph.ml: src/plugins/gui/dgraph.ml.in + $(CP) $< $@ + $(CHMOD_RO) $@ +src/plugins/gui/dgraph.mli: src/plugins/gui/dgraph.mli.in + $(CP) $< $@ + $(CHMOD_RO) $@ endif SINGLE_GUI_CMO:= \ $(WTOOLKIT) \ $(SOURCEVIEWCOMPAT) \ + $(DGRAPHCOMPAT) \ gui_parameters \ gtk_helper gtk_form \ source_viewer pretty_source source_manager book_manager \ @@ -745,7 +761,12 @@ PLUGIN_NAME:=Callgraph PLUGIN_DISTRIBUTED:=yes PLUGIN_DIR:=src/plugins/callgraph PLUGIN_CMO:= options journalize subgraph cg services uses register +#GTK3: no DGraph available. +ifeq ($(HAS_GNOMECANVAS),yes) PLUGIN_GUI_CMO:=cg_viewer +else +PLUGIN_GUI_CMO:= +endif PLUGIN_CMI:= callgraph_api PLUGIN_INTERNAL_TEST:=yes PLUGIN_TESTS_DIRS:=callgraph diff --git a/src/plugins/gui/dgraph.ml.in b/src/plugins/gui/dgraph.ml.in new file mode 100644 index 0000000000000000000000000000000000000000..85cffffb27e5e98e3a7337db4c8c73cd8997f79d --- /dev/null +++ b/src/plugins/gui/dgraph.ml.in @@ -0,0 +1,14 @@ +(* dgraph module that always generates an error: Dgraph is not available + with gtk3 +*) + +module DGraphModel = struct + exception DotError of string +end + +module DGraphContainer = struct + module Dot = struct + let from_dot_with_commands ?packing:_ _ = + raise (DGraphModel.DotError "DGraph is unsupported in GTK3") + end +end diff --git a/src/plugins/gui/dgraph.mli.in b/src/plugins/gui/dgraph.mli.in new file mode 100644 index 0000000000000000000000000000000000000000..ce84948c30dacdc003051579ed437e2e77773678 --- /dev/null +++ b/src/plugins/gui/dgraph.mli.in @@ -0,0 +1,14 @@ +(* dgraph module that always generates an error: Dgraph is not available + with gtk3 +*) + +module DGraphModel: sig + exception DotError of string +end + +module DGraphContainer: sig + module Dot: sig + val from_dot_with_commands: ?packing:(GObj.widget ->unit) -> string -> + GPack.table * <adapt_zoom: unit -> unit> + end +end