Proposal: migrate from GimpContainer to GListModel
GIMP has a concept of a GimpContainer
, a class that describes a general collection of typed elements that easy to use from a UI perspective. AFAICT, it is only extended by GimpLst
.
GLib/GIO also has a similar interface called the GListModel
, for which GTK also provides some widgets (like GtkListBox
/ GtkFlowBox
/ ...). In GTK-4, the GListModel approach is even more integrated (with several subclasses to do filtering/sorting for you).
My proposal would be to:
- Make GimpContainer obsolete by implementing everything in GimpList
- Make GimpList implement GListModel (possibly by using a GSequence instead of a GQueue internally)
- See if we can use widgets provided by GTK instead of rolling our own, or let GTK do the heavy work by subclassing them (i.e. let GimpContainerView subclass GtkListBox)
Possible advantages:
- Performance (since we don't need to emit a signal for each addition/removal anymore)
- Use GTK widgets instead of rolling our own
- Less maintenance burden (since we can let GTK/GIO do part of the work)
Edited by Niels De Graef