Commit Graph

19 Commits

Author SHA1 Message Date
Jehan 2a00a9e60a Issue #434: remove broken plural support for GimpUnit.
Rather than trying to implement full i18n plural support, we just remove
this failed attempt from the past. The fact is that to get proper
support, we'd basically need to reimplement a Gettext-like plural
definition syntax within our API, then ask people to write down this
plural definition for their language, then to write every plural form…
all this for custom units which only them will ever see!

Moreover code investigation shows that the singular form was simply
never used, and the plural form was always used (whatever the actual
unit value displayed).

As for the "identifier", this was a text which was never shown anywhere
(except in the unit editor) and for all built-in units, as well as
default unitrc units, it was equivalent to the English plural value.

So we now just have a unique name which is the "long label" to be used
everywhere in the GUI, and abbreviation will be basically the "short
label". That's it. No useless (or worse, not actually usable because it
was not generic internationalization) values anymore!
2024-08-06 11:39:57 +02:00
Jehan d493f0537f Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!

Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.

As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.

Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.

Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-08-02 10:46:38 +02:00
Jehan 71ccaa21ee pdb, libgimp: remove double API generation from PDB.
All plug-ins got ported. Let's remove support for the old API with IDs
instead of objects.
2019-09-03 13:31:27 +02:00
Jehan fec6034c7a pdb: keep both the old and new API alive.
By default the new API will be used. But if we build with
GIMP_DEPRECATED_REPLACE_NEW_API macro, then the same function names will
call the old API with ids.

This way, we don't have to update all our plug-ins at once (which I
tried and is very tedious work).

Note that bindings won't have access to the deprecated API at all.
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 856c89a845 libgimp: add guards that #error out if individual files are included 2011-04-28 19:59:52 +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 dcc6ebd1b0 HACKING tools/pdbgen/lib.pl fixed spelling of "auto-generated".
2007-01-09  Sven Neumann  <sven@gimp.org>

	* HACKING
	* tools/pdbgen/lib.pl
	* tools/pdbgen/app.pl: fixed spelling of "auto-generated".

	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/procedural_db.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/gradient_select.pdb: improved wording and fixed
	spelling errors.
	
	* libgimp/gimp.c: fixed spelling errors.

	* app/pdb/*.h: 
	* libgimp/gimp*_pdb.[ch]: regenerated.


svn path=/trunk/; revision=21676
2007-01-09 10:52:47 +00:00
Sven Neumann 6264b28fe7 changed code generation rules to place G_GNUC_INTERNAL before the return
2006-08-22  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/lib.pl : changed code generation rules to place
	G_GNUC_INTERNAL before the return value (bug #352268).

	* libgimp/*_pdb.h: regenerated.
2006-08-22 12:58:36 +00:00
Sven Neumann 8824a9bc86 create code with spaces instead of tabs.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/lib.pl: create code with spaces instead of tabs.

	* libgimp/gimp*_pdb.[ch]: regenerated.
2006-04-12 10:27:31 +00:00
Sven Neumann dc4757cedc add G_GNUC_INTERNAL to declaration of wrapped PDB functions.
2005-10-25  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/lib.pl: add G_GNUC_INTERNAL to declaration of
	wrapped PDB functions.

	* libgimp/gimpchannel_pdb.h
	* libgimp/gimpdrawable_pdb.h
	* libgimp/gimpgimprc_pdb.h
	* libgimp/gimpimage_pdb.h
	* libgimp/gimplayer_pdb.h
	* libgimp/gimpplugin_pdb.h
	* libgimp/gimpproceduraldb_pdb.h
	* libgimp/gimpprogress_pdb.h
	* libgimp/gimpselection_pdb.h
	* libgimp/gimpunit_pdb.h: regenerated.

	* libgimp/gimptile.h
	* libgimp/gimpunitcache.h
	* libgimpthumb/gimpthumb-utils.h
	* libgimpwidgets/gimpcolorarea.h
	* libgimpwidgets/gimphelpui.h: declare internal functions as such
	using G_GNUC_INTERNAL.
2005-10-25 12:08:32 +00:00
Manish Singh 122c006564 fix spelling of "quality" in comment
2003-07-03  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/jpeg.c: fix spelling of "quality" in comment

        * tools/pdbgen/*.pl: update copyright strings to 2003

        * libgimp/gimpenums.h
        * libgimp/*_pdb.[ch]
        * app/pdb/*_cmds.[ch]
        * app/pdb/internal_procs.[ch]
        * plug-ins/pygimp/gimpenums.py
        * plug-ins/script-fu/script-fu-constants.c: regenerated
2003-07-03 00:47:26 +00:00
Manish Singh d46b87b1e4 constify input strings, colors, and arrays
2003-07-02  Manish Singh  <yosh@gimp.org>

        * tools/pdbgen/lib.pl: constify input strings, colors, and arrays

        * libgimp/*_pdb.[ch]: regenerated
2003-07-02 01:20:08 +00:00
Sven Neumann 757017a8e2 bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22.
2001-11-23  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version number to 1.3.1.
	Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H
	and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't
	exist any longer.

	* RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to
	be frozen now.

	* HACKING: removed reference to RELEASE-TO-CVS.patch

	* app/gui/menus.c
	* app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform
	to the new GTK+/Pango API.

	* app/core/Makefile.am: generate marshallers with gimp_marshal prefix.

	* app/core/gimpmarshal.list: added all marshallers we use.

	* app/core/gimpmarshal.[ch]: regenerated.

	* app/[lots of .c files]: use gimp_marshal_* for all marshallers.

	* data/images/
	* app/app_procs.c
	* app/gui/splash.c:

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase.h
	* libgimpbase/gimputils.[ch]: removed since they are no longer needed.

	* app/gimprc.c
	* plug-ins/common/ps.c
	* plug-ins/gdyntext/gdyntext.c
	* plug-ins/gdyntext/gdyntextcompat.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gflare/gflare.c
	* plug-ins/script-fu/script-fu-scripts.c: use glib functions instead
	of gimp_strescape() and gimpstrcompress().

	* cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared
	all _get_type function as G_GNUC_CONST.

	* tools/pdbgen/enumcode.pl
	* tools/pdbgen/lib.pl: make them generate header files using
	G_BEGIN_DECLS/G_END_DECLS.

	* pixmaps/Makefile.am
	* pixmaps/wilber3.xpm: removed ...
	* data/images/tips_wilber.png: ... and added here as PNG

	* app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf.

	* data/images/gimp_splash.ppm: removed ...
	* data/images/gimp_splash.png: ... and added as PNG

	* app/app_procs.c
	* app/gui/splash.[ch]: load the splash image using GdkPixbuf.

	* app/gui/about-dialog.c: sink the GtkPreview.
2001-11-22 23:46:13 +00:00
Manish Singh 50e478ef43 $srcdir != $builddir fix for GIMP_CONTRIBUTORS
* configure.in: $srcdir != $builddir fix for GIMP_CONTRIBUTORS

* plug-ins/common/plugin-defs.pl: More tidying up after Daniel Egger

* tools/pdbgen/Makefile.am: parse pdb defs only once for app and lib

* tools/pdbgen/lib.pl
* tools/pdbgen/pdb/procedural_db.pdb: all void rets now return a
boolean for success/failure

-Yosh
2000-08-23 01:44:59 +00:00
Manish Singh 5828759fb8 added get_number_of_built_in_units
* tools/pdbgen/pdb/unit.pdb: added get_number_of_built_in_units

* tools/pdbgen/Makefile.am: gen files in $top_srcdir/libgimp

* tools/pdbgen/lib.pl
* tools/pdbgen/pdb/procedural_db.pdb: libgimp pdbgen munging, final
landing

-Yosh
2000-08-21 21:23:31 +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
Michael Natterer ba9ec2a2ff Sven Neumann <sven@gimp.org>
2000-05-31  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>

	Episode IV...

	* app/Makefile.am

	* app/message_cmds.c: new name
	* app/interface_cmds.c: removed

	* app/help_cmds.c: new name
	* app/gimphelp_cmds.c: removed

	* app/internal_procs.c
	* app/gimphelp_cmds.c
	* app/plug_in_cmds.c: moved gimp_plugin_help_register to
	plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/

	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* libgimp/gimpfileops_pdb.[ch]
	* libgimp/gimpguides_pdb.[ch]
	* libgimp/gimpmessage_pdb.[ch]
	* libgimp/gimpprocedural_db_pdb.[ch]
	* libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers
	moved out of libgimp/gimp.[ch]

	* libgimp/gimpchannel_pdb.c
	* libgimp/gimpdisplay_pdb.[ch]
	* libgimp/gimpdrawable_pdb.[ch]
	* libgimp/gimphelp_pdb.[ch]
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimplayer_pdb.c
	* libgimp/gimpparasite_pdb.c
	* libgimp/gimpselection_pdb.c: various changes.

	* libgimp/gimpunit.c: new file
	* libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed
	with "_" which are called from libgimp/gimpunit.c only.

	* libgimp/gimpunit.h: minor stuff

	* libgimp/gimpcompat.h: declared the following functions obsolete:
	 gimp_query_database
	 gimp_query_images

	* libgimp/gimp.[ch]: removed all PDB wrappers.

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl: changed

	* tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and
	fixed just a few comments.

	* tools/pdbgen/pdb/interface.pdb
	* tools/pdbgen/pdb/gimphelp.pdb: removed

	* tools/pdbgen/pdb/help.pdb
	* tools/pdbgen/pdb/message.pdb: new names

	* plug-ins/script-fu/script-fu.c
	* plug-ins/perl/Gimp/Lib.xs:
	s/gimp_plugin_domain_add/gimp_plugin_domain_register/

2000-05-31  Michael Natterer  <mitch@gimp.org>

	* POTFILES.in: s/gimpunit_pdb/gimpunit/
2000-05-31 13:24:14 +00:00
Michael Natterer 053af2f1c9 Sven Neumann <sven@gimp.org>
2000-05-31  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>

	* libgimp/Makefile.am
	* libgimp/gimpchannel_pdb.h
	* libgimp/gimpdisplay_pdb.h
	* libgimp/gimpdrawable_pdb.h
	* libgimp/gimpgradient_pdb.h
	* libgimp/gimphelp_pdb.h
	* libgimp/gimpimage_pdb.h
	* libgimp/gimplayer_pdb.h
	* libgimp/gimpparasite_pdb.h
	* libgimp/gimpselection_pdb.h
	* libgimp/gimpunit_pdb.h
	* libgimp/gimpdrawable.[ch]
	* libgimp/gimphelp.c
	* libgimp/gimppixelrgn.h
	* libgimp/gimptile.h: new files

	* libgimp/gimp.[ch]
	* libgimp/gimpchannel_pdb.c
	* libgimp/gimpdrawable_pdb.c
	* libgimp/gimpgradient_pdb.c
	* libgimp/gimppalette_pdb.c
	* libgimp/gimpselection_pdb.c
	* libgimp/gimphelp_pdb.c
	* libgimp/gimpimage_pdb.c
	* libgimp/gimplayer_pdb.c
	* libgimp/gimpgradientmenu.c
	* libgimp/gimpbrushmenu.c
	* libgimp/gimpmenu.[ch]
	* libgimp/gimppatternmenu.c
	* libgimp/gimppixelrgn.c
	* libgimp/gimptile.c: part III of the (final) libgimp cleanup

	Split gimp.h into a bunch of headers. More or less finished the
	task of moving PDB wrappers into separate files in preparation
	of the upcoming autogen-it-all-attack.

	* libgimp/gimpcompat.h: declared the following functions obsolete:
	gimp_[channel|layer]_[width|height]
	gimp_layer_[bpp|type]
	gimp_channel_get_[image|layer]_ID

	* libgimp/gimptypes.h: new file:
	GPlugInInfo
	GTile
	GDrawable
	GPixelRgn
	GParamColor
	GParamRegion
	GParamData
	GParamDef
	GParam: s/G/Gimp/

	* app/gimphelp_cmds.c
	* app/plug_in_cmds.c
	* tools/pdbgen/pdb/gimphelp.pdb
	* tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 06:15:06 +00:00