Commit Graph

242 Commits

Author SHA1 Message Date
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
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
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
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 9a561646c2 Move the undo disable/freeze APIs to gimpimage-undo.[ch] 2010-02-09 22:32:48 +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 2b2464d6c8 Move the "flush_accum" to GimpImagePrivate 2010-02-05 09:13:25 +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
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 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
Michael Natterer f769284aca Start private struct for GimpImage and move the first members there 2010-02-03 20:31:25 +01: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 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 6aadd0bbc9 Rename gimp_image_pick_correlate_layer() to gimp_image_pick_layer() 2009-08-25 23:18:34 +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 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 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 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 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 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 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 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 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
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 200c002516 app: Add "exported" signal to GimpImage 2009-05-16 13:02:55 +02:00
Sven Neumann b25b979fc9 removed gimp_image_get_type_string() again.
2009-01-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: removed gimp_image_get_type_string()
	again.
	
	* app/display/gimpdisplayshell-title.c
	(gimp_display_shell_format_title): use the GimpImageBaseType 
enum
	instead.

	* app/tools/gimptool.c (gimp_tool_oper_update): if the image is
	empty and the tool can't handle that, display a message in the
	statusbar telling the user about this.


svn path=/trunk/; revision=27970
2009-01-29 21:32:30 +00:00
Martin Nordholts 3b79e36d30 New method to get a string representation of the image type.
* app/core/gimpimage.[ch] (gimp_image_get_type_string): New method
to get a string representation of the image type.

* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): Ask the GimpImage for an image
type string instead of making assumptions about its
implementation.

svn path=/trunk/; revision=27947
2009-01-25 19:21:52 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer f275cddbbf add member "gboolean floating_selection_changed".
2008-11-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch] (struct GimpImageFlushAccumulator):
	add member "gboolean floating_selection_changed".

	(gimp_image_set_floating_selection): new function which sets
	the image's floating_sel pointer and sets the flag in the
	accumulator to TRUE for later signal emission on flush.

	(gimp_image_projectable_flush): emit "floating-selection-changed"
	if the flag in the accumulator is TRUE.

	* app/core/gimpimage.c (gimp_image_add,remove_layer)
	* app/core/gimpfloatingselundo.c (gimp_floating_sel_undo_pop)
	* app/core/gimplayer-floating-sel.c (floating_sel_to_layer): use
	gimp_image_set_floating_selection() instead of setting
	image->floating_sel menually and remove all calls to
	gimp_image_floating_selection_changed().


svn path=/trunk/; revision=27650
2008-11-14 15:18:29 +00:00
Michael Natterer fb1660a4ea rename gimp_image_floating_sel() to gimp_image_get_floating_selection().
2008-11-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch]: rename gimp_image_floating_sel() to
	gimp_image_get_floating_selection().

	* app/actions/channels-actions.c
	* app/actions/image-actions.c
	* app/actions/layers-actions.c
	* app/actions/layers-commands.c
	* app/actions/select-actions.c
	* app/core/gimpdrawable.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/display/gimpdisplayshell-layer-select.c
	* app/display/gimpdisplayshell.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimpregionselecttool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptexttool.c
	* app/widgets/gimpdrawabletreeview.c
	* app/widgets/gimplayertreeview.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/image.pdb: changed accordingly, replaced some
	instances of direct acces by the accessor.

	* app/pdb/image-cmds.c: regenerated.


svn path=/trunk/; revision=27649
2008-11-14 15:01:44 +00:00
Sven Neumann ada8336822 added gimp_image_get_display_name().
2008-11-13  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: added gimp_image_get_display_name().

	* app/dialogs/palette-import-dialog.c
	* app/display/gimpdisplayshell-close.c
	* app/display/gimpdisplayshell-title.c
	* app/pdb/gimppdb-utils.c

	* app/widgets/gimpviewabledialog.c: use the new method instead 
of
	getting the image URI and mangling it with
	file_utils_uri_display_basename().


svn path=/trunk/; revision=27637
2008-11-13 12:09:05 +00:00
Michael Natterer c0cc7c1156 add new function gimp_drawable_stack_invalidate_previews() which does just
2008-11-05  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawablestack.[ch]: add new function
	gimp_drawable_stack_invalidate_previews() which does just what it
	says.

	* app/core/gimpimage.[ch]: merge invalidate_layer_previews() and
	invalidate_channels_previews() into a single invalidate_previews()
	and replace all calls to the old functions by calls to
	gimp_drawable_stack_invalidate_previews().

	* app/file/file-open.c: changed accordingly.


svn path=/trunk/; revision=27560
2008-11-05 20:48:59 +00:00
Michael Natterer 716e00f88b Unfinished first step to make the projection independent of GimpImage,
2008-11-04  Michael Natterer  <mitch@gimp.org>

	Unfinished first step to make the projection independent of
	GimpImage, also one step closer to layer grouping.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpprojectable.[ch]: add new interface which abstracts
	something that can have a projection attached to it. Has "update"
	and "flush" signals and get_graph() and get_image()
	vfuncs. get_image() is temporary until the hack is finishes.

	* app/core/gimpimage.[ch]: implement GimpProjectableInterface,
	remove "update" and "flush" signals and made get_graph() a private
	implementation of the interface method. Moved interface method
	implementations after virtual function implementations.

	* app/core/gimpprojection.[ch]: change member "image" to
	"projectable" and use the projectable API as often as
	possible. Still some implicit dependencies on the projectable
	being an image left but it's getting close.

	* app/core/gimpprojection-construct.c: same here.


svn path=/trunk/; revision=27552
2008-11-04 18:06:36 +00:00
Michael Natterer d1ca165b4e add new functions gimp_image_get_layer_iter(), channel_iter() and
2008-11-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch]: add new functions
	gimp_image_get_layer_iter(), channel_iter() and vectors_iter()
	which return the GList inside the resp. GimpList.

	* app/actions/channels-actions.c
	* app/actions/layers-actions.c
	* app/actions/vectors-actions.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-flip.c
	* app/core/gimpimage-item-list.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-rotate.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage.c
	* app/core/gimpimage.h
	* app/core/gimpprojection-construct.c
	* app/display/gimpdisplayshell-draw.c
	* app/file/file-open.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpdrawtool.c
	* app/vectors/gimpvectors-compat.c
	* app/vectors/gimpvectors-export.c
	* app/widgets/gimplayertreeview.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/image.pdb: use the new functions instead of
	peeking both into the image and the list. Remove inclusions of
	"gimplist.h" or change them into "gimpcontainer.h" if needed.

	* app/pdb/image-cmds.c: regenerated.


svn path=/trunk/; revision=27524
2008-11-02 20:46:57 +00:00