
On Wed, Sep 07, 2005 at 08:13:24PM +0200, Ralf Stephan wrote:
View ViewWidget +Desktop uses +DesktopWidget +SVGView +SVGViewWidget
(interface) == (abstract base class)
This feels weird to me. Ideally (I think) Desktop/SVGView should not need to know anything about the widgets attached to them -- they are basically "model" classes.
So the knowledge would be more one-way, where the widgets know about the model class, but not vice-versa.
I wondered about the existing circularity. Some of the needed callbacks would be only used by singular classes, and where the reference to the widget itself is returned, it is used by Gtk-specific classes. In these cases, Desktop is best not involved at all.
Bryce asked:
Do you think we would really need both C and C++ implementations?
Maybe not, although it would make switching easy. But replace C with Mac or native Windows or ... So the abstraction is needed anyway. Nearly 10 years ago, I created and maintained the yarec package that had ncurses and Gtk UIs in one binary, so the idea is not new. However, I don't propose full Gtk and Gtkmm inkscape in one binary!
Ah, that makes sense. I didn't think about alternate widget set implementations. It's entirely possible that one day someone would come along with a cool, complete wxWidgets-based interface that we would like to hook onto, and this level of abstraction would permit that.
Btw, there is a presentation in the docs directory of the codebase I did that explains some of my ideas for the rearchitecting of the View/Desktop code. You might find it worthwhile to take a look at it.
Bryce