Apply and heavily modify patch from remyDev which adds "lock position"
to GimpItem, similar to "lock content". Lock position disables all
sorts of translation and transform, from the GUI and the PDB.
Cleaned up some aspects of the lock content code as well because a
second instance of similar code always shows what went wrong the first
time.
but don't fix it for item trees yet (refactoring only). Kill the
"exclusive liked" function which only existed because it was so easy
to have, but was always utterly useless. Prove me wrong and I will
revive it.
Properly distinguish between dropping after a group and into it, by
having three drop areas on a collapsed row. Still handle expanded rows
as before, but indicate dropping into visually just as on a collapsed
row.
In the drop callbacks, don't check if the GimpContainerView's container
contains the dropped item, it might be in a sub-container. Instead,
simply checking if the GimpContainerView knows the item is sufficient
(and also much simpler than a recursive container serach).
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.
- gimp_container_tree_view_prepend_toggle_cell_renderer() to
gimp_container_tree_view_add_toggle_cell()
- gimp_container_tree_view_prepend_cell_renderer() to
gimp_container_tree_view_add_renderer_cell()
because "prepend" is an implementation detail, "renderer" is obsolete,
and in the second case it's not "cell renderer" but really a "renderer
cell".
* app/widgets/gimpitemtreeview.[ch]: add class members for the lock
content button's icon, tooltip and help_id and use them when
creating the button. Create the button in constructor() instead of
init() so we have access to our real class structure without the
need for a custom get_type() function.
* app/widgets/gimpdrawabletreeview.c: configure the button as "Lock pixels".
* app/widgets/gimpvectorstreeview.c: configure it as "Lock path strokes".
- new API to add widgets to a box of options, for stuff like the paint
mode menu and opacity scale. Set it sensitive automatically and
update its spacings in GtkWidget::style_set().
- new API to get a hbox for "lock" toggles, for stuff like lock
pixels and lock alpha.
* app/core/gimpimage.[ch]: rename all gimp_image_reposition_foo() to
gimp_image_reorder_foo() and added "new_parent" parameters. Factor
out calculating of the item's new container and index to a utility
function.
* app/core/core-enums.[ch]: rename the REPOSITION undos to REORDER.
* app/core/gimpimage-undo-push.[ch]
* app/core/gimpchannelpropundo.[ch]
* app/core/gimplayerpropundo.[ch]
* app/vectors/gimpvectorspropundo.[ch]: change accordingly. Remember
the old parent item in all item reorder undos.
* app/widgets/gimpitemtreeview.h: change GimpReorderItemFunc prototype
accordingly.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c (class_init): follow image API
name changes.
* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
implement reordering of items between groups.
* app/widgets/gimpcontainertreeview.c
(gimp_container_tree_view_reorder_item): fix to reorder the item
within its level of the tree (unrelated to above changes, but needed
to make them work).
* app/widgets/gimpcontainertreeview-dnd.c
(gimp_container_tree_view_real_drop_possible): support DND within a
tree and make sure a group item is not dropped into itself.
* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
implement intra-container reordering within all branches; print a
message for inter-container reordering because that's not yet
implemented in the core.
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().
* app/vectors/gimpvectors-import.[ch]: add parent parameters to
the vectors import functions.
* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
removing layers, channels and vectors.
* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
functions and add FIXMEs all over the place because there is some
more hacking needed to make adding with index = -1 (on top of the
current item) work again.
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
* app/core/gimpimage-duplicate.c: duplicate the original image's
tree structure in the copy.
* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
add utility function gimp_item_tree_view_get_drop_index() which
figures where to add something dropped to an item tree.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
new GimpItemTreeView API.
* 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.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
* app/widgets/gimpitemtreeview.[ch]: Make instance member private
and add getter that didn't already exist.
(gimp_item_tree_view_get_new_button)
(gimp_item_tree_view_get_edit_button): New getters.
* app/actions/actions.c
* app/widgets/gimpvectorstreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpchanneltreeview.c: Use new getters.
svn path=/trunk/; revision=27827
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpcontainertreeview-private.h: Make the
renderer_cells and toggle_cells members private.
(gimp_container_tree_view_set_main_column_title)
(gimp_container_tree_view_prepend_toggle_cell_renderer)
(gimp_container_tree_view_prepend_cell_renderer): New interface.
* app/widgets/gimptoolview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpcontrollerlist.c: Use new interface.
svn path=/trunk/; revision=27675
* app/widgets/gimpcontainertreeview.[ch]
(gimp_container_tree_view_set_dnd_drop_to_empty): New setter
function so that we can make the "gboolean dnd_drop_to_empty"
class instance member private.
* app/widgets/gimpcontainertreeview-private.h: Move member here.
* app/widgets/gimpcontainertreeview-dnd.c: Go through priv pointer.
* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_init): Use
the new function.
svn path=/trunk/; revision=27671
* app/widgets/widgets-enums.h: Put the GimpContainerTreeView enums
here instead of exposing them through silly class instance
members.
* app/widgets/gimpcontainertreeview.c:
* app/widgets/gimpcontainertreeview-dnd.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpsettingseditor.c
* app/widgets/gimptemplateview.c
* app/widgets/gimptoolview.c: Clean up and use new enum names.
svn path=/trunk/; revision=27666