Skip to content

Draft: The "break everything" collective MR (aka GTK4 migration)

Adrian Knagg-Baugh requested to merge break-everything into master

Starting point for the great big unholy mess that will be the GTK4 migration. I've changed the dependencies to GTK4 and done a rough automated migration of the UI files. Nothing builds, even if it did build the UI files probably look a bit wrong and maybe miss elements, and we have all the code changes to do like replacing the GtkFileChooserButtons, reworking the event interface and taking advantage of some improvements in GTK4 like GtkDropdown and updates to the GtkTreeView and GtkListView paradigms... the list goes on and on...

Anyway I figured it's probably too big a piece of work for anyone to do on their own, but if we have a big shared MR then we can collectively come up with a todo list and try to work through it together.

TODO List

  • Replace GtkFileChooserButton with a new class SirilFileChooserButton based on GtkFileDialog
  • Adapt to GdkRGBA struct members changing from gdouble to float. This will have quite a lot of impact on colors.c etc.
  • Adapt to changes to GtkEntry (gtk_entry_get_text(entry) has to be replaced with gtk_entry_buffer_get_text(GTK_ENTRY_BUFFER(gtk_entry_get_buffer(entry))), maybe other changes)
  • Change gtk_widget_get_allocated_height to gtk_widget_get_height (same for width)
  • gtk_widget_show(widget) -> gtk_widget_set_visible(widget, TRUE) (similar for gtk_widget_hide())
  • Transition GtkComboBox to GtkDropdown. GtkComboBoxText is no longer available as a special case so these need changing to GtkDropdown too.
  • gtk_main_quit() -> g_application_quit(app) - so we need to add a member to com to hold the GApplication pointer created in main.c
  • Transition GtkColorChooser to GtkColorDialog / GtkColorDialogButton
  • Rework code using GtkContainer as this has been removed entirely, any widgets can have child widgets now
  • GtkImage changes (eg gtk_image_new_from_x now takes different arguments)
  • Adapt to GdkEvent handling changes (eg no more GdkEventButton etc.)
  • Adapt to removal of GtkToggleToolButton (I think it now has to become a GtkToolItem with a GtkToggleButton child).
  • gtk_window_set_keep_above() seems to have gone
  • Changes to GtkWindow enums (migtate to GTK_TOPLEVEL_XX)
  • this is just the list so far, feel free to add to it otherwise I'll carry on later
Edited by Adrian Knagg-Baugh

Merge request reports