Commit Graph

26937 Commits

Author SHA1 Message Date
Michael Natterer c4562c5a93 core: use g_param_spec_boxed() for tile managers, not g_param_spec_pointer() 2010-02-10 12:42:30 +01:00
Michael Natterer 68ee4a5d6c base: add a proper version of the code that tracked down the tile manager leak
For GIMP_UNSTABLE, keep around a list of allocated tile managers and
have a function tile_manager_exit() which complains about them and
unrefs them. This is infinitely more helpful than the tile cache and
swap complaining about not being empty, because there is absolutely
nothing wrong with swap and cache when we simply leaked tile managers.
2010-02-10 12:33:30 +01:00
Simon Budig 7bfa3272ab Give a hint what pressing shift over a vector handle does. 2010-02-09 23:21:42 +01:00
Michael Natterer fe97de2a68 modules: forgot to port this one to GSEAL_ENABLE 2010-02-09 22:42:20 +01:00
Michael Natterer 8afdbd8053 Let gimp_item_tree_get_insert_pos() return a boolean indicating success
and move more precondition checks there. Remove lots and lots of
checks from all its callers and simply bail out if it returns FALSE.
2010-02-09 22:32:54 +01:00
Michael Natterer e83954c49a Add more precondition checks to gimp_item_tree_get_insert_pos() 2010-02-09 22:32:53 +01:00
Michael Natterer 37d10415df Make sure all items of a subtree get added to / removed from the name hash
when whole item hierarchies are added or removed, like when a layer
group goes to the undo stack and back.
2010-02-09 22:32:51 +01:00
Michael Natterer 6e49a0fa5d Move gimp_edit_paste_as_new() to gimp_image_new_from_buffer()
because it better fits there, and it's never actually been a "paste"
from the implementation point of view.
2010-02-09 22:32:49 +01:00
Michael Natterer 903604113f Add utility function to create images to gimpimage-new.[ch]
Add gimp_image_new_from_drawable(), from_component() and from_pixbuf()
and remove that duplicated code from gimptoolbox-dnd.c and
gimpdisplayshell-dnd.c
2010-02-09 22:32:48 +01:00
Michael Natterer 9a561646c2 Move the undo disable/freeze APIs to gimpimage-undo.[ch] 2010-02-09 22:32:48 +01:00
Michael Natterer 052dcd0164 Update the layer stack in gimp_image_active_layer_notify()
instead of in gimp_image_set_active_layer()
2010-02-09 22:32:47 +01:00
Michael Natterer 7413ec9f31 Argh, when removing items, also remove them from the name hash 2010-02-09 22:32:47 +01:00
Michael Natterer 11ca58ccf2 Use G_TYPE_CHECK_INSTANCE_TYPE() instead of GIMP_IS_ITEM()
See below...
2010-02-09 22:32:46 +01:00
Michael Natterer 7bb64cd864 Nuke two more local variables that make no sense any longer 2010-02-09 22:32:45 +01:00
Michael Natterer 430588ac38 Make sure we don't try to reorder items into their children 2010-02-09 22:32:44 +01:00
Michael Natterer 52eaf96a6c Some of the stupidity from the previous commit was copied from here 2010-02-09 22:32:43 +01:00
Michael Natterer 2cb6669d01 Fix a lot of stupidity in gimp_item_tree_uniquefy_name()
Don't write to the string returned by gimp_object_get_name(). Pull
most of the code out of the inner loop (which also means to allocate
only one instead of three strings in the inner loop). Don't use the
object as storage for the name that gets generated in the inner loop.
Also, a space can't hurt so it's now "Foo #1" instead of "Foo#1".
2010-02-09 22:32:43 +01:00
Michael Natterer 6b1872359d Get rid of one more local variable in gimp_image_add_layer() 2010-02-09 22:32:42 +01:00
Michael Natterer b83e82514b Use G_TYPE_CHECK_INSTANCE_TYPE() instead of GIMP_IS_ITEM()
so we check for the real type of the items that are in the tree. Also
added some more precondition checks.
2010-02-09 22:32:42 +01:00
Michael Natterer 1e84abc396 Connect to "notify::active-item" of the item trees
and emit "active-foo-changed" in the signal handlers instead of in
gimp_image_set_active_foo().
2010-02-09 22:32:41 +01:00
Michael Natterer b7d1be96e0 Get rid of the "New" in "New Layer", "New Channel" etc.
because they are "new" only once and then never again. Instead, simply
call new stuff "Layer", "Channel" and "Path", either by passing that
string explicitely, or by passing NULL so their class' default name
will be used.
2010-02-09 22:32:40 +01:00
Michael Natterer 3514271fde Give unnamed items proper names
Use the item class' default name unstead of "Unnamed" so they
will be called "Layer", "Channel" and "Path".
2010-02-09 22:32:38 +01:00
Michael Natterer 5de2482526 Add some comment to group the functions 2010-02-09 22:32:37 +01:00
Cristian Secară 94271a00e6 Updated Romanian translation 2010-02-08 23:17:52 +02:00
Cristian Secară 06d6286d3a Updated Romanian translations 2010-02-08 22:58:01 +02:00
Sven Neumann 834b49ee42 Bump required babl and gegl versions in the run-time sanity checks. 2010-02-08 21:36:30 +01:00
Michael Natterer 7763b9aa35 Depend on babl and gegl >= 0.1.2 2010-02-07 17:16:24 +01:00
Michael Natterer 217d80bb78 Move get_item_by_name() from GimpItemStack to GimpItemTree
and turn its code into a simple hash table lookup.
2010-02-07 16:34:44 +01:00
Michael Natterer 8a7f2e8f51 Bug 604175 - gimp_vectors_import() is O(n**2) in gimp_list_uniquefy_name(), for some data
Switch off unique names for all individual item stacks and make sure
that all items in a GimpItemTree have unique names across all
containers. Uses a hash table and thus gets rid of the O(n**2)
complexity of the unique name code in GimpList.
2010-02-07 16:23:02 +01:00
Michael Natterer 2034a3676c Use gimp_item_tree_rename_item() also when undoing an item rename
so all item renaming goes through GimpItemTree API. Add "push_undo"
parameter to gimp_item_tree_rename_item().
2010-02-07 15:56:53 +01:00
Michael Natterer bcf7603e04 Add gimp_item_tree_rename_item()
and call it from gimp_item_real_rename() if the item is attached to an
image; simply use gimp_object_set_name() otherwise.
2010-02-07 15:39:42 +01:00
Michael Natterer 5455ce895d Cause less eye cancer 2010-02-07 15:27:21 +01:00
Michael Natterer d9d13bc08d Add some more precondition checks to GimpItemTree functions 2010-02-07 15:07:30 +01:00
Michael Natterer e00c59461a No need to pass the active item to GimpItemTree functions any longer 2010-02-07 15:01:31 +01:00
Michael Natterer c9645cc0d3 Add "active-item" property and API to GimpItemTree
and use it to store the image's active layer, channel and vectors.
2010-02-07 14:52:34 +01:00
Michael Natterer 78375e0ec5 Move gimp_image_get_insert_pos() to gimp_item_tree_get_insert_pos() 2010-02-07 14:08:52 +01:00
Michael Natterer 82f8cee292 Use the newly added get_parent() APIs
Get rid of tons of local "parent" variables and inline the
get_parent() calls. They were on separate lines only to make them
readable at all.
2010-02-07 13:46:46 +01:00
Michael Natterer e0224cdbfb Add get_parent() API for items, layers, channels and vectors
this is pretty pointless from an abstraction point of view, but using
these functions will make the code a lot more readable by getting rid
of tons of ugly casts to and from GimpViewable whenever getting an
item's parent.
2010-02-07 12:03:07 +01:00
Michael Natterer f2c56cb363 app: #if 0 some stuff to aviod warnings 2010-02-07 12:02:37 +01:00
Michael Natterer 1b7d60cc87 Add gimp_item_tree_add_item() and gimp_item_tree_remove_item()
and use them from gimp_image_add,remove_layer,channel,vectors().
Removes quite some code duplication from the remove() functions but
almost none from add() because of the ongoing floating selection
madness. We need the calls to the item tree anyway because it's
going to ensure unique names of its items.
2010-02-07 11:47:33 +01:00
Michael Natterer 7bfd5dcf75 Merge the layer, channel and vectors reorder undo into one item undo
- get rid of the individual undo types and add GIMP_UNDO_ITEM_REORDER.
- replace the pushing functions by a single one.
- merge all the actual undo code into gimpitempropundo.[ch].
- use gimp_item_tree_reorder_item() to do the actual reordering.
- fix gimp_item_tree_reorder_item() to use an ordinary "push_undo"
  boolean again instead of a pointer to an undo function.

GimpVectorsPropUndo is now a completely empty skeleton. Keep it around
anyway, maybe we'll get vectors properties to undo soon.
2010-02-06 16:41:54 +01:00
Michael Natterer 804e692c86 Add some item tree infrastructure that will be needed later
- add gimp_image_get_layer_tree(), channel_tree() and vectors_tree()
- change GimpItem::get_container() to GimpItem::get_tree()
- implement gimp_item_get_container() using gimp_item_get_tree()
2010-02-06 16:17:23 +01:00
Michael Natterer 25d39f2daa Add gimp_item_tree_reorder_item()
and remove the code duplication in gimp_image_reorder_layer(),
_channel() and _vectors(), which now consist of a single call to
gimp_item_tree_reorder_item().
2010-02-06 16:00:06 +01:00
Michael Natterer f551333cbe Add an "image" property to GimpItemTree 2010-02-06 13:49:09 +01:00
Michael Natterer c9d0b370fe Use GimpItemTrees to keep the image's layers, channels and vectors
This commit is basically just an exchange of the stack-keeping
objects and one big replacement of e.g. private->layers by
private->layers->container. Useful code will follow :)
2010-02-06 13:41:16 +01:00
Michael Natterer d57f39df00 Add unused new class GimpItemTree which will keep the image's items
It will make sure all items in the tree have unique names,
will keep the active item, handle inserting, removing and
reordering and whatnot...
2010-02-06 13:00:03 +01:00
Michael Natterer 004b96ac6c Don't use gimpimage-private.h undoing guide/sample point removals
Instead, use the proper "add" APIs and remove checks for the guides /
sample points being at the right positions (they might be out of image
when an image resize or rotation is undone). Add comments to make
clear that these functions are internal API, also add comments to the
proper public APIs so it's clear which one to use in which situation.
2010-02-06 13:00:03 +01:00
Marco Ciampa 8d652ba8cd Updated italian translation 2010-02-06 12:55:05 +01:00
Gabor Kelemen adb860af93 Hungarian translation updated 2010-02-06 00:15:48 +01:00
Michael Natterer 4211524ee2 Use gimp_image_undo_is_enabled() instead of private->undo_freeze_count 2010-02-05 09:19:43 +01:00