Commit Graph

318 Commits

Author SHA1 Message Date
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 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 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 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 5b85642e94 Reorder some functions so item and drawable methods are together 2009-09-04 11:31:19 +02:00
Michael Natterer b2fa005445 Chain up unconditionally in GimpViewable::invalidate_preview() 2009-09-01 23:36:46 +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
Michael Natterer d84e48a82f Make "item" parameter of GimpItem::is_attached() const 2009-08-29 19:47:52 +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
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 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 9c4a2ab4ea Move layer mask related functions together 2009-07-30 18:59:12 +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
Martin Nordholts 431cb58e85 Add const qualifier to gimp_layer_get_floating_sel_drawable().
svn path=/trunk/; revision=27974
2009-02-01 10:22:22 +00:00
Michael Natterer 521555c439 add new accessor gimp_layer_get_floating_sel_drawable() which returns the
2009-01-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: add new accessor
	gimp_layer_get_floating_sel_drawable() which returns the drawable
	the floating layer is attached to.

	* app/core/gimpdrawable.c
	* app/core/gimpfloatingselundo.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-quick-mask.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/core/gimplayer-floating-sel.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/image.pdb: use it instead of accessing
	layer->fs.drawable directly.

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


svn path=/trunk/; revision=27962
2009-01-26 22:47:16 +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
Martin Nordholts d37193fe18 Use gimp_item_set/get_image() instead of accessing the instance
member directly.

* app/core/gimpchannel.c
* app/core/gimpdrawable-brightness-contrast.c
* app/core/gimpdrawable-color-balance.c
* app/core/gimpdrawable-colorize.c
* app/core/gimpdrawable-curves.c
* app/core/gimpdrawable-desaturate.c
* app/core/gimpdrawable-hue-saturation.c
* app/core/gimpdrawable-invert.c
* app/core/gimpdrawable-levels.c
* app/core/gimpdrawable-posterize.c
* app/core/gimpdrawable-threshold.c
* app/core/gimplayer.c
* app/core/gimplayermask.c
* app/core/gimpselection.c
* app/dialogs/layer-add-mask-dialog.c
* app/text/gimptextlayer-xcf.c
* app/tools/gimprectangletool.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/vectors/gimpvectors-preview.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/layer.pdb

* app/pdb/layer-cmds.c: Regenerated.

svn path=/trunk/; revision=27840
2008-12-28 00:09:33 +00:00
Sven Neumann 83c66baef5 app/core/gimpchannel.c app/core/gimpdrawable-operation.c
2008-12-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-operation.c
	* app/core/gimpdrawablestack.c
	* app/core/gimpimage.c
	* app/core/gimpimagemap.c
	* app/core/gimplayer.c
	* app/core/gimpprojection.c: gegl_node_add_child() and
	gegl_node_remove_child() are public API in GEGL now.


svn path=/trunk/; revision=27770
2008-12-08 09:56:51 +00:00
Michael Natterer 49e65f1b84 add read-only "mask" property.
2008-11-20  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c: add read-only "mask" property.


svn path=/trunk/; revision=27689
2008-11-19 23:37:15 +00:00
Michael Natterer 6b579085a3 add boolean property "floating-selection" which indicates if the layer is
2008-11-17  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: add boolean property
	"floating-selection" which indicates if the layer is a floating
	selection. Add new API gimp_layer_set_floating_sel_drawable()
	which sets layer->fs.drawable and emits notify on the property.
	Did some minor cleanup in the existing property code.

	* app/core/gimpfloatingselundo.c: use the new function instead of
	setting layer->fs.drawable manually.

	* app/core/gimplayer-floating-sel.c: same here. Remove some
	includes and local variables that are obsolete.


svn path=/trunk/; revision=27676
2008-11-17 00:02:15 +00:00
Sven Neumann b37c8bcf0a app/core/Makefile.am added GIMP_ERROR as general error domain.
2008-11-12  Sven Neumann  <sven@gimp.org>

	* app/core/Makefile.am
	* app/core/gimperror.[ch]: added GIMP_ERROR as general error 
domain.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/core/gimptooloptions.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpheal.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimpperspectiveclone.c
	* app/paint/gimpsourcecore.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdesaturatetool.c
	* app/tools/gimpgegltool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c
	* app/vectors/gimpvectors-import.c: use GIMP_ERROR as error 
domain
	instead of 0, which is not accepted by g_set_error_literal().

	* app/gui/session.c
	* app/menus/menus.c
	* app/vectors/gimpvectors-export.c
	* app/widgets/gimpdevices.c: use G_FILE_ERROR as error domain 
for
	file errors.


svn path=/trunk/; revision=27628
2008-11-12 10:56:06 +00:00
Michael Natterer 855b114f50 Bye bye floating_sel_rigor() and floating_sel_relax():
2008-11-09  Michael Natterer  <mitch@gimp.org>

	Bye bye floating_sel_rigor() and floating_sel_relax():

	* app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region):
	implement compositing the floating selection on the fly. Add
	return parameter "TileManager **temp_tiles" which returns the temp
	buffer used for compositing; the caller has to unref the tiles.

	* app/core/gimpchannel-project.c
	* app/core/gimplayer-project.c: unref the temp_tiles.

	* app/core/gimplayer.[ch]: remove members fs.backing_store and
	fs.initial.

	* app/core/gimplayer-floating-sel.[ch]: remove functions rigor(),
	relax(), store() and restore(), they are not needed any longer.
	Some minor cleanup, more to come.

	* app/core/gimpprojection-construct.c: don't composite the
	floating selection before projecting because that happens on the
	fly now.

	* app/core/core-enums.[ch]
	* app/core/gimpfloatingselundo.c
	* app/core/gimpimage-undo-push.[ch]: remove the rigor and relax
	undos.

	* app/core/gimpdrawable.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/xcf/xcf-save.c: remove all calls to rigor and relax and all
	implementations of virtual functions that were just there to
	rigor/releax around chaining up.

	* tools/pdbgen/pdb/floating_sel.pdb: remove all code from the
	rigor and relax wrappers and deprecate the API.

	* app/pdb/floating-sel-cmds.c
	* libgimp/gimpfloatingsel_pdb.[ch]: regenerated.

	* plug-ins/file-xjt/xjt.c: don't call rigor and relax.


svn path=/trunk/; revision=27579
2008-11-09 16:49:37 +00:00
Michael Natterer 6d2a6d5efa Abstract the legacy projection code away into a virtual function of
2008-11-08  Michael Natterer  <mitch@gimp.org>

	Abstract the legacy projection code away into a virtual function
	of GimpDrawable:

	* app/core/gimpdrawable.[ch]: add new virtual function
	GimpDrawable::project_region() which projects an area of a
	drawable onto a passed in PixelRegion.

	* app/core/Makefile.am
	* app/core/gimpchannel-project.[ch]
	* app/core/gimplayer-project.[ch]: new files which implement it.

	* app/core/gimpchannel.c
	* app/core/gimplayer.c: hook it in.

	* app/core/gimpprojection-construct.c: get rid all the projection
	code moved to above new files and project all drawables in one
	loop.

	* app/core/gimpprojectable.[ch]: remove the legacy methods
	get_colormap() and get_components(), they are not needed any
	longer.

	* app/core/gimpimage.c: changed accordingly.


svn path=/trunk/; revision=27571
2008-11-08 00:16:40 +00:00
Sven Neumann 4762b73403 bumped minimum required version of GLib to 2.18.0.
2008-11-04  Sven Neumann  <sven@sven>

	* configure.in: bumped minimum required version of GLib to 
2.18.0.

	* INSTALL: document the updated dependency.

	* app/core/gimp.[ch]: introduced gimp_message_literal(), a 
variant
	of gimp_message() that takes a literal string.

	* app/errors.[ch]: removed format arguments from 
gimp_fatal_error()
	and gimp_terminate() and let them take a literal string instead.

	* app/tools/gimptool.[ch]: introduced 
gimp_tool_message_literal(),
	a variant of gimp_tool_message() that takes a literal string.

	* app/actions/documents-commands.c
	* app/actions/drawable-commands.c
	* app/actions/edit-commands.c
	* app/actions/error-console-commands.c
	* app/actions/file-commands.c
	* app/actions/gradients-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/palettes-commands.c
	* app/actions/plug-in-commands.c
	* app/actions/select-commands.c
	* app/actions/vectors-commands.c
	* app/config/gimprc.c
	* app/core/gimp-modules.c
	* app/core/gimp-parasites.c
	* app/core/gimp-templates.c
	* app/core/gimp-units.c
	* app/core/gimpchannel.c
	* app/core/gimpcontainer-filter.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage.c
	* app/core/gimpimagefile.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/dialogs/convert-dialog.c
	* app/dialogs/dialogs.c
	* app/dialogs/palette-import-dialog.c
	* app/dialogs/preferences-dialog.c
	* app/dialogs/quit-dialog.c
	* app/dialogs/stroke-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/file/file-open.c
	* app/file/file-procedure.c
	* app/file/file-save.c
	* app/file/file-utils.c
	* app/gegl/gimpcurvesconfig.c
	* app/gegl/gimplevelsconfig.c
	* app/gui/gui-message.c
	* app/gui/gui.c
	* app/gui/session.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpheal.c
	* app/paint/gimpperspectiveclone.c
	* app/paint/gimpsourcecore.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/gimpplugin-message.c
	* app/plug-in/gimpplugin.c
	* app/plug-in/gimppluginmanager-restore.c
	* app/plug-in/gimppluginprocedure.c
	* app/text/gimptextlayer.c
	* app/tools/gimp-tools.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdesaturatetool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpgegltool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpimagemaptool-settings.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimpsourcetool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpactionview.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimpcontrollers.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpdevices.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimperrordialog.c
	* app/widgets/gimphelp.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimppdbdialog.c
	* app/widgets/gimpsettingsbox.c
	* app/widgets/gimpvectorstreeview.c
	* app/widgets/gimpwidgets-utils.c
	* app/xcf/xcf-load.c
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/floating_sel.pdb
	* tools/pdbgen/pdb/image.pdb: use the _literal variants for
	g_set_error(), gimp_message() and gimp_tool_message().

	* app/pdb/convert-cmds.c
	* app/pdb/edit-cmds.c
	* app/pdb/floating-sel-cmds.c
	* app/pdb/image-cmds.c: regenerated.


svn path=/trunk/; revision=27548
2008-11-04 12:33:09 +00:00
Michael Natterer b994ab724e app/core/gimp-edit.c app/core/gimpchannel.c
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp-edit.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpdrawablemodundo.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/text/gimptext-compat.c
	* app/text/gimptextlayer-xcf.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb: use accessors for item->offset_x,y.
	Some minor unrelated cleanups.

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


svn path=/trunk/; revision=27537
2008-11-03 21:17:50 +00:00
Michael Natterer 56b5909c8a add "GimpImageType type" parameter because there are only a few calls to
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
	"GimpImageType type" parameter because there are only a few calls
	to this function which (can easily pass the current type); however
	most calls to gimp_drawable_set_tiles_full() were just using the
	function because of the type argument and passed in the item's
	current offsets (which means peeking into the item struct or using
	temp variables).

	* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
	* app/text/gimptextlayer.c (gimp_text_layer_render)
	* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
	the type to set_tiles().

	* app/core/gimpchannel.c (gimp_channel_convert)
	* app/core/gimpimage-convert.c (gimp_image_convert)
	* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
	change calls to set_tiles_full() into set_tiles() because the
	offset doesn't change.


svn path=/trunk/; revision=27535
2008-11-03 20:51:46 +00:00
Michael Natterer 740ab5e633 renamed gimp_item_width() to gimp_item_get_width() and gimp_item_height()
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: renamed
	gimp_item_width() to gimp_item_get_width() and
	gimp_item_height() to gimp_item_get_height().

	* app/actions/channels-commands.c
	* app/actions/drawable-commands.c
	* app/actions/layers-commands.c
	* app/core/<many>.c
	* app/dialogs/offset-dialog.c
	* app/dialogs/resize-dialog.c
	* app/dialogs/scale-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimpink.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsmudge.c
	* app/text/gimptextlayer-xcf.c
	* app/text/gimptextlayer.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimpregionselecttool.c
	* app/tools/gimptexttool.c
	* app/vectors/gimpvectors.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/widgets/gimpviewrenderervectors.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/drawable.pdb: changed accordingly.

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


svn path=/trunk/; revision=27531
2008-11-03 00:09:01 +00:00
Michael Natterer 5b68a1d0eb renamed gimp_item_offsets() to gimp_item_get_offset() and
2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: renamed
	gimp_item_offsets() to gimp_item_get_offset() and
	gimp_item_set_offsets() to gimp_item_set_offset().

	* app/actions/drawable-commands.c
	* app/actions/layers-commands.c
	* app/core/<many>.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-preview.c
	* app/display/gimpdisplayshell-transform.c
	* app/display/gimpdisplayshell.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsourcecore.c
	* app/text/gimptextlayer-xcf.c
	* app/tools/<many>.c
	* app/widgets/gimptoolbox-dnd.c
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/drawable_transform.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/transform_tools.pdb
	* tools/pdbgen/pdb/vectors.pdb: changed accordingly.

	* app/pdb/drawable-cmds.c
	* app/pdb/drawable-transform-cmds.c
	* app/pdb/selection-cmds.c
	* app/pdb/vectors-cmds.c
	* app/pdb/transform-tools-cmds.c: regenerated.


svn path=/trunk/; revision=27529
2008-11-02 23:03:29 +00:00
Martin Nordholts 93577a2eec Moved the shift_node from GimpLayer to GimpItem, and call it offset_node.
* app/core/gimpitem.[ch]: Moved the shift_node from GimpLayer to
GimpItem, and call it offset_node. Also added
gimp_item_get_offset_node() meant to be used in the same way as
gimp_item_offsets().

(gimp_item_real_translate): Keep the offset_node up to date.

* app/core/gimplayer.[ch]: Don't manage the offset_node, get it
from GimpItem instead.

svn path=/trunk/; revision=27527
2008-11-02 22:29:05 +00:00
Michael Natterer 50ac74be1e remove the mask_node and simply set both opacity and the layer mask's
2008-11-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: remove the mask_node and simply set
	both opacity and the layer mask's source node on the opacity_node.
	Needs latest SVN GEGL.


svn path=/trunk/; revision=27522
2008-11-02 18:39:10 +00:00
Martin Nordholts 24fac1de0f Move the base GeglNode here in preparation for moving the GimpLayer
* app/core/gimpitem.[ch]: Move the base GeglNode here in
preparation for moving the GimpLayer gegl:shift op to here as
well. After all, the offsets are properties of GimpItem and not
GimpLayer.

* app/core/gimpdrawable.[ch]: Delegate appropriate stuff to the
GimpItem base class, like part of the visibility toggling and the
creation and destruction of the GimpItem node.

* app/core/gimplayer.c
* app/core/gimpchannel.c
* app/core/gimpdrawablestack.c: Changed accordingly, use the new
function names.

* app/core/gimpitempropundo.c
* app/vectors/gimpvectors-warp.c
* app/vectors/gimpvectorsmodundo.c: Include gegl.h instead of
glib-object.h

svn path=/trunk/; revision=27521
2008-11-02 16:39:38 +00:00
Martin Nordholts 1f7b2c257e Completed the rename with gimp:layer-mode -> gimp:point-layer-mode and
* app/gegl/gimpoperationpointlayermode.c: Completed the rename
with gimp:layer-mode -> gimp:point-layer-mode and also did some
formating.

* app/core/gimplayer.c: Changed accordingly.

svn path=/trunk/; revision=27408
2008-10-25 21:02:46 +00:00
Martin Nordholts 1a19f7315a Instead of having one GEGL operation per layer mode, make
GimpOperationLayerMode instantiable and add a GimpLayerModeEffects
property to it that we check in ::process() to blend pixels
together.

* app/gegl/gimpoperationlayermode.[ch]: Do the change described
above. Currently only Normal and Addition are implemented. Normal
so that we don't need a special case for the gegl:normal op. Also,
the Dissolve layer mode is not a point op and needs to be
implemented elsewhere.

* app/gegl/gimpoperation*mode.c: Removed.

* app/gegl/gimp-gegl-utils.[ch]: Removed
gimp_layer_mode_to_gegl_operation().

* app/core/gimplayer.c

* app/gegl/Makefile.am
* app/gegl/gimp-gegl.c: Adapt.

svn path=/trunk/; revision=27400
2008-10-25 13:29:55 +00:00
Michael Natterer 880a699cae configure.in require GEGL >= 0.0.21.
2008-10-14  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* app/sanity.c: require GEGL >= 0.0.21.

	* app/core/gimpchannel.c
	* app/core/gimpdrawable-brightness-contrast.c
	* app/core/gimpdrawable-invert.c
	* app/core/gimpimage.c
	* app/core/gimpimagemap.c
	* app/core/gimplayer.c
	* app/gegl/gimp-gegl-utils.c
	* app/tools/gimpbrightnesscontrasttool.c: GEGL operation names
	are now "gegl:"-prefixed.

	* app/core/gimpimagemap.c: set the node's "dont-cache" property
	unconditionally.


svn path=/trunk/; revision=27284
2008-10-14 22:44:42 +00:00
Michael Natterer 5fa6af0e1f add a default implementation of GimpDrawable::get_node() which contains a
2008-10-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: add a default implementation of
	GimpDrawable::get_node() which contains a layer mode node.
	Implement GimpItem::visibility_changed() and turn the node into a
	nop when the drawable is invisible. Added public function
	gimp_drawable_get_mode_node() so subclasses can plug stuff
	into its "aux" pad.

	* app/core/gimplayer.[ch]
	* app/core/gimpchannel.[ch]: changed accordingly (remove
	duplicated member and code that is now in GimpDrawable).


svn path=/trunk/; revision=27277
2008-10-14 18:32:07 +00:00
Michael Natterer e28e864ac6 remove obsolete assertion and redundant cast.
2008-10-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_get_node): remove obsolete
	assertion and redundant cast.


svn path=/trunk/; revision=27229
2008-10-11 10:23:01 +00:00
Michael Natterer b479b7b346 add virtual function GimpDrawable::get_node() which returns a node to be
2008-10-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: add virtual function
	GimpDrawable::get_node() which returns a node to be plugged into
	the projection.

	* app/core/gimplayer.[ch]: remove public get_node() api and
	implement the virtual function instead.

	* app/core/gimpimage.c: changed accordingly.


svn path=/trunk/; revision=27211
2008-10-10 19:36:17 +00:00
Michael Natterer 5ad366c642 implement GimpItem::visibility-changed and turn the layer's node into a
2008-10-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c: implement GimpItem::visibility-changed
	and turn the layer's node into a nop when the layer is invisible.

	(gimp_layer_get_node): connect the stuff to a nop here too for
	invisible layers.


svn path=/trunk/; revision=27208
2008-10-10 13:52:13 +00:00
Michael Natterer f2a6b781e4 the "shift" operation's x and y properties are doubles not ints.
2008-10-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_translate)
	(gimp_layer_get_node): the "shift" operation's x and y properties
	are doubles not ints.

	(gimp_layer_apply_mask): properly disconnect the mask node.

	(gimp_layer_set_opacity): the opacity node has a "value" property,
	not "opacity".


svn path=/trunk/; revision=27205
2008-10-10 11:30:56 +00:00
Michael Natterer 517e58cdeb Address Bug 554983 – Layers Projection using GEGL
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Address Bug 554983 – Layers Projection using GEGL

	* app/gegl/gimp-gegl-utils.[ch]: add (imcomplete) function
	gimp_layer_mode_to_gegl_operation() from bug #554983.

	* app/core/gimpdrawable.[ch]: add gimp_drawable_get_source_node()
	which returns a GimpOperationTileSource for the drawable's
	tiles.

	(gimp_drawable_real_set_tiles)
	(gimp_drawable_configure): set the node's "tiles" property.

	* app/core/gimplayer.[ch]: add gimp_layer_get_node() which returns
	a GeglNode with proxy "input" and "output" pads to be plugged
	into the projection graph. The node has children for opacity,
	mask, layer mode and layer offset.

	(gimp_layer_translate)
	(gimp_layer_add_mask)
	(gimp_layer_apply_mask)
	(gimp_layer_set_opacity)
	(gimp_layer_set_mode): reconfigure the respective nodes.

	* app/core/gimpimage.[ch]: keep a "graph" node around and destroy
	it in finalize(). Not even a stub, just a silly GEGL dependency.


svn path=/trunk/; revision=27204
2008-10-09 20:44:23 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

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

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +00:00
Michael Natterer eed8f2c326 g_return_if_fail() on the mask's image being the same as the layer's
2008-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.c (gimp_layer_add_mask): g_return_if_fail()
	on the mask's image being the same as the layer's image. The PDB
	already checks for this.

	* app/core/gimpimage.c (gimp_image_add_layer,channel,vectors):
	remove calls to gimp_item_set_image() because we only accept
	itmes of this image anyway.


svn path=/trunk/; revision=27138
2008-10-06 09:26:44 +00:00
Michael Natterer d2307c1bf6 add GError parameter and replace g_message() by g_set_error().
2008-09-15  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch] (gimp_layer_add_mask): add GError
	parameter and replace g_message() by g_set_error().

	* app/core/gimplayermaskundo.c
	* app/xcf/xcf-load.c
	* app/actions/layers-commands.c: pass NULL errors since these
	places know what they are doing. Ha ha...

	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/image.pdb: pass the error so we get more real
	error messages for failed PDB calls.

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


svn path=/trunk/; revision=26948
2008-09-15 21:05:01 +00:00
Sven Neumann 876b7ad14c allow to pass NULL for the 'name' parameter. This will be handled just
2008-08-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimplayer.c (gimp_layer_new_from_tiles)
	(gimp_layer_new_from_pixbuf) (gimp_layer_new_from_region): allow
	to pass NULL for the 'name' parameter. This will be handled just
	like in gimp_layer_new().


svn path=/trunk/; revision=26434
2008-08-08 07:52:06 +00:00