Commit Graph

34 Commits

Author SHA1 Message Date
Alx Sa e8df68fb65 libgimp, app, pdb: Rename GimpVectors to GimpPath
This commit renames the GimpVectors
object to GimpPath in both app/core and
in libgimp. It also renames the files
to gimppath.[ch] and updates the relevant
build and translation files.
There are still outstanding gimp_vectors_* ()
functions on the app side that need to be renamed
in a subsequent commit.
2024-07-12 06:16:25 +00:00
Alx Sa b90b6bce00 pdb, libgimp: Rename libgimp GimpVectors vectors API...
...to paths
Follow-up to d0bdbdfd. Changes all
gimp_vectors_* () PDB to gimp_path_* ()
and renames relevant PDB files from
vectors to path.
The next step will be to rename
GimpVectors in libgimp to GimpPath,
removing the last (public) trace of it.
2024-07-08 23:39:51 +00:00
Jehan eab9d8da28 app, libgimp, pdb: new PDB function gimp_fonts_get_by_name().
It returns all the fonts (possibly more than 1) with a given name. I left the
function gimp_font_get_by_name() as a utility when one don't want to choose (or
is not able anyway, e.g. a script with minimal information), though I wondered
if we should not simplify with a single function (the new one, which is the
correct one now that it is possible to have several fonts with a given name).

It is easy to test with fonts named the same. For instance I could find 2
different fonts, both named 'Holiday'. This call in the Python console returns
both:

> Gimp.fonts_get_by_name('Holiday')

As part of this commit, I also implemented resource arrays (or subtype arrays)
as PDB arguments and return types.
2023-10-02 23:22:49 +02:00
Jehan 38c717b149 app, libgimp, pdb: private _gimp_resource_get_by_identifiers() PDB function.
This finds the core resource knowing its type, name, collection and internal
state (in other words, the values returned by _gimp_resource_get_identifiers()).
2023-07-27 15:32:16 +02:00
Jehan d439e9ff5c app, libgimp, pdb: factorize a bunch of similar code into gimp_pdb_get_resource().
Rather than reimplementing the same checks for every possible resource data
type, just do it once and redirect to the correct factory container.

For the libgimp API, we leave per-type functions `gimp_*_get_by_name()` (where *
can be brush|gradient|font|palette|pattern so far), but internally they all use
gimp_pdb_get_resource().

Note that eventually we want these functions to return a list of resources as it
should be possible to have several resources of a given type with the same name
(since they are made by third-party who might have had the same idea of a name).
2023-07-27 15:25:32 +02:00
Michael Natterer a858474fe8 pdb: GimpResource: add is_editable(), rename(), duplicate(). delete()
and remove the API from its subclasses.
2023-06-06 16:33:36 +02:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Michael Natterer 11ce199cea app: stop canonicalizing procedure names
on behalf of plug-in authors who have no style or can't type.

Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
2019-08-18 01:55:47 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Jehan 38a2887802 app, pdb: s/gimp_pdb_item_is_modifyable/gimp_pdb_item_is_modifiable/
Fix proper English.
2018-04-20 23:34:01 +02:00
Ell bccef43049 app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable().  Currently, the only such
object is the custom gradient.

Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.

Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter.  Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 17:22:29 -04:00
Michael Natterer d7bf9de526 Bug 759104 - Allow coordinates of sample points to be accessed from scripts
Add PDB sample point API similar to how the guide API works. Add core
API similar to the core guide API to make guide and sample point APIs
as similar as possible.
2016-01-04 21:24:44 +01:00
Michael Natterer 80f713c9b8 pdb, libgimp: add gimp_context_set/get_mypaint_brush() 2016-01-02 13:40:38 +01:00
Michael Natterer c1f7ec52a8 app: add gimp_pdb_image_get_guide() and use it in the guide PDB wrappers
It returns a proper error message if a guide ID doesn't exist.
2014-07-10 20:24:10 +02:00
Michael Natterer 5732088b0c pdb: replace gimppdb-utils' "writable" boolean by a bitmask
called GimpPDBItemModify that currently has one member
GIMP_PDB_ITEM_CONTENT, in order to be prepared for adding
the "lock position" feature from bug 674160.
2012-11-08 20:46:18 +01:00
Michael Natterer 3e4edc1aea pdb/libgimp: export enum GimpPrecision and gimp-image-convert-precision 2012-05-02 17:51:17 +02:00
Michael Natterer 2857c1c031 pdb: don't allow to convert non-u8 images to indexed 2012-05-02 17:51:16 +02:00
Michael Natterer 01344f811d pdb: add dynamics accessors to the context procedures 2011-10-31 21:08:12 +01:00
Michael Natterer ab852d7409 pdb: add proper error messages for gimp_image_reorder_item() 2010-08-31 17:07:27 +02:00
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 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
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 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 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
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