debug-gui: migrate to GTK4
Global:
- Stop passing commandline arguments to gtk_init:
https://docs.gtk.org/gtk4/migrating-3to4.html#stop-passing-commandline-arguments-to-gtk_init
window_init function:
- gtk_window_new doesn't require a type anymore
- gtk_window_iconify has been renamed to gtk_window_minimize
- gtk_container_add has been removed in favor of container specific
APIs. Use gtk_window_set_child in this case.
- gtk_widget_show_all has been removed, widgets are now visible by
default:
https://docs.gtk.org/gtk4/migrating-3to4.html#widgets-are-now-visible-by-default
- gtk_widget_set_events to NULL is no longer required, widgets must set
their event handlers explicitly now:
https://blog.gtk.org/2020/04/29/custom-widgets-in-gtk-4-input/
window_delete_event_cb function:
- Use the new close-request event:
https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkwidget-event-signals
map_event_cb function:
- gtk_widget_set_cursor_from_name instead of gdk_window_set_cursor
- Wait until the draw area is resized to use the whole window to start
calculating sizes
window_place_ui_elements function:
- Use gtk_widget_get_width and gtk_widget_get_height instead of
gtk_window_get_size
Drawing:
- Use gtk_drawing_area_set_draw_func instead of the GtkWidget::draw
signal:
https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-drawing-model-changes
Signed-off-by: José Expósito <jose.exposito89@gmail.com>