Take the X position of the lines into account when navigating up and
down by lines, so we end up at the right x-pos also for centered and
right-aligned lines.
- hide the generated "empty" menu item in the IM submenu
- pause/resume the text tool around all selection/cursor/buffer changes
(fixes most drawing artifacts)
This has several advantages:
- it's always readable, no matter how sick font/colors are.
- it does not mess up the buffer, which is a model that should not
contain temporary edit states.
- preediting does not clutter undo.
- it fixes the remaining bugs in the old preediting code because that
code is completely gone now.
- Reset the IM context in much more situations, like on button_press
and when the text editor is initialized and halted (pretty much what
GtkTextView does).
- As a consequence, halt the rectangle text tool after the text tool
in control() because cancelling the IM preedit might cause a
re-framing of the layer because it resized.
- pause()/resume() the draw tool around gimp_text_tool_halt() so we
definitely avoid drawing atrifacts when the text tool is shut down
in the middle of an IM preedit. That pause/resume pair should have
been there from the beginning actually.
- most importantly, when the text changes and we set the buffer (as
happens when undoing), block the "changed" signal on the *buffer*
and not on the proxy (which doesn't even have a "changed"
signal). This was apparently something that happened during the
on-canvas editor merging.
- don't update the proxy when the layout changes, that's the wrong way
around. Instead, update the layout whenever the proxy changes,
remove lots of calls to update_layout() from the text editor and let
the "changed" callback on the buffer do its job of updating
everything.
Like that we start selecting on the very first click on an unframed
text layer alreadyand that we ignore clicks in dead space which had
unexpected results before. Also update all comments and move them
into the function.
Feed them into the text editor's IM context and into the proxy text
view's key bindings. Fixes input methods (e.g. entering of unicode
sequences seems to work flawlessly now).
There is no reason to recreate the layout when the cursor or selection
bound move, so remove the entire callback and all the signal
blocking/unblocking.
In button_press(), don't frame the item again and switch to selecting
mode on double and triple click events, we already did that when
receiving the normal button-press. Also clarify a comment.
- remove the button again.
- add a "box-mode" property to GimpTextOptions and a combo box.
- let the normal options -> proxy -> text mechanism do the setting.
- make sure we update the rectangle in some more situations.
- add utility function gimp_text_tool_frame_item().
Add a "Dynamic Text Box" button to the tool options which sets the
text box' mode back to dynamically resizing with the text. This badly
needs UI review but is at least possible now.
Port over the patch I did for GtkTextView and move *to* the end of the
selection and not *from* it when there is a selection and we are
moving by characters.
- bail out and don't warn like crazy in draw() when there is no text.
- fix crash in button_press() when clicking a modified text layer
bring up the confirm dialog and thus didn't set text_tool->text.
- pull setting the right text on text_tool->text_buffer into
gimp_text_tool_canvas_editor() (fixes editing after confirming a
modified text layer edit).
- add lots of missing calls to gimp_text_tool_set_layer() so the
tool will actually start editing.
- Add gimp_text_tool_halt() to shut down the tool and call it
from gimp_tool_control(HALT).
- call control(HALT) when escape is pressed to reset the tool
(can finally switch to other tools again now).
- fix button_press() to handle clicks on already existing
text layers well.
- also button_press(): fix the condition that sets the previously
existing text on the canvas editor so we don't end up with weird
ui states where displayed and internally used text differ.
- remove some redundant code.
Highlight the handle for the first vertex in the Free Select Tool even
with button1 down, since releasing the button on the first point will
close the polygon, so it's a significant state which we must give
feedback for.
Right now the Free Select Tool vertex handles are shown when the
cursor is in the proximity. Extend this a bit, so when the cursor is
_on_ a vertex handle, fill it completely. See bug 598454.
Make sure we never call gimp_free_select_tool_remove_last_segment()
with priv->n_segment_indices being negative, and increase robustness
of the code in general.
Note that we always halt the tool when backspace is pressed and there
are no vertices left. This is to minimize the risk of ending up in an
invalid tool state.
gimp_text_tool_move_cursor(): when there is something selected, and
cursor movement does not extend that selection, move the cursor to the
end of the selection that is in moving direction. This it *not*
how GtkTextView behaves, but it should, see bug #50942.
Whether to use fade at all is a user input, so should be controllable
independently from its dynamic mapping. The reborn property is not
used again yet.
The new function does the right thing, unlike get_toplevel() which
returns the shell itself if it is not in a window. Check the return
value of get_window() for being non-NULL.
Use the new API whenever we want to determine the item's effective
lock state (whether we can write to the item's content or not). Use
gimp_item_get_lock_content() only in code that actually deals with
*this* item's locked state, which is only the PDB wrappers and GUI to
modify the flag on the item itself.
The idea that group layers count as locked was a bad one, start adding
separate checks for group layers, and refuse to modify them with
distinct error messages.
Remove GimpTool::initialize() implementation again and check for the
drawable being locked in GimpTool::button_press() so we can't paint if
the tool has been used before on the same drawable when it was
unlocked.
Check whether the drawable to edit is locked in GimpTool::initialize()
and bail out with an appropriate error if it is. This currently
prevents cloning from locked drawables, will fix that later.
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().
* app/vectors/gimpvectors-import.[ch]: add parent parameters to
the vectors import functions.
* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
removing layers, channels and vectors.
* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
functions and add FIXMEs all over the place because there is some
more hacking needed to make adding with index = -1 (on top of the
current item) work again.
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
* app/core/gimpimage-duplicate.c: duplicate the original image's
tree structure in the copy.
* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
add utility function gimp_item_tree_view_get_drop_index() which
figures where to add something dropped to an item tree.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
new GimpItemTreeView API.
(gimp_image_map_tool_control): call gimp_image_map_tool_response() directly
instead of gtk_dialog_response().
(gimp_image_map_tool_key_press): must not call response() if there is
no dialog (if the tool wasn't used yet).
(gimp_image_map_tool_control): call gimp_image_map_tool_response() directly
instead of gtk_dialog_response().
(gimp_image_map_tool_key_press): must not call response() if there is
no dialog (if the tool wasn't used yet).
* app/paint/gimppaintoptions.c: Add initialization for fading dynamics. Add fading related variables similar to Random. Adjust get_dynamics_mix function. Add fading calculation in get_dynamics_x functions. Adjust get_dynamic_x functions for fade dynamics.
* app/paint/gimppaintoptions.h: Add fading_options in GimpDynamicOptions.
* app/tools/gimppaintoptions-gui.c: Add the function fading_options_gui.
* app/paint/gimpclone.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimppaintbrush.c
* app/paint/gimpsmudge.c
* app/paint/gimpairbrush.c
* app/paint/gimpbrushcore.c
* app/paint/gimpconvolve.c: Adjust function calls. get_dynamic_opacity function calls were adjusted to have one more parameter, paint_core->pixel_dist.
some key words:
get_dynamic_
pixel_dist
paint_core->pixel_dist
the image and the up or down arrow is pressed.
Applied patch from Massimo as found in bug #567393. This changes ROUND()
to RINT() to correct rounding for negative numbers. Also did this change
in gimp_rectangle_tool_adjust_coord().
- keep around more local "buffer" variables to improve readability
- fix all comparisons between coordinates and bounding boxes,
they were off-by-one on one or both sides.
(gimp_text_tool_move_cursor): use PangoLayoutLines and byte indices to
calculate x positions when moving the cursor up or down. text_tool->x_pos
is not in terms of device units within a PangoLayoutLine.
* app/widgets/gimptextproxy.c: also swallow the "toggle-overwrite"
signal.
* app/tools/gimpdrawtool. [ch] (gimp_draw_tool_draw_text_cursor): add
"gboolean overwrite" which causes the cursor to be drawn as block.
* app/tools/gimptexttool.[ch]: implement overwriting, toggling it,
and changing the text cursor accordingly.
- add some local "buffer" variables to avoid writing text_tool->text_buffer
all the time.
- text_tool->text_buffer always exists, no need to check for it.
Add GimpTextProxy, a GtkTextView subclass which does nothing but
overriding the binding methods with empty implementations, so the text
view has no chance of letting e.g. the display beep or doing anything
else.
Change public text tool API to gimp_text_tool_delete_selection() and
move delete and backspace code to their own handlers in preparation of
handling all text deletion types.
* app/widgets/gimpwindow.c: treat GimpCanvas as a text widget and
dispatch all key events to it before invoking menu shortcuts.
* app/display/gimpdisplayshell-callbacks.c: treat all events on the
empty display as unhandled, not handled.
* app/tools/gimptexttool.c: use the right API for invoking the proxy
text view's bindings. Handle some more cursor navigation request and
swallow text deletion requests we don't handle instead of always
doing what the delete key does.
(gimp_text_tool_move_cursor): for GTK_MOVEMENT_DISPLAY_LINE_ENDS,
check if we are an the end of a line, or the cursor will end up on the
end of the next line.
* app/core/gimpmarshal.list: add marshallers needed for the binding
singnals.
* app/tools/gimptexttool.[ch]: add binding signals "move-cursor",
"delete-from-cursor" and "backspace" and hijack GtkTextView's
binding set to invoke them. Move code from the key_press() handler
to the signals' default handlers. This is how it should work. In
fact that code is #ifdef'ed away and we need an evil proxy
GtkTextView to invoke the bindings on because of reasons stated in
comments in the code. Ugly but works just fine.
* app/tools/tools-enums.[ch]: add enum GimpClipboardAction which can be
{ CUT, COPY, PASTE }
* app/tools/gimptool.[ch]
* app/tools/tool_manager.[ch]: add GimpTool::clipboard_action() which
returns a boolean indicating whether the tool handled the action.
* app/tools/gimptexttool.c: implement clipboard_action().
* app/actions/edit-commands.c: try the active tool first in the cut,
copy and paste callbacks.
(gimp_text_tool_motion): always keep the "insert" mark at the mouse
location and the "selection_bound" one at the other end of the
selection.
(gimp_text_tool_key_press): make cursor navigation always move the
"insert" mark, and move "selection_bound" along with it unless shift
is pressed. It was exactly the other way around.
* app/tools/tools-enums.[ch]: add enum GimpButtonPressType which can
be { NORMAL, DOUBLE, TRIPLE }
* app/tools/gimptool.[ch]: add press_type paramater to GimpTool::button_press()
* app/tools/gimp*tool.c
* app/tools/tool_manager.[ch]: changed accordingly.
* app/tools/gimptoolcontrol.[ch]: add members and API so tools can choose
to receive double and triple clicks.
* app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events):
dispatch double and triple clicks to tools if they want them, and if they
became active by the preceding normal button press.
* app/text/gimptextlayout-render.c: remove private function which
creates the transform matrix.
* app/text/gimptextlayout.[ch]: add it here as public API. Also add
function which transform and untransform PangoRectangles, points and
distances using the transform matrix.
* app/tools/gimptexttool.c: convert coordinates using above new
transform functions when drawing selection and cursor, and when
processing mouse events.
Pass the current coords to the function instead of setting them
on the paint core before calling it. Doesn't exactly make the code
in the paint tool simpler, but that needs further refactoring anyway.
* app/actions/actions.h: added prototype for action_message()
* app/actions/actions.c: removed static keyword from action_message()
removed private prototype for action_message()
made action_message() use icons for objects derived from GimpViewable
* app/actions/context-commands.c:
context_brush_radius_cmd_callback()
context_brush_angle_cmd_callback()
context_paint_mode_cmd_callback()
context_brush_shape_cmd_callback()
call acton_message(), these callbacks had use cases where they could not
use generic code
* app/tools/gimpcoloroptions.c: added "average-radius" blurb
and mark for translarion
* app/paint/gimppaintcore.[ch]: add gimp_paint_core_round_line()
* app/tools/gimppainttool.c: remove gimp_paint_tool_round_line() and call
above new function instead.
2009-04-03 Michael Natterer <mitch@gimp.org>
Bug 577575 – transform tool fills underlying extracted area wrongly
* app/tools/gimpfliptool.c
* app/tools/gimpperspectivetool.c
* app/tools/gimprotatetool.c
* app/tools/gimpscaletool.c (gimp_*_tool_register): pass
GIMP_CONTEXT_BACKGROUND_MASK to the register callback to the tools
use the global background color.
svn path=/trunk/; revision=28236
2009-03-14 Sven Neumann <sven@gimp.org>
Bug 566443 – diagonal method guidelines for crop tool
* app/tools/tools-enums.[ch]
* app/tools/gimprectangletool.c
(gimp_rectangle_tool_draw_guides):
applied a slightly modified patch from Lukasz Hladowski, based
on
a patch from Tim Jedlicka. This adds diagonal guidelines as
described by Edwin Westhoff to the rectangle tools.
svn path=/trunk/; revision=28156
2009-02-20 Michael Natterer <mitch@gimp.org>
Bug 572156 – top left pixel position/coordinate is not 0,0 but 1,1
* app/display/gimpstatusbar.c
(gimp_statusbar_push_coords)
(gimp_statusbar_update_cursor): fix braino for
GIMP_CURSOR_PRECISION_PIXEL_CENTER: going to the pixel's
center doesn't need any rounding, it simply needs clipping
the coordinates' fractional parts, gah...
Review all tools' cursor precision:
* app/tools/gimpblendtool.c (gimp_blend_tool_init): set cursor
precision to SUBPIXEL.
* app/tools/gimptexttool.c (gimp_text_tool_init)
* app/tools/gimpmeasuretool.c (gimp_measure_tool_init)
* app/tools/gimpeditselectiontool.c (gimp_edit_selection_tool_init):
set cursor precision to PIXEL_BORDER.
svn path=/trunk/; revision=28053
2009-02-18 Sven Neumann <sven@gimp.org>
Bug 99457 – Support for dynamics on tilt
* app/tools/gimppaintoptions-gui.c
* app/paint/gimppaintoptions.[ch]: applied patch from Alexia
Death
that allows to map tilt to the dynamic brush parameters.
svn path=/trunk/; revision=28049
2009-02-09 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c (gimp_gegl_tool_dialog): seems
pointless to include the GIMP-specific GEGL operations as they
can't be reasonably controlled by the generic GEGL tool user
interface.
svn path=/trunk/; revision=28005
2009-02-09 Michael Natterer <mitch@gimp.org>
Bug 569470 – pls, introduce an option 'how many latest presets for
color curves should be saved'
* app/config/gimprc-blurbs.h
* app/config/gimpguiconfig.[ch]: add integer property
"image-map-tool-max-recent" which defaults to ten. Adding a GUI
for this IMO needs discussion, the value of ten seems appropriate.
* app/widgets/gimpsettingsbox.[ch]
(gimp_settings_box_add_current): add "gint max_recent" parameter
and limit the number of recent settings to this number.
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_response):
pass the new settings property to above function.
svn path=/trunk/; revision=28004
2009-02-08 Michael Natterer <mitch@gimp.org>
* app/tools/gimpcurvestool.c (gimp_curves_tool_key_press): if the
curve view didn't handle the key press, chain up so the normal
GimpImageMapTool keys for reset/cancel/ok works.
svn path=/trunk/; revision=28003
2009-02-08 Michael Natterer <mitch@gimp.org>
Bug 520078 – Rotate brushes
Applied a slightly modified patch from Alexia Death:
* app/core/core-types.h (struct GimpCoords): add "direction" member.
* app/core/gimpcoords.c: take direction into account in mix(),
scalarprod(), length_squared(), manhattan_dist() and equal().
* app/core/gimpcoords-interpolate.c
(gimp_coords_interpolate_catmull): same here.
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): same here.
* app/paint/gimppaintoptions.[ch]: add properties for direction
dynamics and adapt dynamics mixing accordingly.
* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
"interpolate" direction too (in fact, just copy it from
last_coords since it doesn't change along a straight line).
* app/paint/gimppaintcore-stroke.c
(gimp_paint_core_stroke_emulate_dynamics): emulate direction too.
* app/tools/gimppaintoptions-gui.c: add GUI for direction dynamics.
svn path=/trunk/; revision=28001
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-01-29 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: removed gimp_image_get_type_string()
again.
* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): use the GimpImageBaseType
enum
instead.
* app/tools/gimptool.c (gimp_tool_oper_update): if the image is
empty and the tool can't handle that, display a message in the
statusbar telling the user about this.
svn path=/trunk/; revision=27970
2009-01-26 Michael Natterer <mitch@gimp.org>
* app/tools/gimpregionselecttool.c
(gimp_region_select_tool_button_release): move variables to local
scope.
svn path=/trunk/; revision=27951
2009-01-25 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/gimpparamspecs-duplicate.[ch]: new files implementing
gimp_param_spec_duplicate() which is supposed to duplicate any
gimp or gegl GParamSpec (but doesn't do this yet).
* app/tools/gimpgegltool.c: remove the code form here.
svn path=/trunk/; revision=27945
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-12-21 Sven Neumann <sven@gimp.org>
Bug 564869 – GIMP crashes on selecting Tools->GEGL operation
* app/tools/gimptool.c (gimp_tool_initialize): check if the tool
has set an error.
svn path=/trunk/; revision=27819
2008-12-16 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c
(gimp_gegl_tool_operation_blacklisted):
removed 'gegl:stress' from the blacklist. It was put here on
wrong
assumptions.
svn path=/trunk/; revision=27796
2008-11-22 Michael Natterer <mitch@gimp.org>
* app/core/gimpselection.[ch]: make the entire selection
API take GimpSelection arguments, not GimpChannel.
Clean up gimp_selection_load() a bit.
* app/actions/select-commands.c
* app/core/gimp-edit.c
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-quick-mask.c
* app/tools/gimpeditselectiontool.c
* tools/pdbgen/pdb/selection.pdb: add the needed casts.
* app/pdb/selection-cmds.c: regenerated.
svn path=/trunk/; revision=27711
2008-11-21 Sven Neumann <sven@gimp.org>
* app/tools/gimpdrawtool.[ch]: removed unused methods
gimp_draw_tool_set_vectors() and gimp_draw_tool_set_transform()
and related infrastructure.
svn path=/trunk/; revision=27704
2008-11-21 Sven Neumann <sven@gimp.org>
* app/tools/gimpdrawtool.c (gimp_draw_tool_real_draw): moved
vectors drawing to its own function.
svn path=/trunk/; revision=27702
2008-11-21 Sven Neumann <sven@gimp.org>
* app/tools/gimpdrawtool.[ch]: reordered functions to keep those
that actually draw together.
svn path=/trunk/; revision=27698
unresponsive
* app/tools/gimprectangletool.c: Accept a broader range of x, y,
width and height values from the tool options so we don't end up
in an infinite signal emission loop.
svn path=/trunk/; revision=27605
2008-11-06 Sven Neumann <sven@gimp.org>
* tools/gimp-mkenums: use NC_() to mark enum values for
translation.
Use a lower-case short form of the type name as translation
context.
* libgimp/libgimp-intl.h: define the NC_() macro as noop.
* libgimpbase/gimpbasetypes.[ch]
* libgimpbase/gimpbase.def: added new functions to set and
get a translation context on an enum type.
* app/base/Makefile.am
* app/core/Makefile.am
* app/display/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/tools/Makefile.am
* app/widgets/Makefile.am
* libgimp/Makefile.am
* libgimpbase/Makefile.am:
* libgimpconfig/Makefile.am
* libgimpthumb/Makefile.am
* libgimpwidgets/Makefile.am: register the translation context
with the enum types.
* app/display/display-enums.h
* libgimpbase/gimpbaseenums.h
* libgimpconfig/gimpcolorconfig-enums.h: removed old-style
explicit
translation context.
* app/base/base-enums.c
* app/core/core-enums.c
* app/display/display-enums.c
* app/paint/paint-enums.c
* app/plug-in/plug-in-enums.c
* app/text/text-enums.c
* app/tools/tools-enums.c
* app/widgets/widgets-enums.c
* libgimpbase/gimpbaseenums.c
* libgimpconfig/gimpcolorconfig-enums.c
* libgimpwidgets/gimpwidgetsenums.c: regenerated.
svn path=/trunk/; revision=27562
2008-11-04 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/text/gimptext-private.h: removed this header file.
* app/text/gimptextlayout.[ch]: added getters to access the
resolution, text and PangoLayout.
* app/text/gimptextlayout-render.c
* app/tools/gimptexttool.c: use the new getters instead of
poking
into the GimpTextLayout struct.
svn path=/trunk/; revision=27543
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
"GimpImageType type" parameter because there are only a few calls
to this function which (can easily pass the current type); however
most calls to gimp_drawable_set_tiles_full() were just using the
function because of the type argument and passed in the item's
current offsets (which means peeking into the item struct or using
temp variables).
* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
* app/text/gimptextlayer.c (gimp_text_layer_render)
* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
the type to set_tiles().
* app/core/gimpchannel.c (gimp_channel_convert)
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
change calls to set_tiles_full() into set_tiles() because the
offset doesn't change.
svn path=/trunk/; revision=27535
2008-11-03 Michael Natterer <mitch@gimp.org>
Bug 559015 – Move tool gives bad information about px moved
* app/tools/gimpeditselectiontool.c (gimp_edit_selection_tool_init):
set cursor precision to PIXEL_BORDER because that's what the move
tool snaps to.
Unrelated: set CENTER_CROSS_SIZE to an odd number so it's drawn
symmetrically.
svn path=/trunk/; revision=27533
2008-11-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: add new functions
gimp_image_get_layer_iter(), channel_iter() and vectors_iter()
which return the GList inside the resp. GimpList.
* app/actions/channels-actions.c
* app/actions/layers-actions.c
* app/actions/vectors-actions.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-flip.c
* app/core/gimpimage-item-list.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-scale.c
* app/core/gimpimage.c
* app/core/gimpimage.h
* app/core/gimpprojection-construct.c
* app/display/gimpdisplayshell-draw.c
* app/file/file-open.c
* app/tools/gimpaligntool.c
* app/tools/gimpdrawtool.c
* app/vectors/gimpvectors-compat.c
* app/vectors/gimpvectors-export.c
* app/widgets/gimplayertreeview.c
* app/xcf/xcf-save.c
* tools/pdbgen/pdb/image.pdb: use the new functions instead of
peeking both into the image and the list. Remove inclusions of
"gimplist.h" or change them into "gimpcontainer.h" if needed.
* app/pdb/image-cmds.c: regenerated.
svn path=/trunk/; revision=27524
2008-11-01 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectangletool.c
(gimp_rectangle_tool_cursor_update): set the MOVE cursor when we
are in MOVING mode.
* app/tools/gimptexttool.[ch]: remove members x1,x2,y1,y2 and use
the rectangle tool's bounding box for creating the text layer (x2
and y2) were unused anyway. Add boolean member "moving". Implement
oper_update() and set the tool to moving mode when ALT is pressed.
Changed button_press(), button_release() and motion() accordingly.
Some more cleanup and removal of comented out code.
svn path=/trunk/; revision=27519
* app/gegl/gimpoperation*.c: Prefix the GIMP GEGL operations with
"gimp:" instead of "gimp-" so we follow the GEGL prefix style and
better serialize to XML.
* app/tools/gimp*tool.c
* app/core/gimpdrawable-*.c
* app/core/gimpdrawable.c
* app/core/gimpimagemap.c
* app/core/gimpprojection.c: Changed accordingly.
svn path=/trunk/; revision=27512
2008-10-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_key_press): bail out
when the passed display is != tool->display. Makes the keyboard
work in other displays while the text tools is active.
svn path=/trunk/; revision=27498
2008-10-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.[ch]: add gimp_draw_tool_draw_text_cursor()
which draws a properly transformed cursor that always has the same
line width.
* app/tools/gimptexttool.c (gimp_text_tool_draw): use it instead
of drawing a cursor here that is broken at anything but 1:1 zoom.
svn path=/trunk/; revision=27497
2008-10-31 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_key_press): bail out
instead of crashing if the tool has no display.
(gimp_text_tool_draw)
(gimp_text_tool_draw_preedit)
(gimp_text_tool_draw_selection)
(gimp_text_tool_xy_to_offset): need to adjust all drawing and
event coordinates by a possible negative offset between logical
rectangle and ink rectangle (if the ink rectangle is larger than
the logical one).
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): continue normally if
tool_manager_key_press_active() returns FALSE.
svn path=/trunk/; revision=27484
2008-10-30 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c: remove lots of unused variables,
apparently my builds were without proper warnings for some time.
Some formatting cleanup and code reordering.
* app/actions/text-tool-actions.c
* menus/text-tool-menu.xml: rename "text-tool-input-methods"
to "text-tool-input-methods-menu".
svn path=/trunk/; revision=27482
2008-10-29 Sven Neumann <sven@gimp.org>
Bug 558451 – Cannot build GIMP using Sun CC on Solaris 2.8
* app/pdb/gimp-pdb-compat.c
* app/gegl/gimpoperationtilesink.c
* app/gegl/gimpoperationtilesource.c
* app/tools/gimpgegltool.c: applied patches from Eric Lamarque
fixing the build using Sun CC on Solaris.
svn path=/trunk/; revision=27467
* app/tools/gimpmagnifytool.c (gimp_magnify_tool_button_release):
When zooming with a click, use gimp_display_shell_scale() instead
of local zoom logic.
svn path=/trunk/; revision=27452
2008-10-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpwidgets-utils.[ch]: added "gboolean below" to
gimp_enum_radio_frame_add() and gimp_enum_radio_box_add() and
place the widget right of the radio button unless "below" is TRUE.
* app/dialogs/convert-dialog.c
* app/dialogs/layer-add-mask-dialog.c
* app/tools/gimpbucketfilloptions.c
* app/tools/gimpclonetool.c
* app/tools/gimpperspectiveclonetool.c
* app/widgets/gimpfilleditor.c: pass TRUE so everything stays as-is.
svn path=/trunk/; revision=27450
2008-10-27 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c: some minor cleanups.
(gimp_text_tool_draw): draw a cursor of two pixels width which is
between glyphs so it is visible both at the left and the right
border or the rectangle. Also make it look a little more
cursor-like.
svn path=/trunk/; revision=27446
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-27 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_key_press): take the
layout line's x coordinate into account so the stuff works for
right-aligned or centered text.
svn path=/trunk/; revision=27440
2008-10-27 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_key_press): argh, need
to speak in byte offsets not character offsets. Do so and avoid
getting the buffer's text on each keystroke just to do the
char/byte conversion. Will use the same method for all the other
places which do similar things.
(gimp_text_tool_connect): minor cleanup.
svn path=/trunk/; revision=27439
2008-10-27 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpbaseenums.[ch]: added new enum
GimpTextHintStyle.
* libgimp/gimpenums.c.tail
* tools/pdbgen/enums.pl: regenerated.
* app/text/gimptext.[ch]: added new property "hint-style".
Removed
"autohint" property and mapped the boolean property "hinting" to
the new enum property "hint-style".
* app/text/gimptextlayout-render.c
(gimp_text_layout_render_flags):
use "hint-style".
* app/tools/gimptextoptions.[ch]: changed tool options
accordingly.
* tools/pdbgen/pdb/text_layer.pdb: deprecated the "hinting" API
and introduced getters and setters for "hint-style".
* app/pdb/text-layer-cmds.c
* app/pdb/internal-procs.c
* libgimp/gimptextlayer_pdb.[ch]: regenerated.
svn path=/trunk/; revision=27432
2008-10-27 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.[ch]: add gimp_draw_tool_set_clip_rect()
which transforms the passed in GdkRectangle before setting it
on the canvas.
* app/tools/gimptexttool.c (gimp_text_tool_draw): use it instead
of gimp_canvas_set_clip_rect().
svn path=/trunk/; revision=27431
2008-10-27 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.h: add integer x_pos member to remember
the x cursor position when moving up and down across shorter
lines.
* app/tools/gimptexttool.c (gimp_text_tool_key_press): implement
moving the cursor up and down. The x_pos probably needs to be
reset in a few more places but it seems to work pretty nicely
already.
svn path=/trunk/; revision=27430
2008-10-26 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.c: some formatting cleanup.
* app/tools/gimprectangletool.c: add one space.
* app/actions/text-tool-actions.c: look at GDK_SELECTION_CLIPBOARD,
not PRIMARY, to set the sensitivity of "Paste".
svn path=/trunk/; revision=27424
2008-10-26 Michael Natterer <mitch@gimp.org>
* app/tools/gimptexttool.[ch]: some general formatting cleanup.
(gimp_text_tool_key_press): implement ctrl-moving the cursor by
words, handle Delete.
(gimp_text_tool_delete_text): add boolean "backspace" parameter
and delete forward when it's FALSE.
* app/actions/text-tool-commands.c: pass an arbitrary TRUE to
gimp_text_tool_delete_text() (it's not used because when called
from here, there is always a selection).
svn path=/trunk/; revision=27423
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-10-26 Michael Natterer <mitch@gimp.org>
Add some infrastructure for the on-canvas text editing GSoC
project:
* app/tools/gimptoolcontrol.[ch]: add boolean wants_all_key_events
member and API to set and get it.
* app/tools/gimptool.[ch]: add GimpTool::get_popup() which returns
the tool's context menu if it has one, or NULL otherwise.
* app/tools/tool_manager.[ch]: add tool_manager_get_popup_active()
wrapper.
* app/display/gimpdisplayshell-callbacks.c: check if the tool has
a popup menu and show it instead of the usual right-click menu.
Also call the tool's key_press() unconditionally if it wants all
key events, but this code needs more thinking.
svn path=/trunk/; revision=27416
2008-10-21 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c (gimp_gegl_tool_dialog): for the
combo-box, strip known prefixes from the GEGL operation names
and
use icons instead.
svn path=/trunk/; revision=27350
2008-10-15 Michael Natterer <mitch@gimp.org>
* app/tools/gimpgegltool.c (gimp_gegl_tool_operation_blacklisted):
add the gegl: prefix here too.
(gimp_gegl_tool_get_config): canonicalize the type name of the
created config class or we crash.
svn path=/trunk/; revision=27286
2008-10-10 Michael Natterer <mitch@gimp.org>
* app/tools/gimpmovetool.c (gimp_move_tool_button_release): flush
the image after setting active items back from temporarily
selected ones. Fixes menu item sensitivity.
svn path=/trunk/; revision=27209
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 Michael Natterer <mitch@gimp.org>
Remove the last code duplication from the undo system (or if not
the last then at least the most ugly):
* app/core/gimpimage.[ch] (gimp_image_add_layer,channel,vectors):
add "gboolean push_undo" parameter and add the item without
touching undo if it's TRUE. Changed assertions from
g_object_is_floating() to !gimp_item_is_attached() so they also
take items from the undo stack and not only newly created ones.
(gimp_image_remove_layer,channel,vectors): add "push_undo"
parameter here too. Also add a "new_active" parameter where an
optional new active item can be passed.
(gimp_image_remove_layer,channel): these functions must not be
called with push_undo=FALSE and a floating selection attached to
the layer/channel. This can't currently happen; added warnings in
case other code is changed and makes it happen anyway.
* app/core/gimpchannelundo.c
* app/core/gimplayerundo.c
* app/vectors/gimpvectorsundo.c: use above functions to add/remove
items instead of duplicating (parts of) their code. Pass
push_undo=FALSE and the previously active item to the remove()
functions.
* app/actions/channels-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpchannelundo.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimpimage-scale.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayerundo.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/vectors/gimpvectors-import.c
* app/vectors/gimpvectorsundo.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpitemtreeview.[ch]
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimpvectorstreeview.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb: changed accordingly (pass TRUE
unless it's a new image like when loading and XCF file).
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c: regenerated.
svn path=/trunk/; revision=27200
2008-10-09 Michael Natterer <mitch@gimp.org>
Bug 134956 – Curves tool doesn't save free curves
* app/core/gimpmarshal.list
* app/widgets/gimpsettingsbox.[ch]: add signal "file-dialog-setup"
and emit it when the export/import file chooser is fully
constructed. Callbacks can then do additional things to the
dialog, like adding custom buttons.
* app/tools/gimpcurvestool.h
* app/tools/gimplevelstool.h: add boolean member
"export_old_format".
* app/tools/gimpcurvestool.c
* app/tools/gimplevelstool.c (gimp_*_tool_dialog): connect to
the settings box' "file-dialog-setup".
(gimp_*_tool_export_setup): new callback which adds a toggle to
the file choosers that allows to export to the old format.
Default saving the new format, we defaulted to the old one before.
(gimp_*_tool_settings_export): check the "export_old_format"
boolean and only save the cruft format if it is TRUE; chain up
otherwise, which generically saves the new format.
* app/tools/gimplevelstool.c (gimp_levels_tool_settings_import):
add the same file format detection code as in the curves tool
so it transparently loads old and new levels files.
svn path=/trunk/; revision=27194
2008-10-02 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c
(gimp_gegl_tool_operation_blacklisted):
add "text" to the list of blacklisted operations.
svn path=/trunk/; revision=27114
2008-09-30 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.[ch]: keep a "default_config" object
around and use it to reset the tool if it exists.
(gimp_image_map_tool_edit_as): set the default_config on the new
tool so "reset" goes back to the values the tool was started with.
* app/tools/gimpcolorbalencetool.c (gimp_color_balance_tool_reset)
* app/tools/gimpcurvestool.c (gimp_curves_tool_reset)
* app/tools/gimphuesaturationtool.c (gimp_hue_saturation_tool_reset)
* app/tools/gimplevelstool.c (gimp_levels_tool_reset): use the
default config to reset the tool here too if it exists.
svn path=/trunk/; revision=27090
deselects selection
* app/tools/gimprectangleselecttool.c
(gimp_rectangle_select_tool_execute): Be more intuitive when
clicking outside the current selection for the selection modes Add
and Subtract. More specifically, don't alter the selection mask at
all.
svn path=/trunk/; revision=27048
* app/tools/gimprectangleselecttool.c: Added new utility function
gimp_rectangle_select_tool_get_operation(), and started using it.
svn path=/trunk/; revision=27047