Commit Graph

2910 Commits

Author SHA1 Message Date
Martin Nordholts 8bfcd14f9a app: Add GimpSessionInfo getters and setters 2009-09-20 14:51:03 +02:00
Michael Natterer 9e18f771c4 Replace "Group Layer" by "Layer Group" in all user visible strings 2009-09-03 14:57:18 +02:00
Michael Natterer 0b09278c17 Don't access item->width and ->height directly 2009-09-03 01:00:14 +02:00
Michael Natterer a12a9fa70e gimp_vector_tool_button_press(): don't edit locked vectors 2009-09-01 12:43:43 +02:00
Michael Natterer 02903d6970 Use gimp_item_is_content_locked() instead of gimp_item_get_lock_content()
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.
2009-08-29 15:27:04 +02:00
Michael Natterer e979c08133 Start separating the logic for "locked" and "is group" again
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.
2009-08-28 20:07:14 +02:00
Michael Natterer 6aadd0bbc9 Rename gimp_image_pick_correlate_layer() to gimp_image_pick_layer() 2009-08-25 23:18:34 +02:00
Michael Natterer f61f435699 Filter out linked children of linked items to translate 2009-08-25 15:57:04 +02:00
Michael Natterer 9040afc0fc Set BAD cursors if the active drawable is locked 2009-08-21 19:34:59 +02:00
Michael Natterer ed2c002fd8 Make the checks in GimpTool::initialize() work reliably
Set tool->display and tool->drawable to NULL in button_release()
so initialize() is actually called before each button_press().
2009-08-21 19:04:45 +02:00
Michael Natterer c9c28be9df Make the checks in GimpTool::initialize() work reliably
Set tool->display and tool->drawable to NULL in button_release()
so initialize() is actually called before each button_press().
2009-08-21 18:27:50 +02:00
Michael Natterer cca194ed04 Don't transform the item if it was locked while using the tool
Add additional check to gimp_transform_tool_doit() so it won't
transform an item that was locked while we were adjusting the
transform.
2009-08-21 12:07:55 +02:00
Michael Natterer 7b5e176eee Really don't paint on locked drawables
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.
2009-08-21 11:55:18 +02:00
Michael Natterer e95b5d9f72 When cropping the active layer, error out if there is none or it is locked 2009-08-20 22:43:01 +02:00
Michael Natterer ec6600a0b3 Refuse to edit locked drawables
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.
2009-08-20 17:05:23 +02:00
Michael Natterer d53aad9ffb Use gimp_image_get_layer_list() instead of layer_iter(), some cleanup 2009-08-10 12:15:54 +02:00
Sven Neumann 57ceb04b32 Only add the language entry if the iso-codes package is available 2009-08-04 22:46:02 +02:00
Sven Neumann 516735f10c add a blurb to the GimpText:language property 2009-08-04 22:46:02 +02:00
Sven Neumann bf8885f637 Bug 132509 – Allow to choose language in text tool
Remove the commented out language entry from the text editor and add
one to the text tool options instead. Work in progress...
2009-08-04 22:46:01 +02:00
Michael Natterer a53d4566da Use GIMP_IMAGE_ACTIVE_PARENT instead of a NULL parent in all obvious places 2009-08-03 22:30:36 +02:00
Michael Natterer c4075975bf Bring parent items to the public API in the core
* 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.
2009-08-03 19:21:51 +02:00
Michael Natterer 01c77b18d5 Use the new item iter API instead of the image APIs in some straightforward places 2009-08-01 23:07:07 +02:00
Michael Natterer 997111bf0a Use gtk_dialog_get_content_area() instead of dialog->vbox 2009-07-15 16:19:32 +02:00
Michael Natterer c9171a3fbf Clean up various calls to the response() callback
(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).
2009-07-12 17:14:08 +02:00
Michael Natterer 669d26ee39 Move dialog destruction to a utility function 2009-07-12 16:45:18 +02:00
Sven Neumann 05537763ef Bug 567393 – Rectangle select tool size shrinks to 0 if size is larger than
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().
2009-06-30 23:19:13 +02:00
Michael Natterer 4c5c158bfa Fix corner case of text tool up/down navigation
(gimp_text_tool_move_cursor): really go to the beginning/end of the
buffer when there are no further lines to go up/down to.
2009-06-28 17:27:02 +02:00
Michael Natterer bcfaed96d2 Simplify and clean up text tool clipboard handling. 2009-06-27 21:51:52 +02:00
Michael Natterer 8e09c53637 Some more text tool cleanup
- 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.
2009-06-27 21:31:06 +02:00
Michael Natterer 6d3522c737 Make up/down work within wrapped lines
(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.
2009-06-27 15:38:30 +02:00
Michael Natterer 285c25a257 Some minor cleanup 2009-06-27 14:55:45 +02:00
Michael Natterer 1a2136408e Implement overwrite-mode in the text tool
* 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.
2009-06-25 13:22:25 +02:00
Michael Natterer 0ecf3b24d6 Some text tool code cleanup
- 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.
2009-06-25 10:45:06 +02:00
Michael Natterer 877844214c Implement select-all / unselect-all bindings 2009-06-25 10:21:56 +02:00
Michael Natterer e78bda44b3 Implement insert_at_cursor() so bindings can insert text 2009-06-24 21:31:39 +02:00
Michael Natterer 92a89666cf Implement GTK_DELETE_WHITESPACE (code stolen from GtkTextView) 2009-06-24 21:06:31 +02:00
Michael Natterer b5079eb1b7 Move the GimpTextProxy widget from app/tools/ to app/widgets/ 2009-06-24 19:34:36 +02:00
Michael Natterer 512c80cb05 Keep the proxy text view from doing anything
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.
2009-06-24 19:26:24 +02:00
Michael Natterer e170ad77b1 Remove the newly added tool clipboard facility again, we don't need it 2009-06-24 19:08:24 +02:00
Michael Natterer 919c875d65 Implement cut/copy/paste via the proxy text buffer's signals 2009-06-24 19:04:18 +02:00
Michael Natterer 5f65026f94 Implement GTK_DELETE_PARAGRAPH_ENDS (Ctrl+K in emacs) 2009-06-24 18:48:27 +02:00
Michael Natterer 1dcd5a6eaa Implement GTK_DELETE_WORD_ENDS and GTK_DELETE_WORDS 2009-06-24 13:58:40 +02:00
Michael Natterer 2d8ced10c0 Some text deleteion refactoring
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.
2009-06-24 13:51:25 +02:00
Michael Natterer 1b69070556 Make key themes really work this time
* 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.
2009-06-23 23:25:09 +02:00
Michael Natterer e24793a666 Move the proxy text view to its own offscreen window
Add the proxy text view to a toplevel window so it can pick up the
key theme. Remove various hacks and the #ifdef TEXT_TOOL_HACK stuff.
2009-06-23 21:57:59 +02:00
Michael Natterer cfbfb4a6c0 Don't go to the end of the line if we are already there
(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.
2009-06-23 14:05:50 +02:00
Michael Natterer 25963fb1e1 Add some temp debug output 2009-06-23 14:00:23 +02:00
Michael Natterer 6e57a67218 Fix moving back by words 2009-06-23 00:18:31 +02:00
Michael Natterer a235998165 Actually use the hack from the last commit
require a hacked GTK+ ;)
2009-06-22 23:52:42 +02:00
Michael Natterer 64d6ebca00 Make the text tool use GtkTextView's key bindings
* 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.
2009-06-22 23:47:04 +02:00