Panel

From Inkscape Wiki
Jump to: navigation, search

Almost all of Inkscape's dialogs are derived from Inkscape::UI::Widget::Panel. This class is poorly documented and each derived class seems to handle desktop/document tracking in different (and sometimes inconsistent) ways. This is an attempt to rectify that.

I've created a "Prototype" dialog to serve as a model of how derived classes should be constructed. Please comment on the class and correct any errors.

Particular issues:

  • What parts of Panel are optional?
  • Most of the code in Panel.h/.cpp deals with swatches, something almost all of the derived panels don't use.
    • Should this be moved into a separate derived class (it would make understanding Panel.h much easier).
    • Which parts of Panel are solely for swatches?
  • What is the purpose of "targetDesktop" (found in derived classes)? Desktop switching seems to work fine without it.
  • Why do most derived classes keep track of desktop themselves?
  • What does desktopTracker::setBase() do? Why would a derived class call it?
  • What do the signals do?
    • sigc::signal<void, SPDesktop *> _signal_document_replaced seems to only be used by a couple of dialogs (document-preference and undo-history) and it is called four times for each change of desktop . Most setup their own signal to handle this.
  • What does _boundCall() do?