Well, to quote out of order:
"... for all built-in objects the core shouldn't have to tell the
GUI how to draw it."
Well, I think that is a fundamental point on which you and I disagree.
I tried once with Max/FTS (19890-1994 or so) to do precisely that and
the problems of keeping the graphical layer and the real-time layer in
sync ended up overwhelming. In particular, the graphcal layer had to
wait while the real-time layer verified whether object creation
succeeded or not which made the loading of a patch from file impossibly
slow, unless the GUI layer had its own instance of Pd running right
inside it in parallel with the real one. And that - keeping parallel
copies of the same complex data structure in sync as it was changed from
both sides - was also too much to manage.
I did float (a couple of years ago?) the idea of simply having one
process with a GUI thread. Iohannes quickly warned me that that would
invalidate a Pd variant he was working on - I forget what exactly. So I
dropped that idea.
The winning feature of my proposal is that it can be done without
disturbing the existing Pd at all. I could even add a gtk subdir to the
Pd source tree and simultaneously maintain both GTL and TK versions for
years while the kinks get worked out of the GTK one.
"... Why did you pick GTK specifically? What is the 2D canvas
implementation like?"
My solution doesn't use the GTK canvas - it uses Cairo directly. OTOH it
does redraw the entire drawing area offscreen - there's no
region-invalidation as there was with the original Max (1988). This
could be an efficiency problem, but it wouldn't be hard to put
region-invalidation back in if indeed it turns out to be an issue.
OTOH I don't know whether Cairo will prove to be efficient enough for
our purposes.
And... as to GTK4 versus QT, I can't see much reason to prefer one over
the other, although I got a bad impression of QT after seeing what
happened to LXDE when they migrated it to LXQT. The result was just...
ugly. I also much refer GTK4's licensing --- it's hard open source as
opposed to QT's attempting to take both sides on the issue. In my
experience the hard-open-source projects such as linux or indeed pd
itself tend to outlast the sort-of-open-source ones.
Anyway, I'm not sold on this way of doing things - I only put a week
into it so far and have to tend to other stuff for this coming week, so
there's time to think about all this.
cheers
Miller
---
[email protected] - the Pd developers' mailinglist
https://lists.iem.at/hyperkitty/list/[email protected]/message/RLRCVHGFFIX4TBJVVBKT2TUONX7KLYLL/