… the public API.
This was initially proposed by Niels De Graef in !101, and though I
still think this is much less practical for day-to-day development, it
is actually much nicer for the public part of the API. So let's use
these only in public libgimp* API only, not in core.
I actually already started to use these for some of the libgimpwidgets
classes and am now moving libgimp main classes to these macros.
* It doesn't expose the priv member (which is completely useless for
plug-in developers, only to be used for core development).
* It forces us to never have any variable members in the public API
(which we were doing fine so far in newest API, but it's nice to be
enforced with these macros).
* When using G_DECLARE_FINAL_TYPE in particular, it adds flexibility as
we can change the structure size and the members order as these are
not exposed. And if some day, we make the class derivable with some
signals to handle, only then will we expose the class with some
_gimp_reserved* padding (instead of from the start when none is
needed). Therefore we will allow for further extension far in the
future.
Moreover most of these libgimp classes were so far not using any private
values, so we were declaring a `priv` member with a bogus contents just
"in case we needed it in future" (as we couldn't change the struct
size). So even the easiness of having a priv member was very relative
for this public API so far (unlike in core code where we actually have
much more complex interactions and using priv data all the time).
which call gimp_item_get_by_id() and additionally check if the
returned item has the right type, and return NULL if not.
This is both shorter and more readable than
layer = GIMP_LAYER (gimp_item_get_by_id (id));
and additionally makes sure we don't cast e.g. a non-layer with
GIMP_LAYER(), which will give criticals but shouldn't, because the
wrong IDs can come from anywhere and are an input problem and not a
programming error (criticals are for programming errors).
Even when the function names may have stayed the same in most cases, the
API has changed. The "Since:" tag must therefore be bumped.
Also adding docs for gimp_drawable_get_sub_thumbnail_data() which had
none.
This means that images' ownership is not given to caller in particular.
libgimp will now keep a reference of all GimpImage-s it creates and
return this same reference if called again. It also means that you can
now compare images by pointer comparison (as 2 GimpImage objects
representing the same image ID will be equal).
Obviously as a side effect, gimp_image_list() is changed to (transfer
container) as you must only free the container now, not the elements.
Also various other functions creating new images are now (transfer none)
too.
Long-time plug-ins will have to be taken in consideration in a further
step (we currently never free GimpImage for destroyed images in
particular).
No need of is_id_arg() anymore in pdb/lib.pl. Let's reuse the {id}
value. Also I had to add an additional trick for GimpDisplay which we
will now generate as such in libgimp PDB files, but still need to show
as GimpObject on app/pdb/.
As previously, only the new classes and the PDB generation for a first
step.
Same as previous commit: by default the new API will be used. But if a
plug-in builds with GIMP_DEPRECATED_REPLACE_NEW_API macro, then the same
function names will call the old API with ids.
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
2003-07-01 Sven Neumann <sven@gimp.org>
* libgimp/gimp.[ch]
* libgimp/gimpchannel.[ch]
* libgimp/gimpdrawable.[ch]
* libgimp/gimpimage.[ch]
* libgimp/gimplayer.[ch]
* libgimp/gimpmisc.[ch]
* libgimp/gimpmiscui.[ch]
* libgimp/gimppixelrgn.[ch]
* libgimp/gimpproceduraldb.[ch]: added const qualifiers to the
libgimp API. Will cause lots of compiler warnings until the
generated PDB code has been constified as well.
* libgimpbase/gimpparasite.[ch]: use gconstpointer, not const
gpointer.
2000-06-01 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
Simon Budig <Simon.Budig@unix-ag.org>
Garry R. Osgood <gosgood@idt.net>
Seth Burgess <sjburges@gimp.org>
* libgimp/gimpchannel_pdb.[ch]
* libgimp/gimpproceduraldb_pdb.[ch]
* libgimp/gimpunit_pdb.[ch]: replaced with code based on
files generated using pdbgen
* libgimp/Makefile.am
* libgimp/gimp.h
* libgimp/gimp_pdb.h
* libgimp/gimpchannel.[ch]
* libgimp/gimpproceduraldb.[ch]: new files wrapping around the
autogenerated PDB wrappers as found in *_pdb.[ch].
* libgimp/gimpselection_pdb.h: minor change.
* tools/pdbgen/pdb/procedural_db.pdb: made it create libgimp code
* plug-ins/gap/gap_filter_pdb.c
* plug-ins/script-fu/script-fu-console.c
* plug-ins/script-fu/script-fu.c
* plug-ins/xjt/xpdb_calls.c: gimp_query_procedure's signature
is typesafe now.
1998-11-07 Jay Cox <jaycox@earthlink.net>
* libgimp/{gimp.h, gimpchannel.c, gimpdrawable.c, gimplayer.c}:
export the tattoo functions to the plug-ins
* libimp/gserialize.c, libimp/gserialize.h: new files for
serializing structures
* main.c: test the gserialize functions
* gimpsignal.h: declare gimp_sigtype_* as extern
* gimptool.in: added --install-script. Use @INSTALL@ stuff
* libgimp/gimpimage.c
* libgimp/gimplayer.c: fixes for silly errors from Marc Lehmann
* libgimp/gimpchannel.c: implemented gimp_channel_set_show_masked and
gimp_channel_get_show_masked (already in gimp.h>
* plug-ins/blinds/blinds.c
* plug-ins/bmp/bmp.h
* plug-ins/mosaic/mosaic.c
* plug-ins/ripple/ripple.c
* plug-ins/tga/tga.c
* plug-ins/tileit/tileit.c: remove definitions of TRUE and FALSE since glib
does it for us
-Yosh