Commit Graph

456 Commits

Author SHA1 Message Date
Michael Natterer f09be52c1b app: turn the transform preview into a GimpCanvasItem
And remove all the complicated handling code entirely. This makes
GimpTransformTool a lot less complex. As a nice side effect, the
preview is now always 100% in sync with the grid and handles.
2011-03-27 16:40:41 +02:00
Michael Natterer a5549ece52 app: don't pause/resume the shell (and the active tool) around expose()
This was only there to make sure XOR drawing works, and is now
complete overhead since cairo drawing is done *in* expose, and not in
some hack around it.
2011-03-25 21:28:21 +01:00
Michael Natterer de8a07703a app: name display scrollbar callbacks like the signal they are handling
instead of calling them all foo_update() which means absolutely nothing.
Also rename nav_button_press() to navigation_button_press().
2011-02-24 02:15:53 +01:00
Michael Natterer c09ad998a4 app: split tool event handling out into an own file
it was simply getting too hairy in the callbacks.c file.
2011-02-24 02:15:53 +01:00
Michael Natterer 09947733d6 app: use some of the new GDK_KEY_foo #defines from GTK+ 2.22
and use them in gimpdisplayshell-callbacks.c so I can do some
refactoring there without making rebasing the gtk3-port branch almost
impossible.
2011-02-24 02:15:53 +01:00
Michael Natterer ac9ffde880 app: formatting and other minor cleanups 2011-02-22 16:27:18 +01:00
Michael Natterer 4030e3f446 app: make gimp_display_shell_flush_event_queue() private 2011-02-20 16:58:37 +01:00
Michael Natterer 9151899aab app: move variable to local scope in gimp_display_shell_canvas_tool_events() 2011-02-20 16:33:46 +01:00
Michael Natterer 36cc10c4dc app: rename gimp_display_shell_[un]transform_coordiante() to _coords() 2011-02-20 16:29:20 +01:00
Michael Natterer 4bf3a136e0 app: factor out GimpDisplayShell tool event retrieval and untransforming 2011-02-20 16:23:17 +01:00
Michael Natterer d300882401 app: factor out GimpDisplayShell cursor updating to a utility function 2011-02-20 15:38:58 +01:00
Michael Natterer f7bb5f460c app: rename the functions dealing with GimpDisplayShell's software cursor
to gimp_display_shell_foo_software_cursor() in order to remove
confusion with the functions that deal with the windowing system's
cursor.
2011-02-20 14:46:52 +01:00
Michael Natterer d504eeb048 app: move GimpDisplayShell pointer/keyboard grabbing to utility functions
Spit warnings in the functions if grabbing fails and return a boolean
success value. Bail out in the callers upon grab failure instead of
assuming that grabbing always succeeds and running into an
inconsistent state that can cause all sorts of problems.
2011-02-20 12:12:48 +01:00
Michael Natterer 748fac5c00 app: g_printerr() a warning if grabbing fails
This should not happen, but happens anyway on GTK+ 3.x, so better warn
about it to make debugging easier.
2010-12-07 19:57:13 +01:00
Michael Natterer 458230bf8d app: use a GimpCanvasPassePartout for drawing the crop highlight
and remove all old drawing logic.
2010-11-12 19:47:51 +01:00
Michael Natterer f8d6821790 app: get rid of selection_control() in core/ and display/
- replace gimp_display_shell_selection_control() by undraw() and restart()
  which actually say what they are doing
- remove enum GimpSelectionControl
- replace GimpImage::selection_control() by ::selection_invalidate()
  because none of the other enum values was used any longer
2010-10-09 20:28:37 +02:00
Michael Natterer 914ac9aa11 app: no need to cairo_save()/restore() around drawing a canvas item 2010-10-08 16:13:21 +02:00
Michael Natterer 55f01bf6f3 app: remove gimp_display_shell_draw_vectors()
which is the last bit of non-item drawing of stuff that is not
somehow the image itself... wheee!

This involves reverting commit
6bce0641d4 and adding back all the
vectors handlers that were in gimpdisplayshell-callbacks.c before.
Change the callbacks to manage proxy items for all the image's
vectors.
2010-10-08 01:03:56 +02:00
Michael Natterer 1d45f6295e app: add a software cursor canvas item
and use it to draw the sw cursor. Almost every aspect of the old code
was ugly and hard to read, this is so much nicer...
2010-10-02 21:56:36 +02:00
Michael Natterer 502d7c815b app: add a canvas grid item class and use it to draw the grid
Remove gimp_display_shell_draw_grid().
2010-10-02 20:57:40 +02:00
Michael Natterer d3f19baf0d app: remove "shell" parameter from GimpCanvasItem's public APIs
because each item has a shell now. Keep the parameter in the virtual
functions though because that saves a lot of code in the subclasses.
2010-10-01 14:54:53 +02:00
Michael Natterer 26d0035be0 app: draw guides using GimpCanvasItems
- Add signals GimpImage::guide_added(), removed() and moved()
- Remove singal GimpImage::update_guide()
- Adapt core code to emit the new signals instead of update_guide()
- Have the shell connect to the new signals and update guide canvas
  items as needed
- Remove gimp_display_shell_draw_guides()
2010-10-01 10:34:15 +02:00
Michael Natterer 0c613ba87d app: port sample point drawing to GimpCanvasItems
- Add GimpImage signal "sample-point-moved" and emit it when needed
- Let the shell connect to the sample point add, remove and move signals
  and update the canvas items accordingly
- Remove gimp_display_shell_draw_sample_points()
2010-10-01 09:27:57 +02:00
Michael Natterer 7edfa2ca54 app: start an infrastructure where the shell keeps around its canvas items
- Invalidate the proper area when an item gets added or removed.
- Draw the kept canvas items instead of calling a draw tool function.
- The draw tool now sets its item on the shell.
2010-09-29 22:12:01 +02:00
Michael Natterer 42e137fc74 app: rename gimp_display_shell_draw_area() to draw_image() 2010-09-29 20:58:13 +02:00
Sven Neumann 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
Sven Neumann 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
Michael Natterer f284e5f748 app: don't draw the draw tool's items to the wrong display 2010-09-26 16:56:26 +02:00
Michael Natterer c058ec93ee app: temporarily enable double buffering unconditionally 2010-09-23 00:11:18 +02:00
Michael Natterer 1ea16c0770 app: draw the active tool's stuff in the display expose handler 2010-09-22 22:24:22 +02:00
Michael Natterer 8a029f3e4e app: enable double buffering when editing vectors 2010-09-17 23:12:42 +02:00
Sven Neumann 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
Michael Natterer fd14818035 app: port GimpDisplayShell transform preview drawing to cairo 2010-09-08 19:32:22 +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 c0e475e7e2 app: add comment about cairo_t and double buffering 2010-08-28 11:44:11 +02:00
Michael Natterer 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
Michael Natterer f0c40d3717 app: port GimpDisplayShell image drawing to cairo 2010-08-27 23:15:25 +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 529ce40a5d app: port GimpDisplayShell grid drawing to cairo 2010-08-11 13:16:55 +02:00
Martin Nordholts 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
Martin Nordholts 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
Michael Natterer 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
Michael Natterer 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
Michael Natterer 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
Michael Natterer 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
Michael Natterer 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
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