Commit graph

557 commits

Author SHA1 Message Date
Michael Natterer 5c8ded8960 app: let the drawable keep around a pointer to its floating selection
Instead of getting the floating selection from the image. Change
gimp_drawable_has_floating_sel() to get_floating_sel() and remove the
"floating_sel" parameter from gimp_drawable_deatch_floating_sel().
This cleanup is one more step towards sanitizing floating selections,
and makes the crash fix in the next commit much much simpler.
2011-09-23 19:31:50 +02:00
Eric Grivel da37e9ff3e Bug 596410 - gimp-image-get-filename returns NULL for imported files
Make gimp_image_get_uri() and gimp_image_get_filename() behave as in
the GIMP 2.6 days. Add new functions gimp_image_get_xcf_uri(),
gimp_image_get_exported_uri() and gimp_image_get_imported_uri().
2011-08-12 21:15:16 +02:00
Martin Nordholts 0d529f7956 app: Use GimpIdTable 2011-05-04 22:54:35 +02:00
Michael Natterer cc47b2a600 libgimpwidgets/color: move the cairo color utility functions to libgimpcolor
Add CAIRO_CFLAGS to a lot of Makefiles to make this possible, and
because they pull in cairo via the libgimp headers.
2011-04-28 15:50:39 +02:00
Martin Nordholts 0d0ffd1265 Bug 644891 - Ctrl+e crashes gimp
Don't freak out if setting an URI on GimpImage that was getted with
the corresponding getter. Fix by Massimo.
2011-03-17 20:25:43 +01:00
Michael Natterer fcfb7cf160 Use the new g_[s]list_free_full() instead of foreach() and free() 2011-03-07 17:11:28 +01:00
Michael Natterer 616285fa7d app: fix possible warning when removing layers, channels or vectors
Don't call gimp_viewable_is_ancestor() on a NULL ancestor.
2011-03-04 01:49:32 +01:00
Michael Natterer 5b09e61c46 app: move all GimpTemplate members to private 2011-03-02 10:16:43 +01:00
Michael Natterer 9f89bda3b1 app: when removing groups, check if the active item was in the group
and set a new active item.
2011-02-14 01:25:45 +01:00
Michael Natterer 708555a378 app: keep a reference to channels and vectors around removing them
because we temporarily need them after removal from their item trees,
and bad things can happen if they are not kept alive by the undo stack
(like when undo is disabled while loading an image).
2011-02-07 11:35:58 +01:00
Martin Nordholts 366cddc856 app: gimp_image_get/set_imported/exported/save_a_copy_uri()
Add more proper core API for GimpImage URI management.
2011-02-02 22:28:46 +01:00
Martin Nordholts d449317501 app: Add and use gimp_image_get_string_untitled() 2011-02-02 22:28:46 +01:00
Michael Natterer 6a08376d49 app: add new virtual function GimpItem::unset_removed()
and implement it in GimpLayer to unset the removed flag on the layer
mask. Remove layer mask special casing from gimp_image_add_layer().
Make sure that all an item's children get their removed flag unset in
gimp_item_unset_removed().
2011-02-02 19:42:29 +01:00
Michael Natterer af160141db app: add gimp_item_unset_removed() and move item->removed to private 2011-01-30 21:57:45 +01:00
Michael Natterer 96efc7ea1c app: reset an item's "removed" state as it is added to its parent container
and not "manually" from the resp. undo functions.
2011-01-30 19:36:27 +01:00
Martin Nordholts 480d6e0cf2 app: Add and use gimp_image_get_uri() 2011-01-26 08:19:39 +01:00
Martin Nordholts ac773489e4 app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled() 2011-01-26 07:55:14 +01:00
Michael Natterer 5e4eee4653 app: implement GObject::constructed() instead of ::constructor() 2011-01-12 22:53:58 +01:00
Michael Natterer a27b6f5f47 app: keep a GimpPalette around that proxies the image's indexed colormap
and add it to the palette factory as internal object. Work in progress
on the way to getting rid of the ugly code in the colormap editor.
2010-10-27 15:40:43 +02:00
Michael Natterer f8d6821790 app: get rid of selection_control() in core/ and display/
- replace gimp_display_shell_selection_control() by undraw() and restart()
  which actually say what they are doing
- remove enum GimpSelectionControl
- replace GimpImage::selection_control() by ::selection_invalidate()
  because none of the other enum values was used any longer
2010-10-09 20:28:37 +02:00
Michael Natterer 55f01bf6f3 app: remove gimp_display_shell_draw_vectors()
which is the last bit of non-item drawing of stuff that is not
somehow the image itself... wheee!

This involves reverting commit
6bce0641d4 and adding back all the
vectors handlers that were in gimpdisplayshell-callbacks.c before.
Change the callbacks to manage proxy items for all the image's
vectors.
2010-10-08 01:03:56 +02:00
Sven Neumann 20ec80b20e app: formatting 2010-10-07 22:21:32 +02:00
Michael Natterer 26d0035be0 app: draw guides using GimpCanvasItems
- Add signals GimpImage::guide_added(), removed() and moved()
- Remove singal GimpImage::update_guide()
- Adapt core code to emit the new signals instead of update_guide()
- Have the shell connect to the new signals and update guide canvas
  items as needed
- Remove gimp_display_shell_draw_guides()
2010-10-01 10:34:15 +02:00
Michael Natterer 07051535da app: remove GimpImage signal "update-sample-point" 2010-10-01 09:27:57 +02:00
Michael Natterer 0c613ba87d app: port sample point drawing to GimpCanvasItems
- Add GimpImage signal "sample-point-moved" and emit it when needed
- Let the shell connect to the sample point add, remove and move signals
  and update the canvas items accordingly
- Remove gimp_display_shell_draw_sample_points()
2010-10-01 09:27:57 +02:00
Sven Neumann 8cfb8c2143 app: update vectors from the freeze handler as well
This is needed so that the area covered by the vectors before the
change is exposed. Ideally of course the update signal should
include the changed area.
2010-09-17 21:28:30 +02:00
Michael Natterer 6bce0641d4 app: add signal GimpImage::update_vectors() and have the image manage updates
...just as we do for drawables. Connect to adding, removing, modifying
and toggling visibility of all vectors and emit "update-vectors"
accordingly. Add an update-vectors signal handler to GimpDisplayShell
and remove all other vectors handlers.
2010-09-17 11:31:57 +02:00
Michael Natterer 314a6ab926 app: merge the layer, channel and vectors repositioning APIs
into an API based on GimpItem.
2010-07-08 18:08:13 +02:00
Barak Itkin 5930b13084 app: add context to all undo descriptions
Description of undo actions should be marked as action descriptions,
and not as commands. This is required for translation for some
language (like Hebrew) that require a different grammatical tense for
describing actions
2010-06-09 18:50:23 +02:00
Michael Natterer 6650693d29 app: move gimp_image_pick_layer() to its own file
and add a (still unused) text layer picking function.
2010-03-07 01:55:31 +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 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 7bb64cd864 Nuke two more local variables that make no sense any longer 2010-02-09 22:32:45 +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 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 5de2482526 Add some comment to group the functions 2010-02-09 22:32:37 +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 5455ce895d Cause less eye cancer 2010-02-07 15:27:21 +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 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 2b2464d6c8 Move the "flush_accum" to GimpImagePrivate 2010-02-05 09:13:25 +01:00