Add gimp_item_can_lock_content() and gimp_layer_can_lock_alpha() which
return TRUE unless the item is a grop (has children), because group
items will be considered to have lock_content always TRUE and
lock_alpha always FALSE.
* app/plug-in/gimppluginprocedure.[ch]
(gimp_plug_in_procedure_get_sensitive): change GimpImageType
parameter to GimpDrawable and do the type check internally.
* app/actions/plug-in-actions.c (plug_in_actions_update): pass the
active drawable instead of its type.
We have no reason to believe that the original layer names when
importing multi-layered images are not good enough, so stop adding the
filename as a prefix to the names.
* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" to
gimp_pdb_layer_is_text_layer() because that's called on
all text layers anyway.
* tools/pdbgen/pdb/text_layer.pdb
* tools/pdbgen/pdb/vectors.pdb: pass TRUE if we want to modify the layer.
* app/pdb/text-layer-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
Remove GimpTool::initialize() implementation again and check for the
drawable being locked in GimpTool::button_press() so we can't paint if
the tool has been used before on the same drawable when it was
unlocked.
* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" parameter to
gimp_pdb_item_is_attached() because this function is called on
almost all items where a check for locked is needed.
* tools/pdbgen/pdb/*.pdb: pass writable = TRUE in all checks for items
that are modified. Add explicit calls to gimp_pdb_item_is_writable()
in some rare cases.
* app/pdb/*-cmds.c: regenerated.
Check whether the drawable to edit is locked in GimpTool::initialize()
and bail out with an appropriate error if it is. This currently
prevents cloning from locked drawables, will fix that later.
* 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".
Took patch from Martin Nordholts and ported it to add a "lock-content"
property, signal and API in the same way as it's done for "visible"
and "linked".