Commit Graph

205 Commits

Author SHA1 Message Date
Michael Natterer 2229d0aed8 Bug 740939 - No shortcut actions for changing tool's spacing, hardness and force
Add generic tool actions for spacing, hardness and force, and the
GimpToolControl infrasctructure to redirect them to tool-specific
actions. Add tool-specific actions for GimpBrushTool, GimpMybrushTool
and GimpWarpTool as redirect targets. Also fix some existing tool
action callbacks to use the right increase/decrease steps.
2016-03-22 23:54:40 +01:00
Alexia Death 59364ea76d app: separate fallback cursor from primary indicator cursor
Separate fallback use of a cursor from using a plain size
indicator cursor. Ink tool uses a plain circle as primary
drawing indicator instead of outline, totally different
use than a fallback, when brush is too small to be drawn.

Conflicts:
	app/tools/gimppainttool.c
2014-11-19 00:41:43 +02:00
Michael Natterer 242ccacdcc app: s/paint_brush/paintbrush/ in the paintbrush action code 2014-05-03 22:55:05 +02:00
Michael Natterer 0bdb74710a app: rename the value-1...value-4 actions to opacity, size, aspect, angle 2014-04-19 20:09:39 +02:00
Michael Natterer 6e726f248f app: use the right aspect and angle actions for GimpBrushTool 2014-04-19 19:53:40 +02:00
Michael Natterer d897188e32 app: also move the "draw brush outline" logic from brush to paint tool
So all paint tools honor the setting.

Add GimpPaintTool::get_outline() which either returns an outline, or
calls gimp_paint_tool_set_draw_cursor() and implement it in
GimpBrushTool and GimpInkTool. Handle all brush/circle/fallback
drawing in gimp_paint_tool_draw().
2014-04-12 15:03:15 +02:00
Michael Natterer 1ade034c49 app: move "show paint tool cursor" logic from GimpBrushTool to GimpPaintTool
Now all paint tools (also ink and mypaint brush) honor the setting and
can work without mouse cursor.
2014-04-12 12:54:08 +02:00
Michael Natterer 66010e6c6d Bug 623734 - No brush outline with dynamics set to 'size' on 'pressure'
Improve the logic in gimp_brush_tool_draw() and draw a brush-sized
circle if the actual brush outline got scaled away by dynamics.
2014-04-12 01:13:11 +02:00
Michael Natterer e8459beb24 app: don't create a fallback crosshair in gimp_brush_tool_create_outline()
Instead, draw the crosshair in gimp_brush_tool_draw() if create_outline()
didn't return an item *and* if there is no brush tool cursor.

In gimp_source_tool_draw(), don't add an additional crosshair if
create_outline() returned an item.

This fixes both "no cursor at all" and "both outline and crosshair
shown" for certain prefs settings conbinations (bug #623734).
2014-04-09 14:53:24 +02:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer 8b57ef51cc app: clean up the new brush outline stuff a bit 2011-06-30 09:27:43 +02:00
Alexia Death 3c3657f780 app: Refactor path code to support styles and add outline style for use in brush outline 2011-06-29 23:05:14 +03:00
Michael Natterer 91550117c7 app: fix GimpSourceTool's source position drawing for other displays
by adding the source outline's canvas item to the source display
directly. Poking in GimpDrawTool internals is gone and generally not
possible any longer since GimpCanvasItem based drawing.
2011-05-04 23:25:55 +02:00
Michael Natterer 0315f483e6 app: some general GimpPaintCore cleanup 2011-04-06 09:11:25 +02:00
Michael Natterer 21b8007b29 app: add GimpBrushCache which stores brush stuff based on transform parameters
such as masks and outlines. The cache is currently very stupid and
only cacheds the last transformed object. Add caches to GimpBrush for
its mask, its pixmap and its boundary, and remove the same caches and
a ton of members from GimpBrushCore. This involves adding lots of
const qualifiers because GimpBrush returns const pointers now for
trasnformed stuff.
2011-04-05 22:15:30 +02:00
Michael Natterer a50f668d87 app: GimpBrushCore: simplify brush and dynamics setting
by checking for an actual change in the setters. Remove the
"foo != core->foo" checks from all callers.
2011-04-05 19:05:55 +02:00
Michael Natterer 647a576cd4 app: use the new brush boundary API in GimpBrushTool 2011-04-04 21:14:57 +02:00
Michael Natterer ea34b145e8 app: some random tool cleanup 2011-04-04 00:01:30 +02:00
Michael Natterer 6a046d09e4 app: GimpBrushTool: don't split brush setting in two callbacks
The need to both connect() and connect_after() to "set-brush" is gone
because XOR drawing is gone.
2011-03-30 23:38:14 +02:00
Michael Natterer 2e406872c4 app: GimpBrushTool: don't set a BAD cursor permanently
by chaining up after setting it. Instead, don't set it and call
gimp_tool_set_cursor() directly when there is no brush or no dynamics.
2011-03-30 19:18:29 +02:00
Michael Natterer afa8a416c9 app: don't crash if GimpBrushTool has no dynamics to paint a brush outline
Also, set the BAD cursor when there isn't both brush and dynamics
available.
2011-03-24 20:21:57 +01:00
Michael Natterer 503a9cebce app: implement GObject::constructed() instead of ::constructor() 2011-01-13 10:06:07 +01:00
Michael Natterer 32926c9b6a app: implement GimpTool::options_notify()
instead of connecting to the tool options manually.
2010-11-10 14:20:33 +01:00
Alexia Death 8663b22c2a app: Fixes to brush scale->size replacement 2010-10-30 21:38:54 +03:00
Michael Natterer 22db39afd2 app: fix incomplete earlier s/GtkAnchorType/GimpHandleAnchor/ change 2010-10-18 20:13:09 +02:00
Michael Natterer 3de4d7263a app: Bug 631619 - Drawing artifacts spread by paintbrush outline on canvas
Add a transform matrix to GimpCanvasBoundary and get rid of the whole
BoundSeg transform code in boundary.c and gimpbrushcore.c, it was
impossible to get this right on that level. Also fix te extents of
GimpCanvasBoundary os it leaves no artifacts.
2010-10-09 22:00:19 +02:00
Michael Natterer 49f2204a8a app: add a newline 2010-10-05 09:08:56 +02:00
Michael Natterer 4492725110 app: add some (disabled) code that draws the untransformed brush outline 2010-09-26 22:27:55 +02:00
Michael Natterer b3af235e79 app: rename all gimp_draw_tool_draw_foo() functions
to gimp_draw_tool_add_foo() because that's what they do now.
2010-09-25 19:02:22 +02:00
Michael Natterer 7a6a57c42f app: remove code in draw() that special cases drawing vs. undrawing
GimpDrawTool::draw() is not used for undrawing any longer.
2010-09-24 21:18:45 +02:00
Michael Natterer 4d0c750327 app: get rid of "gboolean use_offsets" in the draw tool
and always pass image coordinates. Transform the coords manually in
the very few places which passed TRUE.
2010-09-23 19:23:27 +02:00
Alexia Death 054bd341bd app: fix incomplete revert 2010-03-19 21:21:01 +02:00
Alexia Death 1e8ec625df Revert "app: Fix the code that disables outline to be a bit neater"
This reverts commit 58d82dcadc.
2010-03-19 21:21:01 +02:00
Alexia Death 656eb53aad Revert "app: Do not show brush outline when painting"
This reverts commit 031dc8e68a.
2010-03-19 21:21:01 +02:00
Alexia Death 58d82dcadc app: Fix the code that disables outline to be a bit neater 2010-03-17 00:36:19 +02:00
Alexia Death 031dc8e68a app: Do not show brush outline when painting
It takes resourses and jsut gets in the way of seeing the real brush
2010-03-16 23:48:56 +02:00
Alexia Death bd2f852ac1 app: make off-canvas changes have effect on brush outline 2010-03-16 21:53:34 +02:00
Alexia Death 44a5a34d7e app: Make brush boundaries dynamic aswell 2010-03-15 02:55:15 +02:00
Michael Natterer c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
Michael Natterer ac98c2c234 Use gimp_display_get_shell() instead of directly accessing it 2009-10-04 19:56:39 +02:00
Alexia Death 6aafd34380 Adds dynamic aspect ratio for brushes. 2009-04-25 20:53:09 +03:00
Sven Neumann 30c118b53c Bug 520078 – Rotate brushes
2009-02-05  Sven Neumann  <sven@gimp.org>

	Bug 520078 – Rotate brushes

	Applied patch from Alexia Death:

	* app/core/gimpbrush.[ch]
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrush-transform.[ch]: affine transformations for
	brushes. So far only scaling and rotation is supported. The
	transformation is done using nearest-neighbour. This is a
	regression and we need to add back interpolation before the next
	release.

	* app/paint/gimpsmudge.c
	* app/paint/gimppaintoptions.[ch]
	* app/paint/gimpbrushcore.[ch]: allow to control the brush
	rotation angle.

	* app/tools/gimppaintoptions-gui.c
	* app/tools/gimpbrushtool.c: added UI for controlling the
	brush rotation angle.

	* app/actions/tools-actions.c
	* app/actions/tools-commands.[ch]: add actions for controlling 
the
	brush rotation angle.


svn path=/trunk/; revision=27987
2009-02-05 21:47:57 +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
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 18156ac03f dilate the brush mask in order to obtain a simpler boundary. Addresses bug
2008-01-22  Sven Neumann  <sven@gimp.org>

	* app/paint/gimpbrushcore.c (gimp_brush_core_create_bound_segs):
	dilate the brush mask in order to obtain a simpler boundary.
	Addresses bug #304798.

	* app/tools/gimpbrushtool.c (gimp_brush_tool_draw_brush): 
removed
	redundant casts.


svn path=/trunk/; revision=24676
2008-01-22 20:06:01 +00:00
Sven Neumann 96a46d0d70 Fix bug #491272 (no cursor drawn for small brush sizes):
2007-10-29  Sven Neumann  <sven@gimp.org>

	Fix bug #491272 (no cursor drawn for small brush sizes):

	* app/tools/gimpbrushtool.[ch]
	(gimp_brush_tool_draw_brush): don't draw the brush outline if it
	becomes too small. Instead draw a small cross, but only if
	"draw_fallback" was passed as TRUE.
	(gimp_brush_tool_draw_brush): pass TRUE for "draw_fallback" if
	cursor drawing is disabled for the paint tools.

	* app/tools/gimpsourcetool.c (gimp_source_tool_draw): pass FALSE
	for "draw_fallback".

	* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_cross_by_anchor):
	draw a symmetric cross for odd handle sizes.

svn path=/trunk/; revision=23984
2007-10-29 17:17:14 +00:00
Sven Neumann a5d10b2ff0 renamed gimp_image_active_drawable() to gimp_image_get_active_drawable().
2007-07-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: renamed gimp_image_active_drawable() to
	gimp_image_get_active_drawable().

	* app/[lots of files]
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/image.pdb: changed accordingly.

svn path=/trunk/; revision=22958
2007-07-19 14:59:51 +00:00
Michael Natterer e5070a2486 add a local GimpDisplayConfig variable to improve readability.
2007-05-16  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpbrushtool.c (gimp_brush_tool_constructor): add a
	local GimpDisplayConfig variable to improve readability.


svn path=/trunk/; revision=22514
2007-05-16 18:47:47 +00:00
Sven Neumann a4eafbad64 moved brush drawing code to the new function gimp_brush_tool_draw_brush().
2007-05-07  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpbrushtool.[ch] (gimp_brush_tool_draw): moved
	brush drawing code to the new function gimp_brush_tool_draw_brush().

	* app/tools/gimpsourcetool.c: (gimp_source_tool_draw): draw the
	brush outline at the source position (bug #435545).


svn path=/trunk/; revision=22450
2007-05-07 10:19:04 +00:00