From 9ace9c3b57ae654d5a438d0e49070264262650d4 Mon Sep 17 00:00:00 2001
From: Allan Blanchard <allan.blanchard@cea.fr>
Date: Mon, 6 Mar 2023 12:27:44 +0100
Subject: [PATCH] [gui] remove GTK2 support

---
 .gitignore                                    |  6 --
 src/plugins/gui/GSourceView.2.ml              | 37 ---------
 src/plugins/gui/GSourceView.2.mli             | 34 --------
 .../gui/{GSourceView.3.ml => GSourceView.ml}  |  0
 .../{GSourceView.3.mli => GSourceView.mli}    |  0
 src/plugins/gui/debug_manager.ko.ml           | 23 ------
 src/plugins/gui/debug_manager.mli             | 29 -------
 src/plugins/gui/debug_manager.ok.ml           | 79 -------------------
 src/plugins/gui/design.ml                     |  2 +-
 src/plugins/gui/dgraph_helper.mli             | 42 ----------
 src/plugins/gui/dgraph_helper.no.ml           | 40 ----------
 src/plugins/gui/dgraph_helper.yes.ml          | 60 --------------
 src/plugins/gui/dune                          | 43 +---------
 src/plugins/gui/gtk_compat.2.ml               | 74 -----------------
 src/plugins/gui/gtk_compat.3.ml               | 47 -----------
 src/plugins/gui/gtk_compat.mli                | 49 ------------
 src/plugins/gui/menu_manager.ml               |  2 +-
 src/plugins/gui/property_navigator.ml         | 10 ---
 src/plugins/gui/wutil.ml                      | 19 ++++-
 src/plugins/impact/gui/register_gui.ml        | 33 --------
 20 files changed, 20 insertions(+), 609 deletions(-)
 delete mode 100644 src/plugins/gui/GSourceView.2.ml
 delete mode 100644 src/plugins/gui/GSourceView.2.mli
 rename src/plugins/gui/{GSourceView.3.ml => GSourceView.ml} (100%)
 rename src/plugins/gui/{GSourceView.3.mli => GSourceView.mli} (100%)
 delete mode 100644 src/plugins/gui/debug_manager.ko.ml
 delete mode 100644 src/plugins/gui/debug_manager.mli
 delete mode 100644 src/plugins/gui/debug_manager.ok.ml
 delete mode 100644 src/plugins/gui/dgraph_helper.mli
 delete mode 100644 src/plugins/gui/dgraph_helper.no.ml
 delete mode 100644 src/plugins/gui/dgraph_helper.yes.ml
 delete mode 100644 src/plugins/gui/gtk_compat.2.ml
 delete mode 100644 src/plugins/gui/gtk_compat.3.ml
 delete mode 100644 src/plugins/gui/gtk_compat.mli

diff --git a/.gitignore b/.gitignore
index fccad8e706b..2b4f54f21d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -190,12 +190,6 @@ Makefile.plugin.generated
 /src/kernel_internals/parsing/clexer.ml
 /src/kernel_internals/parsing/cparser.ml
 /src/kernel_internals/parsing/cparser.mli
-# /src/plugins/callgraph/cg_viewer.ml
-/src/plugins/gui/debug_manager.ml
-/src/plugins/gui/dgraph_helper.ml
-/src/plugins/gui/GSourceView.ml
-/src/plugins/gui/GSourceView.mli
-/src/plugins/gui/gtk_compat.ml
 /src/plugins/markdown-report/META
 
 # generated tar.gz files
diff --git a/src/plugins/gui/GSourceView.2.ml b/src/plugins/gui/GSourceView.2.ml
deleted file mode 100644
index 6e7db298617..00000000000
--- a/src/plugins/gui/GSourceView.2.ml
+++ /dev/null
@@ -1,37 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(** compatibility layer between gtksourceview 2 and 3. *)
-include GSourceView2
-
-let make_marker_attributes
-    ~(source:source_view)
-    ~(category:string)
-    ~(priority: int)
-    ?(background: Gdk.color option)
-    ?(pixbuf:GdkPixbuf.pixbuf option)
-    ?(icon_name:string option)
-    () =
-  ignore icon_name; (* not in lablgtk2. *)
-  source#set_mark_category_priority ~category priority;
-  source#set_mark_category_pixbuf ~category pixbuf;
-  source#set_mark_category_background ~category background
diff --git a/src/plugins/gui/GSourceView.2.mli b/src/plugins/gui/GSourceView.2.mli
deleted file mode 100644
index a6a222088e5..00000000000
--- a/src/plugins/gui/GSourceView.2.mli
+++ /dev/null
@@ -1,34 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* compatibility between gtksourceview 2 and 3. *)
-include module type of GSourceView2
-
-val make_marker_attributes:
-  source:source_view ->
-  category:string ->
-  priority: int ->
-  ?background: Gdk.color ->
-  ?pixbuf:GdkPixbuf.pixbuf ->
-  ?icon_name:string ->
-  unit ->
-  unit
diff --git a/src/plugins/gui/GSourceView.3.ml b/src/plugins/gui/GSourceView.ml
similarity index 100%
rename from src/plugins/gui/GSourceView.3.ml
rename to src/plugins/gui/GSourceView.ml
diff --git a/src/plugins/gui/GSourceView.3.mli b/src/plugins/gui/GSourceView.mli
similarity index 100%
rename from src/plugins/gui/GSourceView.3.mli
rename to src/plugins/gui/GSourceView.mli
diff --git a/src/plugins/gui/debug_manager.ko.ml b/src/plugins/gui/debug_manager.ko.ml
deleted file mode 100644
index 14207880c62..00000000000
--- a/src/plugins/gui/debug_manager.ko.ml
+++ /dev/null
@@ -1,23 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* empty file *)
diff --git a/src/plugins/gui/debug_manager.mli b/src/plugins/gui/debug_manager.mli
deleted file mode 100644
index 1d0f25a886e..00000000000
--- a/src/plugins/gui/debug_manager.mli
+++ /dev/null
@@ -1,29 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(** Nothing exported. Automatic registration. *)
-
-(*
-Local Variables:
-compile-command: "make -C ../../.."
-End:
-*)
diff --git a/src/plugins/gui/debug_manager.ok.ml b/src/plugins/gui/debug_manager.ok.ml
deleted file mode 100644
index 94453da44d2..00000000000
--- a/src/plugins/gui/debug_manager.ok.ml
+++ /dev/null
@@ -1,79 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(* Require Dgraph included in OCamlgraph/Ocamlgraph_gtk, thus GnomeCanvas *)
-
-open DGRAPH_MODULE
-
-let graph_view ~packing mk_dot =
-  let f =
-    try Extlib.temp_file_cleanup_at_exit "framac_graph_view" "dot"
-    with Extlib.Temp_file_error s ->
-      Gui_parameters.abort "cannot create temporary file: %s" s
-  in
-  mk_dot f;
-  snd
-    (DGraphContainer.Dot.from_dot_with_commands
-       ~status:DGraphContainer.Global
-       ~packing
-       f)
-
-let state_dependency_graph ~packing () =
-  graph_view ~packing State_dependency_graph.dump
-
-(* [JS 2011/07/05] to be reimplemented *)
-let status_dependency_graph ~packing:_ () = assert false
-(*  let g = Properties_status.Consolidation_tree.get_full_graph () in
-    graph_view ~packing (Properties_status.Consolidation_tree.dump g)*)
-
-let graph_window main_window title mk_view =
-  let height = int_of_float (float main_window#default_height *. 3. /. 4.) in
-  let width = int_of_float (float main_window#default_width *. 3. /. 4.) in
-  let window =
-    GWindow.window ~width ~height ~title ~resizable:true ~position:`CENTER ()
-  in
-  let view = mk_view ~packing:window#add () in
-  window#show ();
-  view#adapt_zoom ()
-
-open Menu_manager
-
-let () =
-  Design.register_extension
-    (fun window ->
-       let mk_graph = graph_window window#main_window in
-       ignore
-         ((window#menu_manager ())#add_debug
-            ~show:(fun () -> Gui_parameters.debug_atleast 1)
-            [ (let s = "State Dependency Graph" in
-               menubar s
-                 (Unit_callback (fun () -> mk_graph s state_dependency_graph)));
-              (let s = "Status Graph" in
-               menubar s
-                 (Unit_callback (fun () -> mk_graph s status_dependency_graph)))
-            ]))
-
-(*
-Local Variables:
-compile-command: "make -C ../../.."
-End:
-*)
diff --git a/src/plugins/gui/design.ml b/src/plugins/gui/design.ml
index fe652f9a031..d9e13758325 100644
--- a/src/plugins/gui/design.ml
+++ b/src/plugins/gui/design.ml
@@ -854,7 +854,7 @@ class main_window () : main_window_extension_points =
       width, if final_h then height else new_height
   in
   let main_window =
-    Gtk_compat.window
+    GWindow.window
       ?icon:framac_icon
       ~title:"Frama-C"
       ~position:`CENTER
diff --git a/src/plugins/gui/dgraph_helper.mli b/src/plugins/gui/dgraph_helper.mli
deleted file mode 100644
index e75b9f20414..00000000000
--- a/src/plugins/gui/dgraph_helper.mli
+++ /dev/null
@@ -1,42 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-(** Creation of windows for displaying graphs. Only available
-    for lablgtk2. In lablgtk3 mode, the window will only display a
-    text saying that the feature is not available.
-*)
-
-(** Create a new window displaying a graph.
-    @see <https://frama-c.com/download/frama-c-plugin-development-guide.pdf> Plug-in Development Guide *)
-val graph_window:
-  parent: GWindow.window ->
-  title:string ->
-  (packing:(GObj.widget -> unit) -> unit ->
-   <adapt_zoom: unit -> unit; ..>) ->
-  unit
-
-(** Create a new window displaying a graph, by printing dot commands. *)
-val graph_window_through_dot:
-  parent: GWindow.window ->
-  title:string ->
-  (Format.formatter -> unit) ->
-  unit
diff --git a/src/plugins/gui/dgraph_helper.no.ml b/src/plugins/gui/dgraph_helper.no.ml
deleted file mode 100644
index 14eba81d271..00000000000
--- a/src/plugins/gui/dgraph_helper.no.ml
+++ /dev/null
@@ -1,40 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-let window_msg_unavailable () =
-  let buttons = GWindow.Buttons.ok in
-  let message_type = `WARNING in
-  let message =
-    "Frama-C has not been compiled against a library with \
-     working graph visualization. Property dependencies graph can't be shown."
-  in
-  let dialog =
-    GWindow.message_dialog ~buttons ~show:true ~message_type ~message ()
-  in
-  let callback _ = dialog#destroy () in
-  ignore (dialog#connect#response ~callback)
-
-let graph_window ~parent:_ ~title:_ _ =
-  window_msg_unavailable ()
-
-let graph_window_through_dot ~parent:_ ~title:_ _ =
-  window_msg_unavailable ()
diff --git a/src/plugins/gui/dgraph_helper.yes.ml b/src/plugins/gui/dgraph_helper.yes.ml
deleted file mode 100644
index 7c506cd2a01..00000000000
--- a/src/plugins/gui/dgraph_helper.yes.ml
+++ /dev/null
@@ -1,60 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-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
-  let graph_window =
-    GWindow.window
-      ~width ~height ~title ~resizable:true ~position:`CENTER ()
-  in
-  let view = make_view ~packing:graph_window#add () in
-  graph_window#show();
-  view#adapt_zoom();
-  ()
-;;
-
-let graph_window_through_dot ~parent ~title dot_formatter =
-  let make_view ~packing () =
-    let temp_file =
-      try
-        Extlib.temp_file_cleanup_at_exit
-          "framac_property_status_navigator_graph" "dot"
-      with Extlib.Temp_file_error s ->
-        Gui_parameters.abort "cannot create temporary file: %s" s in
-    let fmt = Format.formatter_of_out_channel (open_out temp_file) in
-    dot_formatter fmt;
-    Format.pp_print_flush fmt ();
-    let view =
-      snd
-        (DGraphContainer.Dot.from_dot_with_commands ~packing temp_file)
-    in
-    view
-  in
-  try
-    graph_window ~parent ~title make_view
-  with DGRAPH_ERROR _ as exn ->
-    Gui_parameters.error
-      "@[cannot display dot graph:@ %s@]"
-      (Printexc.to_string exn)
diff --git a/src/plugins/gui/dune b/src/plugins/gui/dune
index aaeb10faf88..eb4fd75ad71 100644
--- a/src/plugins/gui/dune
+++ b/src/plugins/gui/dune
@@ -25,9 +25,6 @@
  (deps (universe))
  (action (progn
           (echo "GUI:" %{lib-available:frama-c.gui} "\n")
-          (echo "  - lablgtk2:" %{lib-available:lablgtk2} "\n")
-          (echo "  - lablgtk2.gnomecanvas:" %{lib-available:lablgtk2.gnomecanvas} "\n")
-          (echo "  - lablgtk2.sourceview2:" %{lib-available:lablgtk2.sourceview2} "\n")
           (echo "  - lablgtk3:" %{lib-available:lablgtk3} "\n")
           (echo "  - lablgtk3-sourceview3:" %{lib-available:lablgtk3-sourceview3} "\n")
           ; From a GUI hook registered by RteGen.
@@ -42,44 +39,6 @@
   (name frama_c_gui)
   (public_name frama-c.gui)
   (optional)
-  (modules
-        wutil wutil_once widget wbox wfile wpane wpalette wtext wtable
-        gui_parameters
-        gtk_helper gtk_form
-        source_viewer pretty_source source_manager book_manager
-        warning_manager
-        filetree
-        launcher
-        menu_manager
-        history
-        gui_printers
-        design
-        analyses_manager file_manager project_manager
-        help_manager
-        property_navigator GSourceView gtk_compat
-        dgraph_helper
-)
   (flags -open Frama_c_kernel -linkall :standard -w -9)
-  (libraries frama-c.init.gui frama-c.kernel
-   (select gtk_compat.ml from
-      (lablgtk3 lablgtk3-sourceview3 -> gtk_compat.3.ml)
-      (lablgtk2 lablgtk2.gnomecanvas lablgtk2.sourceview2 -> gtk_compat.2.ml)
-   )
-   (select GSourceView.ml from
-      (lablgtk3 lablgtk3-sourceview3 -> GSourceView.3.ml)
-      (lablgtk2 lablgtk2.gnomecanvas lablgtk2.sourceview2 -> GSourceView.2.ml)
-   )
-   (select GSourceView.mli from
-      (lablgtk3 lablgtk3-sourceview3 -> GSourceView.3.mli)
-      (lablgtk2 lablgtk2.gnomecanvas lablgtk2.sourceview2 -> GSourceView.2.mli)
-   )
-   (select dgraph_helper.ml from
-      (!lablgtk3-sourceview3 ocamlgraph.dgraph -> dgraph_helper.yes.ml)
-      ( -> dgraph_helper.no.ml)
-   )
-   (select debug_manager.ml from
-      (!lablgtk3-sourceview3 ocamlgraph.dgraph -> debug_manager.ok.ml)
-      ( -> debug_manager.ko.ml)
-   )
-)
+  (libraries frama-c.init.gui frama-c.kernel lablgtk3 lablgtk3-sourceview3)
 )
diff --git a/src/plugins/gui/gtk_compat.2.ml b/src/plugins/gui/gtk_compat.2.ml
deleted file mode 100644
index 68b113a4127..00000000000
--- a/src/plugins/gui/gtk_compat.2.ml
+++ /dev/null
@@ -1,74 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-module Pango = struct
-  open Wutil_once
-
-  let small_font =
-    once (fun f ->
-        let f = Pango.Font.copy f in
-        let s = Pango.Font.get_size f in
-        Pango.Font.set_size f (s-2) ; f)
-
-  let bold_font =
-    once (fun f ->
-        let f = Pango.Font.copy f in
-        Pango.Font.set_weight f `BOLD ; f)
-
-  let modify_font phi widget =
-    widget#misc#modify_font (phi widget#misc#pango_context#font_description)
-
-  let set_small_font w = modify_font small_font w
-  let set_bold_font w = modify_font bold_font w
-end
-
-let get_toolbar_index (toolbar:GButton.toolbar) (item:GButton.tool_item) =
-  toolbar#get_item_index item
-
-let window
-    ?(kind:Gtk.Tags.window_type option)
-    ?(title:string option)
-    ?(decorated:bool option)
-    ?(deletable:bool option)
-    ?(focus_on_map:bool option)
-    ?(icon:GdkPixbuf.pixbuf option)
-    ?(icon_name:string option)
-    ?(modal:bool option)
-    ?(position:Gtk.Tags.window_position option)
-    ?(resizable:bool option)
-    ?(screen:Gdk.screen option)
-    ?(type_hint:Gdk.Tags.window_type_hint option)
-    ?(urgency_hint:bool option)
-    ?(wmclass:(string * string) option)
-    ?(border_width:int option)
-    ?(width:int option)
-    ?(height:int option)
-    ?(show:bool option)
-    ()
-  =
-  let allow_shrink = resizable in
-  let allow_grow = resizable in
-  ignore wmclass;
-  GWindow.window
-    ?kind ?title ?decorated ?deletable ?focus_on_map ?icon ?icon_name
-    ?modal ?position ?resizable ?allow_grow ?allow_shrink ?screen
-    ?type_hint ?urgency_hint ?border_width ?width ?height ?show ()
diff --git a/src/plugins/gui/gtk_compat.3.ml b/src/plugins/gui/gtk_compat.3.ml
deleted file mode 100644
index 98bab368665..00000000000
--- a/src/plugins/gui/gtk_compat.3.ml
+++ /dev/null
@@ -1,47 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-module Pango = struct
-  open Wutil_once
-
-  let small_font =
-    once (fun (f: GPango.font_description) ->
-        let f = f#copy in
-        let size = f#size - 2 in
-        f#modify ~size (); f)
-
-  let bold_font =
-    once (fun (f: GPango.font_description) ->
-        let f = f#copy in
-        let weight = `BOLD in
-        f#modify ~weight (); f)
-
-  let modify_font phi (widget: #GObj.widget) =
-    widget#misc#modify_font (phi widget#misc#pango_context#font_description)
-
-  let set_small_font w = modify_font small_font w
-  let set_bold_font w = modify_font bold_font w
-end
-
-let get_toolbar_index toolbar item = toolbar#get_item_index item#as_tool_item
-
-let window = GWindow.window
diff --git a/src/plugins/gui/gtk_compat.mli b/src/plugins/gui/gtk_compat.mli
deleted file mode 100644
index 8eaaf3d5fb5..00000000000
--- a/src/plugins/gui/gtk_compat.mli
+++ /dev/null
@@ -1,49 +0,0 @@
-(**************************************************************************)
-(*                                                                        *)
-(*  This file is part of Frama-C.                                         *)
-(*                                                                        *)
-(*  Copyright (C) 2007-2023                                               *)
-(*    CEA (Commissariat à l'énergie atomique et aux énergies              *)
-(*         alternatives)                                                  *)
-(*                                                                        *)
-(*  you can redistribute it and/or modify it under the terms of the GNU   *)
-(*  Lesser General Public License as published by the Free Software       *)
-(*  Foundation, version 2.1.                                              *)
-(*                                                                        *)
-(*  It is distributed in the hope that it will be useful,                 *)
-(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
-(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
-(*  GNU Lesser General Public License for more details.                   *)
-(*                                                                        *)
-(*  See the GNU Lesser General Public License version 2.1                 *)
-(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
-(*                                                                        *)
-(**************************************************************************)
-
-module Pango : sig
-  val set_small_font : #GObj.widget -> unit
-  (** makes the font smaller. *)
-
-  val set_bold_font : #GObj.widget -> unit
-  (** makes the font bold. *)
-end
-
-val get_toolbar_index: GButton.toolbar -> GButton.tool_item -> int
-
-val window:
-  ?kind:Gtk.Tags.window_type ->
-  ?title:string ->
-  ?decorated:bool ->
-  ?deletable:bool ->
-  ?focus_on_map:bool ->
-  ?icon:GdkPixbuf.pixbuf ->
-  ?icon_name:string ->
-  ?modal:bool ->
-  ?position:Gtk.Tags.window_position ->
-  ?resizable:bool ->
-  ?screen:Gdk.screen ->
-  ?type_hint:Gdk.Tags.window_type_hint ->
-  ?urgency_hint:bool ->
-  ?wmclass:(string * string) ->
-  ?border_width:int ->
-  ?width:int -> ?height:int -> ?show:bool -> unit -> GWindow.window
diff --git a/src/plugins/gui/menu_manager.ml b/src/plugins/gui/menu_manager.ml
index 86429c98562..26fc68df230 100644
--- a/src/plugins/gui/menu_manager.ml
+++ b/src/plugins/gui/menu_manager.ml
@@ -168,7 +168,7 @@ class menu_manager ?packing (_:Gtk_helper.host) =
             | None, Some sep ->
               max
                 0
-                (Gtk_compat.get_toolbar_index toolbar (sep:>GButton.tool_item))
+                (toolbar#get_item_index (sep:>GButton.tool_item)#as_tool_item)
             | Some p, _ -> p)
       in
       let toolbar_packing w =
diff --git a/src/plugins/gui/property_navigator.ml b/src/plugins/gui/property_navigator.ml
index 4423a1d43b2..3f874465f59 100644
--- a/src/plugins/gui/property_navigator.ml
+++ b/src/plugins/gui/property_navigator.ml
@@ -564,16 +564,6 @@ let make_panel (main_ui:main_window_extension_points) =
       ~headers_visible:true
       ~packing:sc#add ()
   in
-  ignore
-    (view#connect#row_activated
-       ~callback:(fun path _col ->
-           match model#custom_get_iter path with
-           | Some { MODEL.finfo = { ip = ip } } ->
-             let format_graph ppf =
-               Consolidation_graph.dump (Consolidation_graph.get ip) ppf in
-             Dgraph_helper.graph_window_through_dot
-               ~parent:main_ui#main_window ~title:"Dependencies" format_graph
-           | None -> ()));
   view#selection#set_select_function
     (fun path currently_selected ->
        if not currently_selected then
diff --git a/src/plugins/gui/wutil.ml b/src/plugins/gui/wutil.ml
index 995b4af8f4e..e0f404a42ce 100644
--- a/src/plugins/gui/wutil.ml
+++ b/src/plugins/gui/wutil.ml
@@ -32,8 +32,23 @@ let once = Wutil_once.once
 (* ---  Pango Properties                                                  --- *)
 (* -------------------------------------------------------------------------- *)
 
-include Gtk_compat.Pango
-
+let small_font =
+  once (fun (f: GPango.font_description) ->
+      let f = f#copy in
+      let size = f#size - 2 in
+      f#modify ~size (); f)
+
+let bold_font =
+  once (fun (f: GPango.font_description) ->
+      let f = f#copy in
+      let weight = `BOLD in
+      f#modify ~weight (); f)
+
+let modify_font phi (widget: #GObj.widget) =
+  widget#misc#modify_font (phi widget#misc#pango_context#font_description)
+
+let set_small_font w = modify_font small_font w
+let set_bold_font w = modify_font bold_font w
 let set_font w name = w#misc#modify_font_by_name name
 let set_monospace w = set_font w "monospace"
 
diff --git a/src/plugins/impact/gui/register_gui.ml b/src/plugins/impact/gui/register_gui.ml
index 2158d07c4c4..640c23d7428 100644
--- a/src/plugins/impact/gui/register_gui.ml
+++ b/src/plugins/impact/gui/register_gui.ml
@@ -158,17 +158,6 @@ let impact_highlighter buffer loc ~start ~stop =
     in
     apply_on_stmt hilight loc
 
-let reason_graph_window parent ?in_kf reason =
-  try
-    let mk_dot_file = Reason_graph.to_dot_formatter ?in_kf reason in
-    Dgraph_helper.graph_window_through_dot
-      ~parent ~title:"Impact graph" mk_dot_file
-  with
-  | Sys_error _ as exn ->
-    Options.error "issue when generating impact graph: %s"
-      (Printexc.to_string exn)
-
-
 let impact_statement restrict s =
   let kf = Kernel_function.find_englobing_kf s in
   let skip = Compute_impact.skip () in
@@ -216,12 +205,6 @@ let impact_statement_ui (main_ui:Design.main_window_extension_points) s =
     main_ui#rehighlight ()
   )
 
-let impact_graph_of_function (main_ui:Design.main_window_extension_points) kf =
-  let g = ReasonGraph.get () in
-  let open Reason_graph in
-  if not (Reason.Set.is_empty g.reason_graph) then
-    reason_graph_window main_ui#main_window ~in_kf:kf g
-
 let pretty_info = ref true
 
 let pp_impact_on_inputs (main_ui:Design.main_window_extension_points) kf =
@@ -297,14 +280,6 @@ let impact_selector
     if button = 3 || FollowFocus.get () then (
       let callback () = ignore (impact_statement_ui main_ui s) in
       ignore (popup_factory#add_item "_Impact analysis" ~callback);
-      if Options.Reason.get ()then begin
-        let g = ReasonGraph.get () in
-        if not Reason_graph.(Reason.Set.is_empty g.reason_graph) then begin
-          let callback () =
-            reason_graph_window main_ui#main_window ~in_kf:kf g in
-          ignore (popup_factory#add_item "Impact _graph" ~callback);
-        end;
-      end;
       if FollowFocus.get () then
         ignore (Glib.Idle.add (fun () -> callback (); false))
     );
@@ -328,14 +303,6 @@ let impact_selector
       let kf = Globals.Functions.get vi in
       pp_impact_on_inputs main_ui kf;
     end;
-    if button = 3 then begin
-      let g = ReasonGraph.get () in
-      let open Reason_graph in
-      if not (Reason.Set.is_empty g.reason_graph) then
-        let kf = Globals.Functions.get vi in
-        let callback () = impact_graph_of_function main_ui kf in
-        ignore (popup_factory#add_item "_Impact graph" ~callback);
-    end
   | _ -> ()
 
 let impact_panel main_ui =
-- 
GitLab