Commit Graph

97 Commits

Author SHA1 Message Date
Ell 0c899394b4 Issue #4205 - The histogram dock scale is incorrect when an image is opened
In gimp_histogram_view_update_bins(), don't update the view's
range if there's no histogram or the histogram is empty, to avoid
discarding the existing range.  Additionally, improve the range
readjustment when the number of bins changes.
2019-11-11 18:16:52 +02:00
Ell fc17f0ed0c app: streamline GimpHistogram; avoid spurious channel switch in histogram view
In GimpHistogram, get rid of the "n-channels" property and
corresponding gimp_histogram_n_channels() function.  The former
returned the actual number of channels, but this wasn't too useful,
as channel values may not be sequential; the latter returned the
number of components.  Instead, add an "n-components" property and
a corresponding gimp_histogram_n_components() function, both of
which return the number of components.  Furthermore, add a
gimp_histogram_has_channel() function, which determines if the
histogram has a given channel; this allows for simple testing for
channel availability, which was done wrong in various places.

Adjust the GimpHistogram code for the changes, and clean it up,
fixing a few bugs.

Adjust users of GimpHisotgram for the changes.  In particular,
in GimpHisotgramView, fix the channel-availability test when
setting the view's histogram (which happens whenever the active
drawable's preview is frozen), to avoid erroneously swithcing the
view's channel back to "Value" when a non-RGB channel is selected.
2019-10-22 15:50:13 +03:00
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
2019-07-31 10:16:21 +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 b5d78ee98a app: fix themeing of GimpHistogramView and GimpCurveView
by simply getting rid of all earlier added style properties
and instead using the style of the "view" CSS class.
2018-05-20 21:06:33 +02:00
Michael Natterer 251d2f494e app: port some stuff to gdk_seat_grab/ungrab 2018-05-20 21:06:30 +02:00
Michael Natterer 4f0a87ffa6 app, libgimpwidgets, themes: fix some themeing
Add CSS names using gtk_widget_class_set_css_name(), remove styling in
code and instead do it properly in CSS, so far in the System theme.
All horribly incomplete but a start.
2018-05-20 21:06:30 +02:00
Michael Natterer bc7b35d2d6 app: port GimpHistogramView to gdk_device_grab()/ungrab() 2018-05-20 21:06:29 +02:00
Michael Natterer 107fc72237 app: define all GimpHistogramView colors via style properties and CSS 2018-05-20 21:06:28 +02:00
Michael Natterer a4b8dafe61 app: add style property and default CSS for GimpHistogramView's grid-color 2018-05-20 21:06:28 +02:00
Michael Natterer 74564dfef3 app: port GimpHistogramView to GtkStyleContext
Locally added shade() and mix() utility functions which use
GtkSymbolicColor. Will move them to a better place once they are
needed elsewhere.
2018-05-20 21:06:28 +02:00
Michael Natterer 20627342ac app: port to the new size request API 2018-05-20 21:06:27 +02:00
Michael Natterer c3b7cee99b app: forgot to remove a cairo_destroy() in draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 0ba456bbd0 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Ell 44ffbe74df app: always update GimpHistogramView bins when changing histograms
... and not only when histogram != NULL, since the bin count may
change in either case.
2018-05-11 21:42:56 -04:00
Ell 4ad72cfc77 app: connect GimpHistogramView to bg-histogram "notify" signal
In GimpHistogramView, connect the view to the bg-histogram's
"notify" signal, and update the view in response.  Previously, we
only updated the view in response to the main histogram's "notify"
signal.

The curves tool only uses the bg-histogram, and after the switch to
asynchronous histogram calculation, in commit
49382e53d5, it failed to update the
histogram view after the calculation was complete.
2018-05-11 21:31:16 -04:00
Michael Natterer 1950eda8ab app: fix rendering of the bg_histogram in GimpHistogramView
gimp_histogram_view_draw_spike(): we were shifting the bg_histogram to
the right by accidentially offsetting the 'i' variable, use a local
variable for the loop instead.
2018-05-07 10:17:19 +02:00
Michael Natterer 4d94863abc app: don't use style->dark for histogram and curve intersections/grid
because it's always darker than "bg" and not visible in dark themes.
Instead, use "text_aa" which is always between "text" and "base".
2018-04-17 20:44:03 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Michael Natterer bc1997eeeb app: fix shutdown of GimpHistogramView
Not only unref the histograms, also disconnect from their signals.
2017-07-05 12:21:23 +02:00
Michael Natterer 94ec249e1e app: initialize variable in gimp_histogram_view_update_bins() 2013-06-18 00:10:57 +02:00
Michael Natterer 3fb16c8849 app: GimpHistogramView: fix display when the number of bins changes
Also look at "bg_histogram", but only if "histogram" is not set. Fixes
curves tool display after changing image precision.
2013-06-15 20:29:42 +02:00
Michael Natterer d26cd268ba app: start using the new histogram property notifications in the widgets
This is only WIP, but it at least updates the selected range correctly
when the image precision changes.
2013-06-11 22:36:33 +02:00
Michael Natterer a7f42de4c0 app: turn GimpHistorgram into a GimpObject, no other changes 2013-06-11 21:23:32 +02:00
Michael Natterer 88a971f6c9 app: port GimpHistogramView drawing to a flexible amount of bins 2013-06-11 08:48:25 +02:00
Michael Natterer 844a8a5ab7 app: more <gegl.h> includes 2012-05-02 17:51:04 +02:00
Michael Natterer 8d5471502e app: move GimpHistogram from base/ to core/ 2012-05-02 17:46:13 +02:00
Michael Natterer 180cb656ae Remove more gdk_pointer_grab() where they are not strictly needed
and replace them by gtk_grab_add()/remove().
2011-12-10 21:51:05 +01:00
Michael Natterer 4466b3a35b app: remove code duplication in the histogram and curve views
by letting the histogram view always draw the background and the outer
borders. Also fix a lot of off-by-one problems in the curve view which
occur due to the 0.5,0.5 offset of cairo line drawing.
2010-07-30 12:51:03 +02:00
Michael Natterer c548a593e5 app: port GimpHistogramView drawing to cairo 2010-07-30 12:18:08 +02:00
Michael Natterer 7175f3e883 Some more changes to build with GSEAL_ENABLE
- use more GTK+ accessors instead of struct members
- remove quite some #undef GSEAL_ENABLE from completely ported files
2010-01-15 15:35:03 +01:00
Michael Natterer 1a23b9ecf2 Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 20:20:39 +02:00
Michael Natterer d85fb156b5 app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcolordialog.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontrollereditor.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimperrordialog.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpmessagedialog.c
	* app/widgets/gimpnavigationview.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimppatternselect.c
	* app/widgets/gimpprogressbox.c
	* app/widgets/gimpprogressdialog.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpselectiondata.c
	* app/widgets/gimpsessioninfo.c
	* app/widgets/gimpsettingsbox.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpview-popup.c
	* app/widgets/gimpview.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpwidgets-utils.c: use accessors for various
	members of GTK+ structures that don't exist any longer when
	GSEAL_ENABLE is defined.


svn path=/trunk/; revision=28193
2009-03-22 16:35:53 +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
Sven Neumann 5b374543cb plugged memory leak.
2008-07-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpsessioninfo-aux.c
	(gimp_session_info_aux_new_from_props): plugged memory leak.

2008-07-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimphistogramview.c
	(gimp_histogram_view_set_background): fixed refcounting	issue.
	This plugs the memory leak I tried to fix in 
GimpHistogramEditor.


svn path=/trunk/; revision=26271
2008-07-22 10:34:21 +00:00
Michael Natterer f53ed53cdb app/widgets/gimpactionview.c app/widgets/gimpblobeditor.c
2008-06-28  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpactionview.c
	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushfactoryview.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcellrendererdashes.c
	* app/widgets/gimpcellrendererviewable.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcomponenteditor.c
	* app/widgets/gimpcontainerbox.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockseparator.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimpmenudock.c
	* app/widgets/gimpmessagebox.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpsessioninfo-book.c
	* app/widgets/gimpsessioninfo-dock.c
	* app/widgets/gimpsettingseditor.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptemplateeditor.c
	* app/widgets/gimptemplateview.c
	* app/widgets/gimpthumbbox.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimptooloptionseditor.c
	* app/widgets/gimptoolview.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpviewrenderervectors.c
	* app/widgets/gimpwidgets-utils.c: use accessors instead of
	accessing members of GTK+ widgets directly.


svn path=/trunk/; revision=26008
2008-06-28 15:50:27 +00:00
Michael Natterer 50ad5cfd32 add refcounting and replace free() API by ref() and unref().
2008-02-04  Michael Natterer  <mitch@gimp.org>

	* app/base/gimphistogram.[ch]: add refcounting and replace free()
	API by ref() and unref().

	* app/core/gimpdrawable-equalize.c
	* app/core/gimpdrawable-levels.c
	* app/widgets/gimphistogrameditor.c
	* tools/pdbgen/pdb/color.pdb: replace calls to
	gimp_histogram_free() by gimp_histogram_unref().

	* app/pdb/color_cmds.c: regenerated.

	* app/widgets/gimphistogramview.c: reference the histograms so we
	don't need the widget's users to keep them around while the widget
	exists.

	* app/tools/gimpcurvestool.[ch]: remove the histogram from the
	tool struct and just create one locally to set it on the histogram
	view widget.

	Unrelated:

	* app/tools/gimplevelstool.[ch]
	* app/tools/gimpthresholdtool.[ch]: renamed "hist" members to
	"histogram" plus some cleanup.


svn path=/trunk/; revision=24792
2008-02-04 21:41:57 +00:00
Michael Natterer 2abe1667eb don't emit signals/notifications if the setting didn't change.
2008-01-30  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimphistogramview.c
	(gimp_histogram_view_set_channel)
	(gimp_histogram_view_set_scale)
	(gimp_histogram_view_set_range): don't emit signals/notifications
	if the setting didn't change.


svn path=/trunk/; revision=24751
2008-01-30 18:19:12 +00:00
Michael Natterer f5bd538118 app/widgets/gimpcolorbar.c cosmetic.
2007-11-20  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcolorbar.c
	* app/widgets/gimphistogramview.c: cosmetic.


svn path=/trunk/; revision=24197
2007-11-19 23:39:56 +00:00
Michael Natterer 2ff7c79caf add read-only property "frozen" and new API
2007-11-15  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpviewable.[ch]: add read-only property "frozen" and
	new API gimp_viewable_preview_is_fozen(). Emit property notifications.

	* app/widgets/gimphistogramview.[ch]: add API to show a second
	histogram in the background. Remove member "light_histogram" from
	the GimpHistogramViewClass struct.

	* app/widgets/gimpcurveview.c: don't set "light_histogram".

	* app/tools/gimpcurvestool.c: set the background histogram instead.

	* app/widgets/gimphistogrameditor.[ch]: connect to "notify::frozen"
	of the drawable and show its histogram at the freezing point in
	the background. This way the original histogram is visible while
	we are doing color corrections.


svn path=/trunk/; revision=24158
2007-11-15 10:26:25 +00:00
Michael Natterer ae1f2eb2bc app/widgets/Makefile.am app/widgets/widgets-types.h new GimpHistogramView
2007-11-04  Michael Natterer  <mitch@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpcurveview.[ch]: new GimpHistogramView subclass
	which does all the curve stuff.

	* app/widgets/gimphistorgramview.[ch]: removed all curve code again.

	* app/tools/gimpcurvestool.c: changed accordingly.


svn path=/trunk/; revision=24051
2007-11-04 13:09:10 +00:00
Michael Natterer 6c64c64b07 added API to set the selected point.
2007-11-02  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimphistogramview.[ch]: added API to set the
	selected point.

	* app/tools/gimpcurvestool.c: use it.


svn path=/trunk/; revision=24046
2007-11-02 17:08:42 +00:00
Michael Natterer e5927feba1 added API to modify free-form curves and properties to listen to curve
2007-11-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcurve.[ch]: added API to modify free-form curves
	and properties to listen to curve changes.

	* app/widgets/gimphistogramview.[ch]: added everything that's
	needed for rendering a curve with all its color and cursor
	indicators on top of a histogram. This code will move to a
	subclass soon.

	* app/tools/gimpcurvestool.[ch]: removed all curve rendering here.
	Also removed all explicit updating by connecting to curve signals
	and updating in the callback.


svn path=/trunk/; revision=24045
2007-11-02 16:51:18 +00:00
Sven Neumann cd92f46891 pass the maximum value double and draw the histogram one pixel less high.
2007-08-11  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimphistogramview.c 
(gimp_histogram_view_draw_spike):
	pass the maximum value double and draw the histogram one pixel 
less
	high. Fixes bug #465669.


svn path=/trunk/; revision=23208
2007-08-11 15:27:11 +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
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 049872b361 app/*.[ch] converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* app/*.[ch]
	* app/*/*.[ch]: converted tabs to spaces.
2006-04-12 12:49:29 +00:00
Michael Natterer e1ceed5147 define GIMP_PARAM_STATIC_STRINGS which is G_PARAM_STATIC_NAME|NICK|BLURB.
2006-01-18  Michael Natterer  <mitch@gimp.org>

	* app/config/config-types.c: define GIMP_PARAM_STATIC_STRINGS
	which is G_PARAM_STATIC_NAME|NICK|BLURB. Also define
	GIMP_PARAM_READABLE, _WRITABLE and _READWRITE which include
	GIMP_PARAM_STATIC_STRINGS.

	* app/*/*.c: use them for all object properties so their
	strings are not copied.
2006-01-18 20:29:40 +00:00
Michael Natterer 61df53ec54 port to G_DEFINE_TYPE() and friends. Some related cleanup.
2005-12-19  Michael Natterer  <mitch@gimp.org>

	* app/widgets/*.c: port to G_DEFINE_TYPE() and friends. Some
	related cleanup.
2005-12-19 22:37:49 +00:00
Michael Natterer 8d856ef5de app/widgets/gimphistogramview.c cleanup.
2005-07-14  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimphistogramview.c
	* app/widgets/gimpnavigationview.c: cleanup.
2005-07-14 18:51:32 +00:00