Commit Graph

29 Commits

Author SHA1 Message Date
Jehan 32310f5e4b libgimp: use G_DECLARE_DERIVABLE_TYPE and G_DECLARE_FINAL_TYPE for…
… 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).
2021-04-06 13:02:03 +02:00
Michael Natterer fd5740e70b libgimp: add gimp_layer,chanel,vectors,etc,_get_by_id()
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).
2019-09-03 10:24:24 +02:00
Michael Natterer 2fd35e77b5 Revert "libgimp: API with new object classes are since 3.0."
This reverts commit e24375e64a.

The API is semantically the same, and there is no danger of confusion,
no need to update the Since: tags.
2019-08-30 18:44:56 +02:00
Jehan e24375e64a libgimp: API with new object classes are since 3.0.
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.
2019-08-30 16:42:08 +02:00
Michael Natterer f57725a96a libgimp: add instance-private struct to all new objects
Just in case we need it later.
2019-08-27 16:47:17 +02:00
Michael Natterer 96c1f754ba libgimp: remove a ton of deprecated API that is unused 2019-08-27 16:32:25 +02:00
Jehan 08849a584c libgimp: GimpItem now also belong to libgimp. 2019-08-22 15:54:36 +02:00
Jehan cfd30ec62a libgimp: s/gimp_image_new_by_id()/gimp_image_get_by_id()/
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).
2019-08-22 15:54:36 +02:00
Jehan 5e6d4d8fbd libgimp: fix the non-generated API with the new class types. 2019-08-22 15:54:36 +02:00
Jehan 8c95499e14 pdb, libgimp: now make all ID types classes of their own.
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.
2019-08-22 15:54:36 +02:00
Jehan 09f0530dab libgimp: update non-generated API to allow old and new API.
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.
2019-08-22 15:54:36 +02:00
Jehan bb72504ea9 libgimp: change all non-generated API to use GimpImage.
We shouldn't pass as parameter nor return gint32 anymore.
2019-08-22 15:54:36 +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
Michael Natterer 9e0dccec73 pdb: update docs to mention the new insert procs instead of the add ones 2010-09-06 00:03:29 +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
Sven Neumann f2df31a50e converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* libgimp*/gimp*.[ch]: converted tabs to spaces.
2006-04-12 10:53:28 +00:00
Sven Neumann 4d61cc563d libgimp/gimp.[ch] libgimp/gimpchannel.[ch] libgimp/gimpdrawable.[ch]
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.
2003-07-01 18:11:18 +00:00
Sven Neumann fe0bf162c1 removed FINITE() macro.
2002-05-13  Sven Neumann  <sven@gimp.org>

	* libgimpmath/gimpmath.h: removed FINITE() macro.

	* tools/pdbgen/pdb/image.pdb
	* app/pdb/image_cmds.c: define FINITE() here, where it is used.

	* tools/pdbgen/pdb/lib.pl: add "config.h" to all generated libgimp
	.c files.

	* libgimp/gimp*_pdb.c: regenerated.

	* libgimp/gimpbrushmenu.c
	* libgimp/gimpchannel.c
	* libgimp/gimpdrawable.c
	* libgimp/gimpgradientmenu.c
	* libgimp/gimphelp.c
	* libgimp/gimpimage.c
	* libgimp/gimplayer.c
	* libgimp/gimppatternmenu.c
	* libgimp/gimppixelrgn.c
	* libgimp/gimpproceduraldb.c
	* libgimp/gimpselection.c
	* libgimp/gimptile.c
	* libgimp/gimpui.c
	* libgimpmath/gimpmatrix.c
	* libgimpmath/gimpvector.c
	* plug-ins/MapObject/arcball.c
	* plug-ins/fp/fp_gdk.c
	* plug-ins/fp/fp_misc.c
	* plug-ins/ifscompose/ifscompose_storage.c
	* plug-ins/ifscompose/ifscompose_utils.c
	* plug-ins/maze/handy.c
	* plug-ins/rcm/rcm_gdk.c
	* plug-ins/sel2path/edge.c
	* plug-ins/xjt/xjpeg.c
	* plug-ins/xjt/xpdb_calls.c: include "config.h".
2002-05-13 23:30:23 +00:00
Sven Neumann 0d533abbdd tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb
2001-01-25  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/lib.pl
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/tools.pdb: changed these with the help of
	Yosh. PDB functions take GimpRGB as color type now.

	* app/plug_in.c
	* app/pdb/channel_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* app/pdb/procedural_db.[ch]
	* app/pdb/tools_cmds.c
	* libgimp/gimp.[ch]
	* libgimp/gimpchannel.[ch]
	* libgimp/gimpchannel_pdb.[ch]
	* libgimp/gimppalette_pdb.[ch]
	* libgimp/gimpprotocol.[ch]
	* libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version
	and changed color type from array of chars to GimpRGB.

	* libgimp/Makefile.am
	* libgimp/gimppalette.[ch]: removed these files again

	* app/libgimp_glue.[ch]
	* libgimpwidgets/gimpcolorbutton.c
	* plug-ins/Lighting/lighting_main.c
	* plug-ins/Lighting/lighting_preview.c
	* plug-ins/MapObject/mapobject_image.c
	* plug-ins/MapObject/mapobject_main.c
	* plug-ins/MapObject/mapobject_preview.c
	* plug-ins/common/apply_lens.c
	* plug-ins/common/blinds.c
	* plug-ins/common/borderaverage.c
	* plug-ins/common/checkerboard.c
	* plug-ins/common/colorify.c
	* plug-ins/common/colortoalpha.c
	* plug-ins/common/cubism.c
	* plug-ins/common/exchange.c
	* plug-ins/common/film.c
	* plug-ins/common/gif.c
	* plug-ins/common/grid.c
	* plug-ins/common/mapcolor.c
	* plug-ins/common/mblur.c
	* plug-ins/common/nova.c
	* plug-ins/common/papertile.c
	* plug-ins/common/png.c
	* plug-ins/common/polar.c
	* plug-ins/common/psd.c
	* plug-ins/common/semiflatten.c
	* plug-ins/common/sinus.c
	* plug-ins/common/sparkle.c
	* plug-ins/common/tiff.c
	* plug-ins/common/vpropagate.c
	* plug-ins/common/warp.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/gap/gap_filter_iterators.c
	* plug-ins/gap/gap_mov_dialog.c
	* plug-ins/gdyntext/gdyntext.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gfli/gfli.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/maze/handy.c
	* plug-ins/mosaic/mosaic.c
	* plug-ins/pagecurl/pagecurl.c
	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/script-fu.c
	* plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need
	to be looked at more closely after this change. I tried to put
	FIXME comments into those.
2001-01-25 01:20:05 +00:00
Sven Neumann 9fd7a4ef2d libgimp/gimpchannel.c libgimp/gimpimage.c libgimp/gimplayer.c
2000-08-25  Sven Neumann  <sven@gimp.org>

        * libgimp/gimpchannel.c
        * libgimp/gimpimage.c
        * libgimp/gimplayer.c
        * libgimp/gimpproceduraldb.c
        * libgimp/gimpselection.c: document wrapped PDB wrappers
2000-08-25 00:37:35 +00:00
Michael Natterer 5f7e2a8d1c Sven Neumann <sven@gimp.org> Simon Budig <Simon.Budig@unix-ag.org> Garry
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.
2000-06-01 17:34:56 +00:00
Manish Singh 763bd6ab98 great renaming
-Yosh
2000-05-26 23:09:41 +00:00
Sven Neumann 3a24f6d9b0 fixed bug 7744 and cleaned up libgimp
--Sven
2000-03-25 18:49:05 +00:00
Marc Lehmann df8b445be6 *** empty log message *** 1999-11-17 21:13:50 +00:00
Jay Cox de2c3f4813 export the tattoo functions to the plug-ins
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
1998-11-07 23:02:14 +00:00
Manish Singh 8024078a3b added --install-script. Use @INSTALL@ stuff
* 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
1998-05-26 08:46:37 +00:00
Manish Singh 84abd5d700 Have fun recompiling gimp everyone. It's the great FSF address change!
-Yosh
1998-04-13 05:44:11 +00:00
Manish Singh 92ab4b4278 Placed libgimp under LGPL
-Yosh
1998-01-25 10:26:47 +00:00
Elliot Lee 32cefec8f7 Initial revision 1997-11-24 22:05:25 +00:00