Add a regression test for sessionrc parsing, handing and writing. The
test work in the following way: GIMP starts so that sessionrc is
deserialized and stored internally, the UI is shown, and then the
internal data structure about windows is serialized to a new
sessionrc. The test makes sure that a new sessionrc actually has been
created, and then that the content of the new file is identical to the
old one.
The WM tests mess up the GIMP dir, in particular any sessionrc if it
exists, due to the interface never being shown. Make the WM test use a
tmp dir to avoid that.
Don't blindly increment last-tip-shown so that the sessionrc is not
modified between each GIMP run. The change is to make it easier to
write regression tests for sessionrc. Eventually we might want some
proper fix.
Add gimp_test_run_temp_mainloop() which is a helper function for tests
that wants to run a main loop for a while. Useful when you want GIMP's
state to settle before doing tests.
The new function is called after the item is inserted. This is a much
smaller change than turning all vfuncs into signals just to be able
connect_after to one of them.
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.
Update export filename priorities according to changes in spec. Also
consistently use GIMP_FILE_EXPORT_URI_KEY instead of
GIMP_FILE_EXPORT_TO_URI_KEY. They have the same value.
Collapsing the tree gets rid of any selection in the collapsed branch,
and doesn't restore it upon exapnding. So connect to the
GtkTreeView::row-expanded signal and select the active item manually.
Had to add evil hack that makes sure we don't try this on child items
that are currently being inserted, because our parent class has no
choice but to expand the tree while the item is not completely
inserted in all subclasses yet.
* app/core/gimpdrawable.[ch]: add "gboolean push_undo" to
GimpDrawable::convert_type().
* app/core/gimpdrawable-convert.[ch]: same here for the gray and rgb
conversion functions.
* app/core/gimpchannel.c
* app/core/gimplayer.c: pass FALSE when called from GimpItem::convert()
because it can be called on unattached items only.
* app/core/gimpimage-convert.c: pass TRUE.
* app/core/core-enums.[ch]
* app/core/gimpgrouplayerundo.[ch]
* app/core/gimpimage-undo-push.[ch]: add GIMP_UNDO_GROUP_LAYER_CONVERT
which simply calls gimp_drawable_convert_type() with the old type
when undone/redone.
* app/core/gimpgrouplayer.c: push a group layer convert undo so this
can be properly undone/redone.
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.
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.
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::".
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.
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.
Needed because a group layer's projection can have a different type
than its image, at least at some pathologic moment during image type
conversion. But even if it didn't, it's cleaner this way anyway.
* app/core/gimpprojectable.[ch]: add the new vfunc plus public API.
* app/core/gimpprojection.c: use it instead of using the type of the
image returned by gimp_projectable_get_image(). The get_image()
function is now unused in the projection and only needs to stay
because the projection is also a GimpPickable.
* app/core/gimpgrouplayer.c: implement GimpProjectable::get_image_type().
The dock needs to listen to image changes in the context and not only
display changes since the introduction of the empty-image-window does
not cause any display changes when creating the first image.