2008-10-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_key_press): bail out
instead of crashing if the tool has no display.
(gimp_text_tool_draw)
(gimp_text_tool_draw_preedit)
(gimp_text_tool_draw_selection)
(gimp_text_tool_xy_to_offset): need to adjust all drawing and
event coordinates by a possible negative offset between logical
rectangle and ink rectangle (if the ink rectangle is larger than
the logical one).
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): continue normally if
tool_manager_key_press_active() returns FALSE.
svn path=/trunk/; revision=27484
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): Don't try to be clever,
call gimp_display_shell_scaled() whenever the canvas size changes
so a newly created display shell gets updated properly.
svn path=/trunk/; revision=27469
2008-10-26 Michael Natterer <mitch@gimp.org>
Add some infrastructure for the on-canvas text editing GSoC
project:
* app/tools/gimptoolcontrol.[ch]: add boolean wants_all_key_events
member and API to set and get it.
* app/tools/gimptool.[ch]: add GimpTool::get_popup() which returns
the tool's context menu if it has one, or NULL otherwise.
* app/tools/tool_manager.[ch]: add tool_manager_get_popup_active()
wrapper.
* app/display/gimpdisplayshell-callbacks.c: check if the tool has
a popup menu and show it instead of the usual right-click menu.
Also call the tool's key_press() unconditionally if it wants all
key events, but this code needs more thinking.
svn path=/trunk/; revision=27416
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-callbacks.c: Fix calls to
gimp_display_shell_scaled() when Resize window on zoom is enabled.
svn path=/trunk/; revision=27366
to 100%
* app/display/display-enums.h: Added a GimpZoomFocus enum with
'best guess', 'pointer' or 'image center' values.
* app/display/gimpdisplayshell-scale.[ch]
(gimp_display_shell_scale): Take a GimpZoomFocus parameter and
pass it on to
(gimp_display_shell_scale_get_zoom_focus): which returns the
requested zoom focus point if one was given, else makes a best
guess.
* app/actions/view-commands.c
* app/display/gimpstatusbar.c
* app/display/gimpnavigationeditor.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-scale-dialog.c: For explicit-zoom
commands like "zoom to 100%", always use the image center as the
zoom focus point. For all other zooming, continue to use the
best-guess method.
* app/display/display-enums.c: Regenerated.
svn path=/trunk/; revision=27104
image open.
* app/widgets/gimpdialogfactory.[ch]: Add 'toggle_visibility' to
GimpDialogFactory and as a parameter to gimp_dialog_factory_new(),
and set it there.
(gimp_dialog_factories_hide_foreach): Don't hide dialogs belonging
to factories with toggle_visibility FALSE.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): Move no-image event
handling to a new helper function, and make pressing Tab hide
windows.
* app/dialogs/dialogs.c (dialogs_init): Allow toggling visibility
for all factories except the display-factory.
svn path=/trunk/; revision=27077
2008-09-03 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* libgimpwidgets/gimpcolorselect.c
* modules/color-selector-water.c
* plug-ins/ifs-compose/ifs-compose.c: instead of using
gdk_window_get_pointer() if GdkEventMotion::is_hint is TRUE,
simply always use the coords from the event and call
gdk_event_request_motions() to ask for more motion events. This is
the recommended way and also works for events from devices other
than the core pointer.
* plug-ins/ifs-compose/ifs-compose.c (design_area_motion): some
code cleanup while i was at it.
svn path=/trunk/; revision=26843
2008-08-20 Michael Natterer <mitch@gimp.org>
Bug 496772 – Position shown in the statusbar needs more
precision (for some tools)
* app/display/display-enums.[ch]: add enum GimpCursorPrecision
which can be one of { PIXEL_CENTER, PIXEL_BORDER, SUBPIXEL }.
* app/display/gimpdisplayshell-cursor.[ch]: add "precision"
parameter to gimp_display_shell_update_cursor() and pass it
on to the statusbar.
* app/display/gimpstatusbar.[ch]: add "precision" parameters to
the cursor coordinates APIs, offset the passed coords accordingly
and display them with one decimal point if SUBPIXEL is requested
and the display's unit is PIXEL. Keep a second floating-point
format string around at any time.
* app/tools/gimptoolcontrol.[ch]: add a "precision" member and API
so tools can configure the precision they need. Defalt to
PIXEL_CENTER since that's right for almost all tools.
* app/display/gimpdisplayshell-callbacks.c: pass the tool's
precision to gimp_display_shell_update_cursor().
* app/tools/gimptool.[ch]: add "precision" parameter to
gimp_tool_push_status_coords() and pass it on to the statusbar.
* app/tools/gimpaligntool.c
* app/tools/gimpblendtool.c
* app/tools/gimpcolortool.c
* app/tools/gimpcroptool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpfliptool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* app/tools/gimpperspectiveclonetool.c
* app/tools/gimprectangleselecttool.c
* app/tools/gimprectangletool.c
* app/tools/gimptransformtool.c
* app/tools/gimpvectortool.c: set precision in init() where
needed. Adjust the precision in the fly when needed, e.g. while
moving guides or when toggling hard-edge on paint tools. Also pass
an appropriate precision to gimp_tool_push_status_coords(), which
is not always the tool's precision as used for cursor display.
svn path=/trunk/; revision=26681
2008-08-17 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): If the image ends up
below or to the right of the viewport top and left edges, and the
image is not centered on a given axis, align the top left image
edge with the top left viewport edge. This is basically the best
we can do without an API for start and end of a window resize
cycle using the mouse.
svn path=/trunk/; revision=26613
2008-08-17 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.[ch]
(gimp_display_shell_configure_event): When applying the centering
logic we need to know the size of the new canvas, so instead of
having it here, only make sure that this logic is run on the next
canvas size-allocate.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): If the size-allocate
comes from a top level window resize, apply centering logic.
svn path=/trunk/; revision=26611
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): Remove the centering
logic because we do not always want to run it when the canvas size
changes. For example, the canvas size changes if rulers are
toggled on/off.
* app/display/gimpdisplayshell.c
(gimp_display_shell_configure_event): Implement
GtkWidget::configure_event() for the display shell and put the
image centering logic here instead, since this class function is
run when the top level window size changes. Run it only if the
size (not position) of the window changes.
svn path=/trunk/; revision=26599
2008-08-13 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scale.[ch]
(gimp_display_shell_scale_to): Make this a private function
because we want to be in full control over what pixel to focus on
when zooming in and out.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): Use
gimp_display_shell_scale() here instead of
gimp_display_shell_scale_to(). We figure out (and can override if
we wish) the coordinates that were previously passed explicitly.
svn path=/trunk/; revision=26531
2008-08-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): If the image fits
within the display shell canvas on a given axis, center the image
on that axis. This behaviour will certainly require a few tweaks
but let's see how this feels. Feedback welcome.
svn path=/trunk/; revision=26489
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]: 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-05 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c: move update_range
callbacks where they belong and make them static.
svn path=/trunk/; revision=26379
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-10 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.[ch]: Make
gimp_display_shell_scroll() a sane public interface for scrolling
and call the old version gimp_display_shell_scroll_private()
* app/display/gimpnavigationeditor.c: Adapt to the saner version
of gimp_display_shell_scroll()
* app/display/gimpdisplayshell-callbacks.c:
* app/display/gimpdisplayshell-autoscroll.c: Use the private
version of gimp_display_shell_scroll()
* app/display/Makefile.am: Added gimpdisplayshell-private.h
svn path=/trunk/; revision=26110
2008-07-03 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_events): don't use Escape to quit full-screen
mode, it collides with tools using the Escape key (bug #539949).
svn path=/trunk/; revision=26049
2008-05-22 Michael Natterer <mitch@gimp.org>
Applied slightly modified and fixed patch from Alexia Death which
adds a "random" axis to the paint dynamics and fixes some issues
in the previous paint dynamics commits. Fixes bug #529431.
* app/core/core-types.h: add a "random" axis to GimpCoords.
* app/display/gimpdisplayshell-coords.c: set it to a random value.
* app/display/gimpdisplayshell-callbacks.c: on button_press,
use the dynamics from the last motion event to avoid blotches
at the beginning of paint strokes.
* app/paint/gimppaintoptions.[ch]: add random properties the same
way we do pressure and velocity. Add get_dynamic_size(),
get_dynamic_color() and get_dynamic_hardness() functions which
look at all dynamic parameters of the passed coords.
* app/tools/gimppaintoptions-gui.c: add gui for the random options.
* app/paint/gimpbrushcore.[ch]: remove calc_brush_scale() and use
gimp_paint_options_get_dynamic_size_instead().
Add "dynamic_hardness" parameters to paste_canvas(),
replace_canvas() and get_brush_mask().
* app/paint/gimpairbrushoptions.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c: calculate the dynamic hardness and pass
it to above brush core functions. Use the get_dynamic_color() to
calculate the gradient color.
svn path=/trunk/; revision=25758
2008-05-10 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_events)
(gimp_display_shell_canvas_tool_events):
don't reserve Delete for use by tools. Fixes bug #532116.
* app/tools/gimpimagemaptool.c
* app/tools/gimptransformtool.c: don't use Delete (you can still
use the Backspace key to achieve the same).
svn path=/trunk/; revision=25607
2008-05-08 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_events): don't call gtk_widget_grab_focus() here.
(gimp_display_shell_canvas_tool_events): call it here instead and
add comments about how BUTTON_PRESS and FOCUS_IN interact.
Also return TRUE from BUTTON_PRESS, BUTTON_RELEASE and
MOTION_NOTIFY.
svn path=/trunk/; revision=25590
2008-05-08 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_events): move the focus to the canvas on
button-press events.
* app/widgets/gimpwindow.c (gimp_window_key_press_event):
removed
a use of G_UNLIKELY() that is somewhat bogus here.
svn path=/trunk/; revision=25587
2008-04-07 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-coords.[ch]
* app/tools/gimppainttool.c
* app/tools/gimptool.[ch]: applied patch from Alexia Death as
attached to bug #508639. This change makes the smoothing depend on
the active tool.
svn path=/trunk/; revision=25392
2008-03-26 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_realize): don't set an initial cursor
so we get the desktop default cursor after starting GIMP.
svn path=/trunk/; revision=25240
2008-03-25 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.[ch]: remove the window
state callback here...
* app/display/gimpdisplayshell.c: ...add it here and turn it into
a GtkWidget::window_state_event() implementation instead of a
signal callback.
svn path=/trunk/; revision=25223
2008-03-25 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.[ch]:
* app/display/gimpdisplayshell.c (gimp_display_shell_init): moved
handling of window state events to a separate callback.
svn path=/trunk/; revision=25221
2008-03-19 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): enable the right click
menu on the empty display.
svn path=/trunk/; revision=25135
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-18 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayoptions.[ch]: add new options object
for the "no image" display appearance.
* app/display/gimpdisplayshell.[ch]: keep one of them around.
* app/display/gimpdisplayshell-appearance.[ch]: use the options
object when the display is empty. Add guards against no image
to some functions. Add gimp_display_shell_appearance_update()
which sets all options according to the current display state
(normal, fullscreen, no image).
* app/actions/view-actions.c: don't allow to configure the GUI
of the empty display.
* app/display/gimpdisplayshell-callbacks.c: use the new appearance
update function instead of doing it all here.
* app/display/gimpdisplayshell-close.c
* app/gui/gui-vtable.c: update the appearance when clearing or
filling the display.
* app/display/gimpdisplayshell-selection.c: forgot some guards
against empty displays.
svn path=/trunk/; revision=25114
2008-03-18 Michael Natterer <mitch@gimp.org>
First draft of the "no image open" window, which is implemented as
a display without image (a view with NULL model). Didn't change
the display's appearance yet so I can first make sure the display
without image works properly in all details before hiding these
details.
* app/core/gimp-gui.[ch]: add "gimp" parameter to display_create()
and allow "image" to be NULL.
* app/core/gimpcontext.c (gimp_context_real_set_display): a
display's image can be NULL now.
* app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig
members. Add Gimp parameter to gimp_display_shell_new(). Changed
gimp_display_reconnect() to gimp_display_set_image() and allow to
set a NULL image.
* app/gui/gui-vtable.c (gui_display_create): if there is a single
display without an image, call gimp_display_set_image() on that
display instead of creating a new one.
* app/display/gimpdisplayshell-close.c: if the last display is
closed, don't close it but make it empty. Factored out that code
to gimp_display_shell_really_close().
* app/display/gimpdisplayshell-dnd.c: when dropping uris on an
empty display, open the first one into that display and the other
ones as layers of the newly opened image. This is consistent with
dropping on an existing image but maybe needs some discussion.
* app/display/gimpdisplayshell-callbacks.c: bail out early in the
tool event callback so tools never have to deal with empty
displays. In expose(), draw the drop zone on the empty display.
* app/display/gimpdisplayshell-title.c: set the empty display's
title to "Gimp - Drop Files".
* app/display/gimpdisplay-foreach.c
* app/display/gimpdisplay-handlers.c
* app/display/gimpdisplayshell-appearance.c
* app/display/gimpdisplayshell-autoscroll.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-cursor.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-filter-dialog.c
* app/display/gimpdisplayshell-handlers.c
* app/display/gimpdisplayshell-layer-select.c
* app/display/gimpdisplayshell-preview.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/display/gimpdisplayshell-selection.c
* app/display/gimpdisplayshell-title.c
* app/display/gimpdisplayshell.c
* app/display/gimpnavigationeditor.c
* app/display/gimpstatusbar.c: use display->gimp and
display->config instead of going via the image. Guard against
empty displays in some few places (most places can't be
called). Where needed, use the canvas' dimensions instead of the
image's dimensions so scroll offsets and scrollbars still have
sane values instead of the last image's ones.
* app/actions/actions.c (action_data_get_gimp)
(action_data_get_context): use display->gimp instead of
display->image->gimp.
* app/actions/edit-commands.c (edit_paste_cmd_callback): redirect
to "paste as new" if there is an empty display.
* app/actions/tools-commands.c (tools_select_cmd_callback): don't
initialize the new tool on an empty display.
* app/actions/view-actions.c (view_actions_update): changed lots
of sensitivity settings to be insensitive when there is no image
(instead of no display).
* app/actions/view-commands.c: use the display's config object
instead of gimp's.
svn path=/trunk/; revision=25113
2008-03-02 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): applied slightly modified patch
from Alexia Death as attached to bug #508639.
svn path=/trunk/; revision=25006
2008-01-28 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell.[ch] (gimp_display_shell_snap_coords):
removed redundant GimpCoords parameter that use to cause valgrind
warnings about overlapping memory regions in memcpy().
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-autoscroll.c: changed accordingly.
svn path=/trunk/; revision=24730
2008-01-23 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.h: don't #include <gegl.h>
* app/actions/tools-commands.c
* app/display/gimpdisplayshell-callbacks.c
* app/tools/gimp-tools.c: include it here. Whenever the build
breaks because of some GEGL change in GIMP, please inlcude
<gegl.h> instead of <glib-object.h> or before <gtk/gtk.h> in the
affected .c files.
svn path=/trunk/; revision=24685
2008-01-22 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-coords.[ch]: applied patch from
Alexia Death with further event filter improvements (bug #508639).
svn path=/trunk/; revision=24672
2008-01-16 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-coords.c: applied parts of a change
from Alexia Death. This improves the event smoothing (bug #508639).
svn path=/trunk/; revision=24624
2008-01-14 Sven Neumann <sven@gimp.org>
* app/core/core-types.h
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-coords.[ch]
* app/display/gimpdisplayshell.h
* app/paint/gimpink.[ch]
* app/paint/gimpinkundo.[ch]: applied patch from Alexia Death
that
adds an event evaluation function that decides if an event is
needed or can be discarded. As a side-product some useful
dynamics
parameters like velocity are added to the GimpCoords struct. The
Ink tool is changed to use this information. See bug #508639.
svn path=/trunk/; revision=24607
2007-12-07 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_tool_events): if a device change happens, make
sure we update the new active tool's focus display and modifier
state. Fixes most of bug #493176.
svn path=/trunk/; revision=24288