Commit Graph

26 Commits

Author SHA1 Message Date
Jehan f705bfb395 libgimpbase: return 0 for GIMP_UNIT_PIXEL in gimp_unit_get_factor().
Just as documented, pixel unit should always return factor 0. There is
no need to call _gimp_unit_vtable.unit_get_factor().

This is even more important as there is one implementation of
unit_get_factor() in core, and another in libgimp and the one in libgimp
is expecting unit to always be >= GIMP_UNIT_INCH. So we were getting
CRITICALs in libgimp when calling gimp_unit_get_factor() on pixel unit
(for instance when drawing a GimpRuler).
2019-08-17 12:12:40 +02:00
Michael Natterer 65a8ae2c91 libgimpbase: make the GimpParamSpecUnit struct public
like all other param specs.
2019-07-30 15:03:03 +02:00
Jehan ab6783902e libgimpbase: more (transfer) and (element-type) warnings fixed. 2019-07-28 10:09:46 +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 695a1c26aa libgimpbase: update gimp_unit_get_digits() description...
... to favor the usage of gimp_unit_get_scaled_digits() when
appropriate.
2017-05-06 22:36:23 +02:00
Jehan 0c07ae3bbf libgimpbase: new gimp_unit_get_accurate_digits() API function. 2017-01-23 20:20:25 +01:00
Jehan 7a330dcf6a libgimpbase: update gimp_unit_get_digits() description.
Digit accuracy being "approximately the same as an inch with 2 digits"
is only true for built-in units, not user-defined ones.
2017-01-20 00:40:27 +01:00
Jehan 3ab25af742 libgimpbase: fix a few typos. 2017-01-20 00:40:27 +01:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
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.
2015-05-31 21:18:09 +02:00
Murray Cumming 58a557d800 libgimpbase: Avoid an assignment to self.
gimp_param_unit_value_validate() set a value to itself to not
change the value, which was strange though not particularly wrong.
Found by Coverity Scan.
2015-02-17 18:49:02 +01:00
Michael Natterer 9ffa9ac6e3 libgimpbase: improve gimp_unit_is_metric()
Don't directly compare doubles, use "ABS (foo - bar) < epsilon".
2013-11-17 21:03:37 +01:00
Michael Natterer f473653889 libgimpbase: add gimp_unit_is_metric()
which currently returns TRUE if the unit has a factor that matches mm,
cm, dm or m. Incomplete, but at least now extendable in one place,
just need to use the new function everywhere.
2013-10-12 18:54:34 +02:00
Michael Natterer 236f9f91f9 Fix two warnings about possibly missing printf format attributes 2013-04-07 16:47:26 +02:00
Michael Natterer 38a8e67e03 libgimpbase: improve warning when a string can't be converted to a GimpUnit 2012-10-04 22:53:14 +02:00
Michael Natterer caa3b9f4bf libgimpbase: add gimp_units_to_points()
because points is used in quite some external APIs (like Pango), and
having one conversion from gimp units is better than duplicating the
code.
2011-03-18 21:34:27 +01:00
Michael Natterer cab852fb73 libgimpbase: add gimp_unit_format_string()
which is the string formatting function from GimpUnitMenu as proper
public API.
2010-10-31 22:10:31 +01:00
Michael Natterer 3411c7b63a libgimpbase: move docs from template files to inline comments
and remove all template files. Also fixed all gtk-doc warnings
and fixed/added some docs.
2010-06-29 19:16:51 +02:00
Michael Natterer 0ee393c692 libgimpbase: fix typos in docs of recently added unit functions 2010-02-24 10:53:10 +01:00
Michael Natterer 52041715a9 libgimpbase: add utility functions to convert between pixels and units 2010-02-21 16:45:01 +01: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 64e893e62f there's no need to make GTypeInfo and GInterfaceInfo structs static.
2006-10-18  Sven Neumann  <sven@gimp.org>

        * [lots of files]: there's no need to make GTypeInfo and
        GInterfaceInfo structs static.
2006-10-18 13:17:50 +00:00
Sven Neumann e9eab5d8e0 libgimpbase/Makefile.am removed this file again.
2005-01-23  Sven Neumann  <sven@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbaseparams.[ch]: removed this file again.

	* libgimpbase/gimpmemsize.[ch]
	* libgimpbase/gimppath.[ch]
	* libgimpbase/gimpunit.[ch]: moved the paramspec definitions to
	the types they belong to.

	* libgimpbase/gimpbase.h: changed accordingly.

	* libgimpwidgets/Makefile.am (libgimpwidgetsinclude_HEADERS):
	install the new header files.
2005-01-23 02:09:41 +00:00
Sven Neumann bd427b2e4d libgimpbase/Makefile.am libgimpbase/gimpbase.h libgimpbase/gimpbase.def
2004-07-27  Sven Neumann  <sven@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase.h
	* libgimpbase/gimpbase.def
	* libgimpbase/gimpmemsize.[ch]: added new files with memsize
	related functions (moved here from gimputil.c) and
	GIMP_TYPE_MEMSIZE (moved here from app/config/gimpconfig-types.[ch]).

	* libgimpbase/gimputils.[ch]: removed gimp_memsize_to_string() here.

	* libgimpbase/gimpunit.[ch]: added GIMP_TYPE_UNIT (moved here from
	app/config/gimpconfig-types.[ch]).

	* libgimpbase/gimpbase-private.c
	* libgimp/gimptile.c
	* libgimp/gimpunitcache.c
	* plug-ins/help/domain.c
	* app/xcf/xcf-read.c: need to include glib-object.h.

	* plug-ins/common/uniteditor.c: use GIMP_TYPE_UNIT.

	* app/config/gimpconfig-types.[ch]: removed code that lives in
	libgimpbase now.

	* app/config/gimpconfig-deserialize.c: changed accordingly.

	* app/config/gimpbaseconfig.c
	* app/config/gimpdisplayconfig.c
	* app/core/gimpcontext.c
	* app/gui/grid-dialog.c
	* app/tools/gimpcolortool.c
	* app/widgets/gimpaction.c
	* app/widgets/gimpunitstore.c: no need to include gimpconfig-types.h
	any longer.
2004-07-27 16:39:00 +00:00
Michael Natterer 879a0500b9 doc fixes.
2003-11-16  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/gimpunit.c: doc fixes.
2003-11-15 23:23:42 +00:00
Michael Natterer 5221d4daa6 libgimpbase/Makefile.am libgimpbase/gimpbase-private.[ch] new files
2003-11-15  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbase-private.[ch]
	* libgimpbase/gimpunit.c: new files implementing GimpUnitVTable
	(formerly known as GimpWidgetsVTable). Now the unit functions
	finally live in the same library as their header declarations.

	* libgimpbase/gimpunit.h: removed comment about being a header for
	two different files.

	* libgimpwidgets/gimpwidgets-private.[ch]: removed
	GimpWidgetsVTable.

	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.c: use normal gimp_unit functions
	again.

	* libgimp/gimpui.c
	* app/gui/gui.c: removed GimpWidgetVTable stuff.

	* libgimp/Makefile.am
	* libgimp/gimpunitcache.[ch]: new files.

	* libgimp/gimpunit.c: removed (moved to gimpunitcache.c).

	* libgimp/gimp.c (gimp_main): initialize GimpUnitVTable using the
	gimp_unit_cache functions.

	* app/Makefile.am
	* app/units.[ch]: new files implementing GimpUnitVTable.

	* app/libgimp_glue.[ch]: removed.

	* app/app_procs.[ch]: made "the_gimp" a static variable. Call
	units_init().

	* app/main.c: changed accordingly.
2003-11-15 22:53:28 +00:00