Commit Graph

11954 Commits

Author SHA1 Message Date
Sven Neumann 8405d69e86 formatting 2009-09-03 20:54:06 +02:00
Martin Nordholts 9359c5d44f app: Escape the file names in export menu items
We need to escape _ in the filenames we use for the 'Overwrite' and
'Export to' menu items, otherwise they show up as mnemonics.
2009-09-03 20:14:15 +02:00
Michael Natterer c1f3872141 Fix loading of layer masks of group layers
Don't add layer masks to their layers while loading because a newly
loaded group layer's size doesn't match its mask's size. Instead,
attach all layer masks to their layers using g_object_set_data(), and
add them after all layers have been loaded.
2009-09-03 19:11:02 +02:00
Michael Natterer c8b0cb68fa xcf_save_layer(): add comment about where we store the layer mask offset 2009-09-03 19:08:22 +02:00
Michael Natterer 9e18f771c4 Replace "Group Layer" by "Layer Group" in all user visible strings 2009-09-03 14:57:18 +02:00
Michael Natterer efd5018420 gimp_editor_set_box_style(): small optimization
Don't set set icon again if the icon size has not actually changed.
2009-09-03 13:24:30 +02:00
Michael Natterer 402408db1a gimp_item_tree_view_style_set(): set the style of the lock buttons
Honor the "button-relief" and "button-icon-size" style properties for
the lock buttons.
2009-09-03 13:22:17 +02:00
Michael Natterer 2d5b6d83d5 Use plain togglebuttons, not checkbuttons for the "lock" toggles
The checkbox is not really needed, the icons can just as well be
toggles themselves.
2009-09-03 13:07:06 +02:00
Michael Natterer f1f186c718 Change mnemonic of "New Group Layer..." to "G" 2009-09-03 09:10:42 +02:00
Michael Natterer 4347c67964 Use gimp_drawable_get_tiles() in a few places instead of direct access 2009-09-03 08:16:26 +02:00
Michael Natterer c39dfab87c Don't access image->width and ->height directly 2009-09-03 01:03:29 +02:00
Michael Natterer 0b09278c17 Don't access item->width and ->height directly 2009-09-03 01:00:14 +02:00
Michael Natterer f3e640f2d2 gimp_projection_projectable_changed(): some fixes and optimizations
When the projectable's size or image type changes, stop the idle
renderer and remove all queued update area because everything needs to
be re-rendered anyway. Also honor the projectable's offset when
invalidating the entire projection after clearing the pyramid.
2009-09-02 21:55:14 +02:00
Michael Natterer 228da1d32e gimp_group_layer_update_size(): remove bogus optimization
The optimization here which would change only the group layer's offset
if the extents of the union of its children has not changed is
completely bogus. That case can only happen if one of the chldren was
moved in a way that does not change the extents of all children's
union, but this doesn't mean that the childrens' positions relative to
each other have not changed.

Instead, invalidate the entire projection to at least avoid constant
reallocation of the tile pyramid.

Found by group layer testing hero Tobias Jakobs.

(will have to optimize real translations of the entire group (or of the
only child in the group) differently)
2009-09-02 21:47:28 +02:00
Michael Natterer 1735f86d25 Kill plug-ins that write to tiles of locked drawables or group layers
Yes this is pretty lame, but we must prevent write access to these
items under all circumstances, and we have no other way but killing
the plug-in (it should not write to the drawable directly anyway)
2009-09-02 19:48:46 +02:00
Michael Natterer b2fa005445 Chain up unconditionally in GimpViewable::invalidate_preview() 2009-09-01 23:36:46 +02:00
Sven Neumann 70fdac012e Minor UI tweak in the Keyboard Shortcuts Editor dialog
Use a Clear icon embedded into the Search entry instead of an extra
button next to it.
2009-09-01 22:26:01 +02:00
Michael Natterer 096ff4b093 Remove all wrong and useless comments
Remove all outdated comments that we just plain wrong and all
useless ones that are like:

/*  do foo bar  */
foo_bar();
2009-09-01 19:23:44 +02:00
Michael Natterer c6c0817602 Don't make the action that invokes the tool insensitive for locked vectors 2009-09-01 12:44:30 +02:00
Michael Natterer a12a9fa70e gimp_vector_tool_button_press(): don't edit locked vectors 2009-09-01 12:43:43 +02:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +02:00
Michael Natterer a0e1fe6a21 gimp_layer_boundary(): come cleanup
Don't allocate the BoundSegs just to free it a few lines later, simply
allocate them before they are actually filled.
2009-08-31 21:23:35 +02:00
Martin Nordholts 5fbe68c26b app: Enforce privacy of GimpObject members
Use g_type_class_add_private() for GimpObject to prevent private data
from being modified "accidentally".
2009-08-31 21:23:29 +02:00
Michael Natterer 3915601544 Remove gimp_image_layer_boundary()
Having a function that only abstracts whether there is an active
layer or not is pretty useless. This also doesn't make the code in
selection_generate_segs() more complex but rather more obvious.
2009-08-31 20:57:52 +02:00
Michael Natterer bbc83d33b5 gimp_drawable_fs_update() takes a GimpLayer, not a GimpDrawable 2009-08-31 20:55:03 +02:00
Michael Natterer 44be1b5d7b Various small cleanups (no code changes) 2009-08-31 20:42:02 +02:00
Michael Natterer 064448cb50 Bug 563770 - Layer border visibility don't work with masks
(gimp_display_shell_selection_control): don't draw the layer boundary
if it is hidden.
2009-08-31 19:25:25 +02:00
Michael Natterer d50d5b5878 Let the drawable connect to its floating selection's "update" signal
When attaching/detaching a floating selection to/from its drawable,
connect/disconnect the floating selection's "update" signal and update
the drawable in the callback, because changes to the floating
selection affect the drawable and not the projection directly. Fixes
floating selection compositing in layer trees and is the right thing
to do anyway.
2009-08-31 17:37:22 +02:00
Michael Natterer cdbb8e1697 Fix loading of layer trees when there is a floating selection
A floating selection is always the first layer in the image, but on
XCF loading it is attached *after* all layers are loaded, so the item
paths for child layers read from the XCF are off-by-one in their
toplevel index. Adjust them so everything loads as it should.
2009-08-31 15:15:30 +02:00
Michael Natterer c6fa4f7206 Implement saving and loading of layer trees in the XCF
* app/xcf/xcf-private.h: add properties PROP_GROUP_ITEM and
  PROP_ITEM_PATH

* app/xcf/xcf-save.c: when saving a group layer, save a
  PROP_GROUP_ITEM.  When saving a child item, save a PROP_ITEM_PATH
  which contains the path indices returned by gimp_item_get_path().

* app/xcf/xcf-load.c: when loading a PROP_GROUP_ITEM, replace the
  layer that is being loaded by a GimpGroupLayer, also ignore that
  layer's hierarchy (it makes no sense to load the tiles of a layer
  that's generated from its children). When loading a PROP_ITEM_PATH,
  pass the loaded path up to xcf_load_image() so it can add the loaded
  layer at the right place in the tree.
2009-08-30 21:28:59 +02:00
Michael Natterer 7f8244d50c Save all an image's layers and channels, but still as flat list
This is actually just an intermediate refactoring that uses
gimp_image_get_foo_list() inetad of get_foo_iter(), but it also
sanitizes saving the image's selection (it's now simply added to the
list of channels to save, instead of using some sick code to save it
in the same loop that saves channels), so i want to have this in a
separate commit from actual tree saving/loading.
2009-08-30 21:19:42 +02:00
Michael Natterer 7eaba5f8fc Move variables to local scopes 2009-08-30 21:07:22 +02:00
Michael Natterer 23749cda2c Don't set "lock-alpha" and "lock-content" on items where it can't be changed 2009-08-30 21:02:43 +02:00
Michael Natterer f9c8bea368 Add gimp_item_stack_get_parent_by_path(), for use un XCF loading
The opposite of gimp_item_get_path(), just that it doesn't return an
item, it returns a parent item and an index that can be used to add
the item to an item tree.
2009-08-30 20:58:24 +02:00
Michael Natterer 3d547c0a70 Add gimp_item_get_path(), to be used in XCF saving
Returns a GList of guint indices that describe the path to an item in
an item tree, pretty much like GtkTreePath does for GtkTreeModels.
2009-08-30 20:56:39 +02:00
Michael Natterer 46b9ffc11f Prepare for changing the layer type in xcf_load_layer_props()
As when loading channel props (which can replace the GimpChannel by a
GimpSelection), pass a GimpLayer** instead of a GimpLayer* to
xcf_load_layer_props(), so the function can replace the GimpLayer to
load by another type (e.g. GimpGroupLayer).
2009-08-30 13:14:28 +02:00
Michael Natterer 03d00c5e0f Save the "lock-content" property on layers and channels in the XCF
Add XCF property PROP_LOCK_CONTENT and save/load it for all layers and
channels. Vectors saving needs some refactoring here I'm afraid, so I
ignored it for now.
2009-08-30 12:44:35 +02:00
Michael Natterer 8f9fc5e2d7 Fix comment: s/layer/channel/ 2009-08-30 11:52:06 +02:00
Michael Natterer 2b3c03593f gimp_text_layer_from_layer(): also copy the "lock-content" property 2009-08-30 10:49:32 +02:00
Michael Natterer e1b743e407 Fix typo in comment 2009-08-30 10:43:09 +02:00
Michael Natterer 27d036b75f Render a layer group's boundary in a different color
This is probably not sufficient, but better than nothing.
2009-08-29 21:26:46 +02:00
Michael Natterer e6235cd982 Don't allow stroking to locked items and group items 2009-08-29 20:20:25 +02:00
Michael Natterer c68f82f4ae Connect to "lock-content-changed" of all items, not "lock-alpha-changed" 2009-08-29 20:19:38 +02:00
Michael Natterer d84e48a82f Make "item" parameter of GimpItem::is_attached() const 2009-08-29 19:47:52 +02:00
Michael Natterer 02903d6970 Use gimp_item_is_content_locked() instead of gimp_item_get_lock_content()
Use the new API whenever we want to determine the item's effective
lock state (whether we can write to the item's content or not). Use
gimp_item_get_lock_content() only in code that actually deals with
*this* item's locked state, which is only the PDB wrappers and GUI to
modify the flag on the item itself.
2009-08-29 15:27:04 +02:00
Michael Natterer 521e790b77 An item is_content_locked() if its parent item is locked 2009-08-29 15:10:38 +02:00
Michael Natterer c730839c1f Implement GimpItem::is_content_locked()
A layer mask is locked if its parent layer is locked.
2009-08-29 15:08:06 +02:00
Michael Natterer 03fafc01a4 Add virtual function GimpItem::is_content_locked() and public API
The purpose of this is to determine an item's effective lock state,
which will also depend on its parent and child items' lock states.
2009-08-29 14:59:07 +02:00
Michael Natterer dc738d229e Don't consider group items as non-lockable any longer 2009-08-29 12:54:25 +02:00
Michael Natterer fecfa95b63 Don't override the "lock-content" property any longer
Group layers can now be locked just as each other item
2009-08-29 12:53:35 +02:00