* app/core/gimpitem.[ch]: add virtual function ::get_container() plus
pubic API wrapper which returns the children of the item's parent
viewable, or the right toplevel container of its image.
Add utility function get_index() which returns the item's index
within its container.
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: implement get_container() and return
the right image container.
* app/core/gimplayer.[ch]: same here, and remove previously added
public get_container() API.
* app/core/gimplayermask.c
* app/core/gimpselection.c: implement get_container() for these GimpChannel
subclasses and return NULL.
The new function returns a layer's container, which is either its
parent viewable's children, or image->layers. Scheduled for being
moved to a virtual function on GimpItem.
* app/widgets/gimpcontainerview.[ch]: add and remove container trees
recursively. Change virtual function ::add_item() to pass the
insert_data of the parent viewable.
* app/widgets/gimpcontainercombobox.c
* app/widgets/gimpcontainerentry.c
* app/widgets/gimpcontainergridview.c: changed accordingly.
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c: dito, but actually use the passed
parent_insert_data to insert the item at the right place in the
GtkTreeView.
- add member "GimpViewable *parent" and accessors to get/set it
(no property or signals yet)
- add virtual function ::get_children() which is supposed to return
a GimpContainer of the viewable's children
Remove a conditional so that, in interactive mode, the Send by E-mail
feature always uses the name of the file as the default file field
value, instead of using the previously entered value of the field.
Factor out large portions of identical code into new utility functions
gimp_container_view_connect_context() and
gimp_container_view_disconnect_context().
Keep around the handler IDs for the "name-changed" signals of the
container's children in a hash table that maps containers to handler
IDs and move adding/removing of the handler to
add_container()/remove_container(). This way the name-changed code is
prepared for handling multiple containers.
In preparation of having a tree of containers, added
gimp_container_view_add_container(),
gimp_container_view_remove_container() and
gimp_container_view_remove_foreach()
which do all the job of inserting/removing items and
connecting/disconnecting the "add", "remove" and "reorder" signals.
Also refactored things so when the toplevel container freezes/thaws,
it simply gets removed from the view instead of ignoring its signals.
gimp_container_view_real_set_container()
gimp_container_view_freeze()
gimp_container_view_thaw(): use the new add_container() and
remove_container() APIs and fix the code for the unlikely case
that a frozen container gets added/removed.
GHashTable has g_hash_table_remove_all() since GLib 2.12, so there is
no need any longer to clear the hash table by destroyung it. Instead,
keep the hash around during the view's entire lifetime and remove all
re-creation code and all checks for its existence.