Commit Graph

401 Commits

Author SHA1 Message Date
Martin Nordholts 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
Alexia Death 2cb8f0a864 app: Make sure button releases get handled by paint tools too 2010-02-19 22:42:35 +02:00
Michael Natterer 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
Michael Natterer 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
Martin Nordholts 2604db71a8 app: Don't yell in FIXME, explain instead 2010-01-19 23:15:37 +01:00
Michael Natterer 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
Alexia Death 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
Alexia Death 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
Alexia Death 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
Alexia Death 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
Michael Natterer 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
Michael Natterer 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
Michael Natterer 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
Michael Natterer 6608d66cde Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 19:51:33 +02:00
Michael Natterer 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
Michael Natterer c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
Michael Natterer d1ded0617f More gimp_display_get_shell() instead of display->shell 2009-10-05 19:58:03 +02:00
Michael Natterer 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
Michael Natterer 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
Michael Natterer 54edc20113 Add missing #include "gimpimagewindow.h" 2009-09-28 22:55:54 +02:00
Michael Natterer 6793d68769 Move the menubar and the menubar_manager to GimpImageWindow
Also move some of their related code and update other code to
go via gtk_widget_get_toplevel(), but also add some horrid temp
/* FIXME image window */ hacks.
2009-09-28 22:55:38 +02:00
Michael Natterer 82c48eeb9e Indentation fix 2009-09-19 15:09:56 +02:00
Michael Natterer b77cbdf3a1 More tool event log output and some minor whitespace cleanup 2009-09-19 15:09:55 +02:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +02:00
Sven Neumann 60f11e18ae Bug 591017 – Tablet pan is not working as fast as it should
Use motion event compression for display scrolling.
2009-08-13 20:24:14 +02:00
Michael Natterer 2bfc48df74 Use accessors instead of sealed GTK+ members 2009-07-15 14:29:43 +02:00
Michael Natterer 1b69070556 Make key themes really work this time
* app/widgets/gimpwindow.c: treat GimpCanvas as a text widget and
  dispatch all key events to it before invoking menu shortcuts.

* app/display/gimpdisplayshell-callbacks.c: treat all events on the
  empty display as unhandled, not handled.

* app/tools/gimptexttool.c: use the right API for invoking the proxy
  text view's bindings. Handle some more cursor navigation request and
  swallow text deletion requests we don't handle instead of always
  doing what the delete key does.
2009-06-23 23:25:09 +02:00
Michael Natterer 1a16b48c93 Add infrastructure for sending double and triple clicks to tools
* app/tools/tools-enums.[ch]: add enum GimpButtonPressType which can
be { NORMAL, DOUBLE, TRIPLE }

* app/tools/gimptool.[ch]: add press_type paramater to GimpTool::button_press()

* app/tools/gimp*tool.c
* app/tools/tool_manager.[ch]: changed accordingly.

* app/tools/gimptoolcontrol.[ch]: add members and API so tools can choose
to receive double and triple clicks.

* app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events):
dispatch double and triple clicks to tools if they want them, and if they
became active by the preceding normal button press.
2009-06-20 17:37:31 +02:00
Michael Natterer a4e7e678c2 Bug 566575 – Warning when creating sample point and releasing Ctrl key
2009-03-28  Michael Natterer  <mitch@gimp.org>

	Bug 566575 – Warning when creating sample point and releasing Ctrl
	key too late

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_ruler_button_press): call
	gimp_display_shell_update_focus() after changing the tool so the
	new tool has the right state.


svn path=/trunk/; revision=28226
2009-03-28 15:20:18 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
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
2009-01-17 22:28:01 +00:00
Sven Neumann f171d10506 Bug 471344 – Circular brush strokes are not smooth and have corners
2009-01-10  Sven Neumann  <sven@gimp.org>

	Bug 471344 – Circular brush strokes are not smooth and have 
corners

	Bug 127785 – stroking with size linked to pressure sensitivity
	should scale the spacing

	* app/core/gimpcoords-interpolate.[ch]
	* app/display/gimpdisplayshell.[ch]
	* app/display/gimpdisplayshell-callbacks.[ch]
	* app/display/gimpdisplayshell-coords.[ch]: applied patch from
	Alexia Death that introduces a Catmul-Rom splines based event
	interpolation and also adapts the brush spacing to brush size.


svn path=/trunk/; revision=27898
2009-01-10 00:48:30 +00:00
Michael Natterer 106b09f5ae bail out instead of crashing if the tool has no display.
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
2008-10-30 23:13:24 +00:00
Martin Nordholts 31e64dace0 Bug 558215 – unit and zoom entries in Statusbar not visible
* 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-29 22:28:48 +00:00
Michael Natterer 68e6d7a610 Add some infrastructure for the on-canvas text editing GSoC project:
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
2008-10-26 16:25:24 +00:00
Martin Nordholts 2427cc5495 Bug 556804 – Zoom drop down doesn't update
* 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
2008-10-22 19:02:00 +00:00
Martin Nordholts 259801e34e Bug 553534 – centering issues after image scaling and setting zoom
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
2008-10-02 14:53:35 +00:00
Martin Nordholts 958de4c297 Bug 554125 – Tab key doesn't hide utility windows when there is no
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-29 15:42:56 +00:00
Sven Neumann 8ec1d65a4a removed trailing whitespace
svn path=/trunk/; revision=26852
2008-09-04 08:37:32 +00:00
Michael Natterer 435f6e3974 app/display/gimpdisplayshell-callbacks.c libgimpwidgets/gimpcolorselect.c
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-09-03 19:24:51 +00:00
Michael Natterer d51c50820f Bug 496772 – Position shown in the statusbar needs more precision (for
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-20 16:22:09 +00:00
Martin Nordholts a07760dea5 Simpliy.
2008-08-17  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_size_allocate): Simpliy.

svn path=/trunk/; revision=26614
2008-08-17 10:48:49 +00:00
Martin Nordholts a4a05e8c59 If the image ends up below or to the right of the viewport top and left
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 07:38:25 +00:00
Martin Nordholts 9311a413fa Don't apply the centering logic on zoom_on_resize.
2008-08-17  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_size_allocate): Don't apply the
	centering logic on zoom_on_resize.

svn path=/trunk/; revision=26612
2008-08-17 07:29:48 +00:00
Martin Nordholts 384df24b80 When applying the centering logic we need to know the size of the new
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-17 07:21:41 +00:00
Martin Nordholts ec15a39b14 Remove the centering logic because we do not always want to run it when
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-16 16:52:05 +00:00
Martin Nordholts 2f52791b2b New helper function.
2008-08-14  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-scroll.c
	(gimp_display_shell_scroll_clamp_and_update): New helper function.

	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-callbacks.c: Use it.

svn path=/trunk/; revision=26554
2008-08-14 14:41:29 +00:00
Martin Nordholts ccdac05843 Make this a private function because we want to be in full control over
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-13 17:58:25 +00:00
Martin Nordholts 73e303590c If the image fits within the display shell canvas on a given axis, center
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 15:19:24 +00:00
Martin Nordholts 2eacb5cf58 Rename gimp_display_shell_scale_setup() to
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 11:56:29 +00:00
Martin Nordholts 4bbe4c81b8 Renamed gimp_display_shell_scroll_private() to gimp_display_shell_scroll()
2008-08-10  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-scroll.[ch]: Renamed
	gimp_display_shell_scroll_private() to gimp_display_shell_scroll()
	and keep it here.

	* app/display/gimpdisplayshell-private.h: Removed.

	* app/display/Makefile.am
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-autoscroll.c: Adapt.

svn path=/trunk/; revision=26480
2008-08-10 11:11:19 +00:00