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".
- adapt callbacks to ignore / not block events on offscreen children
- use GimpOverlayBox' scroll API which makes sure overlay children
don't scroll along
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-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
2008-11-14 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-scroll.[ch]: removed function
gimp_display_shell_scroll_get_scaled_viewport_offset() as it was
only returning -shell->offset_x and -shell->offset_y and it
started to show up in profiles.
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-transform.c
* app/display/gimpdisplayshell-scale.c: use the shell offsets
directly.
svn path=/trunk/; revision=27644
2008-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
2008-08-26 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_unoverscrollify): New function.
* app/display/gimpdisplayshell-autoscroll.c
(gimp_display_shell_autoscroll_timeout): Make sure the autoscroll
does not result in overscroll. This more or less finalizes the
implementation of the enhancement request in bug #362915.
svn path=/trunk/; revision=26775
2008-08-26 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll): If no scroll should be applied we can
return early.
svn path=/trunk/; revision=26774
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-20 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c: Use a constant for the
minimum step amount for scrollbars.
svn path=/trunk/; revision=26685
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_center_image_on_next_size_allocate):
Explain that this function needs to be used with care since it is
risky.
* app/display/gimpdisplayshell.c
(gimp_display_shell_new)
(gimp_display_shell_fill): Clarify that it is safe to use the
risky function.
(gimp_display_shell_configure_event): Make proper comparisions (<=
not =) and explain that usage of the risky function is safe.
(gimp_display_shell_shrink_wrap): Always call
gimp_display_shell_scroll_center_image() and let size-requests be
handled by GimpDisplayShell::configure_event().
* app/actions/view-commands.c (view_shrink_wrap_cmd_callback): No
need to center anything explicitly any longer.
svn path=/trunk/; revision=26607
2008-08-14 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-draw.[ch]
(gimp_display_shell_draw_get_scaled_image_size_for_scale): New
function.
* app/display/gimpdisplayshell-scale.[ch]
(gimp_display_shell_scale): When zooming out and the image
starts to fit the viewport on a given axis, center on that
axis.
(gimp_display_shell_scale_image_starts_to_fit): New function.
(gimp_display_shell_calculate_scale_x_and_y): New function.
* app/display/gimpdisplayshell.c
(gimp_display_shell_scale_changed): Use
gimp_display_shell_calculate_scale_x_and_y().
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_center_image): Bail out if neither
vertical nor horizontal centering is requested.
svn path=/trunk/; revision=26562
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
Always center the image after a wrap. I can't think of a case when
that shouldn't happen.
* app/display/gimpdisplayshell-handlers.c
(gimp_display_shell_size_changed_detailed_handler): Centering
occurs implicitly after wrapping now, no need to do it explicitly.
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_center_image): Handle the no-image
case.
svn path=/trunk/; revision=26487
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.[ch]
(gimp_display_shell_scroll_set_offset): New low level function for
setting display shell offset.
(gimp_display_shell_scroll_center_image)
* app/display/gimpdisplayshell-handlers.c
(gimp_display_shell_size_changed_detailed_handler): Use it instead
of gimp_display_shell_scale_by_values().
svn path=/trunk/; revision=26486
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scale.[ch]:
Rename gimp_display_shell_scale_setup() to
gimp_display_shell_update_scrollbars_and_rulers(), because that's
exactly what that function does.
* app/display/gimpdisplayshell.c
* app/display/gimpdisplayshell-scroll.c
* app/display/gimpdisplayshell-handlers.c
* app/display/gimpdisplayshell-callbacks.c: Adapt to new name.
svn path=/trunk/; revision=26484
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.[ch]: It makes more sense
for gimp_display_shell_get_scaled_image_size() to be moved from
here to
* app/display/gimpdisplayshell-draw.[ch]: here, and rename it to
gimp_display_shell_draw_get_scaled_image_size().
* app/display/gimpdisplayshell.c: Adapt to name change.
svn path=/trunk/; revision=26479
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.[ch]: gimp_display_shell_ ->
gimp_display_shell_scroll_ for functions that are scroll
related. Also did some other minor renamings.
* app/display/gimpnavigationeditor.c
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-transform.c
* app/display/gimpdisplayshell-callbacks.c: Adapt to the name
changes.
svn path=/trunk/; revision=26476
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_center_image): There is no need for
special casing depending on image size relative to viewport size.
svn path=/trunk/; revision=26471
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
Put functions to center the image in the display shell where they
belong, and give them proper names.
* app/display/gimpdisplayshell-scale.[ch]: Get rid of functions
and use the new names.
* app/display/gimpdisplayshell-scroll.[ch]: Put the functions here
and call them gimp_display_shell_scroll_center_image() and
gimp_display_shell_scroll_center_image_on_next_size_allocate().
* app/display/gimpdisplayshell.c:
* app/display/gimpdisplayshell-handlers.c: Use the new names.
svn path=/trunk/; revision=26470
2008-08-05 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-scroll.[ch]
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-transform.c: get rid of the "image"
part in all instances of "scaled_image_viewport_offset", we call
it simply "viewport" in all other places and it makes the code
more readable.
svn path=/trunk/; revision=26395
2008-08-05 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_scale_setup): Don't setup scrollbar step
increment here.
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_setup_hscrollbar_with_value)
(gimp_display_shell_setup_vscrollbar_with_value): Setup scrollbar
step increment here and make sure that a step always scrolls at
least a display shell pixel.
svn path=/trunk/; revision=26390
2008-08-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch] (GimpImage::size-changed-detailed):
change double to int in signal parameters.
Remove gimp_image_emit_size_changed_signals() and call
gimp_viewable_size_changed() in size-changed-detailed's default
handler.
* app/core/gimpimageundo.[ch]
* app/core/gimpimage-undo-push.[ch]: change double to int in
previous-origin related code.
* app/core/gimpimage-undo.c
* app/core/gimpimage-scale.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-resize.c: call gimp_image_size_changed_detailed()
instead of the removed gimp_image_emit_size_changed_signals()
* app/display/gimpdisplayshell-scroll.[ch]: remove
gimp_display_shell_handle_size_changed_detailed() because it
handles both scrolling and scaling and doesn't belong here.
* app/display/gimpdisplayshell-handlers.c: moved its code back to
gimp_display_shell_size_changed_detailed_handler() and follow the
double -> int change above.
svn path=/trunk/; revision=26367
2008-08-03 Martin Nordholts <martinn@svn.gnome.org>
Further work for completing bug #362915 that makes changes to the
image size (e.g when cropping) be much more nicely handled by
display shell.
* app/core/gimpimage.[ch]: Add new signal
GimpImage::size-changed-detailed that is emited whenever
GimpViewable::size-changed is. The new signal provides additional
information, namely the previous origin relative to the current
origin. Cliens choose what specific signal to listen to depending
on how much info they need.
* app/display/gimpdisplayshell-handlers.c: Connect to
GimpImage::size-changed-detailed instead of
GimpViewable::size-changed since the shell wants information about
the previous image origin.
(gimp_display_shell_resolution_changed_handler): Use
gimp_display_shell_scale_resize() instead to avoid display
garbage.
* app/display/gimpdisplayshell-scale.[ch]: Add new utility
function gimp_display_shell_center_image_on_next_size_allocate().
* app/display/gimpdisplayshell-scroll.[ch]
(gimp_display_shell_handle_size_changed_detailed): New function
that replaces logic in gimp_display_shell_handle_size_changed and
that takes previous-origin of the image into account and adjusts
the offset so that the image content that remains doesn't move. If
the window is resized on image resize, just center the image
afterwards.
* app/core/gimpimage-undo-push.[ch]
(gimp_image_undo_push_image_size): Add previous-origin paremeters.
* app/core/gimpimageundo.[ch]: Add and manage previous-origin
properties so that the display shell offset can be appropriately
adjusted also when undoing.
* app/core/gimpundo.h
* app/core/gimpimage-undo.c: Add previous_origin members to the
undo accumulator and emit that information when the size of the
image changes due to the undo.
* app/core/gimpimage-crop.c (gimp_image_crop)
* app/core/gimpimage-scale.c (gimp_image_scale)
* app/core/gimpimage-rotate.c (gimp_image_rotate)
* app/core/gimpimage-resize.c (gimp_image_resize_with_layers):
Supply information about the previous-origin of the image to the
size-changed signals and the undo system.
svn path=/trunk/; revision=26354
2008-07-13 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_setup_hscrollbar_with_value)
(gimp_display_shell_setup_vscrollbar_with_value): Use
gimp_display_shell_get_scaled_image_size() instead of inaccurately
calculate that information locally.
svn path=/trunk/; revision=26175
2008-07-13 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.[ch]
(gimp_display_shell_get_scaled_image_size): New function that
contains logic previously kept in gimp_display_shell_draw_area().
* app/display/gimpdisplayshell-draw.c
(gimp_display_shell_draw_area): Use the new function.
svn path=/trunk/; revision=26168
2008-07-12 Martin Nordholts <martinn@svn.gnome.org>
The following change is conceptually based on a patch by
Alexia Death and implements the core functionality for
bug #362915.
* app/display/gimpdisplayshell-scroll.[ch]
(gimp_display_shell_scroll_clamp_offsets): Clamp the offsets in
such a way that allows to scroll beyond the image border.
(gimp_display_shell_setup_hscrollbar_with_value)
(gimp_display_shell_setup_vscrollbar_with_value): Put common
scrollbar range setup code here.
* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_scale_setup): Use above helper functions for
setting up scrollbar range.
* app/display/gimpdisplayshell-callbacks.c: Handle adjustment of
the scrollbar range when they are about to change value.
* app/display/gimpdisplayshell.c: Always keep the scrollbar
steppers sensitive to user input.
svn path=/trunk/; revision=26166
2008-07-12 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c:
Replace gimp_display_shell_scroll() with
gimp_display_shell_center_around_image_coordinate() since that is
easier to map to something sensible when we allow to scroll beyond
image border.
* app/display/gimpnavigationeditor.c
(gimp_navigation_editor_marker_changed): Adapt to the new
interface.
svn path=/trunk/; revision=26162
2008-07-12 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.c: Kill disp_[xy]offset! We now
keep store that information by using negative values in
offset_[xy].
* app/display/gimpdisplayshell-scroll.[ch]
(gimp_display_shell_scroll_clamp_offsets)
(gimp_display_shell_get_scaled_image_viewport_offset): Adjust
accordingly to preserve current behaviour.
(gimp_display_shell_get_disp_offset): New function to get the old
disp_[xy]offset based on the new offset_[xy].
(gimp_display_shell_get_render_start_offset): New function to get
th old offset_[xy] based on the new offset_[xy].
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-render.c: Get rid of
disp_[xy]offset and use
gimp_display_shell_get_render_start_offset() and
gimp_display_shell_get_disp_offset() instead.
svn path=/trunk/; revision=26146
2008-07-11 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-transform.c
(gimp_display_shell_transform_xy_f)
(gimp_display_shell_untransform_xy_f): We can use
gimp_display_shell_get_scaled_image_viewport_offset() here
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_get_scaled_viewport): and here.
svn path=/trunk/; revision=26141
2008-07-11 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_get_scaled_image_viewport_offset): New
function to replace any occurance of
shell->disp_[xy]offset - shell->offset_[xy]
that is just an implementation specific way of saying the same
thing.
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-transform.c: Make the code less
implementation dependant by using the new function.
svn path=/trunk/; revision=26137