Commit Graph

26 Commits

Author SHA1 Message Date
Michael Natterer f60d456e61 app: add new parameter check function gimp_pdb_item_is_in_tree()
which makes sure the passed item is part of an item hierarchy
(and not for example a selection or a layer mask)
2010-07-23 22:08:28 +02:00
Michael Natterer 4097d3c300 app: add check that items passed through the PDB belong to the right image
Add "image" parameter to gimp_pdb_item_is_attached() and if non-NULL,
make sure the item is attached to that image, and not only attached to
any image. Change wrappers to pass an image where it makes sense.
2010-07-08 21:02:58 +02:00
Michael Natterer 22767ca7b8 Seal GimpData completely and add the missing accessors 2009-10-31 18:48:38 +01:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +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 074257bd37 Add gimp_pdb_item_is_not_group()
New function returns FALSE and sets an appropriate error if invoked on
a group item. Use it from gimp_pdb_get_vectors_stroke() because if we
ever get vectors groups, they will have no strokes.
2009-08-28 20:15:13 +02:00
Michael Natterer cb8a611e93 Don't PDB-modify locked vectors 2009-08-21 18:06:58 +02:00
Michael Natterer 345f88ab04 Make sure we don't PDB-modify locked text layers
* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" to
  gimp_pdb_layer_is_text_layer() because that's called on
  all text layers anyway.

* tools/pdbgen/pdb/text_layer.pdb
* tools/pdbgen/pdb/vectors.pdb: pass TRUE if we want to modify the layer.

* app/pdb/text-layer-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
2009-08-21 14:33:12 +02:00
Michael Natterer 28061c23f1 Don't modify locked items from PDB wrappers
* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" parameter to
  gimp_pdb_item_is_attached() because this function is called on
  almost all items where a check for locked is needed.

* tools/pdbgen/pdb/*.pdb: pass writable = TRUE in all checks for items
  that are modified. Add explicit calls to gimp_pdb_item_is_writable()
  in some rare cases.

* app/pdb/*-cmds.c: regenerated.
2009-08-20 20:47:01 +02:00
Michael Natterer 774850c46f Add gimp_pdb_item_is_writable() which sets an error if the item is locked 2009-08-20 18:50:55 +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 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 4981816c0b Make instance members private and add getters for required members.
* app/core/gimpdatafactory.[ch]: Make instance members private and
add getters for required members.

(gimp_data_factory_get_container)
(gimp_data_factory_get_gimp)
(gimp_data_factory_has_data_new_func): The new getters.

* app/actions/context-commands.c
* app/actions/data-commands.c
* app/core/gimp-gradients.c
* app/core/gimp.c
* app/core/gimpcontext.c
* app/core/gimpdatafactory.c
* app/core/gimpdatafactory.h
* app/dialogs/convert-dialog.c
* app/dialogs/palette-import-dialog.c
* app/pdb/gimppdb-utils.c
* app/widgets/gimpbrushfactoryview.c
* app/widgets/gimpdataeditor.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpselectiondata.c
* app/widgets/gimpviewablebox.c
* tools/pdbgen/pdb/brush_select.pdb
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/palette_select.pdb
* tools/pdbgen/pdb/palettes.pdb
* tools/pdbgen/pdb/pattern_select.pdb
* tools/pdbgen/pdb/patterns.pdb: Use the getters.


* app/pdb/brush-select-cmds.c
* app/pdb/brushes-cmds.c
* app/pdb/gradient-select-cmds.c
* app/pdb/gradients-cmds.c
* app/pdb/palette-select-cmds.c
* app/pdb/palettes-cmds.c
* app/pdb/pattern-select-cmds.c
* app/pdb/patterns-cmds.c: Regenerated.

svn path=/trunk/; revision=27812
2008-12-19 21:58:17 +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
Sven Neumann f26fb06dbc Bug 559292 – SOTA Chrome cannot accept different textures
2008-11-13  Sven Neumann  <sven@gimp.org>

	Bug 559292 – SOTA Chrome cannot accept different textures

	* app/pdb/gimppdb-utils.c (gimp_pdb_image_is_base_type)
	(gimp_pdb_image_is_not_base_type): gimp_object_get_name() may 
	return NULL for images. Use gimp_image_get_uri() instead.


svn path=/trunk/; revision=27635
2008-11-13 08:21:00 +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 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 68c21b49e9 Revert the change which adds GError parameters to
2008-09-17  Michael Natterer  <mitch@gimp.org>

	Revert the change which adds GError parameters to
	gimp_image_add_{channel,layer,vectors}():

	* app/actions/channels-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/gimpimage.[ch]
	* app/core/gimplayer-floating-sel.c
	* app/core/gimpselection.c
	* app/core/gimptemplate.c
	* app/display/gimpdisplayshell-dnd.c
	* app/text/gimptext-compat.c
	* app/tools/gimptexttool.c
	* app/tools/gimpvectortool.c
	* app/vectors/gimpvectors-import.c
	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpitemtreeview.[ch]
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c: revert.

	Instead, fix it at the PDB level:

	* app/core/gimpimage.c: turn the "added to wrong image" warning
	into a g_return_val_if_fail() assertion.

	* app/pdb/gimppdb-utils.[ch] (gimp_pdb_item_is_floating): add a
	"dest_image" parameter and fail if the passed item is not for this
	image.

	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paths.pdb: pass the dest image to
	gimp_pdb_item_is_floating().

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


svn path=/trunk/; revision=26970
2008-09-17 11:41:54 +00:00
Sven Neumann 62e6240b04 added test for floating items.
2008-04-04  Sven Neumann  <sven@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: added test for floating items.

	* tools/pdbgen/pdb/image.pdb: use it to improve error handling.

	* app/pdb/image_cmds.c: regenerated.


svn path=/trunk/; revision=25356
2008-04-04 07:21:27 +00:00
Sven Neumann 472fa72b12 improved error handling.
2008-04-04  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/image.pdb: improved error handling.

	* app/pdb/image_cmds.c: regenerated.


svn path=/trunk/; revision=25355
2008-04-04 07:11:13 +00:00
Sven Neumann 54e8c482d1 added utility functions to check the image base type.
2008-04-04  Sven Neumann  <sven@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: added utility functions to check 
the
	image base type.

	* tools/pdbgen/pdb/convert.pdb: use it so that we get a proper
	error set on failure.

	* app/pdb/convert_cmds.c: regenerated.


svn path=/trunk/; revision=25354
2008-04-04 06:57:42 +00:00
Michael Natterer 953a62b63d app/pdb/gimppdb-utils.c GIMP_PDB_CALLING_ERROR and
2008-04-03  Michael Natterer  <mitch@gimp.org>

	* app/pdb/gimppdb-utils.c
	* tools/pdbgen/pdb/text_layer.pdb: GIMP_PDB_CALLING_ERROR and
	GIMP_PDB_EXECUTION_ERROR are not from the GimpPdbErrorCode
	enum. Use GIMP_PDB_INVALID_ARGUMENT instead.

	* app/pdb/text_layer_cmds.c: regenerated.


svn path=/trunk/; revision=25351
2008-04-03 10:01:16 +00:00
Sven Neumann bd1feb95de added gimp_pdb_layer_is_text_layer().
2008-04-02  Sven Neumann  <sven@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: added 
gimp_pdb_layer_is_text_layer().


svn path=/trunk/; revision=25339
2008-04-02 20:35:53 +00:00
Michael Natterer bc5aa05440 add gimp_pdb_get_vectors_stroke() which is a replacement for
2008-03-06  Michael Natterer  <mitch@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: add gimp_pdb_get_vectors_stroke()
	which is a replacement for gimp_vectors_stroke_get_by_ID() and
	sets an error message if the stroke doesn't exist.

	* tools/pdbgen/pdb/vectors.pdb: use it.

	* app/pdb/vectors_cmds.c: regenerated.


svn path=/trunk/; revision=25051
2008-03-06 18:39:07 +00:00
Michael Natterer 9d3850bc20 add gimp_pdb_item_is_attached() which is a replacement for
2008-02-04  Michael Natterer  <mitch@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: add gimp_pdb_item_is_attached()
	which is a replacement for gimp_item_is_attached() and returns a
	proper error message.

	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/drawable_transform.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/floating_sel.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/text_tool.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: use it.

	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/drawable_transform_cmds.c
	* app/pdb/edit_cmds.c
	* app/pdb/floating_sel_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/paint_tools_cmds.c
	* app/pdb/selection_cmds.c
	* app/pdb/text_tool_cmds.c
	* app/pdb/transform_tools_cmds.c: regenerated.


svn path=/trunk/; revision=24790
2008-02-04 17:12:25 +00:00
Michael Natterer 2424e2bae4 app/pdb/Makefile.am new utility functions which look up brushes, patterns
2007-12-11  Michael Natterer  <mitch@gimp.org>

	* app/pdb/Makefile.am
	* app/pdb/gimppdb-utils.[ch]: new utility functions which look up
	brushes, patterns etc. and set appropriate error messages if the
	objects are not found.

	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/buffer.pdb
	* tools/pdbgen/pdb/context.pdb
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/pattern.pdb
	* tools/pdbgen/pdb/patterns.pdb: use them here. Also set non_empty
	to TRUE for all brush, pattern etc. names.

	* app/pdb/brush_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/buffer_cmds.c
	* app/pdb/context_cmds.c
	* app/pdb/convert_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/paint_tools_cmds.c
	* app/pdb/palette_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/pattern_cmds.c
	* app/pdb/patterns_cmds.c: regenerated.


svn path=/trunk/; revision=24318
2007-12-11 09:54:41 +00:00