Commit Graph

274 Commits

Author SHA1 Message Date
Michael Natterer c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
Michael Natterer 02903d6970 Use gimp_item_is_content_locked() instead of gimp_item_get_lock_content()
Use the new API whenever we want to determine the item's effective
lock state (whether we can write to the item's content or not). Use
gimp_item_get_lock_content() only in code that actually deals with
*this* item's locked state, which is only the PDB wrappers and GUI to
modify the flag on the item itself.
2009-08-29 15:27:04 +02:00
Michael Natterer e95b5d9f72 When cropping the active layer, error out if there is none or it is locked 2009-08-20 22:43:01 +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 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
Michael Natterer f7287be7b5 app/tools/gimptool.[ch] made all GimpCoords* in the tool API const.
2008-11-01  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: made all GimpCoords* in the tool
	API const.

	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbrushtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpeditselectiontool.[ch]
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]
	* app/tools/gimpregionselecttool.c
	* app/tools/gimpselectiontool.[ch]
	* app/tools/gimpsourcetool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: changed accordingly and added const
	to all GimpCoords* in utility functions too.

	* app/tools/gimptexttool.c: don't modify the passed coords. In
	fact, simply removed the code that did because it had no effect.


svn path=/trunk/; revision=27517
2008-11-01 15:17:36 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
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-10-09 20:24:04 +00:00
Sven Neumann 8ec1d65a4a removed trailing whitespace
svn path=/trunk/; revision=26852
2008-09-04 08:37:32 +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 f5c4c35ff8 No need to expose definitions of GimpCropTool or GimpCropToolClass.
2008-05-11  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.[ch]: No need to expose definitions of
	GimpCropTool or GimpCropToolClass.

svn path=/trunk/; revision=25640
2008-05-11 13:23:35 +00:00
Martin Nordholts de8909ddee Fix emission of rectangle-change-complete signals.
2008-05-11  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangletool.c: Fix emission of
	rectangle-change-complete signals.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c:
	Use the rectangle-change-complete signal to update the default
	aspect ratio. Fixes bug #530519.

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_button_release)
	(gimp_crop_tool_options_notify)
	* app/tools/gimprectangleselecttool.c
	(gimp_rectangle_select_tool_button_release): No need to explicitly
	update option defaults since it is handled through the
	rectangle-change-complete signal now.

svn path=/trunk/; revision=25639
2008-05-11 13:01:24 +00:00
Martin Nordholts d6db9d5262 Add a GimpRectangleTool::cancel() implementation that updates default
2008-05-10  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c: Add a GimpRectangleTool::cancel()
	implementation that updates default aspect ratio when cancelling a
	crop.

svn path=/trunk/; revision=25601
2008-05-10 07:34:22 +00:00
Martin Nordholts 0a27fd37fa Keep track of the current image and manage a subscription to
2008-05-09  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.[ch]: Keep track of the current image and
	manage a subscription to "size-changed" so that default aspect
	ratio is properly updated.
	(gimp_crop_tool_execute): No need to explicitly call
	gimp_crop_tool_update_option_defaults() any longer.

svn path=/trunk/; revision=25598
2008-05-09 12:46:28 +00:00
Martin Nordholts fc35afe371 Make it feel like a class member function by G_CONNECT_SWAPPED-izing it.
2008-05-07  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_image_changed): Make it
	feel like a class member function by G_CONNECT_SWAPPED-izing it.

svn path=/trunk/; revision=25582
2008-05-07 17:55:39 +00:00
Martin Nordholts b9aa7f2c67 Align static function prototpyes.
2008-04-30  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c: Align static function prototpyes.

svn path=/trunk/; revision=25554
2008-04-30 18:55:49 +00:00
Martin Nordholts 1014fca378 Reverted the changes that made GimpRectangleTool keep track of its active
2007-12-14  Martin Nordholts  <martinn@svn.gnome.org>

	Reverted the changes that made GimpRectangleTool keep track of its
	active display in GimpRectangleToolPrivate, the approach is
	broken.

svn path=/trunk/; revision=24364
2007-12-14 17:22:46 +00:00
Martin Nordholts 8208d16bb0 Changed name of `gimp_rectangle_tool_is_active_at' to
2007-12-13  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangletool.[ch]: Changed name of
	`gimp_rectangle_tool_is_active_at' to
	`gimp_rectangle_tool_is_active_on_display'.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c: Use the new name.

svn path=/trunk/; revision=24360
2007-12-13 21:48:55 +00:00
Martin Nordholts f643d5545c Don't use the `display' member of GimpTool for keeping track of what
2007-12-13  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangletool.[ch]: Don't use the `display' member
	of GimpTool for keeping track of what display the rectangle is
	active on. Instead store the active display in
	GimpRectangleToolPrivate. This change is based on a patch by Bill
	Skaggs.
	(gimp_rectangle_tool_is_active)
	(gimp_rectangle_tool_is_active_at)
	(gimp_rectangle_tool_get_active_display): New public functions for
	GimpRectangleTool active-display interaction.

	* app/tools/gimpellipseselecttool.c
	(gimp_ellipse_select_tool_select): Use the active display of
	GimpRectangleTool instead of tool->display.

	* app/tools/gimprectangleselecttool.c
	(gimp_rect_select_tool_rectangle_changed): Use the active display
	of GimpRectangleTool instead of tool->display.

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_button_press): Use the active display of
	GimpRectangleTool instead of tool->display.

svn path=/trunk/; revision=24358
2007-12-13 21:30:59 +00:00
Martin Nordholts 8372fd28bf Added gimp_rectangle_tool_init() (and minor code cleanup).
2007-12-09  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangletool.[ch]: Added
	gimp_rectangle_tool_init() (and minor code cleanup).

	* app/tools/gimprectangleselecttool.c
	(gimp_rect_select_tool_init): Call gimp_rectangle_tool_init().

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_init): Call gimp_rectangle_tool_init().

svn path=/trunk/; revision=24304
2007-12-09 09:38:34 +00:00
Martin Nordholts d583686878 Connect a new function gimp_rectangle_options_string_current_updates()
2007-10-09  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangleoptions.[ch]: Connect a new function
	gimp_rectangle_options_string_current_updates() that updates the
	Fixed: Aspect entry with a 'Current' string when aspect of the
	current pending rectangle is used, and sets sensitivity FALSE on
	aspect ratio changing buttons when that string is shown. Prevents
	the confusion mentioned in bug #479999.

	A new Rectangle Options property 'use-string-current' has been
	added that should be refactored away from the options object along
	with references to option widgets.

	* app/tools/gimprectangleselecttool.c
	(gimp_rect_select_tool_update_option_defaults): Set default Fixed:
	Aspect ratio to that of the pending rectangle, and always have
	default Fixed: Size as 100x100.

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_update_option_defaults): Always have default
	Fixed: Size 100x100.

	* libgimpwidgets/gimpnumberpairentry.[ch]
	(gimp_number_pair_entry_class_init): Add a new property
	'default-text' that contains text to be shown instead of numbers
	when default numbers are to be shown.
	(gimp_number_pair_entry_get_default_text)
	(gimp_number_pair_entry_set_default_text): Getter and setter for
	it.

	* libgimpwidgets/gimpwidgets.def: Updated.

svn path=/trunk/; revision=23788
2007-10-09 20:54:07 +00:00
Martin Nordholts cd5a441610 Add an allow-growing option.
2007-09-22  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcropoptions.[ch]: Add an allow-growing option.

	* app/tools/gimpcroptool.c: Take the new allow-growing option into
	account when setting crop rectangle constraints, and restructure
	the code a bit.
	(gimp_crop_tool_execute): Allow rectangles larger than the
	image/layer being sent to gimp_image_crop() since that function
	handles that fine. These changes fixes bug #368325.

svn path=/trunk/; revision=23616
2007-09-22 18:55:14 +00:00
Martin Nordholts ce21737d37 New function to update default values for Fixed: Size. This function is
2007-09-02  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangleselecttool.c
	(gimp_rect_select_tool_update_option_defaults): New function to
	update default values for Fixed: Size. This function is called to
	update defaults values for Fixed: Size to that of the pending
	rectangle width x height if there is one, or 100x100 otherwise.

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_update_option_defaults): Set Fixed: Size to the
	size of the pending crop rectangle, or 100x100 if there is none.

svn path=/trunk/; revision=23440
2007-09-02 04:39:17 +00:00
Martin Nordholts 63fbdc2600 Generalize the default Fixed: Aspect ratio option setting code so that it
2007-09-01  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_update_default_fixed_ratio_options):
	Generalize the default Fixed: Aspect ratio option setting code
	so that it can later be used for Fixed: Size as well, and move
	it to

	* app/tools/gimprectangletool.[ch]
	(gimp_rectangle_tool_pending_size_set)
	(gimp_rectangle_tool_constraint_size_set): and use these two new
	functions instead.

svn path=/trunk/; revision=23435
2007-09-01 20:01:38 +00:00
Martin Nordholts e4baf09863 Call gimp_crop_tool_update_default_fixed_ratio_options after
2007-08-18  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_button_release): Call
	gimp_crop_tool_update_default_fixed_ratio_options after
	gimp_rectangle_tool_button_release, so that the state of the
	rectangle tool is reflected when updating the default aspect.

svn path=/trunk/; revision=23317
2007-08-18 06:39:18 +00:00
Martin Nordholts bf4858c52c Added a 'ignore_pending' boolean parameter so that the pending rectangle
2007-08-18  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_update_default_fixed_ratio_options): Added a
	'ignore_pending' boolean parameter so that the pending rectangle
	can be ignored in gimp_crop_tool_execute, as it should be.

svn path=/trunk/; revision=23316
2007-08-18 06:31:15 +00:00
Martin Nordholts eb06a11ea9 Connect to the "image-changed" signal of GimpContext and update default
2007-08-17  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c
	(gimp_crop_tool_constructor): Connect to the "image-changed"
	signal of GimpContext and update default aspect when image
	changes (fixes bug #417166), by using
	(gimp_crop_tool_update_default_fixed_ratio_options): which is a
	new function that does this. This function is called whenever it
	is time to update defualts.

	* app/tools/gimprectangletool.[ch]: Made
	gimp_rectangle_tool_get_constraint part of the rectangle tool API.

svn path=/trunk/; revision=23312
2007-08-17 18:29:09 +00:00
Martin Nordholts 6ea396963b Initialize 'tool' before using it.
2007-08-11  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_execute): Initialize
	'tool' before using it.

svn path=/trunk/; revision=23210
2007-08-11 16:13:14 +00:00
Martin Nordholts fd5363cd87 Set default 'Fixed: Aspect ratio' values to the size of the pending crop
2007-08-10  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_button_release): Set
	default 'Fixed: Aspect ratio' values to the size of the pending
	crop rectangle. Fixes bug #355545.

	* app/tools/gimprectangletool.[ch]
	(gimp_rectangle_tool_get_rectangle_size): New helper function.

svn path=/trunk/; revision=23194
2007-08-10 16:41:30 +00:00
Michael Natterer 26edfdec1a no need to set the tool cursor here, we already do that in init() and
2007-08-02  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_cursor_update): no need
	to set the tool cursor here, we already do that in init() and
	never change it.

	* app/widgets/gimpcursor.c (gimp_cursor_new): don't show the move
	cursor and the move modifier at the same time. Some small
	cleanups.


svn path=/trunk/; revision=23104
2007-08-02 13:33:38 +00:00
Michael Natterer 58bea5b1b6 access the GimpCropOptions structure directly to read the "layer_only"
2007-03-31  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpcroptool.c: access the GimpCropOptions structure
	directly to read the "layer_only" option (don't use g_object_get),
	some code cleanup.


svn path=/trunk/; revision=22207
2007-03-31 16:07:05 +00:00
Raphael Quinet 89c4abd6ea added status bar help messages explaining the usage of the modifiers.
2007-02-28  Raphael Quinet  <raphael@gimp.org>

	* app/tools/gimpmeasuretool.[ch]: added status bar help messages
	explaining the usage of the modifiers.

	* app/tools/gimpvectortool.c (gimp_vector_tool_status_update):
	suggest Ctrl for edit mode, to close the path or move handles.

	* app/tools/gimpcroptool.c (gimp_crop_tool_button_release):
	"press enter" should be "press Enter", as in the other tools.

svn path=/trunk/; revision=22030
2007-02-28 22:35:37 +00:00
Michael Natterer 83eb96db21 added "gboolean wants_click" member and getters/setters.
2007-02-27  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptoolcontrol.[ch]: added "gboolean wants_click"
	member and getters/setters.

	* app/tools/gimptool.[ch] (struct GimpTool): added members
	in_click_distance, press_coords and press_time.

	(gimp_tool_button_press): if the tool wants click events, record
	press_coords and press_time.

	(gimp_tool_motion): check if we are still in click distance.

	(gimp_tool_button_release): ditto. If we are still in click
	distance, synthesize a motion event back to the recorded
	press_coords and send the tool release_type = CLICK.

	(gimp_tool_check_click_distance): utility function which checks
	the current coords and time against the recorded ones, using
	gtk-double-click-time and gtk-double-click-distance as thresholds.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c: request click events
	and handle them.

	* app/tools/gimprectangletool.[ch]: handle click events. Removed
	gimp_rectangle_tool_no_movement().


svn path=/trunk/; revision=22016
2007-02-27 21:11:35 +00:00
Michael Natterer d7ed63948c Step one towards enabling tool cancellation by other means than mouse
2007-02-27  Michael Natterer  <mitch@gimp.org>

	Step one towards enabling tool cancellation by other means than
	mouse button 3 and towards proper "clicked" semantics.

	* app/tools/tools-enums.[ch]: added enum GimpButtonReleaseType
	which can be one of { NORMAL, CANCEL, CLICK } (click is curently
	unused).

	* app/tools/gimptool.[ch] (GimpTool::button_release): added
	"release_type" parameter.

	(gimp_tool_button_release): if the state contains
	GDK_BUTTON3_MASK, call the tool's button_release() with CANCEL,
	use NORMAL otherwise.

	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]
	* app/tools/gimpregionselecttool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c (button_release): added
	"release_type" parameters and get rid of own checks for
	GDK_BUTTON3_MASK.


svn path=/trunk/; revision=22015
2007-02-27 18:55:12 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer f8edfbd1a5 app/tools/gimpcroptool.c app/tools/gimprectangleselecttool.c moved stuff
2006-11-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]: moved stuff from
	GimpTool::initialize() to GObject::constructor() and removed all
	initialize functions entirely. initialize() only needs to be
	implemented if the tool has a dialog or if initialization() can
	fail. Also moved some type-checking casts after the
	g_return_if_fail()s
2006-11-05 14:11:34 +00:00
Michael Natterer 2a64b58c97 cache the round-corners and corner-radius properties in the
2006-11-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimprectangleselecttool.[ch]: cache the round-corners
	and corner-radius properties in the GimpRectSelectTool struct,
	connect to "notify" of GimpRectSelectOptions and update display
	drawing when the options change.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleoptions.c: whitespace stuff.
2006-11-05 13:45:04 +00:00
Michael Natterer 94182f1439 app/tools/gimpcroptool.[ch] app/tools/gimpellipseselecttool.c
2006-11-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpcroptool.[ch]
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimprectangleselecttool.[ch]
	* app/tools/gimprectangletool.[ch]: removed dispose() and
	finalize() implementations. The finalize() ones did nothing and
	dispose() was only redundantly disconnecting from signals that
	were connected using connect_object() anyway. Some cosmetic
	cleanups all over the place.
2006-11-05 12:35:59 +00:00
Michael Natterer 1b1299aff3 added GError** parameter to GimpPaintCore::start().
2006-09-26  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore.[ch]: added GError** parameter to
	GimpPaintCore::start().

	* app/tools/gimppainttool.c (button_press): display the error in
	the statusbar.

	* app/paint/gimppaintcore-stroke.c: pass a NULL error, effectively
	swallowing mssages. Will fix that later.

	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimpsourcecore.c: changed accordingly. Set the error
	instead of calling g_message().

	* app/paint/gimpheal.c
	* app/paint/gimpperspectiveclone.c: implement start() and bail out
	early on indexed drawables instead of showing a g_message() in
	other functions that are called later.

	* app/tools/gimptool.[ch]: added GError** to GimpTool::initialize().

	* app/tools/gimptool.c (gimp_tool_initialize): display the error
	in the statusbar. Keep the external API GError-free.

	* app/tools/gimprectangletool.[ch]: added GError** to
	gimp_rectangle_tool_initialize().

	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimptransformtool.c: changed accordingly. Set the
	errors in initialize() instead of using gimp_message().

	* app/tools/gimpblendtool.c: implement initialize() and bail out
	early on indexed images instead of showing a gimp_message() in
	button_press().
2006-09-26 20:55:40 +00:00
William Skaggs 0b005ffe99 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]: put back code for responding
	to modifiers pressed after mouse1-down, at mitch's request.
2006-09-23 22:32:35 +00:00
William Skaggs 2c07e922a2 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/actions/tools-actions.c
	* app/actions/tools-commands.[ch]: add new actions for
	toggling "fixed-aspect" and "fixed-center" options of
	rectangle tools.

	* app/tools/gimprectangletool.[ch]
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimpcroptool.c: rely on new actions for
	keyboard control, not on modifiers pressed after
	mouse1-down.
2006-09-23 19:38:26 +00:00
William Skaggs 73a25c2a61 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpairbrushtool.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimphealtool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimpperspectivetool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c
	* app/tools/gimpsmudgetool.c
	* app/tools/gimptexttool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimpvectortool.c:  Apply patch from J. Baker,
	with some modifications, to improve tooltips and tool
	names.  Almost fixes bug #356137.
2006-09-18 18:00:22 +00:00
Sven Neumann 0fb9104817 removed "Resize" from the tool name and description.
2006-09-13  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcroptool.c (gimp_crop_tool_register): removed
	"Resize" from the tool name and description.
2006-09-13 16:03:24 +00:00
Michael Natterer 868b8afbff Added new tool API for modifier key events while the tool is active and
2006-09-12  Michael Natterer  <mitch@gimp.org>

	Added new tool API for modifier key events while the tool
	is active and implement it in the rect select and crop tools.
	Fixes bug #316156 and bug #355302.

	* app/tools/gimptool.[ch]: added GimpTool::active_modifier_key()
	and public function gimp_tool_set_active_motifier_state(). Remember
	the active_state at button_press and reset it on button_release.
	Ignore releases of modifiers that were pressed at button_press (but
	only ignore them once).

	* app/tools/tool_manager.[ch]: added wrapper
	tool_manager_active_modifier_state_active().

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_events): return FALSE for all modifiers even
	when mouse button 1 is pressed.

	(gimp_display_shell_canvas_tool_events): when bouse button 1 is
	pressed *and* the tool is active, dispatch the new active_modifier
	events to tools.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]: implement active_modifier_key()
	instead of modifier_key().
2006-09-12 18:41:09 +00:00
Sven Neumann 7053e3daac app/tools/gimpclonetool.c app/tools/gimpconvolvetool.c
2006-09-12  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimpregionselecttool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimpsmudgetool.c
	* app/tools/gimpvectortool.c: removed trailing dot from
statusbar
	messages.

	* app/widgets/gimpwidgets-utils.c (gimp_suggest_modifiers):
don't
	use "try" if the modifier action has been specified.
2006-09-12 06:37:54 +00:00
William Skaggs 5e9dc3c0d8 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/tools-enums.[ch]: add GimpRectangleConstraint
	enum.

	* app/tools/gimprectangletool.[ch]: replace "constrain"
	boolean with "constraint" enum property.  Implement
	constraints in motion handler -- the implementation
	is rather elegant but pretty tricky.

	* app/tools/gimpcroptool.c: constrain to image bounds,
	or to active drawable bounds if "current layer only"
	option is checked.

	* app/tools/gimpellipseselecttool.c
	* app/tools/gimprectangleselecttool.c: no constraint.

	This addresses bug #353936 -- I would say fixes it, but it
	probably needs some fine-tuning.  Also perhaps fixes
	bug #329817 a bit better than before.
2006-09-06 22:51:54 +00:00
William Skaggs 05f8df22d7 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpcroptool.c
	* app/tools/gimpcropoptions.[ch]: remove "crop vs resize"
	option, as recommended in bug #353936.
2006-09-06 15:38:28 +00:00
Michael Natterer 6c7f0c6830 added gimp_tool_get_options() so tools don't need to incude
2006-09-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]: added gimp_tool_get_options() so tools
	don't need to incude "core/gimptoolinfo.h" just to get to
	their options.

	* app/tools/gimp*tool.h: added macros GIMP_FOO_TOOL_GET_OPTIONS()
	which return specific tool options types and do all casting
	themselves.

	* app/tools/*.c: use the new macros and don't include
	"core/gimptoolinfo.h" in most files.

	* app/tools/gimpcolorpickertool.c (gimp_color_picker_tool_register):
	make it use the parent context's FG and BG.

	* app/tools/gimpcolortool.c (gimp_color_tool_real_picked): set the
	color on the tool's options, not on the user context.
2006-09-05 18:25:31 +00:00
William Skaggs d4f2171301 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/display/gimpdisplayshell-callbacks.c: allow modifier key events
	for Shift and Control to be propagated even if button1 is down.

	* app/tools/gimpclonetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpvectortool.c: change  modifier_key method
	to prevent any bad consequences.

	* app/tools/gimprectangletool.[ch]:  add modifier_key handler, and use it
	to toggle "make-square" if Shift is pressed while button1 is down, and
	"fixed-center" if Control is pressed while button1 is down.

	* app/tools/gimprectangleselecttool.c (gimp_rectangle_tool_modifier_key):
	call rectangle tool modifer_key method after chaining up.
2006-08-21 17:10:29 +00:00
William Skaggs 4742424b78 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpcroptool.c
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimprectangletool.[ch]: code cleanups

	* app/tools/gimpnewrectselecttool.[ch]: try to do what
	the user intuitively expects when deciding which selection
	operation to perform.  When modifying an existing rectangle,
	always use the operation with which it was created.
2006-06-10 16:49:07 +00:00
Michael Natterer d2911f6aee removed enum GimpRectangleMode.
2006-06-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/tools-enums.[ch]: removed enum GimpRectangleMode.

	* app/tools/gimprectangletool.[ch]: added virtual function
	GimpRectangleTool::cancel(). Added public wrapper for it. Removed
	coordinates paramaters from gimp_rectangle_tool_execute(). Removed
	gimp_rectangle_tool_response(), need to call either execute() or
	cancel() now. Added gimp_rectangle_tool_halt() which disconnects
	the tool from the display without canceling it.

	* app/tools/gimpcroptool.c: changed accordingly.

	* app/tools/gimpnewrectselecttool.c: moved the rectangle creating
	code from the execute() implementation to the new function
	gimp_new_rect_select_tool_rect_select(). Added cancel()
	implementation which pops the remembered undo step if
	appropriate. Call the new rect_select() wrapper from
	rectangle_changed() so we don't create the rectangle on both
	button_release *and* execute(), breaking modifiers and stuff.
2006-06-05 17:14:16 +00:00