Commit Graph

44 Commits

Author SHA1 Message Date
Michael Natterer e909b77969 Bug 771851 - Vertical ruler shows artifacts if the status bar isn't showing
gimp_ruler_draw_pos(): when remembering the just drawn rectangle's
position, don't just unconditionally overwrite the previous position's
rectangle. Instead, if the previous position's rectangle has not been
cleared yet (has a non-zero size), remember the union of old and new
rectangle.

Why this only happened to the vertical ruler with statusbar off is
beyond my mind, it should have always produced artifacts.

Unrelated: make sure the idle function is removed if we decide to
immediately redraw in gimp_ruler_set_position().
2016-09-22 23:10:10 +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 64a93c6051 libgimpwidgets: merge a small GimpRuler optimization from gtk3-port
In size_allocate(), call gimp_ruler_make_pixmap() only if the widget
was resized, not only moved around.
2016-09-09 10:02:53 +02:00
Michael Natterer f2d581a536 Bug 761170 - Warnings building with clang
Fix a bunch of clang warnings.
2016-02-12 22:49:47 +01:00
Michael Natterer f6df750714 libgimpwidgets: minor formatting changes in gimpruler.c
to make rebasing this file in gtk3-port a little less painful.
2015-09-27 13:45:13 +02:00
Michael Henning 8c02b360fb libgimpwidgets: Disconnect ruler's idle handler in dispose
As discussed on irc, this is more appropriate than finalize because
we shouldn't be making any gtk calls after dispose.
2015-09-06 17:41:09 -04:00
Michael Henning 3233a70bae libgimpwidgets: Avoid updating the rulers too often.
Ever since 72617e42b, whenever the user generated a lot of mouse
input, we would constantly queue redraws to the rulers. These redraws
had a higher idle priority than updating the canvas, so we would
rarely get around to canvas updates, which made certain tools
(painting with dynamics, the blend tool) feel very unresponsive.

This fixes it by only redrawing the rulers if the mouse has moved
far from the last location, or if there are no idle handlers with
a priority above LOW.
2015-09-06 17:18:12 -04:00
Michael Henning 72617e42b4 Bug 736411 - Ruler updates cause slowdown when painting
We now avoid drawing rulers in the position property setter and use
gtk's region invalidation instead. Previously, we were basically
redrawing the ruler inside the mouse event handler, which is pure evil.
2015-08-13 11:41:18 -04:00
Michael Natterer affef350e7 libgimpwidgets: fix registration of GimpRuler's "unit" property
Install it with the PROP_UNIT id not PROP_LOWER (probably a copy &
paste mess). Spotted by John Cuppit.
2015-06-14 22:57:46 +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
Massimo Valentini 20863440fb Bug 736411 - Ruler updates cause slowdown when painting
Reuse the cairo_t from expose() in gimp_ruler_draw_pos() instead of
creating a new one.
2015-01-10 23:37:31 +01:00
Massimo Valentini 67525c0d47 Bug 688305: drag and drop for guides broken 2012-11-15 19:02:42 +01:00
Michael Natterer 59ea89234f app: GimpRuler: clip position marker drawing to the ruler's allocation
so we don't overdraw when drawing out of expose.
2011-04-20 00:31:59 +02:00
Michael Natterer c215677876 libgimpwidgets: turn GimpRuler into a no-window widget
and use an input-only window for events.
2011-04-10 02:00:40 +02:00
Mikael Magnusson 3eb096b239 Revert "libgimpwidgets: avoid using a function only available since GTK+ 2.22"
We depend on GTK+ 2.24 now.

This reverts commit 0e55c5e4d8.
2011-04-06 20:19:09 +02:00
Michael Natterer 24ee3370b8 Depend on GTK+ >= 2.24.3, cairo >= 1.20.1, gdk-pixbuf >= 2.22.1
and completely separate configure and sanity checks for gdk-pixbuf
from GTK+, because it's now distributed as a separate package. Remove
all sorts of conditional compiling based on GDK_CHECK_VERSION() and
CAIRO_VERSION.
2011-04-06 19:58:24 +02:00
Michael Natterer 4fd56d9640 libgimpwidgets: don't pass around uninitialized memory in GimpRuler 2011-02-06 11:20:07 +01:00
Michael Natterer 3ef31e4cc8 libgimpwidgets: use new GdkWindow API only when available 2011-01-23 00:30:58 +01:00
Michael Natterer d155be622d libgimpwidgets: fix ruler motion event tracking on offscreen overlays
Add a list of "track widgets" to GimpRuler and connect to their
motion-notify-event. Correctly translate the motion event's x/y to the
ruler's coordinate system when updating the marker.
2011-01-20 20:26:35 +01:00
Mikael Magnusson 0e55c5e4d8 libgimpwidgets: avoid using a function only available since GTK+ 2.22 2010-12-18 00:31:56 +01:00
Mikael Magnusson 2471f37660 libgimpwidgets: port the ruler from deprecated gdk to cairo
Backported from the gtk3-port branch.
2010-12-17 22:59:49 +01: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 a2c70822d4 Use accessors from GTK+ 2.20 instead of using sealed members directly 2010-04-19 19:21:07 +02:00
Michael Natterer 1aeb315ecf undef GTK_DISABLE_DEPRECATED in many places which undef GSEAL_ENABLE
because the widget flag access macros (e.g. GTK_WIDGET_REALIZED) are
now deprecated in GTK+ master.
2010-03-06 23:14:29 +01:00
Sven Neumann 42e31b1cc8 libgimpwidgets: clean up comment
Rephrase a comment so that it does not cause a false positive when
looking for deprecated GDK symbols.
2009-11-09 19:07:54 +01: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 2abca796bf Don't touch widget->requisition in size_request()
gimp_ruler_size_request(): modify the passed GtkRequisition, not
widget->requisition.
2009-08-01 18:57:58 +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 2bdb7d1e98 cosmetics.
2008-10-08  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpruler.c: cosmetics.


svn path=/trunk/; revision=27179
2008-10-08 18:47:13 +00:00
Sven Neumann 80b9cad58c cache the PangoLayout. Use it not only for drawing the numbers, but also
2008-10-05  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.c: cache the PangoLayout. Use it not
	only for drawing the numbers, but also to calculate the size
	requisition depending on the actual font size.


svn path=/trunk/; revision=27131
2008-10-04 23:32:41 +00:00
Sven Neumann 35b5591585 instead of hardcoding a size request, implement GtkWidget::size_request
2008-10-05  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.c: instead of hardcoding a size
	request, implement GtkWidget::size_request and set the size
	depending on the font-scale.


svn path=/trunk/; revision=27130
2008-10-04 23:13:44 +00:00
Sven Neumann 61f31f307e increased ruler font scale from X_SMALL to SMALL as it appears to be too
2008-10-04  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.c: increased ruler font scale from
	X_SMALL to SMALL as it appears to be too small for many users.

	* themes/Default/gtkrc: follow that change here, but keep the
	ruler font extra small in the Small theme.


svn path=/trunk/; revision=27127
2008-10-04 21:47:53 +00:00
Sven Neumann c28b7653f5 make the font scale factor configurable in gtkrc.
2008-10-04  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.c: make the font scale factor
	configurable in gtkrc.

	* themes/Default/gtkrc
	* themes/Small/gtkrc: for documentation, add the default value 
here.


svn path=/trunk/; revision=27121
2008-10-03 22:11:15 +00:00
Michael Natterer 975f6d0a1a use gtk_widget_get_style() instead of widget->style. Reduce indentation by
2008-09-02  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpruler.c: use gtk_widget_get_style() instead
	of widget->style. Reduce indentation by one level in
	gimp_ruler_draw_pos().


svn path=/trunk/; revision=26836
2008-09-02 12:30:53 +00:00
Sven Neumann 8a374be95f fixed gtk-doc comment.
2008-08-29  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.c (gimp_ruler_new): fixed gtk-doc 
comment.


svn path=/trunk/; revision=26812
2008-08-29 10:43:21 +00:00
Michael Natterer 067a7e093a Should say make before committing...
svn path=/trunk/; revision=26811
2008-08-29 10:40:38 +00:00
Michael Natterer edcd1e7810 libgimpwidgets/Makefile.am libgimpwidgets/gimpwidgets.h
2008-08-29  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimphruler.[ch]
	* libgimpwidgets/gimpvruler.[ch]: remove separate H/VRuler classes.

	* libgimpwidgets/gimpruler.[ch]: add an "orientation" property
	instead. Add gimp_ruler_new().

	* libgimpwidgets/gimpwidgets.def: changed accordingly.

	* app/dialogs/resolution-calibrate-dialog.c
	* app/display/gimpdisplayshell.c
	* plug-ins/gfig/gfig-preview.c
	* plug-ins/imagemap/imap_preview.c: ditto.


svn path=/trunk/; revision=26810
2008-08-29 10:25:29 +00:00
Sven Neumann fcc0dc50a0 libgimpwidgets/gimpruler.[ch] libgimpwidgets/gimphruler.c removed
2008-05-28  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.[ch]
	* libgimpwidgets/gimphruler.c
	* libgimpwidgets/gimpvruler.c: removed GimpRulerMetric struct from
	public API. Removed gimp_ruler_draw_pos() and gimp_ruler_draw_ticks()
	methods. Added a "unit" property with getter and setter.

	* libgimpwidgets/gimpwidgets.def: updated.

svn path=/trunk/; revision=25838
2008-05-28 11:49:24 +00:00
Sven Neumann e7494c1c0f started to sanitize the ruler API.
2008-05-28  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.[ch]: started to sanitize the ruler 
API.

	* app/dialogs/resolution-calibrate-dialog.c
	* app/display/gimpdisplayshell-scale.c
	* plug-ins/gfig/gfig-preview.c
	* plug-ins/imagemap/imap_preview.c

	* libgimpwidgets/gimpwidgets.def: updated.


svn path=/trunk/; revision=25836
2008-05-28 10:18:43 +00:00
Sven Neumann 305e672d3c libgimpwidgets/gimpruler.[ch] libgimpwidgets/gimphruler.c enlarge the
2008-05-28  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.[ch]
	* libgimpwidgets/gimphruler.c
	* libgimpwidgets/gimpvruler.c: enlarge the array of scales to
	prevent ruler numbers from overlapping (bug #535039).


svn path=/trunk/; revision=25835
2008-05-28 09:48:07 +00:00
Sven Neumann 7efbde7f85 minor tweaks and constification
svn path=/trunk/; revision=25830
2008-05-27 13:41:48 +00:00
Sven Neumann 89cd2d483d libgimpwidgets/gimpruler.[ch] libgimpwidgets/gimphruler.c
2008-05-27  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpruler.[ch]
	* libgimpwidgets/gimphruler.c (gimp_hruler_draw_ticks)
	* libgimpwidgets/gimpvruler.c (gimp_vruler_draw_ticks): use an
	extra small font for the tick labels.

	* themes/Default/gtkrc: don't hardcode a font size for the rulers.

svn path=/trunk/; revision=25829
2008-05-27 13:24:18 +00:00
Sven Neumann ae67f09ddd libgimpwidgets/Makefile.am libgimpwidgets/gimpwidgets.h
2008-05-26  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimpwidgetstypes.h

	* libgimpwidgets/gimpruler.[ch]
	* libgimpwidgets/gimphruler.[ch]
	* libgimpwidgets/gimpvruler.[ch]: added ruler widgets. These are
	mostly copied from GTK+ and work as a drop-in replacement for
	GtkRuler and friends.

	* libgimpwidgets/gimpwidgets.def: updated.

	* app/display/gimpdisplayshell.c
	* app/display/gimpdisplayshell-scale.c
	* app/dialogs/resolution-calibrate-dialog.c
	* plug-ins/imagemap/imap_preview.c
	* plug-ins/gfig/gfig-preview.c: use the GimpRuler widgets.


svn path=/trunk/; revision=25820
2008-05-26 21:20:16 +00:00