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().
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>".
Use more proper API in gimp_statusbar_init() when we rearrange widgets
to get rid of warnings. Requires an up to date GTK+, max 2 weeks old
or so, for gtk_statusbar_get_message_area().
This makes app/tests run again since there are no warnings about wrong
widget parent.
Make drag-and-drop rearrangement of dockables happen directly in the
existing widget hierarchy so we don't have to use special, ugly
widgets (read GimpDockSeparator:s) for that.
More specifically, make edges of dockables and dockbooks have the same
semantics as the GimpDockSeparators had. We put a highlight colored
GdkWindow on top of the widget in question to highlight these special
drop areas. This GdkWindow is not taken into consideration in the GTK+
drag-and-drop code, so it does not interupt the DND interaction.
To achive this, there is a problem we must solve: Drag events in GTK+
are propagated inwards and out, but we sometimes want ancenstor
widgets to take care of drop events. We solve this by introducing the
concept of "drag handlers". A drag handler is asked if it will handle
a given drag event, and if it will, a client will let the drag event
be propagated upwards in the widget hierarchy. Right now, the
GimpPanedBox is the only "drag handler". The code could be generalized
more but it doesn't feel worth it at this point.
The size of the special drop area is 5px, the same size as the default
GtkPaned handles. This is because the plan is to later use these
handles as drop areas too.
Other changes of interest are:
* We need to take care of "drag-motion", "drag-drop" and widget
highlightning ourselves. We can not use the GtkDestDefaults
conveniences with gtk_drag_dest_set() any longer since we need more
control.
* Make the drop callback pass the insert index directly instead of a
GimpDockSeparator
* Add some GIMP_LOG() debug output for DND
* Disable the GimpDockSeparator code in GimpToolbox
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
Removes tons of code but looks ugly because it uses GTK_STOCK_GO_DOWN
currently, will fix that. Also did some random small cleanups and
removed unused members from the instance struct.
Move g_list_copy() out from gimp_dock_columns_get_docks(). Fixes at
least one memory leak (in gimp_dock_window_get_dock()) and feels nicer
and more flexible.
The insert position for new column in GimpDockColumns was sometimes
wrong, the problem was in gimp_dock_separator_get_insert_pos() not
return an index but a GtkAnchorType. Convert from GtkAnchorType to an
insert index.
* app/core/gimpdata.c (gimp_data_get_identifier): check if the data's
path starts with either of those and use the symbolic paths in that
case.
* data/tags/gimp-tags-default.xml.in: use them here too instead of
/home/martin/foo/bar/...
This way we can ship a default file that makes sense, and need much
less identifier remapping. The identifiers even stay the same when
upgrading GIMP.
Implement GtkWidget::focus_in_event() and ::focus_out_event() in
GimpCanvas and don't chanin up so the default handler never runs.
Remove code that tries to do the same in the canvas' tool events
callback.
The default impl invalidates the entire widget for no reason (the
canvas doesn't draw a focus indicator anyway), and the old solution
failed for empty displays and was constantly invalidating the entire
drop zone when the toplevel window gained or lost focus.
(gimp_data_factory_refresh_cache_add): don't add data objects without
filename to the refresh cache. Regardless why they have no filename,
they can't be reloaded anyway (in this case it's newly created objects
that couldn't be saved because there is no folder to save them).
Make the function do what is says also if the callback doesn't remove
the data from the factory, argh... also add "gboolean skip_internal"
parameter because doing that unconditionally feels equally broken.
(gimp_data_factory_get_save_dir): add GError and return an error
message telling why exactly a writable folder could not be found.
Show that error message instead of silently failing of just giving a
useless generic error so the user knows how to fix the problem.
Keeping gimp_data_factory_data_reload() separate from
gimp_data_factory_data_refresh() is more confusing than helpful
because the function is an integral part of the refresh logic and
implemented everything but saving all dirty objects.