Commit Graph

8 Commits

Author SHA1 Message Date
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
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 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 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 76ba5de16a Remember the settings in the scale and resize dialogs for images and
2006-10-14  Michael Natterer  <mitch@gimp.org>

	Remember the settings in the scale and resize dialogs for images
	and layers. Fixes bug #164995, bug #316392, and bug #357424.

	* app/dialogs/scale-dialog.h: removed GimpScaleCallback typedef.

	* app/dialogs/dialogs-types.h: added it here.

	* app/dialogs/image-scale-dialog.[ch]: made the ImageScaleDialog
	struct private, return a GtkWidget* from image_scale_dialog_new()
	and use a GimpScaleCallback in the public API.

	* app/actions/actions-types.h: #include "dialogs/dialogs-types.h"

	* app/actions/image-commands.c: changed according to image scale
	dialog changes. Remember the scale dialog's unit (if it is
	"percent") and interpolation type across dialog invocations. Also
	remember the resize dialog's unit (if it is "percent").

	* app/actions/layers-commands.c: remember scale and resize dialog
	stuff as in image-commands.c
2006-10-14 16:51:30 +00:00
Michael Natterer a6dbb78dfa added GimpContext parameters and create the GimpView with that context.
2006-09-01  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpviewabledialog.[ch]: added GimpContext
	parameters and create the GimpView with that context.

	* app/widgets/gimpcolordialog.[ch]
	* app/dialogs/convert-dialog.[ch]
	* app/dialogs/desaturate-dialog.[ch]
	* app/dialogs/grid-dialog.[ch]
	* app/dialogs/image-properties-dialog.[ch]
	* app/dialogs/layer-add-mask-dialog.[ch]
	* app/dialogs/offset-dialog.[ch]
	* app/dialogs/print-size-dialog.[ch]
	* app/dialogs/resize-dialog.[ch]
	* app/dialogs/scale-dialog.[ch]
	* app/dialogs/stroke-dialog.[ch]
	* app/dialogs/template-options-dialog.[ch]
	* app/dialogs/vectors-options-dialog.[ch]: added GimpContext
	parameters here too and pass them to gimp_viewable_dialog_new().

	* app/actions/colormap-editor-commands.c
	* app/actions/drawable-commands.c
	* app/actions/gradient-editor-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/palette-editor-commands.c
	* app/actions/select-commands.c
	* app/actions/vectors-commands.c
	* app/actions/view-commands.c
	* app/dialogs/channel-options-dialog.c
	* app/dialogs/dialogs-constructors.c
	* app/dialogs/image-merge-layers-dialog.c
	* app/dialogs/image-scale-dialog.c
	* app/dialogs/layer-options-dialog.c
	* app/display/gimpdisplayshell-filter-dialog.c
	* app/display/gimpdisplayshell-scale.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpcolorpanel.c
	* app/widgets/gimpcontrollereditor.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimptoolbox-color-area.c: pass contexts to above
	dialog constructors.
2006-09-01 11:26:54 +00:00
Sven Neumann b0330f95d4 added a resolution label similar to one in the template editor. Prepared
2004-10-27  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpsizebox.[ch]: added a resolution label similar
	to one in the template editor. Prepared for editable resolution,
	work in progress...

	* app/dialogs/scale-dialog.[ch]: added resolution and resolution
	unit parameters to ScaleDialogCallback.

	* app/actions/layers-commands.c: changed accordingly.
2004-10-26 23:31:34 +00:00
Sven Neumann 22a1384b5a app/widgets/Makefile.am app/widgets/widgets-types.h added new widget
2004-10-12  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpsizebox.[ch]: added new widget GimpSizeBox.

	* app/widgets/gimppropwidgets.c: the order of setting the X and Y
	properties does matter.

	* app/dialogs/Makefile.am
	* app/dialogs/scale-dialog.[ch]: added first version of a new
	Scale dialog in an attempt to address bug #151022.

	* app/actions/layers-commands.c: use the new scale dialog.
2004-10-12 14:59:14 +00:00