Commit Graph

431 Commits

Author SHA1 Message Date
eb5bb6363e app/display: draw the crop highlight using cairo
Instead of dimming the actual pixels, apply a translucent fill to
the area outside the highlight rectangle.
2010-09-29 20:34:59 +02:00
ccee0ec41a app/display: let cairo render the checkerboard
Instead of blending the scaled image data onto the checkerboard and
then painting this image to the screen, render the image data into
an ARGB cairo image surface. Then paint a checkerboard on the canvas
and the image on top of it.
2010-09-29 20:34:59 +02:00
f284e5f748 app: don't draw the draw tool's items to the wrong display 2010-09-26 16:56:26 +02:00
c058ec93ee app: temporarily enable double buffering unconditionally 2010-09-23 00:11:18 +02:00
1ea16c0770 app: draw the active tool's stuff in the display expose handler 2010-09-22 22:24:22 +02:00
8a029f3e4e app: enable double buffering when editing vectors 2010-09-17 23:12:42 +02:00
4c57e3f19e app: port GimpVectors drawing to cairo
This is just a rough proof of concept. More changes are about
to follow.
2010-09-16 21:13:08 +02:00
fd14818035 app: port GimpDisplayShell transform preview drawing to cairo 2010-09-08 19:32:22 +02:00
274f210e4c app: remove obsolete includes 2010-08-28 15:33:25 +02:00
02abdff8aa app: move the wilber drawing functions to gimpcairo.c 2010-08-28 15:30:02 +02:00
c0e475e7e2 app: add comment about cairo_t and double buffering 2010-08-28 11:44:11 +02:00
d1393686ab app: move creating of the cairo_t to gimp_display_shell_canvas_expose()
and pass it down to the drawing functions.
2010-08-28 00:09:31 +02:00
f0c40d3717 app: port GimpDisplayShell image drawing to cairo 2010-08-27 23:15:25 +02:00
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
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
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
529ce40a5d app: port GimpDisplayShell grid drawing to cairo 2010-08-11 13:16:55 +02:00
4ca603e97d Revert "Bug 610587 - Zooming with zoom tool pans away from the cursor"
This reverts commit 1f1f20261e. It was
not proper , and correcting it reintroduces the bug :(
2010-06-18 23:00:11 +02:00
1f1f20261e Bug 610587 - Zooming with zoom tool pans away from the cursor
Connect gimp_display_shell_hscrollbar_update to "notify::" so that the
notify freeze in gimp_display_shell_scale_update_scrollbars() works.
2010-06-18 20:53:01 +02:00
67ba62154e app: fix and improve text style overlay keyboard interaction
- app/widgets/gimptextstyleeditor.c: don't block all key events so
  they can reach the canvas.

- app/display/gimpdisplayshell-callbacks.c: instead, ignore canvas key
  events when the canvas has no focus.

This fixes navigating out of the text style editor with TAB, moving
focus to the canvas. I have no clue why navigating *between* the
widgets in the style editor doesn't work.
2010-05-12 19:00:18 +02:00
4ceb72848a app: enable canvas double buffering if there is a transform preview
or it will flicker like mad.
2010-05-10 20:57:45 +02:00
b925e256d3 app: don't set the GTK_HAS_FOCUS flag on the canvas manually
because it's sealed and deprecated. I don't remember why this code was
there at all (it should never be needed), so I added warnings that go
off if the widget's focus state doesn't match the received event.
2010-05-10 20:00:23 +02:00
02b8eea086 app: restrict sample point drawing to the exposed region
With the same limitation as for guides in the last commit.
2010-05-02 15:58:51 +02:00
6e4be79bef app: restrict grid and guide drawing to the exposed region
Doesn't really clip yet for guide drawing, but at least doesn't bother
to draw them when they are outside the expose region's bounding box.
2010-05-02 15:40:11 +02:00
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
656e99faf5 app: clean up and simplify gimp_display_shell_canvas_expose() 2010-05-01 18:02:42 +02:00
a2c70822d4 Use accessors from GTK+ 2.20 instead of using sealed members directly 2010-04-19 19:21:07 +02:00
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
62af8de7ea app: no need to say shell->canvas when we are in a canvas callback 2010-03-02 00:11:47 +01:00
ede02a68b9 app: Make pressure at stroke ends nicer 2010-02-24 02:15:50 +02:00
f9a2c5cfe1 app: Add Windows→Hide docks menu item
Add Windows→Hide docks menu item. We don't remove the hardcoding of
having Tab trigger it though, because gtk_accelerator_valid() returns
FALSE for GDK_tab. This means that if the user changes keyboard
shortcut for the menu item, both the user shortcut and the hardcoded
shortcut will work. We remove gimp_dialog_factories_toggle() and make
clients activate the action instead to toggle dock visibility.
2010-02-20 22:54:11 +01:00
2cb8f0a864 app: Make sure button releases get handled by paint tools too 2010-02-19 22:42:35 +02:00
c0aa4498d2 app: add intrastructure to send key_release events to tools
The code is 100% identical to the key_press handling and simply
dispatches key_release events too tools which selected them via
GimpToolControl.
2010-02-18 20:50:11 +01:00
5af05cce0b app: move the entire get-coords API from GimpDisplayShell to GimpDeviceInfo
because GimpDeviceInfo will soon apply curves to the axes. Also change
everything to speak in terms of GimpDeviceInfo instead of GdkDevice.
2010-02-16 13:00:46 +01:00
2604db71a8 app: Don't yell in FIXME, explain instead 2010-01-19 23:15:37 +01:00
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
d3dde03b78 app: Fix a tug of war with scrollbars when middle click panning.
Whenever panning with a mouse scrollbars generated reverse events,
one for each, causing flicker on image borders.
2010-01-10 22:16:27 +02:00
dbf844c012 app: Disable history buffer via use of gimprc option
Adds non-UI option to disable the use of often buggy history buffer.
This option defaults to false, since a lot of device/X/GDK combos are broken
and the resulting stroke often actually looks better without history events.
Put (use-event-history yes) in gimprc if you want more events and possibly bugs.
2009-12-20 18:46:25 +02:00
1f4098200a Revert "app: Removing code for making use of the X event history buffer"
This reverts commit af4717e78f.
People want it, to see when the backend is fixed.
2009-12-20 17:29:22 +02:00
af4717e78f app: Removing code for making use of the X event history buffer
X event history buffer is major source of problems. Almost all reports
about painting at an offset from the cursor in GIMP seem to originate
from history buffer bugs either at X or GTK level. There are device&X
combinations that work fine and there are others that are broken.
With current smothing the benefits of using the buffer are almost gone
and more exact does not always mean better to look at.
2009-12-20 16:27:03 +02:00
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
ea7c37293c Don't block all key events on the canvas (fixes tool interaction)
(gimp_display_shell_canvas_tool_events): when ignoring events on
overlays, special case key events because they always originate from
the topelvel and never from the canvas' window itself.
2009-10-21 19:35:20 +02:00
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
6608d66cde Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 19:51:33 +02:00
23955439d6 Don't access GtkAdjustment's members directly
but also don't use its accessors because doing that would emit
"changed" multiple times when setting up an adjustment with multiple
utility functions. Instead, use g_object_set() and freeze/thaw
notification around all calls. g_object_thaw_notify() will make sure
"changed" is emitted if anything has changed since freezing.
2009-10-09 09:59:01 +02:00
c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
d1ded0617f More gimp_display_get_shell() instead of display->shell 2009-10-05 19:58:03 +02:00
1c430a2b19 Move all GimpImageWindow members to a private struct
Add accessor functions for publically available members and visibility
functions for menubar and statusbar.
2009-09-29 21:44:43 +02:00
253b8e2cbe Use gimp_display_shell_get_window() instead of gtk_widget_get_toplevel()
The new function does the right thing, unlike get_toplevel() which
returns the shell itself if it is not in a window. Check the return
value of get_window() for being non-NULL.
2009-09-29 20:32:26 +02:00
54edc20113 Add missing #include "gimpimagewindow.h" 2009-09-28 22:55:54 +02:00