Commit Graph

14510 Commits

Author SHA1 Message Date
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 054957a1ee app: s/nbrushes/n_brushes/ in GimpBrushPipe 2011-04-05 15:16:06 +02:00
Michael Natterer 7db7cc111c app: clean up gimpbrush-boundary.c a bit and prepare for outline approximation 2011-04-05 14:52:44 +02:00
Michael Muré 7f6d06d3e9 cagetool: fix buffer leak 2011-04-05 10:18:07 +02:00
Michael Muré 2200b80033 cagetool: fix the restoration of the image when going back to edit mode 2011-04-05 00:05:56 +02:00
Michael Muré ec25c6be42 cage tool: fix transformed area going away when setting a cage,
going back to edit mode, edit the cage then going to deform mode
2011-04-05 00:05:56 +02:00
Michael Natterer eda5cdf666 app: add gimp_bezier_desc_new_from_bound_segs() to GimpBezierDesc
and remove that code from gimpbrush-boundary.c
2011-04-04 22:06:32 +02:00
Michael Natterer 46819a05da app: fix transformation in GimpCanvasPath 2011-04-04 21:41:46 +02:00
Michael Natterer d008fcd588 app: remove the entire brush boundary code from GimpBrushCore 2011-04-04 21:24:41 +02:00
Michael Natterer 647a576cd4 app: use the new brush boundary API in GimpBrushTool 2011-04-04 21:14:57 +02:00
Michael Natterer cf52b10e9b app: implement gimp_brush_transform_boundary()
There is infinite room for optimization, but the API and pixel-perfect
functionality is there, which is step one.
2011-04-04 21:11:39 +02:00
Michael Natterer 99e0e73fc6 app: add "x" and "y" properties to GimpCanvasPath
so paths can be rendered at any position. Pass 0,0 from all places
that draw GimpVectors.
2011-04-04 20:58:38 +02:00
Michael Natterer 9e1db5dc92 app: add empty stub gimp_brush_transform_boundary()
as a separate commit because it reindents the entire header.
2011-04-04 19:21:25 +02:00
Michael Natterer 7d39d800fc app: GimpColorTool and GimpMoveTool: don't start the draw tool twice
and some minor coding style cleanup.
2011-04-04 19:20:04 +02:00
Michael Natterer ac9b487795 app: fix GimpBrush transform parameter names and coding style 2011-04-04 18:57:48 +02:00
Michael Natterer 8b4870dad7 app: move GimpBezierDesc from app/vectors/ to app/core/ 2011-04-04 18:40:12 +02:00
Michael Natterer 492e0f9cfd app: some more mostly cosmetic tool cleanup 2011-04-04 08:19:12 +02:00
Michael Natterer 39fa147c17 app: unset GimpSpinScale's context sensitive cursor when the pointer leaves 2011-04-04 01:10:44 +02:00
Enrico Schröder d4316902a2 app: DodgeBurn/Convolve: Fix error in behavior of modifier keys
Fix for bug #632816: When holding shift key to go to LineDraw mode,
then pressing ctrl and releasing shift before ctrl, the release of
ctrl switches the function of DodgeBurn and Convolute tool. This patch
adds a variable to GimpDodgeBurnTool/GimpConvolveTool to only switch
said function on releasing ctrl when it has been toggled previously.
2011-04-04 00:38:01 +02:00
Michael Natterer 036c5aff73 app: constify "color" parameter in GimpColorTool::picked() 2011-04-04 00:08:57 +02:00
Michael Natterer ea34b145e8 app: some random tool cleanup 2011-04-04 00:01:30 +02:00
Michael Natterer 32c6177c1e app: gimp_canvas_sample_point_set(): x and y are integers not doubles 2011-04-03 23:42:26 +02:00
Michael Natterer 70e5cf57a1 app: move GimpColorPickerTool's shutdown code to control(HALT) 2011-04-03 23:33:07 +02:00
Michael Natterer 6d73eead54 app: emit "notify::tool-options" when GimpToolPreset's options change
Fixes the "dirty" state and thus saving of modified presets.
2011-04-03 19:34:31 +02:00
Michael Natterer fce5c7ea26 app: add "gboolean focus_in" to gimp_display_shell_update_focus()
and use it to update the tool's state also when the canvas gets a
FOCUS_OUT.
2011-04-03 19:02:19 +02:00
Michael Natterer 5a76519c88 app: call gimp_display_shell_update_focus() in more cases
instead of duplicating its functionality.
2011-04-03 18:52:24 +02:00
Michael Natterer a0641d73d6 app: remove the hackish "button_press_before_focus" from GimpDisplayShell
and simply *always* set the tool to the right state before sending it
a button_press. GimpTool's state setting functions are now smart
enough to simply ignore setting the same state again. When recieving a
FOCUS_IN, skip state setting when the pointer is grabbed, which is a
safe indicator for tool interaction going on. This hopefully fixes
states for both click-to-focus and focus-follows-mouse *and* fixes the
previously warning case where a new image was opened into an already
focussed canvas (the warning then happened on button press, and the
tool was in an inconsistent state).
2011-04-03 18:42:50 +02:00
Michael Natterer b468bb5ec9 app: add gimp_display_shell_initialize_tool() in tool-events.c
so another big block of logic is gone from "the huge function".
2011-04-03 18:28:26 +02:00
Michael Natterer dea9176121 app: fix initial navigation popup position
so it doean't jump around on first mouse movement.
2011-04-03 18:00:12 +02:00
Martin Nordholts a8f552da2f Bug 646371 - The wrong file gets saved when exporting with overwrite
An image can not be considered both exported and imported at the same
time, so stop consider it as imported after we consider it exported.

Also add an automatic regression test.
2011-04-03 16:54:34 +02:00
Alexia Death 8bbc475eab Revert "app: initialize GimpToolPreset's tool options from the user context"
This reverts commit b458b1b5c0.

This hides preset errors form users and creates confusion in case
of presets with bugs distributed among users. It also tries to set
resources from user context when that context doesnt exist yet.
2011-04-03 12:34:52 +03:00
Michael Natterer b458b1b5c0 app: initialize GimpToolPreset's tool options from the user context
so that if deserializing wants to set an unknown brush, pattern etc.,
the previously set default value will be used instead.
2011-04-03 00:47:41 +02:00
Michael Natterer 64b9ac3f6c app: move the GimpTextTool shutdown code to control(HALT) 2011-04-03 00:40:41 +02:00
Michael Natterer 6de9615154 app: bail out in gimp_blend_tool_initialize() if there is no gradient 2011-04-03 00:33:41 +02:00
Michael Natterer 61025c6023 Bug 624824 - use gtk-image-menu-item-set-always-show-image on some menu items
Always show icons for:

- Fill FG/BG/Pattern
- Rotate
- Recently opened
- Open images
2011-04-02 15:38:55 +02:00
Michael Natterer 9ec725c297 app: move the GimpIscissorsTool shutdown code to control(HALT) 2011-04-02 11:58:29 +02:00
Michael Natterer 3056cdbc43 app: remove the entire IscissorsDraw enum and member
and simplify drawing massively. It was a pile of XOR cruft that's not
needed any longer.
2011-04-02 11:40:56 +02:00
Michael Natterer 6f4be58716 app: GimpFreeSelectTool: highlight the hovered handle 2011-04-02 08:29:53 +02:00
Michael Natterer efbbe39734 app: rmove gimp_free_select_tool_update_button_state()
and priv->button1_down. Use gimp_tool_control_is_active() instead
because it now has exactly that meaning.
2011-04-02 08:24:24 +02:00
Michael Natterer 7a6bf9b5fe app: generically call gimp_tool_control(HALT) in GObject::dispose()
so all the previously added shutdown fragments are executed when the
tool destroyed.
2011-04-01 22:56:33 +02:00
Michael Natterer 880572860a app: move shutdown code from gimp_image_map_tool_response() to control(HALT) 2011-04-01 22:56:33 +02:00
Michael Natterer d90de689fb app: GimpCageTool: in CAGE_CHANGE mode, switch to DEFORM when enter is pressed 2011-04-01 22:56:33 +02:00
Michael Natterer a7f32f2290 app: move shutdown code from gimp_cage_tool_halt() to control(HALT) 2011-04-01 22:56:33 +02:00
Michael Natterer 813392cafd app: move shutdown code from gimp_free_select_tool_halt() to control(HALT) 2011-04-01 22:56:33 +02:00
Michael Natterer 8ca28f19a3 app: move shutdown code from gimp_measure_tool_halt() to control(HALT) 2011-04-01 22:56:33 +02:00
Michael Natterer 931d2110c6 app: move shutdown code from gimp_align_tool_halt() to control(HALT)
and also remove GObject::dispose() because that's going to be
handled generically soon.
2011-04-01 22:56:33 +02:00
Michael Natterer eb9fefe505 app; move GimpTransformTool's shutdown code to control(HALT)
and remove gimp_transform_tool_halt(), including all the duplicated
parent class shutdown code.
2011-04-01 22:56:33 +02:00
Michael Natterer 8a69d4f639 app: fix GimpCanvasProgress' position, extents, and drawing, gah... 2011-04-01 22:56:33 +02:00
Michael Natterer c48c77b2e0 app: NULLify GimpRectangleOptions widget pointers upon destruction
so the NULL checks in GimpRectangleTool work no matter what the
shutdown order is.
2011-04-01 22:56:33 +02:00
Michael Natterer 0c7cd5b8a1 app: GimpPaintTool: don't call paint_core_paint(FINISH) in control(HALT)
because that simply can't happen (we call paint(FINISH) in
button_release() already and press and release are always paired. Only
call paint_core_cleanup() in control(HALT).
2011-04-01 22:56:32 +02:00
Michael Natterer e1bc19faf6 app: make state checks on tool much more strict
so wrong calls will run into precondition checks and warnings. This is
optional, but currently enabled, to reduce the risk of introducing
permanent new warnings for 2.8. See STRICT_TOOL_CHECKS in gimptool.h.
2011-04-01 22:56:32 +02:00
Michael Muré 24c117082f gimp:cage-transform : prepare optimisation for when the Gegl bug #645810 is solved 2011-03-31 23:00:23 +02:00
Michael Natterer e4daf561ac app: return TRUE after handling double and triple click tool events
so we don't redundantly update the cursor again.
2011-03-31 10:21:55 +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 0db785c36a app: don't call control_activate()/control_halt() in GimpRectangleTool
Instead, call it in all implementors.
2011-03-30 22:13:31 +02:00
Michael Natterer 884e4868a4 app: fix calls to control_activate() and control_halt() in GimpIScissorsTool 2011-03-30 21:48:37 +02:00
Michael Natterer 55f80cd758 app: fix GimpForegroundSelectTool pen cursor drawing
It seems some of the junk removed in the last commit did have a
purpose :) Also use a tool progress because it's the result of a
canvas interaction.
2011-03-30 21:24:04 +02:00
Michael Natterer cc63337be5 app: simplify gimp_foreground_select_tool_oper_update() a lot
by removing tons of cruft. Fixes both status messages and tool drawing
with multiple displays.
2011-03-30 20:39:00 +02:00
Michael Natterer 92d7c7d8d9 app: change about dialog role from "about-dialog" to "gimp-about" 2011-03-30 20:20:47 +02:00
Enrico Schröder 074e2c088a app: GimpRectangleTool: Rounding error when moving/resizing with keyboard
Fix for bug #653186: When a rectangle selection is created or moved by
mouse at certain zoom-levels (200%, 400%, 800%), its coordinates can
become exactly .500. By then using the keyboard to move/resize in
steps of one pixel, a rounding error occurs in
gimp_rectangle_tool_update_int_rect(). This leads to the coordinate
either not beeing changed at all or changed by 2 pixels at a time. The
patch changes the function from using RINT() to ROUND() for the
calculations, which prevents the rounding error from happening.
2011-03-30 19:45:46 +02:00
Enrico Schröder aae8787ee3 app: SIOX: algorithm ignores color sensitivity changes
Fix for bug #627062: When changing the color sensitivity settings of
the Foreground Selection Tool, the SIOX algorithm gets called with
refinement=SIOX_REFINEMENT_CHANGE_SENSITIVITY, which then triggers
refinement=SIOX_REFINEMENT_RECALCULATE. However, there is no
implementation for RECALCULATE so the change is ignored. The patch
sets refinement to SIOX_REFINEMENT_ADD_FOREGROUND and _ADD_BACKGROUND
which triggers a complete recalculation.
2011-03-30 19:35:38 +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 96c8c35575 app: GimpFreeSelectTool: remove if (tool->display != display) checks
This can't happen in motion() and release() because they won't be
called if we didn't activate the tool.
2011-03-30 19:01:11 +02:00
Michael Natterer 9755d7d06c app: GimpForegroundSelectTool: call control_activate() unconditionally 2011-03-30 15:05:33 +02:00
Michael Natterer 3d2fb51a63 app: GimpEditSelectionTool: call control_halt() in button_release()
Just for consistency, the tool is destroyed at the end of
button_release() anyway.
2011-03-30 12:08:38 +02:00
Michael Natterer 6899b0bf60 app: GimpCageTool: go to deform mode only if the user clicked the first handle
and not if it was only moved.
2011-03-30 11:51:51 +02:00
Michael Natterer f585788e46 app: tool control cleanup in GimpCageTool
Don't call tool_control functions twice in init(). Call activate() and
halt() only on button_press() and button_release() to indicate that
the tool wants motion events.
2011-03-30 11:48:05 +02:00
Michael Natterer 28c48b1857 app: GimpBrightnessContrastTool: don't call gimp_tool_control_pause()/resume()
It must not be called directly, and is entirely useless here anyway.
2011-03-30 11:44:12 +02:00
Michael Natterer d92b22c567 app: #include "widgets-types.h" so the GDK_KEY_foo defines are there 2011-03-29 22:39:34 +02:00
Michael Natterer 1cdaa2846f app: some forgotten s/GDK_foo/GDK_KEY_foo/ 2011-03-29 18:53:02 +02:00
Michael Natterer 7c60bb5181 app: use more of the new GDK_KEY_foo key names
and move the compat defines from display-enums.h to widgets-enums.h
2011-03-29 17:24:08 +02:00
Michael Natterer 2468f9fd55 app: cancel the align tool on Escape, and some more cleanup 2011-03-29 15:16:17 +02:00
Michael Natterer bb5dea615b app: some more cleanup and namespacing in GimpAlignTool 2011-03-29 14:32:00 +02:00
Michael Natterer 0c8ff468f6 app: remove empty GimpTool::initialize() impl from GimpAlignTool 2011-03-29 14:00:10 +02:00
Michael Natterer f7bb4afbd8 app: add gimp_image_pick_layer_by_bounds() and use it in GimpAlignTool
Also do some refactoring in the align tool, like adding
gimp_align_tool_halt() and using it to shut down the tool.
2011-03-29 13:58:23 +02:00
Michael Natterer 08e409d6e3 app: move the GimpAlignTool options GUI to GimpAlignOptions
which fixes a major uglyness, it should have always been there.
Also fixes warnins on quit if the align tool is active.
2011-03-29 13:26:18 +02:00
Michael Natterer c38eb0df4a app: core-enums.h: fix type macros of the align type enums 2011-03-29 12:45:54 +02:00
Michael Natterer f32e285ea3 app: more cleanup in GimpMeasureTool
- highlight the active point while dragging
- make sure the tool is only active while dragging
- misc formatting cleanup
2011-03-29 09:16:22 +02:00
Michael Natterer f59eeb95e7 app: remove GimpMeasureTool:active_handle and use the existing :point
Also don't re-find the active point in button_press().
2011-03-29 08:52:09 +02:00
Mikael Magnusson afb68c1cea app: fix return value from NULL to FALSE 2011-03-29 00:23:27 +02:00
Michael Natterer 2b9b737686 app: add gimp_measure_tool_oper_update() which should have always been there
and add the stuff that should not be done in cursor_update(). Also add
highlighting of the currently hovered handle.
2011-03-28 20:44:30 +02:00
Michael Natterer 44a6e4f07a app: use gimp_canvas_item_hit() in GimpMeasureTool 2011-03-28 20:13:18 +02:00
Michael Natterer 365902b582 app: use gimp_canvas_item_hit() in gimp_transform_tool_oper_update()
so all the extents calculation and parameter passing is not
duplicated for the first time \o/
2011-03-28 18:55:08 +02:00
Michael Natterer e03a25caeb app: add virtual function gboolean GimpCanvasItem::hit()
and implement it for GimpCanvasHandle and GimpCanvasGroup.
2011-03-28 18:54:02 +02:00
Michael Natterer b529d556fa app: add and use more GimpCanvasItem setters 2011-03-28 15:15:43 +02:00
Michael Natterer d96091d514 app: port GimpMagnifyTool away from draw_tool_pause()/resume() 2011-03-28 12:22:29 +02:00
Michael Natterer accc12a3ca app: change GimpCanvasItem setters to take GimpCanvasItem*
not GimpCanvasLine* etc. We keep them around as items, and their
constructors return items, and it's getting more code anyway when
porting away from pause/resume, so let's keep the casting minimal at
least.
2011-03-28 12:20:36 +02:00
Michael Natterer aa5d2f8082 app: port GimpBlendTool to pause()/resume()-less drawing
Instead, keep around the created GimpCanvasItems, and update them when
the blend coordiates change. Add setters to GipmCanvasLine and
GimpCanvasHandle which take care of calling begin_change() and
end_change() on the items around the change, so thes invalidate
properly.
2011-03-28 11:08:40 +02:00
Michael Natterer 1c0fe73da4 app: gimp_transform_tool_draw(): initialize the array of handles to NULL
And update/improve some comments in the entire file.
2011-03-28 10:16:00 +02:00
Michael Natterer 20bed2c609 app: add gimp_draw_tool_add_transform_preview() and use it 2011-03-28 02:18:00 +02:00
Michael Natterer fd80b90cf0 app: more minor GimpTransformTool cleanup 2011-03-28 02:10:33 +02:00
Michael Natterer 9f6b60c29d app: draw the perspective clone handles only when they can be used 2011-03-28 01:27:02 +02:00
Michael Natterer 4097825f3c app: some more code removal and cleanup in the transform classes 2011-03-28 01:20:47 +02:00
Michael Natterer dde7d6c0ee app: remove lots of junk from GimpPerspectiveCloneTool
This is an evil transform tool copy, so do the same changes here.
2011-03-28 01:20:47 +02:00
Michael Natterer babc2186c5 app: move the enum of indexes into the trans_info array to the .c files
and turn #defines from 0 to N into enums.
2011-03-28 00:50:46 +02:00
Michael Natterer 06e0183f96 app: right-align the perspective matrix labels with the right API
Use gtk_misc_set_alignment() instead of gtk_label_set_justify().
2011-03-28 00:39:39 +02:00
Michael Natterer d36887644d app: highlight the active transform tool handle 2011-03-28 00:13:14 +02:00
Michael Natterer 32f240fa4a app: prepare GimpTransformTool for highlighting the handles 2011-03-27 23:57:12 +02:00
Michael Natterer 18929f0865 app: lay out the GimpTransformOptions GUI more uniformly 2011-03-27 23:18:28 +02:00
Michael Natterer 8512675088 app: rename GimpTransformTool::recalc() to ::recalc_matrix() 2011-03-27 23:12:11 +02:00