These function names look like they should be applied to a
GimpPaletteEntry, which is a type which doesn't exist in libgimp. This
naming is much more appropriate.
GBytes are a bit annoying to handle, so I'm renaming the PDB procedure
to a private _gimp_palette_get_bytes() instead, and making a wrapper
function which returns a C array and both the number of colors or number
of bytes. The latter is needed for introspection (otherwise the binding
can't know the size of the C array), but for the C API, both these
returned integers can be considered redundant (since one can be computed
from the oher), so only one at a time is mandatory.
Without this, there is no easy way to quietly check for existence of a resource by name.
Needed when plugin authors can name defaults for resource args by name.
Add tests to script-fu/test/tests
Until now, it was not really possible to delete a colormap color, but since we
now use GimpPalette, people would definitely try to do so. It just makes sense
to allow doing this, but only if the color is unused.
Additionally when we do this, all the pixels refering to bigger indexes will be
edited so that they continue to refer to the same color (bigger indexes are
shifted by -1). Therefore removing an unused color does not change the image
render.
I wondered if we might want more options, e.g. the ability to delete a color
without fixing indexes (i.e. that colors over the deleted color index would
shift to the next color). This would even allow to delete used colors (though
now the last index would have to be unused one, unless we cycle colors).
Yet I don't think this should belong to this basic API. The most expected
behavior when deleting a color from an image colormap is to fix all indexes
stored in pixels so that the image still shows the same. So that's what this
function will do in this generic usage.
Resources are stored by the plug-in infrastructure and their memory should not
be managed by plug-in code.
My commit 4f69995b46 was crappy and modified a generated function. I was just
too tired with all the heat in here, I guess!
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.
modified: libgimp/gimpplugin-private.h
So procedures can declare args and GimpProcedureDialog show chooser
widgets
Fix so is no error dialog on id_is_valid for resources
Palette.pdb changes and testing
Memory mgt changes
Gradient pdb
Font and Pattern tests
Test brush, palette
Cleanup, remove generator
Rebase, edit docs, install test-dialog.py
Whitespace, and fix failed distcheck
Fix some clang-format, fix fail distcheck
Fix distcheck
Cleanup from review Jehan
Fix the dependency by making the stamp an actual (yet empty/no-op)
header file which is included by all generated source file. This way, we
ensure that meson rebuild .o files when the .pdb sources are changed.
This is the second solution proposed by eli-schwartz here:
https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080053413
So a value array can now we created like this:
array = gimp_value_array_new_from_types (&error_msg,
G_TYPE_STRING, "foo",
G_TYPE_INT, 23,
G_TYPE_NONE);
Change PDB generation to use this, which makes for much nicer code in
the libgimp wrappers, and only set arrays separately instead of all
values.
Also generate comments like "Must be freed with g_free()" for all
return values instead of manually and inconsistently having them on
some return values only.
This reverts commit 833666d462.
The _pdb files are an implementation detail and we do not want
separate doc sections for them, the conflicts need so be resolved in
another way.
Otherwise we get a few duplicate sections since some of the non-PDB
files are named similarly.
Fix this GObject introspection warning and other similar warnings:
> libgimp/gimp_pdb.c:28: Warning: Gimp: multiple comment blocks
> documenting 'SECTION:gimp:' identifier (already seen at gimp.c:129).
All foo_pdb.c functions in libgimp regenerated. I have reviewed this a
dozen times, but please have a look, there might well be glitches and
our public API is sortof important...
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
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
2008-07-14 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/palette.pdb: added new PDB function
gimp-palette-get-colors that retrieves all colors from a palette
in a single call. Based on patches from bug #332206.
* app/pdb/palette-cmds.c
* app/pdb/internal-procs.c
* libgimp/gimppalette_pdb.[ch]: regenerated.
* libgimp/gimp.def: updated.
svn path=/trunk/; revision=26192
2005-08-03 Michael Natterer <mitch@gimp.org>
Changed naming scheme for PDB procedure names from
random_crap_that_traditionally_has_underscores to
enforced-canonical-identifiers. I'm pretty sure some things are
broken after this commit. More changes to come...
* libgimpbase/gimpbase.def
* libgimpbase/gimputils.[ch]: added gimp_canonicalize_identifier().
* app/pdb/procedural_db.[ch] (struct ProcRecord): added
"gchar *original_name" to keep a procedure's original name as
reigstered by plug-ins (compat cruft).
(procedural_db_init_procs): canonicalized list of deprecated
procedures.
* app/plug-in/plug-in-proc-def.c (plug_in_proc_def_free): free
original_name.
* app/plug-in/plug-in-message.c: canonicalize procedure names
which are received over the wire.
* app/plug-in/plug-in-rc.c: serialize the original_name and create
the canonicalized name on-the-fly when deserializing.
* app/plug-in/plug-in-run.c: pass the original_name to plug-ins
when running them because they strcmp() the passed procedure name.
* app/plug-in/plug-ins.c (plug_ins_add_to_db): pass
canonical procedure names to procedural_db_execute().
(plug_ins_file_proc_compare): special-case "gimp-xcf", not "gimp_xcf".
* app/xcf/xcf.c: changed static XCF procedures accordingly.
* tools/pdbgen/app.pl
* tools/pdbgen/lib.pl: do some trivial substitutions to generate
canonicalized names in app/, and C identifiers with underscores in
libgimp/.
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/fileops.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/palettes.pdb
* tools/pdbgen/pdb/patterns.pdb
* tools/pdbgen/pdb/plug_in.pdb
* tools/pdbgen/pdb/procedural_db.pdb
* tools/pdbgen/pdb/text_tool.pdb
* tools/pdbgen/pdb/transform_tools.pdb: canonicaloized procedure
names in calls to std_pdb_deprecated() and in procedure names in
generated C code.
* app/pdb/*_cmds.c
* libgimp/*_pdb.c: regenerated.
2005-03-08 Sven Neumann <sven@gimp.org>
* app/core/gimppalette.[ch]: renamed gimp_palette_[gs]et_n_columns
to gimp_palette_[gs]et_num_columns().
* app/dialogs/palette-import-dialog.c
* app/widgets/gimppaletteeditor.c: changed accordingly.
* tools/pdbgen/pdb/palette.pdb: added new PDB function to control
the number of columns used when displaying a palette (bug #169370).
* app/pdb/internal_procs.c
* app/pdb/palette_cmds.c
* libgimp/gimppalette_pdb.[ch]: regenerated.
* libgimp/gimp.def: updated.