2008-05-02 Martin Nordholts <martinn@svn.gnome.org>
* gimptexttool.c
* gimptexttool.h:
* gimprectangletool.c
* gimprectangletool.h
* gimprectangleselecttool.c: Renamed the "rectangle-changed"
signal to "rectangle-change-complete" which is much better name
since the signal is not emited when the rectangle is changed, but
when the change is complete.
svn path=/trunk/; revision=25557
2008-03-09 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangleselecttool.[ch]
* app/tools/gimprectangleselectoptions.[ch]
* app/tools/gimpellipseselecttool.[ch]
* app/tools/gimp-tools.c: s/Rect/Rectangle/ and s/rect/rectangle/
in types and function names.
svn path=/trunk/; revision=25076
2008-01-23 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_execute): Reset the automatic undo/redo
mechanism so that commiting pending rectangles with Return
works (bug #511599).
svn path=/trunk/; revision=24696
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-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 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-11-24 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangletool.[ch]: Renamed RECT_* identifiers of
the GimpRectangleFunction enum to GIMP_RECTANGLE_TOOL_*.
* app/tools/gimprectangleselecttool.c: Use the new names.
svn path=/trunk/; revision=24226
2007-11-18 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c: Cosmitics. More strictly
align static function prototypes and consistently use the name
rect_sel_tool for pointers to GimpRectSelectTool.
svn path=/trunk/; revision=24192
2007-11-11 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangletool.[ch]: Removed
gimp_rectangle_tool_get_press_coords() as it doesn't make sense
for a rectangle tool interface to provide this functionality.
Clients should take care of that themselves. Also adjusted
internal code accordingly.
* app/tools/gimprectangleselecttool.c: Remember the pressed
coordinates on _button_press instead of asking GimpRectangleTool
about it.
svn path=/trunk/; revision=24119
2007-10-30 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_round_corners_notify): Update the selection
when Rounded corners is toggled or the radius is changed as
discussed in bug #418284.
svn path=/trunk/; revision=23991
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-09-23 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_should_draw): New name for
gimp_rect_select_selection_visible() which has been changed to
always return TRUE when the tool is active, i.e. when a rectangle
is being create or resized. Better fix for bug #479426.
svn path=/trunk/; revision=23623
2007-09-23 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_draw): Only draw the rectangle when `Show
selection' is `true', with the help of a new function
gimp_rect_select_tool_selection_visible(). Fixes bug #474509.
svn path=/trunk/; revision=23621
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-05-02 Sven Neumann <sven@gimp.org>
* app/core/gimppickable.[ch]: removed get_color_at() from the
GimpPickable interface. Implement the same functionality using
get_pixel_at() but with a saner API.
* app/core/gimpdrawable.c
* app/core/gimpprojection.c
* app/core/gimpimagemap.c: removed get_color_at() implementations.
* app/tools/gimpbycolorselecttool.c: adapt to API change of
gimp_pickable_get_color_at().
* app/tools/gimprectangleselecttool.c: added missing include.
svn path=/trunk/; revision=22383
2007-04-12 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangleselecttool.c: implement
GimpTool::key_press and delegate to the rectangle tool or the
edit
selection tool. This resurrects positioning of floating
selections
with the cursor keys.
svn path=/trunk/; revision=22244
2007-03-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangleselecttool.c: read the "operation" member
of GimpSelectionOptions directly.
* app/tools/gimpellipseselecttool.c (gimp_ellipse_select_tool_draw):
chain up instead of calling gimp_rectangle_tool_draw() directly,
don't #include "gimprectantletool.h".
svn path=/trunk/; revision=22208
2007-03-05 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_execute): if the user clicks inside an
existing selection, initialize the rectangle tool to the entire
selection, not just to the part of it that is within the active
drawable. Also removed some dead code.
svn path=/trunk/; revision=22049
2007-02-28 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_rectangle_changed): don't change the
selection while the tool is active. Fixes bug #398185. Thanks to
Martin Nordholts for investigating this problem.
* app/tools/gimprectangletool.c: minor cleanup.
svn path=/trunk/; revision=22025
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 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-08 Michael Natterer <mitch@gimp.org>
Unbreak rectangle select tool undo handling a bit:
* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_select):
add boolean return value indicating if something was actually selected.
(gimp_rect_select_tool_rectangle_changed): peek the newly pushed
undo only if we selected something.
svn path=/trunk/; revision=21866
2006-11-15 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.[ch]
* app/tools/gimprectangleselecttool.c: removed function from the
properties. Added getter and setter functions instead. Redraw
the
tool whenever the function changes.
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 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 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-10-18 Michael Natterer <mitch@gimp.org>
Applied modified patch from Martin Nordholts which adds a "Rounded
Corners" option to the rectangle select tool. Fixes bug #86279.
* app/core/gimpchannel-combine.[ch]: added
gimp_channel_combine_ellipse_rect(). Use it from
gimp_channel_combine_ellipse().
* app/core/gimpchannel-select.[ch]: added
gimp_channel_select_round_rect()
* app/tools/gimprectangleselectoptions.[ch]: added properties
"round-corners" and "corner-radius" and GUI for the new propeties.
* app/tools/gimprectangleselecttool.h: added macro
GIMP_RECT_SELECT_TOOL_GET_OPTIONS().
* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_draw):
draw round corners if enabled.
(gimp_rect_select_tool_real_select): use
gimp_channel_select_round_rect() if enabled.
* app/tools/gimpselectionoptions.[ch]: added "antialias_toggle"
to the GimpSelectionOptions struct so the rect select options
can set its sensitivity.
Unrelated:
* app/tools/gimpellipseselecttool.c (gimp_ellipse_select_tool_draw):
use 360 * 64 instead of 23040.
2006-10-17 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangleselecttool.[ch]
* app/tools/gimpellipseselecttool.c: use enum GimpChannelOps
instead of SelectOps.
2006-10-14 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_execute):
flush the image after clearing the selection and after anchoring
a floating layer. Fixes bug #362096.
* 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.
* app/tools/gimprectangleoptions.[ch]
* app/tools/gimprectangleselecttool.c
* app/tools/gimprectangletool.c
* app/tools/gimpselectionoptions.c: move "auto-shrink"
and "shrink-merged" from selection options to
rectangle options where they belong; now shown
for crop tool as well as rect select.
* 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-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().
* 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-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.
* 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.
* app/tools/gimprectangleselecttool.[ch]: if the user is
modifying a rectangle and the mode is REPLACE, don't
show the marching ants for the previous selection, because
it confuses users. Should fix bug #347945.
* app/tools/gimprectangleselecttool.c: if there is a floating selection
and mouse is clicked outside it without movement, anchor it.
* app/tools/gimprectangletool.c: corner handle area was scaling
improperly when image was zoomed.