Gdl

From Inkscape Wiki
Jump to navigation Jump to search

Inkscape used the Gnome Docking Library to support docking dialogs either in the main window or in floating windows.

To create a docked dialog see the "Prototype Dialog" which is a simple example of deriving from the Inkscape::UI::Widget::Panel widget. Dialogs must be registered in dialog-manager.cpp.

Dialogs are never destructed.

Functionality is very confusing!

GDL code: https://git.gnome.org//browse/gdl

Bugs

Gtk Error Messages

To break at warning:

 $ G_DEBUG=fatal_warnings gdb inkscape
  • Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GdlSwitcher
  • Gtk-WARNING **:: Allocating size to GdlDock 0x..... without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
  • Gdk-Message: Window 0x..... is a temporary window without a parent, application will not be able to postion it on screen. (WAYLAND)

Wayland

Wayland cannot position windows relative to each other: https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ This screws drag-n-drop of dialogs.

Widget Tree

To see the tree:

 $ GTK_DEBUG=interactive inkscape

With the "Objects Tab", click on the "Target" icon in the upper left corner and the select a widget in the Inkscape window; then click on the icon next to the "Target" icon to show the tree.

Tree:

gtkmm_GtkPaned: Canvas_and_Dock
gtkmm__GtkScrolledWindow: DockScrolledWindow: Scrollbar only appears if pane is too small for dialog.
GtkViewport: Unnamed: Auto created by scrolled window?
gtkmm__GtkBox: DockBox
gtkmm__GtkPaned: DockBoxPane: Why is this needed. Can't we just add GdlDock with Gtk::PACK_SHRINK?
GdlDock
GdkDockItem
GdlDockItemGrip
gtkmm__GtkFrame: : Why? Adds shadow.
gtkmm__GtkVBox: : Why?
gtkmm__GtkBox: InkscapePanel (vertical)
gtkmm__GtkHBox: PanelTopBar
gtkmm__GtkLabel: : Panel name
gtkmm__GtkHBox: PanelBoxY
gtkmm__GtkVBox: PanelContents
Different depending on panel
gtkmm__GtkVBox: PanelRightBar
filler: DockBoxFiller: An empty box to fill the pane.

When there is more than one panel a GdlDockNotebook->GdlSwitcher is inserted between GdlDock and GdlDockItem. More than one GdlDockNotebook can exist grouping different panels.