Commit Graph

26910 Commits

Author SHA1 Message Date
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
Michael Natterer 2b2464d6c8 Move the "flush_accum" to GimpImagePrivate 2010-02-05 09:13:25 +01:00
Martin Nordholts 43c0cfedbd app: "Pixel dimensions" -> "Size in pixels" in Image Properties dialog
'Pixel dimensions' can be misinterpreted with the size of a pixel, so
use 'size in pixels' instead. This is consistent with e.g. the Image
Scale dialog which talks about 'image size'.
2010-02-04 21:25:17 +01:00
Michael Natterer 0f0853ca86 Move "preview" to GimpImagePrivate 2010-02-04 21:09:19 +01:00
Michael Natterer 09c897262e Move all undo-related members to GimpImagePrivate
Also add some new API to access them.
2010-02-04 20:06:49 +01:00
Michael Natterer 4c1ec79281 Move the quick mask members to GimpImagePrivate
and add API to access the "inverted" state.
2010-02-04 09:49:45 +01:00
Michael Natterer 02f5931c96 Move "visible" and "active" to GimpImagePrivate
and add accessors for the entire arrays (not just their members).
2010-02-04 09:10:02 +01:00
Alexandre Prokoudine a8df1ec985 Updated Russian translation 2010-02-04 07:20:25 +03:00
Michael Natterer 4143f5cd62 Move "parasites" to GimpImagePrivate 2010-02-03 23:42:32 +01:00
Michael Natterer 4a247e9182 Move "floating_sel" and "selection_mask" to GimpImagePrivate 2010-02-03 23:24:18 +01:00
Michael Natterer 3720938517 Move the active layer, channel and vectors to GimpImagePrivate 2010-02-03 23:12:22 +01:00
Michael Natterer 67014260dd Move some container handlers to GimpImagePrivate 2010-02-03 23:05:49 +01:00
Michael Natterer 88de69464e Move "layers", "channels" and "vectors" to GimpImagePrivate 2010-02-03 23:00:31 +01:00
Michael Natterer c9b9b8e18e Increating and decreasing the display count were swapped 2010-02-03 22:59:50 +01:00
Michael Natterer c9f8399614 Move "grid", "guides" and "sample_points" to GimpImagePrivate 2010-02-03 22:16:02 +01:00
Michael Natterer 2005fd1a68 Move "projection" and "graph" to GimpImagePrivate 2010-02-03 21:46:09 +01:00
Michael Natterer bb624cb8c4 Move "tattoo_state" to GimpImagePrivate 2010-02-03 21:31:27 +01:00
Michael Natterer 0b2c804e9d Move "disp_count" and "instance_count" to GimpImagePrivate
and add the neccessary API to access and modify them.
2010-02-03 21:22:00 +01:00
Sven Neumann 8e31261caa plug-ins: fix build rules for web-browser plug-in in plugin-defs.pl 2010-02-03 20:57:11 +01:00
Sven Neumann 799a7fc5a8 script-fu: drop gimp.org header and label scripts
These scripts used to be used to create graphics for the old gimp.org
web-page that has long been redone several times. There is no point in
distributing these scripts any longer.
2010-02-03 20:54:04 +01:00
Sven Neumann a179537e29 app: fix compiler warning and improve formatting a little 2010-02-03 20:49:38 +01:00
Sven Neumann edb41221c6 plug-ins: drop gee and gee-zoom plug-ins
These plug-ins used to be used as easter-eggs and have only been
available thru the PDB. Since they are not useful except for the fun
of staring at the weird code, we can as well remove them entirely.
2010-02-03 20:39:02 +01:00
Michael Natterer f769284aca Start private struct for GimpImage and move the first members there 2010-02-03 20:31:25 +01:00
Michael Natterer 32358615d4 Don't access image->colormap directly 2010-02-03 20:09:20 +01:00
Michael Natterer f18943f4ce Don't access the image's unit and resolution members directly 2010-02-03 19:53:45 +01:00
Michael Natterer b6ce5d075d Remove macros SCREEN_XRES() and SCREEN_YRES()
and add gimp_display_shell_get_screen_resolution() instead. The times
when these macros were used in inner loops have long passed.
2010-02-03 19:50:46 +01:00
Akkana Peck 36551daa19 Fix bug 590418: make chalk script-fu work.
Sobel doesn't work on layers with transparency, like text layers,
so the text layer in the chalk script needed to be merged with the
background layer beneath it.
2010-02-02 13:04:24 -08:00
Martin Nordholts 1d6c2307f9 etc: Make sessionrc up to date with recent code changes 2010-02-02 08:35:26 +01:00