app: Make GimpDock a GtkVBox

Make GimpDock be a GtkVBox instead of a GimpDockWindow. This means we
can now put a GimpDock anywhere, including inside an image window.

In order to do this we need to:

 * Separate dock and dock window creation in the dialog factory and
   add a couple of new dock window constructors

 * Change gimp_dialog_factory_dock_new() to not only create a dock,
   but also create a dock window and then combine those two

 * Change the dock constructor to take a GimpUIManager since they
   depend on that during their construction. We get the ui manager
   from the dock window, but we can't create the dock *inside* the
   dock window, we have to add the dock later. So we create the dock
   window first and then pass its ui manager to the dock constructors

 * Make some other minor adaptions, mostly with
   gimp_dock_window_from_dock() and gimp_dock_window_get_dock()
This commit is contained in:
Martin Nordholts
2009-09-26 16:21:10 +02:00
parent 5447938d5c
commit 4f7693acf0
13 changed files with 134 additions and 54 deletions

View File

@ -245,12 +245,14 @@ dialogs_init (Gimp *gimp,
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
/* Toplevel */
global_dialog_factory = gimp_dialog_factory_new ("toplevel",
gimp_get_user_context (gimp),
menu_factory,
NULL,
TRUE);
/* Toolbox */
global_toolbox_factory = gimp_dialog_factory_new ("toolbox",
gimp_get_user_context (gimp),
menu_factory,
@ -258,7 +260,10 @@ dialogs_init (Gimp *gimp,
TRUE);
gimp_dialog_factory_set_constructor (global_toolbox_factory,
dialogs_dockable_constructor);
gimp_dialog_factory_set_dock_window_func (global_toolbox_factory,
dialogs_toolbox_dock_window_new);
/* Dock */
global_dock_factory = gimp_dialog_factory_new ("dock",
gimp_get_user_context (gimp),
menu_factory,
@ -266,13 +271,17 @@ dialogs_init (Gimp *gimp,
TRUE);
gimp_dialog_factory_set_constructor (global_dock_factory,
dialogs_dockable_constructor);
gimp_dialog_factory_set_dock_window_func (global_dock_factory,
dialogs_dock_window_new);
/* Display */
global_display_factory = gimp_dialog_factory_new ("display",
gimp_get_user_context (gimp),
menu_factory,
NULL,
FALSE);
for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++)
gimp_dialog_factory_register_entry (global_dialog_factory,
toplevel_entries[i].identifier,