Commit Graph

81 Commits

Author SHA1 Message Date
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
Michael Natterer 1afb7a8b32 libgimpwidgets: add GDestroyNotify to gimp_widget_track_monitor() 2019-08-07 23:44:18 +02:00
Michael Natterer c12c031f2d pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values 2019-08-01 15:39:13 +02:00
Michael Natterer 8b22b3ab35 libgimpwidgets: fix some glitches noticed when updating docs 2019-07-23 19:33:48 +02:00
Jehan 4be9b7a401 app, libgimpwidgets: new gimp_color_area_set_out_of_gamut().
This allows to force a GimpColorArea to display as out-of-gamut color.
Current code was only considering the generic RGB case (outside of [0-1]
range), and in particular not grayscale or indexed images.

Ideally the GimpColorArea widget could be (optionally) made to follow a
context, so that for instance it could update its representation when
the context image changes, or when this image's type changes. Yet since
it is a libgimpwidgets widget, it cannot get such update. Instead I add
a new API function to display the color box with the out-of-gamut
triangle. The decision code for this will have to be done elsewhere.

Use this new API for GimpColorHistory to display non-gray colors in the
history as out-of-gamut on grayscale images, or colors absent of the
palette on indexed images.
2019-03-06 16:30:35 +01:00
Michael Natterer abd7cbfc8d Issue #1788 - Inconsistency between FG color and selected color in...
...palette views despite selected color being in the currently
selected pallette

As suggested by Massimo, changing the color comparison EPSILON in
gimppalette.c from 1e-10 to 1e-6 fixes this, and is really small
enough.

Also, generally clean up color comparison epsilons:

- use a #define, not hardcoded values for all uses of
  gimp_rgb[a]_distance()
- call the #defines RGB_EPSILON and RGBA_EPSILON
- make them all 1e-6 or larger
2019-01-02 01:49:43 +01:00
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04: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 1b7d63cce9 Use g_set_object() in a lot of places, and splrinkle some g_clear_object() 2018-06-01 12:59:52 +02:00
Michael Natterer 9b3366309c libgimpwidgets: undeprecate insensitive drawing of GimpColorArea
by simply drawing the buffer with cairo_mask() and a stipple pattern
so we get the same effect as before, but without rendering the
widget's background color into the buffer ourselves.
2018-05-20 21:06:35 +02:00
Michael Natterer bb2a9d119f libgimpconfig: move all GimpColorConfig members to private 2018-05-20 21:06:33 +02:00
Michael Natterer f4f106ad26 libimp*: add private pointers to all instance structs
even if we don't have private members (yet). Also make class padding 8
pointers in all headers. This commit moves nothing to private, it just
makes all headers consistent and adjusts .c files accordigly.
2018-05-20 21:06:33 +02:00
Michael Natterer 271f94928f libgimpwidgets: move all GimpColorArea members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 1264285cff libgimpwidgets: implement GtkWidget::state_flags_changed()
instead of GtkWidget::state_changed()
2018-05-20 21:06:28 +02:00
Michael Natterer 42252b3f6f libgimpwidgets: port GimpColorArea to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 5fb95d09a1 libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 582c6edd54 libgimp*: use some g_clear_object() and g_clear_pointer() 2017-09-03 15:14:51 +02:00
Michael Natterer f9ee38ea33 libgimp: add blurbs to all object properties for the docs
and some minor doc fixes.
2017-06-06 21:19:17 +02:00
Michael Natterer 331fc27f11 libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
and reduce the indicator to 2/3 of the area's shorter side.
2017-05-19 11:54:59 +02:00
Michael Natterer c4dfef0779 libgimpwidgets: add an out-of-gamut indicator to GimpColorArea 2017-05-19 11:00:38 +02:00
Timm Bäder 53f34ebc0b Chain up in some size-allocate implementations
The default implementation does just the right thing for most widgets.
2016-09-09 21:31:09 +02:00
Michael Natterer 3ed305f6f5 libgimpwidgets, app: have all previews track the monitor they are on
and update their color transforms with the new monitor's color
profile. A widget is considered changing monitors when its toplevel
window's center crosses, in order to let widgets within one window
have consistent colors.
2016-06-01 22:42:00 +02:00
Michael Natterer 4ad2493283 libgimpwidgets, modules: improve set_color_config() functions a bit
Don't do anything if the config doesn't change.
2016-05-31 12:27:15 +02:00
Michael Natterer 0bfa402c1a Argh, this was meant to be squashed into the previous commit... 2016-05-26 22:18:50 +02:00
Michael Natterer cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00
Michael Natterer 1cffaa7120 libgimpwidgets: add gimp_color_area_set_color_config()
And do a display profile transform on the color area if it's set.
2016-05-25 12:39:31 +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
Michael Natterer fe19ad9706 Bug 683694 - Spelling errors
Reworded all places that used to say "allows to".
2012-11-11 15:50:25 +01:00
Michael Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +02:00
Michael Natterer 3e119c5af7 libgimpcolor: add gimp_rgb[a]_set,get_pixel()
which converts from/to any pixel format using Babl. Added tons of
includes and CFLAGS now that libgimpcolor publically uses Babl.
2012-05-02 17:50:43 +02:00
Michael Natterer 8b4bcbb9e1 libgimpwidgets: port GimpColorArea drawing to cairo
And unexport an unused lib-internal function. Leave it there privately
though because it might be useful later.
2010-09-10 19:53:48 +02:00
Michael Natterer 1f7ff98c45 libgimpwidgets: move docs from template files to inline comments
but leave the template file for gimpstock there because its contents
would be too much for gimpstock.h.
2010-07-05 18:01:28 +02:00
Michael Natterer fcd346a227 Build with GSEAL_ENABLE with a few exceptions
Use the new accessors in GTK+ 2.18 and #undef GSEAL_ENABLE where
accessors are missing or where I'm not quite sure how to fix the
stuff yet.
2009-10-17 18:51:48 +02:00
Michael Natterer 3795f9b9c5 libgimpwidgets/gimpchainbutton.c libgimpwidgets/gimpcolorarea.c
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpcolorscale.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimpdialog.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimpmemsizeentry.c
	* libgimpwidgets/gimpoffsetarea.c
	* libgimpwidgets/gimppickbutton.c
	* libgimpwidgets/gimppixmap.c
	* libgimpwidgets/gimppreview.c
	* libgimpwidgets/gimppreviewarea.c
	* libgimpwidgets/gimpruler.c
	* libgimpwidgets/gimpscrolledpreview.c
	* libgimpwidgets/gimpwidgets.c: use accessors for various members
	of GTK+ structures that don't exist any longer when GSEAL_ENABLE
	is defined.


svn path=/trunk/; revision=28190
2009-03-22 15:42:42 +00: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
Michael Natterer 58cfcd4f57 libgimp/gimpgradientselectbutton.c libgimp/gimpmenu.c
2008-06-28  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimpgradientselectbutton.c
	* libgimp/gimpmenu.c
	* libgimpwidgets/gimpbrowser.c
	* libgimpwidgets/gimpcellrenderercolor.c
	* libgimpwidgets/gimpcellrenderertoggle.c
	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorscale.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimpenumwidgets.c
	* libgimpwidgets/gimpframe.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimpoffsetarea.c
	* libgimpwidgets/gimppreviewarea.c
	* libgimpwidgets/gimppropwidgets.c
	* libgimpwidgets/gimpscrolledpreview.c: use accessors instead of
	accessing members of GTK+ widgets directly.


svn path=/trunk/; revision=26005
2008-06-28 15:09:46 +00:00
Sven Neumann c1c7afb03a libgimp/gimppatternselectbutton.c libgimp/gimpbrushselectbutton.c
2007-10-16  Sven Neumann  <sven@gimp.org>

	* libgimp/gimppatternselectbutton.c
	* libgimp/gimpbrushselectbutton.c
	* libgimpwidgets/gimpcolorarea.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpdockbook.c: set GDK_WINDOW_TYPE_HINT_DND on
	popup windows used to implement a DND cursor.

svn path=/trunk/; revision=23841
2007-10-16 13:56:34 +00:00
Sven Neumann 6ebcf700d1 removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15  Sven Neumann  <sven@gimp.org>

	* app/*/*.c:
	* lib*/*.c: removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15 09:46:31 +00:00
Sven Neumann e779cf0b0f added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct
2006-04-27  Sven Neumann  <sven@gimp.org>

	* libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB.
	Made the GimpParamSpecRGB struct public. When validating a color,
	only look at the alpha channel if has_alpha is set.

	* libgimpconfig/gimpconfig-params.h: added "has_alpha" to
	GIMP_CONFIG_INSTALL_PROP_RGB macro definition.

	* libgimpconfig/gimpconfig-serialize.c: serialize color values as
	"(rgb r g b)" if the param-spec indicates that the alpha channel
	is meaningless.

	* app/config/gimpconfig-dump.c: take "has_alpha" into account when
	documenting color properties.

	* app/core/gimpcontext.c
	* app/core/gimpgrid.c
	* app/display/gimpdisplayoptions.c
	* app/text/gimptext.c
	* app/widgets/gimpaction.c
	* app/widgets/gimpcolorbar.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c: specify whether color properties
	have an alpha channel.

	* tools/pdbgen/app.pl: handle "has_alpha" for color paramaters.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/context.pdb
	* tools/pdbgen/pdb/grid.pdb
	* tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where
	appropriate.

	* app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set
	"has_alpha" to TRUE for GIMP_PDB_COLOR.

	* app/pdb/channel_cmds.c
	* app/pdb/context_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/grid_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/palette_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/selection_tools_cmds.c: regenerated.

	* app/config/gimpdisplayconfig.c (gimp_display_config_class_init):
	removed unused code.
2006-04-27 15:19:59 +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 7b24dd8e36 moved GIMP_PARAM defines from here ...
2006-01-30  Sven Neumann  <sven@gimp.org>

	* app/config/config-types.h: moved GIMP_PARAM defines from here ...

	* libgimpbase/gimpparam.h: ... to this new files.

	* libgimpbase/Makefile.am
	* libgimpbase/gimpbasetypes.h: include the new header file.

	* libgimp/gimpfontselectbutton.c
	* libgimpconfig/gimpcolorconfig.c
	* libgimpthumb/gimpthumbnail.c
	* libgimpwidgets/gimpcellrenderercolor.c
	* libgimpwidgets/gimpcellrenderertoggle.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpcolordisplay.c
	* libgimpwidgets/gimpcontroller.c
	* libgimpwidgets/gimpdialog.c
	* libgimpwidgets/gimpenumcombobox.c
	* libgimpwidgets/gimpintcombobox.c
	* libgimpwidgets/gimppageselector.c
	* libgimpwidgets/gimppreview.c
	* libgimpwidgets/gimppreviewarea.c
	* libgimpwidgets/gimpzoommodel.c
	* modules/cdisplay_colorblind.c
	* modules/cdisplay_gamma.c
	* modules/cdisplay_highcontrast.c
	* modules/cdisplay_lcms.c
	* modules/cdisplay_proof.c
	* modules/controller_linux_input.c
	* modules/controller_midi.c: use the GIMP_PARAM defines to avoid
	unnecessary string allocations.
2006-01-30 16:10:56 +00:00
Michael Natterer 33ae55f873 libgimp/*.c libgimpconfig/*.c libgimpmodule/*.c libgimpthumb/*.c port to
2005-12-20  Michael Natterer  <mitch@gimp.org>

	* libgimp/*.c
	* libgimpconfig/*.c
	* libgimpmodule/*.c
	* libgimpthumb/*.c
	* libgimpwidgets/*.c: port to G_DEFINE_TYPE() and friends. Some
	related cleanup.
2005-12-20 20:35:23 +00:00
Sven Neumann 815c90d179 pass sensitivity to _gimp_color_area_render_buf().
2005-10-13  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorarea.[ch]: pass sensitivity to
	_gimp_color_area_render_buf().

	* libgimpwidgets/gimpcellrenderercolor.c
	(gimp_cell_renderer_color_render): respect cell and widget
	sensitivity.
2005-10-13 15:54:51 +00:00
Sven Neumann 80d4e4f5b0 invalidate the buffer when the widget's sensitivity changes. Draw a
2005-06-04  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorarea.[ch]: invalidate the buffer when
	the widget's sensitivity changes. Draw a stipple pattern on the
	insensitive color area.

	* libgimpwidgets/gimpcellrenderercolor.c: follow internal API change.

	* libgimpwidgets/gimpcolorbutton.c: pass GDK_BUTTON1_MASK as
	drag-mask. Doesn't work for whatever reason but it didn't work
	with GDK_BUTTON2_MASK either.
2005-06-04 12:02:36 +00:00
Sven Neumann be3a1dcc08 reduced the number of characters to show before ellipsizing the label.
2005-06-04  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdnd.c (gimp_dnd_get_viewable_icon): reduced the
	number of characters to show before ellipsizing the label.

	* libgimpwidgets/gimpcolorarea.c: added a "draw-border" property.

	* app/widgets/gimpcolorframe.c: draw a border around the color area.
2005-06-04 10:12:03 +00:00
Sven Neumann 101c5a2dc9 pass GIMP_COLOR_AREA_CHECKS_SMALL instead of TRUE for the type of the
2005-05-29  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdnd.c (gimp_dnd_get_color_icon): pass
	GIMP_COLOR_AREA_CHECKS_SMALL instead of TRUE for the type of the
	GimpColorArea.

	* app/widgets/gimpcoloreditor.c: added a "context" property.

	* libgimpwidgets/gimpcolorarea.c (gimp_color_area_set_color):
	always use gimp_rgba_distance(), regardless of the area's type.
2005-05-29 13:48:03 +00:00
Sven Neumann 3ca90a182e Use the canonical form for signal names in lots of places (but by far not
2005-05-27  Sven Neumann  <sven@gimp.org>

	* (lots of files): Use the canonical form for signal names in lots
	of places (but by far not all).
2005-05-27 13:05:26 +00:00
Sven Neumann 04d9d5bd43 libgimpwidgets/gimpcolorarea.c more object properties.
2005-05-20  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c: more object properties.
2005-05-20 20:42:39 +00:00
Sven Neumann 6bd6a44442 libgimpwidgets/Makefile.am libgimpwidgets/gimpwidgetsenums.h moved enums
2005-05-20  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgetsenums.h
	* libgimpwidgets/gimpwidgetstypes.h: moved enums to a new file and
	register the GimpColorAreaType enum with the type system.

	* libgimpwidgets/gimpwidgets.def: updated.

	* libgimpwidgets/gimpcolorarea.c: added an object property.
2005-05-20 18:34:00 +00:00
Sven Neumann 763bbcd496 libgimpwidgets/Makefile.am libgimpwidgets/gimpwidgets.def
2004-07-26  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets.def
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimpwidgetstypes.h
	* libgimpwidgets/gimpcellrenderercolor.[ch]: added a GimpRGB cell
	renderer.

	* libgimpwidgets/gimpcolorarea.[ch]: exported the function that
	renders the color to a buffer for internal use in libgimpwidgets.

	* libgimpwidgets/gimpcolorhexentry.c: use the new cell renderer
	for the completion popup.
2004-07-26 18:52:35 +00:00