- add gimp_draw_tool_push_group()/pop_group() which manage a stack
of groups; all items automatically get added to the stack's top group
- use push_group()/pop_group() all over the place, which saves a lot
of code in most cases
- return GimpCanvasGroup not GimpCanvasItem pointers from
gimp_draw_tool_add_stroke_group() and fill_group()
Unrelated:
- add GipmCanvasGroup parameter to gimp_rectangle_tool_draw()
- put rect select's round corners into the stroke group to
avoid ugly overdrawing (the mis-alignment of arcs becomes
very visible now however, will fix that 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
2008-10-27 Michael Natterer <mitch@gimp.org>
* menus/text-tool-menu.xml
* app/actions/text-tool-actions.c
* app/actions/text-tool-commands.[ch]: add "Text along Path" to the
text tool context menu.
* app/tools/gimptextoptions.[ch]: remove the text along path
button here.
* app/tools/gimptexttool.c: changed accordingly.
* app/tools/gimptexttool.[ch]: move public functions together,
move all virtual function implementations together and put them in
order, made the text along path function public, factor out
gimp_text_tool_xy_to_offset() instead of duplicaing this code
three times, remove gimp_rectangle_tool_frame_item() because it
doesn't belong here.
* app/tools/gimprectangletool.[ch]: add
gimp_rectangle_tool_frame_item() here. Enselic, please process ;)
svn path=/trunk/; revision=27444
2008-10-26 Michael Natterer <mitch@gimp.org>
Merge on-canvas GSoC project:
* configure.in: check for pangocairo.
* app/Makefile.am
* app/text/Makefile.am: add its CFLAGS and LIBS.
* app/text/gimptext-bitmap.[ch]
* app/text/gimptext-private.h
* app/text/gimptext-vectors.[ch]
* app/text/gimptextlayer.c
* app/text/gimptextlayout-render.c
* app/text/gimptextlayout.c: port to pangocairo.
* menus/Makefile.am
* menus/text-tool-menu.xml
* app/menus/menus.c
* app/actions/Makefile.am
* app/actions/actions.c
* app/actions/text-tool-actions.[ch]
* app/actions/text-tool-commands.[ch]: add a context menu for the
text tool similar to GtkEntry's context menu.
* app/tools/gimprectangletool.[ch]: add "narrow-mode" property.
* app/tools/gimptextoptions.[ch]
* app/widgets/gimptexteditor.[ch]: take a text buffer for the
standalone text editor window instead of creating one internally.
* app/tools/gimptexttool.[ch]: all the new wonderful on-canvas
text editing logic. Wheee!
svn path=/trunk/; revision=27419
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-04-07 Sven Neumann <sven@gimp.org>
* app/tools/gimprectangletool.[ch]:
* app/tools/gimptexttool.c removed out 'force-narrow' mode as it
is hard to use and just looks broken.
svn path=/trunk/; revision=25399
* app/tools/gimprectangletool.[ch]: add "force_narrow"
parameter.
* app/tools/gimptexttool.c: Force rectangle to always
be narrow, and squash a few bugs.
svn path=/trunk/; revision=25397
* app/text/gimptextlayout.c
* app/tools/gimptexttool.[ch]
* app/tools/gimprectangletool.[ch]
* app/tools/gimptextoptions.c: allow resizing of text
box. This is work in progress, and needs some tweaks
and fixes. See bug #122707.
svn path=/trunk/; revision=25344
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-12-12 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangletool.c: Extended public interface a bit.
(gimp_rectangle_tool_point_in_rectangle): New convenience function
to test if a point is within the rectangle (if active).
(gimp_rectangle_tool_rectangle_is_new): New function so that
clients can determine if the rectangle currently being
rubber-banded was created from scatch or not.
svn path=/trunk/; revision=24343
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-24 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangletool.[ch]: Ported the internal
representation of the rectangle to gdouble:s instead of
gint:s. This solves problems like not being able to swap portrait
for landscape on very small rectangle and bug #442027, as well as
provides a nice base to solve other similar problems when they are
discovered. It is possible to choose what precision the
GimpRectangleTool:s will appear to have externally through a new
GimpRectanglePrecision enum and property, but the gdouble
precision mode still requires some work in order to be useful. In
the processes quite some refactoring has taken place, mostly
restructuring code and splitting larger functions into smaller
more managable ones.
(gimp_rectangle_tool_rect_rubber_banding_func)
(gimp_rectangle_tool_setup_snap_offsets)
(gimp_rectangle_tool_apply_fixed_rule)
(gimp_rectangle_tool_update_int_rect)
(gimp_rectangle_tool_get_public_rect): New helper functions.
* app/tools/tools-enums.h: Added GimpRectanglePrecision.
svn path=/trunk/; revision=24224
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-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-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-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-07-14 Martin Nordholts <martinn@svn.gnome.org>
Made the rectangle tool handles not resize during rectangle
manipulation, as outlined in the spec, by separating highlight
updating and handle size updating calls.
* app/tools/gimprectangletool.c (gimp_rectangle_tool_configure):
Renamed to
(gimp_rectangle_tool_update_handle_sizes): and moved
gimp_rectangle_tool_set_highlight out of it. These two are now
called independantly.
svn path=/trunk/; revision=22929
2007-06-30 Martin Nordholts <martinn@svn.gnome.org>
Started taking GimpRectangleTool towards the new specification.
The side handles now have the same width and height as the
corresponding corner handles, and the size of the side handles do
not span across the whole rectangle. Side handles also have a
limited mimimum size, just as corner handles.
* app/tools/gimprectangletool.c (gimp_rectangle_tool_oper_update,
gimp_rectangle_tool_draw, gimp_rectangle_tool_configure,
gimp_rectangle_tool_get_anchor): Changed accordingly.
* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_corner): Changed
accordingly.
svn path=/trunk/; revision=22856
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
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/gimprectangletool.[ch]: made gimp_rectangle_tool_halt()
private. Get rid of some more local variables (use private->foo
instead). Fixed statusbar rectangle size display. Some indentation
cleanup.
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/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-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().
* 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/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.
Here is the big change-over, finally.
* app/tools/gimprectselecttool.[ch]: removed.
* app/tools/Makefile.am
* app/tools/gimp-tools.c
* app/tools/gimpellipseselecttool.c
* app/tools/gimpellipseselecttool.h
* app/tools/gimpnewrectselectoptions.c
* app/tools/gimpnewrectselectoptions.h
* app/tools/gimpnewrectselecttool.c
* app/tools/gimpnewrectselecttool.h
* app/tools/gimpselectionoptions.c
* app/widgets/gimptoolbox.c
* menus/image-menu.xml.in: get rid of the "new" in everything
referring to the new rect select tool, except filenames. This
will wait for yosh to perform cvs-magic-foo.
* app/tools/gimprectangleoptions.[ch]
* app/tools/gimprectangletool.[ch]: fix a couple of minor
problems that popped up during testing.
* 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-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.
* app/tools/gimprectangletool.[ch]: add new signal
"rectangle-changed" and method rectangle_changed.
Emit them on button release and when dimensions are
changed in controls.
* app/tools/gimpnewrectselecttool.c: use rectangle_changed
method to change selection, undoing previous change if
necessary.
* app/tools/gimprectangletool.[ch]: add "constrain" property
to specify whether to clip at image bounds when computing
dimensions.
* app/tools/gimpcroptool.c
* app/tools/gimpnewrectselecttool.c: set "constrain" to TRUE.
* app/tools/gimpellipseselecttool.c: set "constrain" to FALSE.
Hopefully fixes bug #329817.
2006-03-26 Karine Delvare <edhel@gimp.org>
* app/tools/gimpcropoptions.c
* app/tools/gimprectangleoptions.[ch]
* app/tools/gimprectangletool.[ch]: moved options gui creation
from the tool to the options.
* app/tools/gimpselectionoptions.c
* app/tools/gimpnewrectselecttool.[ch]
* app/tools/gimpellipseselecttool.[ch]: ported ellipse selection
tool to the new rectangle interface.
* app/tools/gimpcroptool.c
* app/tools/gimpnewrectselecttool.c
* app/tools/gimprectangletool.c
* app/tools/gimprectangletool.h: move tool_control out of rectangle
tool and into users of it, and make rect select execute on leaving
but crop tool not. Also rename functions and clean up formatting
a bit.