2007-03-26 17:20:49 UTC
I've been busy with work since the release of 0.45, but now I have
finally found some time to spend on Inkscape again... :)
I have uploaded a patch to the tracker which is a first attempt to
implement dockable dialogs/panels using gdl (Gnome development
The patch adds a dockable pane to the desktop on which any GTKmm:ified
dialog can be docked. Here are some screenshots showing what it's all
To compile you'll need gdl >= 0.6.1, the latest version is available
Gdl is a fairly small UI library developed for IDE:s such as
Anjuta. The main thing it provides is a set of components to build
I realize that it would be better to do this without an additional
library, but right now I think gdl is the best option assuming that we
want a dockable interface.
The pros of using gdl, as I see it, are:
* It provides a lot for free. Dockable items (dialogs in this case)
can be attached and detached to docks, iconified to dock bars and
docked to each other as separate floating groups. Furthermore they
can be stacked as notebook tabs, and complete layouts can be
saved/restored from disk (I haven't got that one working, though).
It would require a major amount of work to reproduce the docking
functionality found in gdl.
* It's still actively developed. Inkscape could benefit from the new
functionality added to gdl.
...and the cons:
* It's yet another library, with all the problems that brings. The
availability could be an issue. Distributions that provide Anjuta
or Screem should have gdl in their repos as well. Merging gdl into
Inkscape's tree is probably a bad idea...
* I haven't tried it on win32 or Mac OS X, so I'm not sure about the
compatibility. It used to require some gnome only libraries, but it
doesn't anymore from what I know.
* It's a C library. There is a C++ wrapper called gdlmm, but it
hasn't been worked on since 2005, and I'm not sure how
complete/stable it is.
The only alternative to gdl that I know of is CurlyAnkles. It has the
same issues with availability and compatibility as gdl, but is less
mature (I'm not aware of any project that uses it yet). On the
positive side it provides other widgets that could improve Inkscape's
As for the design I've chosen to keep the current UI::Dialog::Dialog
hierarchy as opposed to extending UI::Widget::Panel, which I guess was
planned to be the root class of everything dockable (?). The main
reasons for this were that I wanted to keep the old dialog behavior as
an option and also that I wanted to avoid rewriting the code of the
The way I did this was to break out much of the functionality of
Dialog::Dialog into the implementations of an interface
Dialog::Behavior. The implementations that extends it are
FloatingBehavior (the current dialog behavior) and DockBehavior. Each
dialog is instantiated with a behavior and the DialogManager handles
them the same way as before, regardless of behavior.
The Dialog::Behavior interface covers most of the functionality of
Gtk::Dialog. FloatingBehavior is just a proxy for a real Gtk::Dialog
(just as before), while DockBehavior tries to emulate the dialog
functionality on a GdlDockItem. This allows all the current dialogs
(under UI::Dialog) to be dockable without rewriting them.
A global preference "options.dialogtype" controls what the kind of
dialogs to create (0 = old/floating, 1 = new/dock).
It's still a work in progress, and I'd be glad to get feedback on the
design, etc. (The class naming could probably be more
accurate/consistent, for instance.)
There's a bunch of known bugs, but I'm not experiencing any major ones
right now. I've probably broken something that used to work with the
floating dialogs, though.
Please note that this patch only works for the GKmm:ified dialogs
under UI::Dialog, so dialogs such as Fill&Stroke and the XML editor
won't be dockable.
If there's an interest in working on this, I could create a branch,
otherwise I'll just drop patches as I proceed. (I intend to continue
to keep it up to date even if there's no plan to merge it -- Inkscape
is pretty much unusable without it for me when using my primary window
I'll be on the IRC channel in a near future if anybody would like to
discuss this further...