Commit Graph

32 Commits

Author SHA1 Message Date
Martin Nordholts 7e5224f828 app: Add and use gimp_dock_window_new() 2010-01-06 11:35:25 +01:00
Martin Nordholts 4fcd3024f1 app: Set a GimpContext on GimpDockColumns
In order to make a GimpDock get hold of a GimpContext both in
single-window mode and in multi-window mode, don't make it look for a
GimpContext in a GimpDockWindow, put the context in GimpDockColumns
instead. GimpDockColumns exists both in s-w-m and m-w-m, contrary to
GimpDockWindow. Still use the GimpDockWindow as a backup though.
2010-01-05 11:31:15 +01:00
Martin Nordholts 90d7ffde1a app: Make all GimpDialogFactory members private
Add necessary trivial API that allows us to make remaining
GimpDialogFactory instance members private, and make them private.
2009-12-20 20:21:26 +01:00
Martin Nordholts 65c5541faf app: Don't crash when detaching dockables from image window
Don't crash when detaching dockables from the image window. This
scenario only occurs in single-window mode. We solve it by using
global variables and checking for NULL for src_dock_window; there is
no dock window when detaching from the image window.

The use of global variables is meant to be temporary.
2009-12-10 19:30:49 +01:00
Martin Nordholts 1bf84999e4 Move the Image Selection Menu to GimpDockWindow
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
2009-12-05 21:21:24 +01:00
Martin Nordholts cb854e6ad7 app: Only do necessary init in gimp_dock_window_init()
The private instance data struct is zeroed out for us so we don't need
to assign NULL, FALSE and 0 to private instance data members in
gimp_dock_window_init().
2009-12-05 12:38:55 +01:00
Martin Nordholts d33f643f6b app: Move GimpDockWindow::"font-scale" style property to GimpDock
To make the smaller font in docks also apply in single-window mode,
move the GimpDockWindow::font-scale style property to GimpDock. We use
the GimpDockWindow approach, so now each GimpDock has a name of the
form "gimp-internal-dock-<id>". We add "internal" to avoid clashing
with the GimpDockWindow legacy id "gimp-dock-<id>".
2009-12-03 23:08:30 +01:00
Martin Nordholts 5ae5ef0f9f app: dock_ID -> dock_window_ID in gimp_dock_window_init() 2009-12-03 21:51:56 +01:00
Martin Nordholts a685508713 app: Make GimpDockColumns listen to "dock-removed"
Make GimpDockColumns listen to "dock-removed", not "dockbook-removed",
when trying to figure out when to destroy itself. Fixes some crashes
when rearranging the UI, for example when doing this step-by-step:

1. Have two dock windows with one dockable each, say A and B
2. Move A to B's dock window and make it multi-column
3. Try to detach B, will result in a crash
2009-11-15 21:26:17 +01:00
Martin Nordholts 624bb78c4c app: Move down gimp_dock_window_from_dock() in the file
Move down gimp_dock_window_from_dock() in the file as it is a special
kind of function.
2009-10-26 07:52:07 +01:00
Martin Nordholts be8e0045ac app: Add gimp_dock_window_get_docks()
Add gimp_dock_window_get_docks() and get rid of trailing whitespace.
2009-10-25 21:50:08 +01:00
Martin Nordholts e81c4f44de app: Allow more than one dock inside a dock window
Put a GimpDockColumns inside GimpDockWindow so that there can be more
than one dock inside a dock window. For now,
gimp_dock_window_get_dock() returns the first dock. Eventually need to
return all docks and refactor the other code as needed.
2009-10-25 13:10:08 +01:00
Sven Neumann bc9602c410 remove pointless delete-event handler 2009-09-29 23:38:16 +02:00
Martin Nordholts c7b8a67cfd app: Don't kill the toolbox window when removing the last dockbook
Add a "allow-dockbook-absence" property to the GimpDockWindow which is
set to TRUE for the dock window for the toolbox so that it is not
kiled when the last dockbook is removed.
2009-09-27 14:15:03 +02:00
Martin Nordholts 9106c75b14 app: Remove temporary GimpDockWindow property prefixes
With GimpDock and GimpDockWindow being separate they can share
property names.
2009-09-26 16:25:30 +02:00
Martin Nordholts 4f7693acf0 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()
2009-09-26 16:21:10 +02:00
Martin Nordholts c47c397332 app: Add and use gimp_dock_window_set_dock()
Add and use gimp_dock_window_set_dock() in preparation for making
GimpDock a non-GimpDockWindow.
2009-09-26 15:38:08 +02:00
Martin Nordholts 12a0ea1063 app: Destory the dock window from the dock window, not the dock 2009-09-26 15:26:05 +02:00
Martin Nordholts 02c8835e2c app: Make gimp_dock_window_get_dock() public 2009-09-20 20:21:45 +02:00
Martin Nordholts 8bfcd14f9a app: Add GimpSessionInfo getters and setters 2009-09-20 14:51:03 +02:00
Martin Nordholts e87ed66ba7 app: Don't cast GimpDock to GimpDockWindow
In preparation for making GimpDock inherit from a non-window, stop
casting GimpDocks to GimpDockWindows. Instead look up the toplevel
widget for a dock and get the dock window that way.
2009-09-15 07:58:14 +02:00
Martin Nordholts 67128d6034 app: Add GimpDock::set_host_geometry_hints()
In order to allow the toolbox dock to set geometry hints on the
GtkWindow it is in, introduce host geometry hint setting through a new
virtual function GimpDock::set_host_geometry_hints() and a new
"geometry-invalidated" signal.

Docks that needs to setup geometry hints on the window they are in
call gimp_dock_invalidate_geometry(). The GimpDockWindow will listen
to this and give the dock a chance to set geometry hints (or any setup
really) on the GimpDockWindow.
2009-09-13 14:14:08 +02:00
Martin Nordholts a23a220d60 app: Add and use GimpDockWindow window title infrastructure
Add a "title-invalidated" signal to GimpDock and a virtual function
GimpDock::get_title(). When GimpDocks have a state change that their
title depends on they call gimp_dock_invalidate_title(). The
GimpDockWindow listens to this signal and update its window title
using GimpDock::get_title() in an idle handler.
2009-09-13 13:14:18 +02:00
Martin Nordholts 0d4e8d0526 app: Move 'Recently Closed Docks' logic to GimpDockWindow
Move 'Recently Closed Docks' logic from GimpDock to
GimpDockWindow. GimpDock is now free of explicit GtkWindow
dependencies.
2009-09-13 12:04:50 +02:00
Martin Nordholts fb99f99788 Move dock window themeing to GimpDockWindow
Move the dock window related themeing namely default dock heght and
font scale from GimpDock to GimpDockWindow to get rid of yet another
GtkWindow dependency from GimpDock.

Note that this change requires gtkrc updates where "GimpDock::" needs
to be repaced with "GimpDockWindow::".
2009-09-13 11:23:02 +02:00
Martin Nordholts 12494097b0 app: Explicitly init dialog_factory member in GimpDockWindow::_init() 2009-09-13 10:14:26 +02:00
Martin Nordholts 88e6fe1e62 app: Add GimpDialogFactory property to GimpDockWindow
Add a GimpDialogFactory property to GimpDockWindow so that it can get
rid of its GimpDock dependency. We need to call the property
"gimp-dialog-factory" instead of "dialog-factory" though as long as
GimpDock subclasses GimpDockWindow.
2009-09-13 09:49:56 +02:00
Martin Nordholts 3532acbec6 app: Move UI manager from GimpImageDock to GimpDockWindow
Move the GimpUIManager from GimpImageDock to GimpDockWindow. This
includes making the ui_manager_name class-member of GimpImageDock a
normal instance member of GimpDockWindow since the UI manager name no
longer can be configured at the class level.
2009-09-13 09:22:59 +02:00
Martin Nordholts 5b74dd27ef app: Move window init code from GimpDock to GimpDockWindow
Move window init code common to all docks from GimpDock to
GimpDockWindow.
2009-09-10 22:13:21 +02:00
Martin Nordholts 26fbeebf02 app: Set the dock-window-hint centrally in GimpDockWindow
Set the dock-window-hint centrally in GimpDockWindow instead of both
in GimpToolbox and GimpMenuDock.
2009-09-10 22:03:39 +02:00
Martin Nordholts 81d961423a app: Add GimpContext property to GimpDockWindow
The GimpDockWindow will need to have a GimpContext so add such a
property but call it "gimp-context" for now to avoid clashing with
"context" of GimpDock.
2009-09-10 22:03:30 +02:00
Martin Nordholts 0110eb0cdf app: Introduce GimpDockWindow
Introduce GimpDockWindow and make GimpDock inherit from it. Right now
it is just a GimpWindow, but window logic from GimpDock and subclasses
will gradually be moved here so that we eventually can make GimpDock a
GtkBin. That in turn will allow us to put several GimpDocks next to
each other in columns, or GimpDocks in an image window.
2009-09-09 18:22:05 +02:00