Commit Graph

3372 Commits

Author SHA1 Message Date
Alexia Death 2656875953 Remove the silly ratio limit from scale and just make sure that transformation result is at least 1px 2009-10-11 10:57:13 +03:00
Michael Natterer 42b66678f5 Honor the "global-dynamics" setting 2009-10-11 01:44:38 +02:00
Michael Natterer 3aa8db4cea Use the configured default_dynamics from the config object 2009-10-11 01:36:24 +02:00
Michael Natterer 8be598e029 Create the dynamics directory 2009-10-11 01:34:48 +02:00
Michael Natterer b550fc9f65 Use the newly added dynamics paths 2009-10-11 01:33:14 +02:00
Michael Natterer ba355321cf Various cleanups in the GimpDynamics object 2009-10-11 01:19:40 +02:00
Michael Natterer 26bda5a2e2 Some more cleanup
- move the GimpDynamics typedef to core-types.h
- related changes
- clean up gimpcontext.c
2009-10-11 00:20:06 +02:00
Michael Natterer 5c1a9497f0 Some formatting cleanup 2009-10-11 00:20:06 +02:00
Alexia Death 0ca81896e9 Merge commit 'origin/master' into soc-2009-dynamics 2009-10-11 01:05:40 +03:00
Sven Neumann aa9538a81a Optimize gimp_channel_combine_ellipse_rect()
The actual algorithm is still the same sick algorithm that was used
before. But instead of iterating the mask row-by-row and filling
it in small spans, we now use one pixel_regions_process() loop to
process the whole mask. Makes a significant difference for large
elliptical selections.

Remove gimp_channel_add_segment() and gimp_channel_sub_segment()
as they are not needed any longer and were responsible for the
bad performance.
2009-10-10 23:09:54 +02:00
Sven Neumann bcfce95a5e minor cleanups 2009-10-10 23:09:46 +02:00
Sven Neumann 4c0f1a2d54 app: minor optimization and cleanups
gimp_channel_add_segment() and gimp_channel_sub_segment() can just
write directly if the value is 255, which it is quite commonly.
2009-10-10 23:09:46 +02:00
Martin Nordholts 90abaf1a73 app: Document GimpContext 2009-10-10 22:06:55 +02:00
Alexia Death 9b0f6ae5e2 Make saves work a bit more. 2009-10-10 22:29:04 +03:00
Alexia Death 4a5f070217 Fixing dynamics extension on save 2009-10-10 22:05:50 +03:00
Alexia Death 0ffcad4688 Several small fixes. 2009-10-10 21:43:58 +03:00
Alexia Death 7f8b347677 Several small fixes. 2009-10-10 21:43:57 +03:00
Michael Natterer cbcf46506c Fix up dynamics loading/saving 2009-10-10 20:39:11 +02:00
Alexia Death 72e976cca6 Make saving work. sortof. 2009-10-10 20:46:06 +03:00
Alexia Death 5adeb6ee25 Obsolete comment removed 2009-10-10 20:23:08 +03:00
Alexia Death 430a796904 Fixes 2009-10-10 20:22:31 +03:00
Alexia Death ac111be15d Added dynamics list and some infrastructure. still ont 100% tho 2009-10-09 20:25:07 +03:00
Alexia Death 860c952416 Inverted maping matrix and fixes to jitter 2009-10-07 23:32:17 +03:00
Alexia Death 7a2acf8811 Merge commit 'origin/master' into soc-2009-dynamics 2009-10-04 11:41:30 +03:00
Alexia Death 212ea4cc66 Start of dynamic jitter 2009-10-04 11:40:26 +03:00
Martin Nordholts 301e5c2c34 app: Maintain a list of GimpImageWindow:s on an app instance level 2009-10-04 02:10:11 +02:00
Alexia Death 3a041ad252 Lots of improvements on dynamics 2009-10-03 18:53:25 +03:00
Alexia Death 6581893616 Fix color dynamic 2009-10-03 16:54:10 +03:00
Alexia Death 26e7b5f0e2 Fix ennum ordering 2009-10-03 16:08:15 +03:00
Alexia Death 0a2d99ab16 Adding all other drivers to calculation and ading several other calculation methods for differently distributed values like angle and aspect ratio. 2009-10-03 15:12:03 +03:00
Michael Natterer f5f571bce5 Formatting cleanup 2009-10-03 13:53:40 +02:00
Alexia Death 155393491b Merge commit 'origin/master' into soc-2009-dynamics 2009-10-03 14:12:53 +03:00
Alexia Death da2920b0eb Adding random as part of the calculations, renaming calc method to linear for type 2009-10-03 14:08:05 +03:00
Alexia Death cd36753f17 Fixed loading for dynamics and made them actually accessible 2009-10-03 12:59:45 +03:00
Tal Trachtman 9fe00a7877 Bug 596472 - Rotate brushes artifacts at certain rotation angles
Solved a bug in the bilinear interpolated brush transform algorithm that
sometimes caused pixel artifacts to appear on brush edges for brushes
rotated 90, -90, -180, 180 degrees.
2009-09-29 23:03:58 +02:00
Alexia Death e75d44c77c Merge commit 'origin/master' into soc-2009-dynamics 2009-09-28 20:30:17 +03:00
Alexia Death bb18654483 Fix some compile errors 2009-09-28 20:30:03 +03:00
Michael Natterer 01bafc6ea8 Move variables to local scopes and some minor cleanup 2009-09-22 21:41:24 +02:00
Michael Natterer e306df220a Fix typo in comment 2009-09-22 21:39:32 +02:00
Michael Natterer a40f2b9037 Fix and optimize gimp_group_layer_duplicate()
Make sure the duplicated group layer actually has a properly set up
tile manager taken from its projection, and not just a dumb copy of
the original group's tiles. Also optimizes away useless calls to
gimp_group_layer_update_size().
2009-09-21 22:36:26 +02:00
Michael Natterer 43cf8e9259 Make "merge visible layers" work on the right container
(gimp_image_merge_visible_layers): merge the visible layers in the
active layer's group. We can't possibly merge across different groups
anyway because there is no logical place to add the merged layer.
Moreoever, this change makes the group behave more like a sub-image,
which is our metaphor anyway.
2009-09-21 20:30:10 +02:00
Michael Natterer e79c3c9bd7 Allow merging down a group layer
There is no reason to disallow this, the merged-down group layer will
simply disappear from the image just as a normal layer, and its
projection composited with the layer below.
2009-09-21 19:21:03 +02:00
Michael Natterer 170054a36e Add gimp_image_merge_group_layer()
The new function replaces a group layer by a normal one that looks
exactly the same.
2009-09-21 19:08:04 +02:00
Michael Natterer 13e39d7e2c Fix precondition check when duplicating group layers
(gimp_group_layer_duplicate): change the allowed type of the duplicate
from GIMP_TYPE_GROUP_LAYER to GIMP_TYPE_DRAWABLE. The former was
simply a braino when copying and modifying the GimpLayer code.
2009-09-21 18:41:54 +02:00
Alexia Death be78fe3b1d Merge commit 'origin/master' into soc-2009-dynamics 2009-09-20 14:32:32 +03:00
Michael Natterer 17f345fa1a Add missing boilterplate macro 2009-09-14 21:37:53 +02:00
Michael Natterer 717b4e6a07 Fix undoing a group layer type conversion
* app/core/gimpdrawable.[ch]: add "gboolean push_undo" to
  GimpDrawable::convert_type().

* app/core/gimpdrawable-convert.[ch]: same here for the gray and rgb
  conversion functions.

* app/core/gimpchannel.c
* app/core/gimplayer.c: pass FALSE when called from GimpItem::convert()
  because it can be called on unattached items only.

* app/core/gimpimage-convert.c: pass TRUE.

* app/core/core-enums.[ch]
* app/core/gimpgrouplayerundo.[ch]
* app/core/gimpimage-undo-push.[ch]: add GIMP_UNDO_GROUP_LAYER_CONVERT
  which simply calls gimp_drawable_convert_type() with the old type
  when undone/redone.

* app/core/gimpgrouplayer.c: push a group layer convert undo so this
  can be properly undone/redone.
2009-09-13 19:24:19 +02:00
Michael Natterer 2af860e6a6 Add GimpProjectable::get_image_type()
Needed because a group layer's projection can have a different type
than its image, at least at some pathologic moment during image type
conversion. But even if it didn't, it's cleaner this way anyway.

* app/core/gimpprojectable.[ch]: add the new vfunc plus public API.

* app/core/gimpprojection.c: use it instead of using the type of the
  image returned by gimp_projectable_get_image(). The get_image()
  function is now unused in the projection and only needs to stay
  because the projection is also a GimpPickable.

* app/core/gimpgrouplayer.c: implement GimpProjectable::get_image_type().
2009-09-12 19:24:01 +02:00
Michael Natterer 0f918e75a4 Implement GimpDrawable::convert_type()
Don't convert the pixels but reallocate the group's projection for the
new type. This breaks badly on undo, don't bother to try yet...
2009-09-11 22:03:55 +02:00
Michael Natterer 53c9eeee82 Use gimp_drawable_convert_type() to convert to gray and rgb 2009-09-11 22:03:55 +02:00
Michael Natterer cd60b9ef5c gimp_channel_convert(): use gimp_drawable_convert_type() 2009-09-11 22:03:54 +02:00
Michael Natterer c6fb6d0ceb Implement GimpDrawable::convert_type()
Move pixel conversion code from gimp_layer_convert() to the new
gimp_layer_convert_type() implementation and call
gimp_drawable_convert_type() from convert(). In convert_type(), simply
chain up to convert to gray and rgb and only implement indexed
conversion ourselves.
2009-09-11 22:03:54 +02:00
Michael Natterer 86a264e9f2 Add new virtual function GimpDrawable::convert_type()
This may look like duplication of GimpItem::convert() but in fact will
fix the longstanding uglyness that GimpItem::convert() both transfers
an item to another image *and* converts the image type of drawables.
When this refactoring is done, GimpItem::convert() will only move an
item to another image, and its implementation in GimpDrawable classes
will call GimpDrawable::convert_type() to convert the pixels to
whatever format.

Takes a "dest_image" parameter anyway because for converting to
indexed we need the destination colormap. The default impl in
GimpDrawable can only convert to gray and rgb however.
2009-09-11 22:03:54 +02:00
Michael Natterer 45f05b272c gimp_item_real_duplicate(): don't set lock-content if it can't be set
Also use the proper APIs to set visible, linked and lock-content
instead of accessing the item struct directly.
2009-09-08 22:09:53 +02:00
Michael Natterer a8b0e3c943 gimp_layer_duplicate(): don't set lock-alpha if it can't be set 2009-09-08 22:09:03 +02:00
Michael Natterer 0c57e8c68e gimp_layer_transform_color(): don't assume the dest region has alpha
Don't blindly fill the dest region's alpha channel even if it has
none. Fixes longstanding bug that made things without alpha dropped
to indexed images to arrive broken.
2009-09-08 20:54:51 +02:00
Michael Natterer f2f741a26e Add gimp_drawable_convert_rgb() and gimp_drawable_convert_grayscale()
The new functions reall convert the drawable this time, using the
previously renamed convert_tiles functions. Remove tile manager
fiddling from all callers and leave it there only for converting to
indexed.
2009-09-08 20:36:51 +02:00
Michael Natterer 83c79bad5d Use gboolean instead of gint for boolean value 2009-09-08 19:57:50 +02:00
Michael Natterer f3bae9ac57 Remove "old_base_type" parameters from gimp_drawable_convert_tiles_foo()
I have no idea how ancient these parameters were, but the drawable
knows about its type itself, so no need to pass it in.
2009-09-08 19:46:20 +02:00
Michael Natterer 1ecf6b5bc8 Rename the functions in gimpdrawable-convert.[ch]
Rename them from gimp_drawable_convert_foo() to
gimp_drawable_convert_tiles_foo() because they don't convert the
drawable itself, they convert its tiles into passed-in tiles.
2009-09-08 19:46:19 +02:00
Michael Natterer e77f6b10f4 Use gimp_drawable_type() instead of drawable->type 2009-09-08 19:46:19 +02:00
Michael Natterer d1f767d9b6 Make gimp_image_get_layer,channel,vectors_by_name,tattoo() more readable
Add local GimpItemStack variables instead of having the functions'
entire code in one line.
2009-09-08 19:46:18 +02:00
Martin Nordholts b61c971f22 app: Add gimp_set/get_show_gui()
For test cases we typically don't want to present any windows, so
allow test cases to turn that off.
2009-09-08 19:26:57 +02:00
Martin Nordholts a8e5dea309 app: Print error message when tag cache parsing fails 2009-09-08 17:48:39 +02:00
Michael Natterer 1961036f5e Add gimp_item_stack_is_flat() which returns TRUE if it's not a tree 2009-09-07 21:07:44 +02:00
Michael Natterer 4df9b25217 Add facility to compress multiple group layer resizings into one
* app/core/gimpgrouplayer.[ch]: add gimp_group_layer_suspend_resize()
  and gimp_group_layer_resume_resize() and call them around functions
  where all a group's children are transformed (translated, resized
  etc).  This way we go from the worst case of reallocating the
  group's projection tiles once for each child down to exactly one
  reallocation.

* app/core/Makefile.am
* app/core/core-enums.[ch]
* app/core/core-types.h
* app/core/gimpimage-undo-push.[ch]
* app/core/gimpgrouplayerundo.[ch]: add new undo class
  GimpGroupLayerUndo which implements undos for suspend/resume of
  group layers and calls them in reverse order when undoing.
2009-09-07 13:12:54 +02:00
Michael Natterer 56a17ed118 Forgot one "Group Layer" -> "Layer Group" string change 2009-09-07 10:58:55 +02:00
Michael Natterer 5b85642e94 Reorder some functions so item and drawable methods are together 2009-09-04 11:31:19 +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 4347c67964 Use gimp_drawable_get_tiles() in a few places instead of direct access 2009-09-03 08:16:26 +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 b2fa005445 Chain up unconditionally in GimpViewable::invalidate_preview() 2009-09-01 23:36:46 +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 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 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 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 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
Martin Nordholts 957cf2cfa9 app: Always use gimp_object_get_name()
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
2009-08-29 12:41:29 +02:00
Martin Nordholts 0e82aca27c app: Use gimp_object_name_free() instead of manipulating private data 2009-08-29 12:41:28 +02:00
Michael Natterer eb03413b49 Add separate check that prevents merging down to a group layer 2009-08-29 12:26:15 +02:00
Martin Nordholts 5383bf0dc7 app: Fix annoying typos in previous commit 2009-08-29 12:13:28 +02:00
Martin Nordholts cb94993f40 app: Clarify corner case uses of gimp_object_name_changed() 2009-08-29 12:12:08 +02:00
Sven Neumann 53aa877346 use G_FILE_TEST_IS_REGULAR instead of G_FILE_TEST_EXISTS
Keeps us from trying to load a directory as a data file.
2009-08-27 23:12:55 +02:00
Michael Natterer 6031800b90 Fix automatic size updates of nested groups (again!)
Make sure a group layer really emits all needed size change signals
when children get added and removed, so the group layer above it can
also update itself based on these signals. Spotted (again) by tobi.
2009-08-27 23:07:38 +02:00
Michael Natterer 3a0168ee83 When removing a group layer, remove all its children from image->layer_stack 2009-08-27 22:10:36 +02:00
Michael Natterer 1accd760a3 Implement GimpDrawable::estimate_memsize()
Add the scaled sizes of all children and of the projection so the
scale dialog's size warning is correct again.
2009-08-27 19:43:45 +02:00
Michael Natterer ecacf6f0c3 Filter out child items from the list used to estimate the saled memsize 2009-08-27 19:41:14 +02:00
Michael Natterer f05c5ecfdc gimp_image_item_list_filter(): actually honor the passed parameters
Gah, I added these parameters for a reason, so do *not* remove all
child items if remove_children is FALSE.
2009-08-27 19:36:22 +02:00
Michael Natterer 19a168cb9d Mostly revert to the state before group layers
Now that group layers properly implement GimpItem::resize(), ::flip(),
::rotate() and ::scale(), we can go back to just transforming the
toplevel container of layers in the image. Left in and/or added some
special cases anyway, like when resizing sets of layers along with the
image is requested.
2009-08-27 19:31:55 +02:00
Michael Natterer cfaf6501e0 Remove outdated comment 2009-08-27 15:15:57 +02:00
Michael Natterer 4db124defa Don't forget to add the projection in GimpObject::get_memsize() 2009-08-27 14:26:57 +02:00
Michael Natterer 193a0b3bcf Use gimp_item_stack_get_item_iter(stack) instead of GIMP_LIST(stack)->list 2009-08-27 12:26:14 +02:00
Michael Natterer 8f7527616a Make the include guards match the filename 2009-08-27 12:06:09 +02:00
Michael Natterer cd70850990 When scaling a group layer, remove children that are scaled away
When a child's width or height becomes < 1, remove it rather than
trying to scale it to impossible dimensions.
2009-08-27 11:53:47 +02:00
Michael Natterer 2a8f29f00a Minor whitespace cleanup 2009-08-27 11:01:51 +02:00
Michael Natterer 98123f3475 Add freeze_notify/thaw_notify around GimpDrawable::set_tiles() 2009-08-26 13:20:18 +02:00
Michael Natterer d442379d5e Change GimpProjectable::update to GimpProjectable:invalidate
The only purpose of this change is to avoid having the "update"
signal twice on GimpGroupLayer (from GimpDrawable and from
GimpProjectable). Switch back to normal g_signal_connect()
in the projection.
2009-08-26 13:06:55 +02:00
Michael Natterer ea33581451 Use gimp_image_set_size() instead of setting width and height manually
This also (really this time) fixes nested group layers. There were
cases when the outer group layer didn't properly resize itself because
gimp_drawable_set_tiles() on the inner group layer failed to emit
notify::width and notify::height.
2009-08-26 13:03:40 +02:00
Michael Natterer ce5d591336 Add lowlevel accessor gimp_item_set_size()
Sets the "width" and "height" properties and emits notifications and
"size-changed" if anything has changed. This in only to be used by
functions that actually resize the item, it does not scale/resize
anything.
2009-08-26 13:00:13 +02:00
Michael Natterer 6aadd0bbc9 Rename gimp_image_pick_correlate_layer() to gimp_image_pick_layer() 2009-08-25 23:18:34 +02:00
Michael Natterer fe84af9fd9 Don't forget to add added drawables' GeglNodes to the stack's GeglNode
I have no clue how this could work before, but fixing it fixes
projection of nested groups. The goat can be evil.
2009-08-25 23:10:31 +02:00
Michael Natterer d37dc64b16 Add GError reporting to gimp_image_merge_down()
- turn g_return_if_fail() of more complex conditions into errors.
- change PDB wrapper accordingly instead of adding a ton of conditions
  there.
2009-08-25 22:02:02 +02:00
Michael Natterer d91a89e157 Make "Merge down" work on trees and start fixing the rest of the merge code
* make internal merge functions aware of the container to merge and
  its parent layer.
* git rid of some cruft in gimp_image_merge_down().
* merge down works within one container (naturally) and needs:
  - the uppper layer not to be a group
  - the lower layer to be writable
* fix action sensitivity accordingly.
2009-08-25 21:26:14 +02:00
Alexia Death 4cb185a8ba Fixing up the dynamics UI. Currently does not sync with the object in the context tho. 2009-08-25 21:28:24 +03:00
Michael Natterer 7a373152f9 Remove boolean variable that was only set and never used after 2009-08-25 20:00:30 +02:00
Michael Natterer 7a4ac0802c Implement GimpItem::resize()
Resize all children, but only crop them (don't enlarge them, unlike
when resizing normal layers).
2009-08-25 17:29:29 +02:00
Michael Natterer 764af4879e Revert almost all item tree related changed in this file
Don't recursively duplicate all items. Instead, just duplicate the
items in the toplevel image containers, because group items duplicate
their children correctly all by themselves.
2009-08-25 16:25:26 +02:00
Michael Natterer d873372262 Don't spoil the names of duplicated groups' children with "copy"s 2009-08-25 16:05:39 +02:00
Michael Natterer 6fa6aa2686 Filter out linked children of linked items to transform 2009-08-25 15:55:30 +02:00
Michael Natterer 86a76d6237 Skip group layers when transforming the entire image
Group layers update themselves when their children change, so simply
skip them when cropping, flipping, resizing, rotating or scaling the
image.
2009-08-25 15:46:53 +02:00
Michael Natterer cb1e3afba4 Add gimp_image_item_list_filter()
New function takes a GList of items as returned by
gimp_image_item_list_get_list() and can filter out items that:

- have lock_content set to TRUE.
- are children of items that are also in the list (to avoid
  transforming group items *and* their children, because
  the group items already do that for us).
2009-08-25 15:36:03 +02:00
Michael Natterer bdf01c6495 Fix gimp_group_layer_scale() to do the right thing
Scale all children in relation to the group layer's old and new size
and offset. The group itself will follow the childrens' sizes.
2009-08-25 14:26:26 +02:00
Michael Natterer 62c5b23aaf Add naive and wrong version of GimpItem::convert()
That code will fail badly when dropping layer groups between images of
different types, but will at least work between two RGB images.
2009-08-25 14:23:42 +02:00
Michael Natterer 71134c7f7d gimp_group_layer_duplicate(): insert children in the right order 2009-08-25 12:11:44 +02:00
Michael Natterer 6934a0d2eb Make sure all group layers' projections switch to GEGL with the main projection 2009-08-24 22:38:16 +02:00
Michael Natterer 1403db11ef Fix the layer-offset of the group layer's projection graph
Insert a gegl:translate node into the group layer's projection
graph. Produces identical results as the legacy projection now, but is
not yet switched on by checking View->Use Gegl.
2009-08-24 22:01:16 +02:00
Michael Natterer 9fd204977d Implement GimpItem's transform methods
Add implementations for GimpItem::translate(), scale(), resize(),
flip(), rotate() and transform(). Simply transform all children, the
group layer will automatically update itself. Also transform the layer
mask.
2009-08-24 19:33:29 +02:00
Michael Natterer c8c6d77c35 Fix finalize() so it doesn't crash 2009-08-24 17:30:41 +02:00
Michael Natterer 4fa06d0405 Add a projection to GimpGroupLayer so we finally have a *visible* layer tree
Implement the GimpProjectable interface and keep a GimpProjection
around that projects the GimpDrawableStack of our children. Propagate
the childrens' "update" signals to our own "update" signal so our
parent projection picks up all changes.
2009-08-24 16:05:39 +02:00
Michael Natterer dd8a7740ab Honor the projectable's offset in the projection
Add/Subtract the projectable's offset whenever we go from coordinates
from our public interface (which are always image coordinates) and
coordinates in out internal tile pyramid (wihch always starts at 0,0).

The Gegl projection still needs an offset node that is missing.

Also, connect to the projectable's "update" signal using
g_signal_connect_closure_by_id() instead of simply g_signal_connect(),
so we really connect to the signal of the GimpProjectable interface
and not to the "update" signal of GimpDrawable (which is a conflict
that will happen on group layers).
2009-08-24 16:05:38 +02:00
Michael Natterer 0f668e411e Add an offset API to the GimpProjectable interface
Add GimpProjectable::get_offset() and gimp_projectable_get_offset()
which returns the offset of the projectable in image coordinates, so
we can have projections that act as a viewport onto things that live
in image coordinates.
2009-08-24 16:05:38 +02:00
Michael Natterer a451eb950c Use gimp_item_stack_get_item_iter() 2009-08-24 16:05:38 +02:00
Michael Natterer ffe1359d84 Add gimp_item_stach_get_item_iter()
Simply an accessor for GIMP_LIST (stack)->list.
2009-08-24 16:05:37 +02:00
Michael Natterer 2ec53512c5 Change local variable names from "layer" to "group" 2009-08-24 16:05:37 +02:00
Michael Natterer a136d86c54 Automatically adjust the size of group layers
Connect to size and offset of all children and resize/move the
group layer accordingly.
2009-08-23 23:00:32 +02:00
Michael Natterer 819abf2fa0 Override the "lock-content" property to default to TRUE 2009-08-23 20:02:36 +02:00
Michael Natterer 922375ceca g_return_if_fail() on attempts to set locks that can't be changed 2009-08-23 19:54:19 +02:00
Michael Natterer d52d7e77b3 Add API to determine whether "lock" properties can ba changed
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.
2009-08-23 18:44:05 +02:00
zhenfeng zhao 287f9ab887 Adjust UI code to make check button. 2009-08-23 11:56:03 -03:00
Alexia Death d2143b8886 Merging master to current state 2009-08-21 19:26:05 +03:00
Michael Natterer 0953146be1 Check if there is an active layer if active_layer_only is TRUE 2009-08-20 22:41:49 +02:00
Alexia Death db8aa6cb21 Make dynamics object have an effect on the paintpbrush. Currently pressure and velocity only. 2009-08-20 22:46:17 +03:00
Michael Natterer b5c3e5a6b6 Also copy "lock_content" when duplicating an item 2009-08-20 19:34:30 +02:00
Alexia Death e04a7617d5 Cleaning up the dynamics init a little bit more 2009-08-20 18:24:50 +03:00
Alexia Death 4af5324d58 Cleaning up the dynamics init a little bit 2009-08-20 15:53:40 +03:00
Alexia Death 455e5239cb Adding the sub files for dynamics save and load 2009-08-20 12:34:45 +03:00
Alexia Death 569a64d2c9 Created stubs for saving and loading dynamics 2009-08-20 12:26:02 +03:00
Alexia Death 93f8216881 Renaming GimpDynamicsOptions to GimpDynamics and moving from paint/ to core/. A BIG change. 2009-08-20 04:25:26 +03:00
Alexia Death 9fa9f41106 Taking out unimplemented gimp_dynamics_load for now 2009-08-20 03:25:14 +03:00
Alexia Death 460bf0ecdd Fixing some more props errors in context 2009-08-20 03:20:17 +03:00
Alexia Death 17a377a553 Fixing props errors in context 2009-08-20 02:31:59 +03:00
Michael Natterer fb1a672546 Bug 61019 - add a 'lock' flag per layer to protect it
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".
2009-08-19 21:30:48 +02:00
Michael Natterer f7ba1d1f2e Add missing blank line after the vectors group of functions 2009-08-19 21:30:47 +02:00
Michael Natterer 7f94f3213b Pack boolean members into a bitfield to save two integers per item 2009-08-19 21:30:47 +02:00
zhenfeng zhao 822e394981 Fix seg fault for gimpcontext 2009-08-19 13:29:06 -03:00
Sven Neumann d655f03607 correct a comment 2009-08-19 16:59:15 +02:00
zhenfeng zhao 6aa4d55315 Solve errors in gimpcontext for dynamics. 2009-08-18 22:38:45 -03:00
zhenfeng zhao f48a7e4a8b Add dynamics context and factory data and functions (need debugging). 2009-08-17 23:47:26 -03:00
Martin Nordholts 966b81992b app: Add "FG to BG (Hardedge)" gradient
Add internal gradient "FG to BG (Hardedge)" based on gradient by
Saul Goode. See bug #589371.
2009-08-15 11:58:08 +02:00
Martin Nordholts 98aaae7cac app: Clean up internal gradient construction
Move code that is not shared between all gradients out of
gimp_gradients_add_gradient() and group the code with comments.
2009-08-15 11:48:36 +02:00
Martin Nordholts 3d0c025a51 app: Support obsolete data resources
Add support for having obsolete data resources. An obsolete resource
is not shown in the UI or managed in any way, but it will be
considered when plug-ins requests resources. This in order to maintain
backwards compatibility for plug-ins.
2009-08-13 21:54:00 +02:00
Michael Natterer 28aa03e525 Move gimp_image_raise_layer_to_top() around
Reorder functions so layer reorder function are in the same
order as channel and vectors ones.
2009-08-10 00:45:25 +02:00
Michael Natterer dc53e81705 Make sure items passed as "parent" are actually group items
Add precondition checks to all image add() and reorder() functions
2009-08-10 00:45:24 +02:00
Martin Nordholts b1e969cc6d app: Fix typo gimpgoruplayer 2009-08-08 15:26:34 +02:00
Martin Nordholts b9b05e7d39 app: Don't reuse the GeglProcessor
Don't reuse the GeglProcessor as it can't handle dirty rects when
painting in GIMP, and this makes it harder to make GEGL-wise progress
in other parts of GIMP.
2009-08-08 07:03:15 +02:00
Michael Natterer d059f239ac Make reordering items between groups work in the core and the UI
* 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).
2009-08-06 18:43:57 +02:00
Michael Natterer 8cda7dca56 Add gimp_viewable_is_ancestor()
The new functions figures if one viewable is another's parent or
grandparent or grandgrand... Note that unlike gtk_widget_is_ancestor(),
this function has its parameters in the right order.
2009-08-05 14:17:07 +02:00
Michael Natterer aaab0d40a9 Add GimpTreeHandler, a signal connection helper for object trees
A tree-enabled replacement for gimp_container_add,remove_handler(),
slightly more sane to a degree that makes me think it could replace
GimpContainer's own handler stuff. Public API consists of two
function:

- gimp_tree_handler_connect() which connects recursively to a specific
  signal of all items in a container tree.

- gimp_tree_handler_disconnect() is just a wrapper around unrefing the
  handler, but makes sure that dispose() is really executed (which
  actually disconnects things).
2009-08-04 20:12:34 +02:00
Michael Natterer ea7c07647b Some group layer fixes
- call new group layers "Group Layer" by default.
- when duplicating, don't forget to set the duplicated childrens'
  parent viewable.
2009-08-04 00:14:53 +02:00
Michael Natterer 7dafae7f26 Add a GimpGroupLayer class (not used yet) 2009-08-03 23:24:46 +02:00
Michael Natterer a53d4566da Use GIMP_IMAGE_ACTIVE_PARENT instead of a NULL parent in all obvious places 2009-08-03 22:30:36 +02:00
Michael Natterer a3b4b595d0 Add infrastructure to add items to the active item's parent container
* app/core/gimpimage.h: add define GIMP_IMAGE_ACTIVE_PARENT for magic
  the value ((gpointer) 1) which can be passed as parent item to
  add_layer(), add_channel() and add_vectors().

* app/core/gimpimage.c: add utility function
  gimp_image_get_insert_pos() which honors above new special value and
  figures all of parent container, parent item and insert position.
  Remove lots of duplicated code from add_layer(), add_channel() and
  add_vectors().
2009-08-03 21:47:21 +02:00
Michael Natterer c4075975bf Bring parent items to the public API 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.
2009-08-03 19:21:51 +02:00
Michael Natterer 87d463aed0 Iterate over all an image's items recursively
Use gimp_image_get_layer,channel,vectors_list() instead of
gimp_image_get_layer,channel,vectors_iter(). As a side-effect,
simplified some code that was making sure we don't modify the list
returned by the old functions (the new functions return newly
allocated lists so we can safely remove items from the image while
iterating it). Some places will need adjusting once we really have
item trees.
2009-08-02 17:44:05 +02:00
Michael Natterer ec21c2880c Remove gimp_image_get_layer,channel,vectors_by_index()
The don't make sense any longer with item trees and I just fixed the
last places where they were used.
2009-08-02 15:56:06 +02:00
Michael Natterer d7fa10c708 Get rid of using gimp_image_get_layer_by_index() in gimpimage.c 2009-08-02 15:43:04 +02:00
Michael Natterer 49b7f6b436 Implement adding/removing items to/from trees of items
Change gimp_image_add,remove_layer,channel,vectors() to deal with
parent items and insert/remove things to/from the right containers.
The "parent" parameter to the add_foo() functions is currently a local
variable that defaults to NULL, so nothing has chaged yet.
2009-08-02 15:36:00 +02:00
Michael Natterer ccc167994c Remove some old and unused GimpImage API cruft
Get rid of gimp_image_active_layer,channel,vectors_changed(),
they are unused and it's even conceptually wrong to have them
in the public API.
2009-08-02 12:45:04 +02:00
Michael Natterer 7805bd2186 Use the new item counting functions where appropriate 2009-08-02 12:24:06 +02:00
Michael Natterer 6be068ceab Add functions to count the items in an image
* app/core/gimpitemstack.[ch]: add gimp_item_stack_get_n_items()
  which counts a stack's items recursively.

* app/core/gimpimage.[ch]: add get_n_layers(), get_n_channels()
  and get_n_vectors().
2009-08-02 12:13:55 +02:00
Michael Natterer 251ee3a7be Move get_item_by_tattoo() and by_name() functions from GimpImage to GimpItemStack 2009-08-02 01:39:51 +02:00
Michael Natterer 9381358b6b Make setting the active layer, channel, vectors work for items in groups 2009-08-02 01:03:58 +02:00
Michael Natterer 99ceaf984a Make getting items by name work on trees 2009-08-02 00:21:31 +02:00
Michael Natterer 227076b6d1 Make getting items by tattoo work on trees 2009-08-02 00:15:53 +02:00
Michael Natterer 01c77b18d5 Use the new item iter API instead of the image APIs in some straightforward places 2009-08-01 23:07:07 +02:00
Michael Natterer 5f66faf953 Should try the code before pushing... 2009-08-01 22:53:31 +02:00
Michael Natterer 6e29b94bd0 Add gimp_item_get_container_iter()
This is just a utility function like gimp_image_get_layer_iter()
in order to avoid including "core/gimplist.h" whenever a file needs
access to the actual GList inside the container.
2009-08-01 22:40:32 +02:00
Michael Natterer 571d26a198 Add functions for getting lists of all an image's items
* app/core/gimpitemstack.[ch]: add gimp_item_stack_get_item_list()
  which returns a GList of all the stack's items, in depth-first
  order if the stack is in fact a tree.

* app/core/gimpimage.[ch]: add gimp_image_get_layer_list(),
  channel_list(), vectors_list() which use above new function.
2009-08-01 21:59:45 +02:00
Michael Natterer 2f018dfcc2 Use the new item APIs for layer/channel/vectors reordering
Don't use image->layers, ->channels and ->vectors in the raise, lower
and position functions; use gimp_item_get_container() and
gimp_item_get_index() instead.
2009-08-01 21:37:19 +02:00
Michael Natterer 88f49a5ddb Use gimp_item_get_index() all over the place
Remove gimp_image_get_layer,channel,vectors_index() and
use the new function everywhere.
2009-08-01 20:49:55 +02:00
Michael Natterer a3cb1191b9 Actually assign the new get_container() impl to the vtable 2009-08-01 20:32:13 +02:00
Michael Natterer 297c2f0082 Add gimp_item_get_container() and gimp_item_get_index()
* app/core/gimpitem.[ch]: add virtual function ::get_container() plus
  pubic API wrapper which returns the children of the item's parent
  viewable, or the right toplevel container of its image.
  Add utility function get_index() which returns the item's index
  within its container.

* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: implement get_container() and return
  the right image container.

* app/core/gimplayer.[ch]: same here, and remove previously added
  public get_container() API.

* app/core/gimplayermask.c
* app/core/gimpselection.c: implement get_container() for these GimpChannel
  subclasses and return NULL.
2009-08-01 20:22:07 +02:00
Michael Natterer fd8ebdacef gimp_item_is_attached(): an item is attached if its parent item is attached 2009-08-01 19:39:10 +02:00
Michael Natterer f4f5fc5f55 Add utility function gimp_layer_get_container()
The new function returns a layer's container, which is either its
parent viewable's children, or image->layers. Scheduled for being
moved to a virtual function on GimpItem.
2009-08-01 19:27:45 +02:00
Michael Natterer ad66250f90 Invalidate all the item stack's previews recursively 2009-08-01 19:23:59 +02:00
Michael Natterer 464ce841aa When an item is removed, emit "removed" on all its children 2009-08-01 19:21:43 +02:00
Michael Natterer 1e5da3939b Add basic infrastructure for trees of viewables
- add member "GimpViewable *parent" and accessors to get/set it
  (no property or signals yet)
- add virtual function ::get_children() which is supposed to return
  a GimpContainer of the viewable's children
2009-08-01 19:04:33 +02:00
Michael Natterer 9c4a2ab4ea Move layer mask related functions together 2009-07-30 18:59:12 +02:00
Martin Nordholts 5ad570e3cc Fix compilation errors
Fix compilation errors with obvious fixes.
2009-07-20 12:48:05 +02:00
Martin Nordholts b2b2b41e62 Get rid of artificial compiler warnings
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
2009-07-20 12:47:59 +02:00
Michael Natterer 24209f7625 Use g_value_dup_object() inatead of g_value_get_object() and g_object_ref() 2009-07-18 18:57:15 +02:00
Martin Nordholts 1662ff2523 app: Keep track of GimpImage export dirtiness
Since save and export are separate activities we need to keep track of
image dirtiness for both of them. For this purpose, add a
'export_dirty' member to GimpImage which has the same semantics as
'dirty', but for export. Set it to clean whenever a document is
exported by whatever means. Do this with a new function
gimp_image_export_clean_all(). Also add gimp_image_is_export_dirty().
2009-07-05 09:28:52 +02:00
Martin Nordholts c181f4eb05 app: Add and use gimp_image_is_dirty() 2009-07-03 21:11:21 +02:00
Martin Nordholts 51f81bd15e app: Reuse the GeglProcessor
Reuse the GeglProcessor instead of creating a new one in each call to
gimp_projection_construct_gegl(). Requires at least 0ed57a05da of
GEGL. Does not seem to give any performance improvement at all
unfortunately :(
2009-06-26 08:17:48 +02:00
Michael Natterer 64d6ebca00 Make the text tool use GtkTextView's key bindings
* app/core/gimpmarshal.list: add marshallers needed for the binding
  singnals.

* app/tools/gimptexttool.[ch]: add binding signals "move-cursor",
  "delete-from-cursor" and "backspace" and hijack GtkTextView's
  binding set to invoke them. Move code from the key_press() handler
  to the signals' default handlers. This is how it should work. In
  fact that code is #ifdef'ed away and we need an evil proxy
  GtkTextView to invoke the bindings on because of reasons stated in
  comments in the code. Ugly but works just fine.
2009-06-22 23:47:04 +02:00
Michael Natterer 9b1681216d Bug 586591 - Opening jpg image sets cpu activity to 100%
(gimp_projection_validate_tile): fix stupid braino that made the
recently added optimization loop infinitely on images with a width
that is a multiple of TILE_WIDTH.
2009-06-22 20:24:28 +02:00
Michael Natterer e2d90e3e1f Bug 585488 – Perspective transformation on a layer with a mask causes crash
(gimp_drawable_transform_affine)
(gimp_drawable_transform_flip)
(gimp_drawable_transform_rotate): also transform the layer mask if we
are transforming a layer and there is no selection (which causes the
entire layer to be transformed).
2009-06-17 21:14:32 +02:00
Michael Natterer 13cb156a80 Get rid of more x1,y1,x2,y2 uglyness
(gimp_drawable_push_undo): change x1,y1,x2,y2 parameters to
x,y,witdh,height and update all callers accordingly.
2009-06-16 22:59:07 +02:00
Michael Natterer 9af87c83aa Speed up the gegl projection by a factor of about 4
(gimp_projection_validate_tile): validate a strip of up to 8 invalid
tiles at once to reduce whatever overhead inflicted on gegl.
2009-06-11 22:22:11 +02:00
Alexia Death f3f7b28079 Fix for another potentially crashing and while.
This time in gimp_coords_interpolate_catmull. This should be
the last one.
2009-06-06 19:25:13 +03:00
Sven Neumann 0935bdde12 formatting 2009-05-21 19:06:07 +02:00
Sven Neumann cbfe411ea1 Bug 577301 – Dithering with transparency is broken for "positioned" method
Applied patch from Rob Antonishen fixing the reported transparency
dithering issue.
2009-05-21 19:03:36 +02:00
Sven Neumann ed748fd383 Bug 472644 – Rotate with clipping crops the whole layer
Applied patch from Andreas Neustifter fixing outstanding issues.
2009-05-21 14:42:48 +02:00
Michael Natterer e0453b44b1 Make some GimpCoords* params const
Add const to GimpCoords* params in GimpBrush::select_brush() and
want_null_motio().
2009-05-19 21:37:56 +02:00
Stephen Griffiths 40fde28a62 Add status bar feedback for keyboard changes to brush paramaters.
* app/actions/context-commands.c:
include core/gimptoolinfo.h
include pain/gimppaintoptions.h

context_opacity_cmd_callback()
context_brush_spacing_cmd_callback()
context_brush_spikes_cmd_callback()
context_brush_hardness_cmd_callback()
context_brush_aspect_cmd_callback()
use 'action_select_property()' for statusbar feedback

* app/core/gimpbrush.c: added translable string for brush spacing
* app/paint/gimppaintoptions.c: add blurb to prop double brush-aspect-ratio
2009-05-16 15:34:41 +02:00
Martin Nordholts 200c002516 app: Add "exported" signal to GimpImage 2009-05-16 13:02:55 +02:00
Martin Nordholts 9625c4610e app: Store entire source URI for a duplicated image 2009-05-16 13:02:54 +02:00
Alexia Death c3be07e937 Fixes to brush aspect ratio dynamics
Fixes to brush aspect ratios for parametric brushes
2009-04-26 12:08:41 +03:00
Alexia Death 6aafd34380 Adds dynamic aspect ratio for brushes. 2009-04-25 20:53:09 +03:00
Michael Natterer 090e06ecdd Move the stuff in tools-utils to the core so it can be used from
app/paint/ in the next step.

* app/tools/Makefile.am
* app/tools/tools-utils.[ch]: removed.

* app/core/gimp-utils.[ch]: add gimp_constrain_line() instead.

* app/tools/gimpblendtool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimppainttool.c: changed accordingly.
2009-04-22 21:08:42 +02:00
Tobias Mueller ed7b1a9c4d Remove the ICC profile when image will be converted from/to grayscale mode.
svn path=/trunk/; revision=28268
2009-04-13 20:14:49 +00:00
Sven Neumann 640afea581 Bug 471681 – Keyboard shortcuts for brush size/params need feedback
2009-03-19  Sven Neumann  <sven@gimp.org>

	Bug 471681 – Keyboard shortcuts for brush size/params need 
feedback

	* app/core/gimpbrushgenerated.c
	* app/core/gimpcontext.c
	* app/paint/gimppaintoptions.c: applied patch from Stephen G. 
that
	marks some strings for translation.


svn path=/trunk/; revision=28182
2009-03-19 20:40:43 +00:00
Sven Neumann 55c8a0f636 formatting
svn path=/trunk/; revision=28163
2009-03-16 19:59:58 +00:00
Sven Neumann a9327fca52 gimp_brush_real_transform_pixmap): don't mix variable declarations and
2009-03-16  Sven Neumann  <sven@gimp.org>

	* app/core/gimpbrush-transform.c 
(gimp_brush_real_transform_mask):
	gimp_brush_real_transform_pixmap): don't mix variable 
declarations
	and code. Added missing const qualifiers.

	* plug-ins/common/ripple.c (ripple_horizontal): removed stray
	semicolon.


svn path=/trunk/; revision=28162
2009-03-16 19:57:31 +00:00
Sven Neumann 7b5c3a8273 another tiny formatting change
svn path=/trunk/; revision=28140
2009-03-11 21:04:13 +00:00
Sven Neumann 54871b7ad0 formatting.
2009-03-11  Sven Neumann  <sven@gimp.org>

	* app/core/gimpscanconvert.c (gimp_scan_convert_render_full):
	formatting.


svn path=/trunk/; revision=28139
2009-03-11 20:56:07 +00:00
Sven Neumann 73ae572b75 Bug 520078 – Rotate brushes
2009-03-03  Sven Neumann  <sven@gimp.org>

	Bug 520078 – Rotate brushes

	* app/core/gimpbrush-transform.c: applied patch from Tal that
	improves bilinear interpolation for the brush transformations 
and
	fixes a bug in the calculation of the transformation matrix.


svn path=/trunk/; revision=28098
2009-03-03 15:00:14 +00:00
Michael Natterer b1b7f8102d app/core/gimpfilteredcontainer.[ch] app/core/gimptag.c codingstylize. Call
2009-03-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpfilteredcontainer.[ch]
	* app/core/gimptag.c
	* app/core/gimptagcache.[ch]: codingstylize. Call iterator GList*
	variables simply "list" just as we call integers simply "i".


svn path=/trunk/; revision=28097
2009-03-02 23:33:24 +00:00
Michael Natterer c06c90b545 add gimp_tagged_set_tags() which takes a GList of tags.
2009-03-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimptagged.[ch]: add gimp_tagged_set_tags() which
	takes a GList of tags.

	* app/widgets/gimptagentry.c (gimp_tag_entry_assign_tags): use it.

	(gimp_tag_entry_item_set_tags): remove.


svn path=/trunk/; revision=28094
2009-03-02 21:48:50 +00:00
Sven Neumann a586ea03fa Bug 520078 – Rotate brushes
2009-02-28  Sven Neumann  <sven@gimp.org>

	Bug 520078 – Rotate brushes

	* app/core/gimpbrush-transform.c: applied patch from Tal that
	implements bilinear interpolation for the brush transformations.


svn path=/trunk/; revision=28078
2009-02-28 13:06:44 +00:00
Martin Nordholts cb3b8608ce Rename gegl-types.h to gimp-gegl-types.h
Rename gegl-types.h to gimp-gegl-types.h as gegl-types.h invades on
the GEGL namespace

svn path=/trunk/; revision=28056
2009-02-21 15:06:49 +00:00
Aurimas Juška 6575913f12 added support for tag translation, user installation and migration procedures for tags.xml.
svn path=/trunk/; revision=28045
2009-02-17 18:43:32 +00:00
Sven Neumann 306374a851 Bug 99457 – Support for dynamics on tilt
2009-02-14  Sven Neumann  <sven@gimp.org>

	Bug 99457 – Support for dynamics on tilt

	* app/core/gimpbrush.[ch]
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrush-transform.[ch]
	* app/paint/gimpbrushcore.c
	* app/paint/gimpsmudge.c: applied patch from Alexia Death,
	separates brush scaling for x and y.


svn path=/trunk/; revision=28036
2009-02-14 22:00:48 +00:00
Martin Nordholts 18640f90e5 Remove gimp_drawable_update_tile_source_node()
Remove gimp_drawable_update_tile_source_node(), it was not useful.

svn path=/trunk/; revision=28034
2009-02-14 18:53:50 +00:00
Sven Neumann 8a28c073f1 app/core/gimpcoords-interpolate.c applied patch from Alexia Death that
2009-02-14  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcoords-interpolate.c
	* app/display/gimpdisplayshell-coords.c: applied patch from 
Alexia
	Death that fixes issues with the new stroke direction code
	(bug #520078).


svn path=/trunk/; revision=28030
2009-02-14 13:36:28 +00:00
Sven Neumann be83d34498 Bug 472644 – Rotate with clipping crops the whole layer
2009-02-14  Sven Neumann  <sven@gimp.org>

	Bug 472644 – Rotate with clipping crops the whole layer

	* app/core/gimp-transform-resize.c: applied patch as attached to
	bug #472644. Supposedly fixes the problem of the disappearing
	image.


svn path=/trunk/; revision=28029
2009-02-14 12:48:12 +00:00
Michael Natterer 4897f4841c need to rip the floating selection's source node out of its layer's graph
2009-02-13  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.c (gimp_drawable_sync_source_node): need
	to rip the floating selection's source node out of its layer's
	graph before using it in the floating selection sub-graph, and
	need to plug it back there when it's not a floating selection any
	longer.

	Unrelated:

	Also introduce a "fs_crop_node" that makes sure the floating
	selection stops at the drawable's boundaries.

	(gimp_drawable_visibility_changed): use item->node instead of
	gimp_item_get_node() because the latter creates the node on
	demand.

	* app/core/gimpdrawable-private.h: add fs_crop_node member.


svn path=/trunk/; revision=28022
2009-02-13 15:35:13 +00:00
Sven Neumann 46835a81fb applied patch from Alexia Death that fixes a bug that was introduced by
2009-02-11  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcoords-interpolate.c
	(gimp_coords_interpolate_catmull): applied patch from Alexia 
Death
	that fixes a bug that was introduced by the last commit.


svn path=/trunk/; revision=28013
2009-02-11 18:52:14 +00:00
Sven Neumann f64e2a76bf app/core/gimpcoords-interpolate.c app/core/gimpbrush-transform.c
2009-02-10  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcoords-interpolate.c
	* app/core/gimpbrush-transform.c
	* app/paint/gimppaintoptions.c
	* app/display/gimpdisplayshell-coords.c: applied patch from 
Alexia
	Death that fixes the direction of brush rotation (bug #520078).


svn path=/trunk/; revision=28010
2009-02-10 21:07:35 +00:00
Michael Natterer 9999ccf790 Bug 520078 – Rotate brushes
2009-02-08  Michael Natterer  <mitch@gimp.org>

	Bug 520078 – Rotate brushes

	Applied a slightly modified patch from Alexia Death:

	* app/core/core-types.h (struct GimpCoords): add "direction" member.

	* app/core/gimpcoords.c: take direction into account in mix(),
	scalarprod(), length_squared(), manhattan_dist() and equal().

	* app/core/gimpcoords-interpolate.c
	(gimp_coords_interpolate_catmull): same here.
	* app/display/gimpdisplayshell-coords.c

	(gimp_display_shell_eval_event): same here.

	* app/paint/gimppaintoptions.[ch]: add properties for direction
	dynamics and adapt dynamics mixing accordingly.

	* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
	"interpolate" direction too (in fact, just copy it from
	last_coords since it doesn't change along a straight line).

	* app/paint/gimppaintcore-stroke.c
	(gimp_paint_core_stroke_emulate_dynamics): emulate direction too.

	* app/tools/gimppaintoptions-gui.c: add GUI for direction dynamics.


svn path=/trunk/; revision=28001
2009-02-08 12:55:20 +00:00
Michael Natterer cb0f8d8d51 Simplify floating selection handling a bit more:
2009-02-07  Michael Natterer  <mitch@gimp.org>

	Simplify floating selection handling a bit more:

	* app/core/gimpdrawable.c
	(gimp_drawable_attach_floating_sel)
	(gimp_drawable_detach_floating_sel): call
	gimp_image_set_floating_selection() from these functions.

	* app/core/gimpfloatingselundo.c (gimp_floating_sel_undo_pop)
	* app/core/gimpimage.c (gimp_image_add,remove_layer)
	* app/core/gimplayer-floating-sel.c (floating_sel_to_layer): don't
	call it here because we already call above functions.


svn path=/trunk/; revision=28000
2009-02-07 19:23:32 +00:00
Michael Natterer bfb8e1e115 call gimp_drawable_invalidate_boundary(floating_sel). Fixes missing
2009-02-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.c
	(gimp_drawable_attach_floating_sel)
	(gimp_drawable_detach_floating_sel): call
	gimp_drawable_invalidate_boundary(floating_sel). Fixes missing
	selection update after turning a floating selection into a
	layer. It's called redundantly now when adding or deleting a
	floating selection, but that doesn't hurt much.

	* app/core/gimpfloatingselundo.c (gimp_floating_sel_undo_pop):
	don't call it here because we already call above functions.


svn path=/trunk/; revision=27999
2009-02-07 19:09:55 +00:00
Martin Nordholts ce697ffb54 Introduce and use gimp_image_map_update_undo_tiles()
Move undo tiles updating into a helper function
gimp_image_map_update_undo_tiles() so the logic of
gimp_image_map_apply() becomes clearer.

svn path=/trunk/; revision=27997
2009-02-07 09:31:10 +00:00
Martin Nordholts 2fa083c720 Introduce and use gimp_image_map_kill_any_idle_processors()
Introduce and use a local helper function
gimp_image_map_kill_any_idle_processors() to get a rid of some code
duplication.

svn path=/trunk/; revision=27996
2009-02-07 09:31:06 +00:00
Martin Nordholts ccaa981b50 Introduce and use gimp_image_map_cancel_any_idle_jobs()
Introduce and use a local helper function
gimp_image_map_cancel_any_idle_jobs() to get a rid of some code
duplication.

svn path=/trunk/; revision=27995
2009-02-07 09:31:01 +00:00
Martin Nordholts 72bb1965f8 Fix misindented return statement in gimpimagemap.c
svn path=/trunk/; revision=27994
2009-02-07 09:30:56 +00:00
Sven Neumann 30c118b53c Bug 520078 – Rotate brushes
2009-02-05  Sven Neumann  <sven@gimp.org>

	Bug 520078 – Rotate brushes

	Applied patch from Alexia Death:

	* app/core/gimpbrush.[ch]
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrush-transform.[ch]: affine transformations for
	brushes. So far only scaling and rotation is supported. The
	transformation is done using nearest-neighbour. This is a
	regression and we need to add back interpolation before the next
	release.

	* app/paint/gimpsmudge.c
	* app/paint/gimppaintoptions.[ch]
	* app/paint/gimpbrushcore.[ch]: allow to control the brush
	rotation angle.

	* app/tools/gimppaintoptions-gui.c
	* app/tools/gimpbrushtool.c: added UI for controlling the
	brush rotation angle.

	* app/actions/tools-actions.c
	* app/actions/tools-commands.[ch]: add actions for controlling 
the
	brush rotation angle.


svn path=/trunk/; revision=27987
2009-02-05 21:47:57 +00:00
Michael Natterer d2a716d37f app/core/gimpdrawable.h move the preview related members to the private
2009-02-05  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.h
	* app/core/gimpdrawable-preview.c: move the preview related
	members to the private struct.

	* app/core/gimpdrawable.c
	* app/core/gimpdrawable-private.h
	* app/core/gimpselection.c: changed accordingly.


svn path=/trunk/; revision=27986
2009-02-05 20:27:09 +00:00