Commit Graph

2636 Commits

Author SHA1 Message Date
915b0f3eec app: re-enable and port the display shell mask rendering code
for the ported foreground select tool. Untested!
2013-04-26 10:33:10 +02:00
89081075f3 app: don't subtract the offset twice in zoom_xy() and transform_xy() 2013-04-25 09:13:30 +02:00
5d0450e4ea app: draw guides across the entire canvas also when rotated 2013-04-25 09:12:35 +02:00
37d589335f app: consolidate all transform API in gimpdisplayshell-transform.[ch]
Added complete API for zoom/unzoom (scale and scroll) and
rotate/unrotate, with the same set of functions as the existing
transform/untransform. Moved some special case functions to the
namespaces they belong.
2013-04-25 00:29:58 +02:00
aea94211b1 app: add an unrotated canvas item group to GimpDisplayShell
and put the software cursor and the tool progress there.
2013-04-24 00:01:01 +02:00
a4d8ce6d11 app: update the rotate dialog's spinbutton when the view is rotated 2013-04-22 23:18:27 +02:00
3643551280 Bug 697530 - zoom during mouse-pan focuses on wrong location
Block all key events while middle-mouse panning, to prevent
accelerators from being invoked.
2013-04-21 20:00:28 +02:00
3972da5256 app: add signal GimpDisplayShell::rotated and use it to update the menu 2013-04-21 03:15:22 +02:00
b4a2cf9432 app: remove useless real_new_scale variable from gimp_display_shell_scale() 2013-04-21 03:14:36 +02:00
ca9a9fb498 app: reset the rotation to zero when the shell is emptied
so the next image doesn't appear rotated.
2013-04-21 02:46:17 +02:00
81e293cb06 app: don't leak the rotate transform matrices when destroying the shell 2013-04-21 02:40:41 +02:00
ee2e5fb517 app: fix image rendering atifacts in rotated views
- stroke around the drawn area to work around the impossibility of
  tiling antialiased stuff.
- don't use the display xfer stuff because if we overdraw we must
  not have anything in the source pattern outside the drawn region
2013-04-21 02:10:36 +02:00
e98013af34 app: make the rotate angle spinner wrap around, and add a reset button 2013-04-20 23:54:55 +02:00
977a194923 app: add a rotate dialog to rotate to exact degrees 2013-04-20 23:22:14 +02:00
855fa3aa4a app: add gimp_display_shell_rotate() and rotate_to() 2013-04-20 22:14:30 +02:00
296284fe38 app: rotate cursors that indicate a direction with the view
- reorder enum GimpCursorType to be in angular order
- add gimp_cursor_rotate(cursor_type, angle)
- rotate the shell's cursors automatically in the setter
2013-04-20 17:21:01 +02:00
3a75ec3283 app: keep the view rotate angle within [0..360[ 2013-04-20 17:20:18 +02:00
b3a9a6a3e3 Bug 55367 - Rotated view of the canvas (view is rotated, not image contents)
First version of display rotation, inspired by gimp-painter.
The rotation always happens around the image's center.

The only "UI" for rotating is currently shift+middle-drag and
shift+space-drag. Control constrains the angle to 15 degrees
and is currently the only way to go back to "no rotation".
2013-04-20 15:11:01 +02:00
057ec9ac4a app: remove rectangle parameters from gimp_display_shell_draw_checkerboard()
because the cairo_t is already clipped to the right extents.
2013-04-20 10:47:13 +02:00
6b8426874d app: simplify scroll offset calculation for middle-mouse scrolling 2013-04-20 08:37:15 +02:00
9785c4e1a3 app: simplify gimp_display_shell_canvas_draw_image() a lot
by not manually intersecting and subtracting regions at all. Simply
clip the cairo_t to the area we want to render, it will automatically
intersect with the clip region from the expose event, and check if the
clip is empty before actually drawing anything.
2013-04-19 02:23:38 +02:00
4279023bc6 app: small whitespace fix in gimpdisplayshell-scroll.c 2013-04-18 21:50:29 +02:00
c3b53b8b66 app: move the "get scaled image size" functions from shell-draw to -scale 2013-04-18 19:06:17 +02:00
afddcce4e5 app: remove gimp_display_shell_update_scrollbars_and_rulers()
and move its two statements to its two callers.
2013-04-18 18:45:55 +02:00
0add37a6cc app: remove GimpDisplayShell parameters from all GimpCanvasItem vfuncs
and get the shell from gimp_canvas_item_get_shell() if needed.  Remove
some cairo_translate() that didn't have any effect and were leftovers
from a very early canvas item code.
2013-04-18 16:46:01 +02:00
59c7d42530 app: missed two shell->canvas, use gimp_canvas_item_get_canvas() instead 2013-04-18 16:46:01 +02:00
52b92e740f app: rename gimpdisplayshell-style to gimpcanvas-style
because it doesn't and shouldn't depend on GimpDisplayShell at all.
In the future, it will take its defaults from the canvas' theme.
2013-04-18 16:46:01 +02:00
64c929a1d1 app: add an own GimpCanvasItem API for transforming coords
and use it in all subclasses. Removes all gimpdisplayshell-transform
dependency from all item implementations.
2013-04-18 16:46:00 +02:00
dc514dd967 app: no need to ask the projection's buffer for its size
when we have the image, they are always exactly the same.
2013-04-18 16:46:00 +02:00
65a2d2be31 app: fix copy/paste error in gimp_display_shell_transform_xy() 2013-04-18 16:16:03 +02:00
fd6c5dd576 app: port the image and wilber drawing code away from GdkRegion
the changes are simply copied from the gtk3-port branch, reducing the
number of diffs, and enabling hacking on drawing stuff in master while
keeping the branch easily rebasable.
2013-04-18 11:56:43 +02:00
810bb18949 app: remove the old rendering increments from struct GimpDisplayShell
and don't use them for (un)transforming integer coordinates. Everything
seems to work fine, but this sort of change has caused off-by-one errors
before, please review.
2013-04-18 02:10:38 +02:00
5880685472 Bug 675549 - image region does not have focus unless clicked on
We cannot simply randomy move the focus from e.g. a text entry back to
the canvas. Instead introduce global handling of "Escape" and a
"primary_focus_widget" that is always set the the image window's
active canvas. When Escape is pressed, move the focus to that primary
focus widget, or beep if it is already there. Text widgets still get
the key events before that logic and can consume the Escape.
2013-04-09 15:41:20 +02:00
faf2217811 Bug 696958 - In-image preview in Transform tools is off by one screen pixel
Simplify the loops without any significant loss in performance, separating
the positive and negative X directions to treat each correctly. Fixes this
bug.
2013-04-02 17:23:40 +02:00
c83e7790bf app: Two mostly cosmetic changes
Use a temporary that is less expensive to refer to. Don't loop more
than necessary when comparing pairs.
2013-04-02 17:05:52 +02:00
64438c1b4e Bug 694028 - statusbar cancel button for plug-ins is hard to discover
Add the word "Cancel" next to the cancel icon, the button is only
visible during a plug-in progress anyway, so no space is wasted.
2013-03-18 01:26:44 +01:00
bc190a6bab Bug 397359 - Can't access color management parameters
Create all display filters with "color-config" and "color-managed"
parameters set, not only the automatically added color management
display filter. This way we don't only support removing and adding the
filter again, but also support potential other color management
modules.
2013-03-13 10:37:25 +01:00
0884880579 app: small indentation fix in GimpImageWindow 2013-03-10 19:55:48 +01:00
fc19348621 app: consider the label in GimpStatusbar's size negotiation
doesn't change anything, except perhaps for weird themes.
2013-03-10 19:54:42 +01:00
9da0f489e1 Bug 694665 - SWM should distribute remaining space to main frame
Save the "right-docks-position" as negative value in pixels from the
right window border. Change the image window restoring code to
interpret negative values like that, but keep the meaning of positive
values for compatibility with existing sessionrc files.
2013-02-27 23:46:00 +01:00
97af52c465 Bug 686544 - Opening new image window doesn't restore docks
Call gimp_dialog_factory_show_with_display() in gimp_display_new(), we
otherwise do this only when the ICONIFIED state of an image window
changes.
2013-02-27 23:26:49 +01:00
169d32532a Bug 676927 - Shortcuts with backspace not working if image is focused
Move local variable out of the switch() block, it was never initialized.
2013-02-15 01:00:13 +01:00
a907741d8a Bug 692900 - Dragging left canvas border doesn't respect dock borders
Don't allow the single window's docks to shrink smaller than their
requisition, because that's horribly broken.
2013-02-06 23:27:37 +01:00
b8e96c7141 app: rename gimpdisplay-transport.[ch] to gimpdisplayxfer.[ch]
so it matches the name of the stuff it implements.
2013-02-03 13:26:32 +01:00
d0a5879f28 app: some GIMP-style cleanup to the last commit 2013-02-02 17:07:03 +01:00
4a81849e36 app: Use SHM transport for data transfer for display
Recent Cairo uses SHM transports when available, and exposes the ability
for its users to manage images shared between it and the display.
This allows us to eliminate copies, and if the architecture supports it
even to upload directly into GPU addressable memory without any copies
(all in normal system memory so we suffer no performance penalty when
applying the filters). The caveat is that we need to be aware of the
synchronize requirements, the cairo_surface_flush and
cairo_surface_mark_dirty, around access to the transport image. To
reduce the frequency of these barriers, we can subdivide the transport
image into small chunks as to satisfy individual updates and delay the
synchronisation barrier until we are forced to reuse earlier pixels.

Note this bumps the required Cairo version to 1.12, and please be aware
that the XSHM transport requires bug fixes from cairo.git (will be
1.12.12)

v2: After further reflections with Mitch, we realized we can share the
transport surface between all canvases by attaching it to the common
screen.

v3: Fix a couple of typos in insert_node() introduced when switching
variables names.

v4: Encapsulating within an image surface rather than a subsurface was
hiding the backing SHM segment from cairo, causing it to allocate
further SHM resources to stream the upload. We should be able to use a
sub-surface here, but it is more convenient to wrap the pixels in an
image surface for rendering the filters (and conveniently masking the
callee flushes from invalidating our parent transport surface).

Cc: Michael Natterer <mitch@gimp.org>
2013-02-02 13:59:59 +01:00
6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
2491a3a088 app: add (disabled) support for rendering the image at high resolution
for what Apple calls "Retina". Disabled because the GDK API to figure
the scale factor doesn't exist yet.
2013-01-18 16:36:22 +01:00
454639f9d9 Bug 689087 - Drag-and-drop foo.jpg behaves different from 'gimp foo.jpg'...
Prefer text/uri-list over image/* to make dropping from file managers
always behave like opening the image directly.
2013-01-09 00:28:30 +01:00
1934b65fcb app: raise idle priority for initially scaling and positioning the image
so it is just a bit more important than projection construction. Makes
initial image display show up in the right place much quicker, but
still after layouting the shell's widgets.
2012-12-15 19:27:16 +01:00