Commit Graph

78 Commits

Author SHA1 Message Date
Michael Natterer 30a45c05e4 app: turn double buffering off/on when filling/emptying the display
instead of turning it off unconditionally in gimp_canvas_init(), so we
have full control over buffering when we are rendering images, but let
GTK+ handle a flicker-free wilber itself.
2011-04-09 23:17:16 +02:00
Michael Natterer cad95533dd app: queue a draw on the canvas in gimp_canvas_set_bg_color()
Instead of doing it in gimp_display_shell_set_padding() from where
it's called.
2010-10-02 21:13:31 +02:00
Michael Natterer d6f035a934 app: bye bye XOR :D 2010-09-24 21:03:51 +02:00
Michael Natterer e7f1d444c3 app: remove much more dead code paths from the draw tool and the canvas 2010-09-24 19:08:19 +02:00
Michael Natterer 41c338ce93 app: remove XOR drawing code paths which are now dead 2010-09-24 02:11:04 +02:00
Michael Natterer 7e28f52dd7 app: remove unused clipping functions in GimpDrawTool and GimpCanvas 2010-09-19 18:58:23 +02:00
Martin Nordholts 0dc4b5de72 Fix a bunch of warnings 2010-08-31 22:46:36 +02:00
Michael Natterer 274f210e4c app: remove obsolete includes 2010-08-28 15:33:25 +02:00
Michael Natterer 02abdff8aa app: move the wilber drawing functions to gimpcairo.c 2010-08-28 15:30:02 +02:00
Michael Natterer f0c40d3717 app: port GimpDisplayShell image drawing to cairo 2010-08-27 23:15:25 +02:00
Michael Natterer a6ce99afe0 app: remove point drawing API from GimpCanvas, it's not used any longer 2010-08-26 21:01:21 +02:00
Michael Natterer be2bd189cd app: completely switch to cairo-drawing the selection
and remove all old selection drawing code. Thanks to Benjamin Otte for
pointing out the right optimization.

Also fixes bug #479875 - performance problem drawing a complex selection.
2010-08-26 20:52:52 +02:00
Michael Natterer 4e0925a67c app: port GimpDisplayShell layer boundary drawing to cairo
The boundary is temporarily kept around as both BoundSeg and
GdkSegment arrays now, but this uglyness will go away once porting to
cairo is complete.
2010-08-24 18:07:31 +02:00
Michael Natterer 18d3882c5c app: port GimpDisplayShell pen drawing to cairo 2010-08-23 21:59:27 +02:00
Michael Natterer 3a1ba90507 app: port GimpDisplayShell cursor drawing to cairo
Also add code to invalidate the new cursor location in
gimp_display_shell_update_cursor(), which is needed with
the new manual double buffering code.
2010-08-23 20:39:22 +02:00
Michael Natterer 1d1ff1fedd app: port GimpDisplayShell sample point drawing to cairo
Same disclaimer about tool uglyness applies here. Will be fixed.
2010-08-12 13:13:15 +02:00
Michael Natterer 922c330bec app: port GimpDisplayShell guide drawing to cairo
The cairo_t code in GimpMoveTool is still disgusting. This probably
needs some GimpTool API that creates a cairo_t for tools.
2010-08-12 00:51:58 +02:00
Michael Natterer 94dc079d44 app: forgot to save the last comment edit 2010-06-12 18:46:30 +02:00
Michael Natterer 88250391b0 app: fix keyboard focus navigation in overlay children
Implement GtkWidget::focus() and override GtkContainer's focus()
implementation which would always give focus to the canvas because it
is focussable. Instead, try navigating in the focussed overlay child
first, and use GtkContainer's default implementation only if that
fails (which happens when focus navigation leaves the overlay child).
2010-06-12 18:39:21 +02:00
Michael Natterer 1f8d2e66e1 app: make clip rect and clip region parameters const 2010-05-02 16:06:15 +02:00
Michael Natterer 84cf53d908 app: fix artifacts caused by delayed tool drawing
and as a "side effect", speed up rendering the image significantly:

- disable double buffering on the canvas widget.
- implement background clearing ourselves (needed after turning off
  double buffering).
- remove any fiddling with clipping regions on the tool drawing GCs
  and pull the pause/resume code out of the actual image expose
  function.
- if there are overlay widgets on the canvas, implement double
  buffering manually to aviod flicker, but do it in a way that keeps
  pausing/resuming the active tool *outside* the double buffered
  drawing.
2010-05-02 12:12:48 +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
Martin Nordholts fc35ec4fe5 app: Fix magic number in gimp_canvas_draw_segments() 2010-03-05 21:31:06 +01:00
Michael Natterer 6a00a4ef22 Add comment why we implement focus_in_event() and focus_out_event() 2009-11-04 19:32:13 +01:00
Michael Natterer 8c07e52759 Don't let focus-in and focus-out on the canvas invalidate everything
Implement GtkWidget::focus_in_event() and ::focus_out_event() in
GimpCanvas and don't chanin up so the default handler never runs.
Remove code that tries to do the same in the canvas' tool events
callback.

The default impl invalidates the entire widget for no reason (the
canvas doesn't draw a focus indicator anyway), and the old solution
failed for empty displays and was constantly invalidating the entire
drop zone when the toplevel window gained or lost focus.
2009-11-03 13:58:36 +01:00
Michael Natterer 8124792130 Derive GimpCanvas from GimpOverlayBox
- adapt callbacks to ignore / not block events on offscreen children
- use GimpOverlayBox' scroll API which makes sure overlay children
  don't scroll along
2009-10-18 22:19:29 +02:00
Michael Natterer 6608d66cde Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 19:51:33 +02:00
Michael Natterer 27d036b75f Render a layer group's boundary in a different color
This is probably not sufficient, but better than nothing.
2009-08-29 21:26:46 +02:00
Michael Natterer d3dcff66f7 app/display/gimpcanvas.c use accessors for various members of GTK+
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c
	* app/display/gimpdisplayshell.c: use accessors for various
	members of GTK+ structures that don't exist any longer when
	GSEAL_ENABLE is defined.


svn path=/trunk/; revision=28192
2009-03-22 16:03:46 +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 ce00697368 #define GIMP_CANVAS_EVENT_MASK.
2008-08-22  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.h: #define GIMP_CANVAS_EVENT_MASK.

	* app/display/gimpcanvas.c (gimp_canvas_realize): use it here.


svn path=/trunk/; revision=26713
2008-08-22 16:05:46 +00:00
Michael Natterer c1e13e2c5d add gimp_canvas_scroll() which scrolls the canvas and makes the result
2008-08-22  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.[ch]: add gimp_canvas_scroll() which
	scrolls the canvas and makes the result visible immediately.

	* app/display/gimpdisplayshell-scroll.c
	(gimp_display_shell_scroll): use the new function.


svn path=/trunk/; revision=26712
2008-08-22 15:57:41 +00:00
Michael Natterer 041fd8e125 turn into a GtkContainer subclass mainly to reduce the diff to a local
2008-08-21  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.[ch]: turn into a GtkContainer subclass
	mainly to reduce the diff to a local hack I'm at. Also swallow
	some code that used to be called on the canvas widget externally.

	* app/display/gimpdisplayshell.c (gimp_display_shell_new): remove
	the swallowed code.

	* app/display/gimpdisplayshell-callbacks.h: remove canvas event
	mask define.


svn path=/trunk/; revision=26708
2008-08-21 23:55:58 +00:00
Michael Natterer 8c66ea4b19 app/actions/layers-commands.c app/actions/view-actions.c
2008-06-28  Michael Natterer  <mitch@gimp.org>

	* app/actions/layers-commands.c
	* app/actions/view-actions.c
	* app/dialogs/about-dialog.c
	* app/dialogs/layer-options-dialog.c
	* app/dialogs/preferences-dialog.c
	* app/display/gimpcanvas.c
	* app/display/gimpdisplayshell-appearance.c
	* app/display/gimpnavigationeditor.c
	* modules/colorsel_water.c: use accessors instead of accessing
	members of GTK+ widgets directly.


svn path=/trunk/; revision=26006
2008-06-28 15:12:13 +00:00
Michael Natterer 8088b64c72 app/display/gimpcanvas.c app/widgets/gimpcoloreditor.c
2008-03-30  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c
	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcursorview.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockbook.c
	* app/widgets/gimpdockseparator.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpmenudock.c
	* app/widgets/gimpsamplepointeditor.c
	* app/widgets/gimptoolbox.c: chain up unconditionally in
	GtkWidget::style_set() because there is has a default
	implementation.


svn path=/trunk/; revision=25307
2008-03-29 23:43:39 +00:00
Sven Neumann 86cf30dd1d hide ugly details behind a sane API.
2008-03-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcairo-wilber.[ch]: 
	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): hide 
ugly
	details behind a sane API.


svn path=/trunk/; revision=25248
2008-03-26 19:25:55 +00:00
Sven Neumann 3f2120ed09 include a better Wilber path, thanks to Jimmac.
2008-03-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcairo-wilber.c: include a better Wilber path,
	thanks to Jimmac.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): undid
	scaling "fix", instead take the offset into account. Draw with
	transparency.

svn path=/trunk/; revision=25246
2008-03-26 17:25:00 +00:00
Michael Natterer 00b3334d1f fix scaling.
2008-03-26  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): fix scaling.


svn path=/trunk/; revision=25245
2008-03-26 16:33:04 +00:00
Sven Neumann 93dcbb1904 app/widgets/Makefile.am new files that renders a Wilber image as a Cairo
2008-03-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/gimpcairo-wilber.[ch]: new files that renders a
	Wilber image as a Cairo path. Or at least it is supposed to do
	this at some point...

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): use the
	scalable Wilber path. Needs more work...

svn path=/trunk/; revision=25244
2008-03-26 15:59:52 +00:00
Sven Neumann ea0f905e75 use the height for height, not the width
svn path=/trunk/; revision=25243
2008-03-26 14:20:23 +00:00
Sven Neumann 7dadaee825 install wilber.png.
2008-03-26  Sven Neumann  <sven@gimp.org>

	* data/images/Makefile.am: install wilber.png.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): try to
	load "wilber.png" from $prefix/share/gimp/2.0/images.

	* app/display/gimpdisplayshell.c (gimp_display_shell_new):
	improved tooltip.

svn path=/trunk/; revision=25242
2008-03-26 14:08:45 +00:00
Michael Natterer 7301aaaeae improve wilber scaling and remove the drop zone layout.
2008-03-26  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.[ch]: improve wilber scaling and remove
	the drop zone layout.

	* app/display/gimpdisplayshell.c: add a tooltip instead.


svn path=/trunk/; revision=25241
2008-03-26 13:49:27 +00:00
Michael Natterer 86f0c83d52 Forgot to unref the pixbuf.
svn path=/trunk/; revision=25237
2008-03-26 13:10:55 +00:00
Michael Natterer cc72a9d4c1 add wilber image to figure the proper scale behavior. Proper image still
2008-03-26  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): add
	wilber image to figure the proper scale behavior. Proper image
	still missing :)


svn path=/trunk/; revision=25236
2008-03-26 13:08:31 +00:00
Sven Neumann ee166ba599 tweaked opacity calculation so that the opacity is only increased with
2008-03-21  Sven Neumann  <sven@gimp.org>

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): tweaked
	opacity calculation so that the opacity is only increased with
	smaller font sizes.


svn path=/trunk/; revision=25166
2008-03-21 22:27:00 +00:00
Michael Natterer deefaa0e49 make sure the drop label's opacity scales with its size so we don't end up
2008-03-21  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): make sure
	the drop label's opacity scales with its size so we don't end up
	with tiny text at 10% opacity.


svn path=/trunk/; revision=25149
2008-03-21 11:31:47 +00:00
Michael Natterer fb6a3a0eca make the scale factor of the label 4/5 instead of 2/3 of the canvas and
2008-03-19  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): make the
	scale factor of the label 4/5 instead of 2/3 of the canvas and
	move the factor out of the MIN().


svn path=/trunk/; revision=25132
2008-03-19 20:37:45 +00:00
Sven Neumann 1c0466dabc return FALSE so that the default drag highlighting works.
2008-03-19  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_expose): return FALSE so that the
	default drag highlighting works.

	* app/display/gimpdisplayshell-dnd.c: only set the canvas as 
drop
	target, not the whole shell.

	* app/display/gimpdisplayshell.c: delay the call to
	gimp_display_shell_dnd_init() until after the canvas has been
	created.


svn path=/trunk/; revision=25127
2008-03-19 19:10:00 +00:00
Sven Neumann a355f1777b app/widgets/gimpdockable.c moved utility function for setting attributes
2008-03-19  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdockable.c
	* app/widgets/gimpwidgets-utils.[ch]: moved utility function for
	setting attributes on a PangoLayout out of gimpdockable.c.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): use a
	bold font and paint the layout with transparency.

svn path=/trunk/; revision=25116
2008-03-19 09:29:30 +00:00