Determines if the tool can pick at a given coordinate, without
actually picking. The default implementation uses
gimp_image_coords_in_active_pickable(); GimpFilterTool overrides
this function, to return TRUE whenever the active picker has
pick_abyss == TRUE.
Use this function when updating the cursor, and when determining
whether to draw the sample-average region indicator.
Add two new tools, GimpGuideTool and GimpSamplePointTool. They are
one-trick-ponies and can only create new or move existing guides and
sample points. They can't be selected from the toolbox, only
temporarily pushed as active tools on top of any active tool using
their public start() APIs.
Use that API to enable them when the rulers are clicked, and replace
the entire guide and sample point moving code in GimpMoveTool and
GimpColorTool by simple calls to that API.
This might look like overkill but can easily be used for other
features like moving guides from within the paint tools (mirror
painting) or gegl filters (preview curtain).
...when a color profile is active
This commit doesn't fix anything, but it prepares the code to do the
right thing:
It passes the actual raw image pixels through the entire color picking
mechanism to the widgets which display colors, particularly
GimpColorFrame.
This is needed for GimpColorFrame's "Pixel" mode (as opposed to its
RGB, HSV etc. modes) which is supposed to show the raw pixel values
from the image.
Before this commit, it was recreating the raw pixel values from the
GimpRGB value it knows, which will become impossible when we correctly
pick color managed GimpRGB values soon.
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
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.
2005-03-09 Michael Natterer <mitch@gimp.org>
More sample point stuff. Addresses bug #137776.
* app/core/gimpimage-sample-points.c
* app/core/gimpimage-undo-push.c: append, not prepend the sample
paints to the image's list because their index matters. Update
sample points when their index changes.
* app/display/gimpcanvas.[ch]: added own sytles for the sample
points. Added gimp_canvas_draw_text() which uses a PangoLayout
which is cached in the canvas.
* app/display/gimpdisplayshell-draw.c
(gimp_display_shell_draw_sample_point): draw the sample points
more distinct from guides using the new canvas APIs above.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_[hv]ruler_button_press): factored out all
code to
(gimp_display_shell_ruler_burron_press): which takes a boolean
"horizontal" variable and allows to add sample points with
<control>+drag.
* app/tools/gimpcolortool.[ch]: implement adding, moving and
removing of sample points in the same way as the move tool moves
guides.
* app/tools/gimpcolorpickertool.c
(gimp_color_picker_tool_oper_update): chain up.
2004-06-30 Michael Natterer <mitch@gimp.org>
Fixed a 1.2 -> 2.0 regression that was forgotten:
* app/widgets/widgets-enums.[ch]: added enum GimpColorPickState
which can be one of { NEW, UPDATE }.
* app/widgets/gimppaletteeditor.[ch]: changed #if 0'ed function
gimp_palette_editor_update_color() to
gimp_palette_editor_pick_color() and restored the functionality of
creating/updating colors via this API
Changed button_press handler to only edit the color on double
click if it's really a double click on the same color.
Fixes bug #141381.
* app/tools/gimpcolorpickeroptions.[ch]: added boolean property
"add-to-palette" and a GUI for it.
* app/core/gimpmarshal.list
* app/tools/gimpcolortool.[ch]: added a GimpColorPickState
parameter to the "color_picked" signal. Pass NEW on button_press
and UPDATE on motion.
* app/tools/gimpcurvestool.c (gimp_curves_tool_color_picked)
* app/tools/gimplevelstool.c (gimp_levels_tool_color_picked)
* app/tools/gimppainttool.c (gimp_paint_tool_color_picked):
changed accordingly
* app/tools/gimpcolorpickertool.c (gimp_color_picker_tool_picked):
If "add-to-palette" is TRUE, get the palette editor and call
gimp_palette_editor_pick_color().
2003-09-26 Michael Natterer <mitch@gimp.org>
Cleaned up all places which pick colors to work consistently: the
concept of an "active color" has disappeared, instead <ctrl> picks
the BG color all over the place (fixes bug #122931).
* app/tools/tools-enums.[ch]: added enum GimpColorPickMode which
can be one of { FOREGROUND, BACKGROUND }. Reordered enums so
non-registered ones are at the end of the file. Removed trailing
whitespace.
* app/tools/gimpcolorpickeroptions.[ch]: added a "pick-mode"
property and a GUI for it. Renamed the "update-active" property to
"update-toolbox".
* app/tools/gimpcolorpickertool.c: honor the new option. Toggle
pick-mode on <ctrl>.
* app/tools/gimpcolortool.[ch]: added pick_mode member and change
the cursor accordingly.
* app/widgets/gimpcolormapeditor.[ch]: added "GdkModifierType
state" to the "selected" signal. Removed the signal's default
implementation.
* app/gui/dialogs-constructors.c: fixed the signal handler which
lives here and set BG if <ctrl> was pressed.
* app/widgets/gimppaletteeditor.c: removed weird <ctrl> <->
active_color interaction and pick BG on <ctrl>. Don't change the
toolbox color when editing a color in the palette.
* app/widgets/gimptoolbox-color-area.[ch]: made the whole
active_color stuff private. Will remove these artefacts soon...
* app/gui/colormap-editor-menu.c
* app/gui/palette-editor-menu.c: added separate menu entries
for adding a color from the current FG and BG.
* app/gui/colormap-editor-commands.c
* app/gui/palette-editor-commands.[ch]: changed callbacks
accordingly.
* cursors/background.xbm
* cursors/background_mask.xbm
* cursors/foreground.xbm
* cursors/foreground_mask.xbm
* cursors/gimp-tool-cursors.xcf: moved the FG/BG cursor modifiers
closer to the upper right corner.
* app/widgets/gimpcursor.c: ignore the cursor modifiers' hotspots
since they are not relevant and I didn't save the hotspot in the
updated cursor files for that reason.
2003-06-05 Sven Neumann <sven@gimp.org>
* app/tools/gimpcoloroptions.c: changed the default radius.
* app/tools/gimpcolortool.[ch]: pass GimpColorOptions to
gimp_color_tool_enable(). Added gimp_color_tool_disable() and
gimp_color_tool_is_enabled().
* app/tools/gimpcolorpickertool.c: changed accordingly.
* app/tools/gimppainttool.[ch]: derived GimpPaintTool from
GimpColorTool and removed most color picking code.
* app/tools/gimpdodgeburntool.c (gimp_dodgeburn_tool_modifier_key)
* app/tools/gimperasertool.c (gimp_eraser_tool_modifier_key):
chain up to the parent class.
* app/tools/gimppaintbrushtool.c: purely cosmetic change.
2003-06-04 Sven Neumann <sven@gimp.org>
* app/core/gimpmarshal.list: added VOID: ENUM, BOXED, INT.
* app/tools/gimpcolortool.[ch]: added a default implementation for
GimpColorTool::pick. Emit a "picked" signal when a color was
successfully picked.
* app/tools/gimpcolorpickertool.c: simplified a lot since
GimpColorTool does most of the work for us now.
2003-06-04 Sven Neumann <sven@gimp.org>
* app/tools/Makefile.am
* app/tools/gimpcoloroptions.[ch]
* app/tools/gimpcolortool.[ch]: new files that implement base
classes moved out of GimpColorPickerOptions and GimpColorPickerTool.
* app/tools/gimpcolorpickeroptions.[ch]
* app/tools/gimpcolorpickertool.[ch]: derive from the new obejcts.
* app/tools/gimpimagemaptool.h
* app/tools/gimppainttool.c
* app/tools/tools-types.h: moved typedefs into the types file.