Commit Graph

11954 Commits

Author SHA1 Message Date
Michael Natterer 35a7052b8d Add actions and callbacks to toggle "lock-content" on drawables and vectors 2009-08-20 21:19:43 +02:00
Michael Natterer 28061c23f1 Don't modify locked items from PDB wrappers
* app/pdb/gimppdb-utils.[ch]: add "gboolean writable" parameter to
  gimp_pdb_item_is_attached() because this function is called on
  almost all items where a check for locked is needed.

* tools/pdbgen/pdb/*.pdb: pass writable = TRUE in all checks for items
  that are modified. Add explicit calls to gimp_pdb_item_is_writable()
  in some rare cases.

* app/pdb/*-cmds.c: regenerated.
2009-08-20 20:47:01 +02:00
Michael Natterer b5c3e5a6b6 Also copy "lock_content" when duplicating an item 2009-08-20 19:34:30 +02:00
Michael Natterer 774850c46f Add gimp_pdb_item_is_writable() which sets an error if the item is locked 2009-08-20 18:50:55 +02:00
Michael Natterer 7262e45df9 Made modifying actions insensitive when the active item is locked
Use the term "writable" in the code as a shortcut for "there is an
active item and it is not locked".
2009-08-20 17:11:31 +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 ee5b8c6552 Make the appearance of the "lock content" toggle configurable
* app/widgets/gimpitemtreeview.[ch]: add class members for the lock
  content button's icon, tooltip and help_id and use them when
  creating the button. Create the button in constructor() instead of
  init() so we have access to our real class structure without the
  need for a custom get_type() function.

* app/widgets/gimpdrawabletreeview.c: configure the button as "Lock pixels".

* app/widgets/gimpvectorstreeview.c: configure it as "Lock path strokes".
2009-08-20 12:50:40 +02:00
Michael Natterer ff31975305 Keep the lock buttons at the end of the options vbox 2009-08-20 12:33:01 +02:00
Michael Natterer 86ad1ff70e Add a "lock content" toggle that needs some more refinement hacking 2009-08-19 21:30:48 +02:00
Michael Natterer a16bfe749f Fix a comment 2009-08-19 21:30:48 +02:00
Michael Natterer fb1a672546 Bug 61019 - add a 'lock' flag per layer to protect it
Took patch from Martin Nordholts and ported it to add a "lock-content"
property, signal and API in the same way as it's done for "visible"
and "linked".
2009-08-19 21:30:48 +02:00
Michael Natterer f7ba1d1f2e Add missing blank line after the vectors group of functions 2009-08-19 21:30:47 +02:00
Michael Natterer 7f94f3213b Pack boolean members into a bitfield to save two integers per item 2009-08-19 21:30:47 +02:00
Michael Natterer 5260a535e5 Use the new option box API of GimpItemTreeView, remove own code for it 2009-08-19 21:30:47 +02:00
Michael Natterer 36530dd8be Add generic code for boxes of options to GimpItemTreeView
- new API to add widgets to a box of options, for stuff like the paint
  mode menu and opacity scale. Set it sensitive automatically and
  update its spacings in GtkWidget::style_set().
- new API to get a hbox for "lock" toggles, for stuff like lock
  pixels and lock alpha.
2009-08-19 21:30:47 +02:00
Sven Neumann d655f03607 correct a comment 2009-08-19 16:59:15 +02:00
Martin Nordholts 966b81992b app: Add "FG to BG (Hardedge)" gradient
Add internal gradient "FG to BG (Hardedge)" based on gradient by
Saul Goode. See bug #589371.
2009-08-15 11:58:08 +02:00
Martin Nordholts 98aaae7cac app: Clean up internal gradient construction
Move code that is not shared between all gradients out of
gimp_gradients_add_gradient() and group the code with comments.
2009-08-15 11:48:36 +02:00
Martin Nordholts b72e5a35b1 Revert "Add a button to create a group layer to the layers dialog"
This reverts commit d2e1f2ac74. If we
keep the layer group button in 2.7.0 people will expect layer groups
to fully work and get mad when that is not the case. We can enable it
again after the release.
2009-08-15 09:41:20 +02:00
Martin Nordholts 8414cf77b0 app: Change default brush to "Round Fuzzy" 2009-08-14 19:57:06 +02:00
Martin Nordholts 1dbf732943 app: Add temp_buf_dump()
Add temp_buf_dump() which can be used to dump TempBufs to disk for
easier analysis, for example with GIMP.
2009-08-14 19:23:01 +02:00
Martin Nordholts 3d0c025a51 app: Support obsolete data resources
Add support for having obsolete data resources. An obsolete resource
is not shown in the UI or managed in any way, but it will be
considered when plug-ins requests resources. This in order to maintain
backwards compatibility for plug-ins.
2009-08-13 21:54:00 +02:00
Martin Nordholts 4df574acd6 Use separate shortcuts for 'File->Export to' and 'File->Overwrite'
Since Ctrl+E previously meant something harmless, don't use that
keyboard shortcut for the destructive command 'File->Overwrite'. We
still keep Ctrl+E for 'File->Export to' though, and we do this by
having 'File->Overwrite' as a separate GtkAction with its own keyboard
shortcut slot.
2009-08-13 21:53:23 +02:00
Sven Neumann 60f11e18ae Bug 591017 – Tablet pan is not working as fast as it should
Use motion event compression for display scrolling.
2009-08-13 20:24:14 +02:00
Michael Natterer ae6828c1cc Add more precondition checks to vectors import functions
(gimp_vectors_import_file)
(gimp_vectors_import_buffer): check the parent item the same
way gimp_image_add_vectors() does.
2009-08-10 13:28:14 +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
Michael Natterer 28aa03e525 Move gimp_image_raise_layer_to_top() around
Reorder functions so layer reorder function are in the same
order as channel and vectors ones.
2009-08-10 00:45:25 +02:00
Michael Natterer dc53e81705 Make sure items passed as "parent" are actually group items
Add precondition checks to all image add() and reorder() functions
2009-08-10 00:45:24 +02:00
Martin Nordholts 6e483e95b2 Remove web-browser gimprc option
The web-browser plug-in uses gtk_show_uri() now.
2009-08-08 15:26:34 +02:00
Martin Nordholts b1e969cc6d app: Fix typo gimpgoruplayer 2009-08-08 15:26:34 +02:00
Martin Nordholts 2591d7e368 app: Don't use plug-in-web-browser in About Dialog
The GtkAboutDialog is implemented with a GtkLinkButton which uses
gtk_show_uri(). We don't need to add any hooks.
2009-08-08 14:43:33 +02:00
Martin Nordholts b9b05e7d39 app: Don't reuse the GeglProcessor
Don't reuse the GeglProcessor as it can't handle dirty rects when
painting in GIMP, and this makes it harder to make GEGL-wise progress
in other parts of GIMP.
2009-08-08 07:03:15 +02:00
Michael Natterer 4e9f198831 Fix dropping an item into an empty group item immediately above it 2009-08-07 09:46:16 +02:00
Michael Natterer d2e1f2ac74 Add a button to create a group layer to the layers dialog
Will probably hide that button again, or make it only appear
when some environment variable is set until the stuff works
completely.
2009-08-06 21:34:54 +02:00
Michael Natterer d059f239ac Make reordering items between groups work in the core and the UI
* app/core/gimpimage.[ch]: rename all gimp_image_reposition_foo() to
  gimp_image_reorder_foo() and added "new_parent" parameters. Factor
  out calculating of the item's new container and index to a utility
  function.

* app/core/core-enums.[ch]: rename the REPOSITION undos to REORDER.

* app/core/gimpimage-undo-push.[ch]
* app/core/gimpchannelpropundo.[ch]
* app/core/gimplayerpropundo.[ch]
* app/vectors/gimpvectorspropundo.[ch]: change accordingly. Remember
  the old parent item in all item reorder undos.

* app/widgets/gimpitemtreeview.h: change GimpReorderItemFunc prototype
  accordingly.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c (class_init): follow image API
  name changes.

* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
  implement reordering of items between groups.

* app/widgets/gimpcontainertreeview.c
  (gimp_container_tree_view_reorder_item): fix to reorder the item
  within its level of the tree (unrelated to above changes, but needed
  to make them work).
2009-08-06 18:43:57 +02:00
Michael Natterer e8bd830f48 Add action and callback for adding a group layer (works but is not used yet) 2009-08-06 18:37:54 +02:00
Michael Natterer b2c7c4f61b Add infrastructure for dragging things between branches of a tree
* app/widgets/gimpcontainertreeview-dnd.c
  (gimp_container_tree_view_real_drop_possible): support DND within a
  tree and make sure a group item is not dropped into itself.

* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
  implement intra-container reordering within all branches; print a
  message for inter-container reordering because that's not yet
  implemented in the core.
2009-08-05 18:57:08 +02:00
Michael Natterer 8cda7dca56 Add gimp_viewable_is_ancestor()
The new functions figures if one viewable is another's parent or
grandparent or grandgrand... Note that unlike gtk_widget_is_ancestor(),
this function has its parameters in the right order.
2009-08-05 14:17:07 +02:00
Sven Neumann 5c630f4ad8 Change the default for the 'trust-dirty-flag' gimprc option back to FALSE
It appears that there are good reasons why a user might want to save
a clean image, for example because the file has been deleted or damaged.
2009-08-04 23:20:49 +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 5febc2e417 Add functions to get the ISO 639-1 language code from GimpLanguageEntry
and to set the language using this code.
2009-08-04 22:46:01 +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
Sven Neumann e2dbd56c5a app: add stubs for gimp_prop_language_entry_new() 2009-08-04 22:46:01 +02:00
Michael Natterer 1b806e5fb6 Set handler variables to NULL after disconnecting them 2009-08-04 22:43:53 +02:00
Michael Natterer 86239d3b55 Use GimpTreeHandler to connect to all layers in the image 2009-08-04 22:41:49 +02:00
Michael Natterer 6a64de7f48 Include "core/gimptreehandler.h" 2009-08-04 22:32:24 +02:00
Michael Natterer 6425f5404d Use GimpTreeHandler to connect to all vectors in the image 2009-08-04 22:06:28 +02:00
Sven Neumann 2d5792d1da app: increase the timeout for temporary status-bar messages to 8 seconds 2009-08-04 20:29:07 +02:00
Michael Natterer 57f44b89e8 Use GimpTreeHandler to connect to all items' "visible" and "linked" callbacks
Makes the visibility and link buttons work for all items in a tree.
2009-08-04 20:20:09 +02:00
Michael Natterer 00682ee7cf Replace the hash table of container handlers by a single GimpTreeHandler 2009-08-04 20:19:13 +02:00
Michael Natterer aaab0d40a9 Add GimpTreeHandler, a signal connection helper for object trees
A tree-enabled replacement for gimp_container_add,remove_handler(),
slightly more sane to a degree that makes me think it could replace
GimpContainer's own handler stuff. Public API consists of two
function:

- gimp_tree_handler_connect() which connects recursively to a specific
  signal of all items in a container tree.

- gimp_tree_handler_disconnect() is just a wrapper around unrefing the
  handler, but makes sure that dispose() is really executed (which
  actually disconnects things).
2009-08-04 20:12:34 +02:00
Michael Natterer e8c6e3dbd3 Expand the treeview to newly inserted items 2009-08-04 09:06:03 +02:00
Michael Natterer 3c0df851d0 Make the preview column the expander column 2009-08-04 00:21:07 +02:00
Michael Natterer ea7c07647b Some group layer fixes
- call new group layers "Group Layer" by default.
- when duplicating, don't forget to set the duplicated childrens'
  parent viewable.
2009-08-04 00:14:53 +02:00
Michael Natterer ac052aabf4 Add items at the right place again (did not affect item treeviews) 2009-08-04 00:13:58 +02:00
Michael Natterer 8a578354fe Show expanders in treeviews showing actual trees 2009-08-03 23:46:19 +02:00
Michael Natterer ad806713ae Add a per-class flags that indicates that a container view's model is a tree
* app/widgets/gimpcontainerview.h: add "gboolean model_is_tree"
  to GimpContainerViewInterface.

* app/widgets/gimpcontainerview.c: default to FALSE and enable the
  commented-out optimization in remove_container() for list-only
  container views.
2009-08-03 23:42:55 +02:00
Michael Natterer 7dafae7f26 Add a GimpGroupLayer class (not used yet) 2009-08-03 23:24:46 +02:00
Michael Natterer 6f555cc407 Make sure duplicated item groups end up at the right place
Use the actual parent item when adding to the image, not
GIMP_IMAGE_ACTIVE_PARENT because the latter would add a duplicated
group inside itself instead of above it
2009-08-03 23:19:25 +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
Sven Neumann 45529d4886 Bug 590638 – Changing palettes from list to grid view loses "locked to dock" status
Transfer the 'locked' state to the newly created dockable in
dockable_toggle_view_cmd_callback().
2009-08-03 22:16:33 +02:00
Michael Natterer 3e1c13bc96 Support GIMP_IMAGE_ACTIVE_PARENT in the vectors import functions 2009-08-03 22:06:40 +02:00
Michael Natterer a3b4b595d0 Add infrastructure to add items to the active item's parent container
* app/core/gimpimage.h: add define GIMP_IMAGE_ACTIVE_PARENT for magic
  the value ((gpointer) 1) which can be passed as parent item to
  add_layer(), add_channel() and add_vectors().

* app/core/gimpimage.c: add utility function
  gimp_image_get_insert_pos() which honors above new special value and
  figures all of parent container, parent item and insert position.
  Remove lots of duplicated code from add_layer(), add_channel() and
  add_vectors().
2009-08-03 21:47:21 +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
Martin Nordholts 18603ac192 Bug 401754 – Port Hue, Saturation, Value to CIE LCH
When using GEGL for the projection, use CIE LCH for the Hue,
Saturation and Value layer modes, just as we already do for the Color
layer mode. The Value layer mode will later be renamed to Lightness
since that is the semantics it has now.
2009-08-02 21:36:00 +02:00
Michael Natterer 87d463aed0 Iterate over all an image's items recursively
Use gimp_image_get_layer,channel,vectors_list() instead of
gimp_image_get_layer,channel,vectors_iter(). As a side-effect,
simplified some code that was making sure we don't modify the list
returned by the old functions (the new functions return newly
allocated lists so we can safely remove items from the image while
iterating it). Some places will need adjusting once we really have
item trees.
2009-08-02 17:44:05 +02:00
Michael Natterer ec21c2880c Remove gimp_image_get_layer,channel,vectors_by_index()
The don't make sense any longer with item trees and I just fixed the
last places where they were used.
2009-08-02 15:56:06 +02:00
Michael Natterer 3c76b2797b Get rid of using gimp_container_get_vectors_by_index() in xcf-load.c
One of the places needs changing if we ever support trees of vectors,
the other one deals with compat paths which can't be in a tree anyway.
2009-08-02 15:48:27 +02:00
Michael Natterer d7fa10c708 Get rid of using gimp_image_get_layer_by_index() in gimpimage.c 2009-08-02 15:43:04 +02:00
Michael Natterer 49b7f6b436 Implement adding/removing items to/from trees of items
Change gimp_image_add,remove_layer,channel,vectors() to deal with
parent items and insert/remove things to/from the right containers.
The "parent" parameter to the add_foo() functions is currently a local
variable that defaults to NULL, so nothing has chaged yet.
2009-08-02 15:36:00 +02:00
Martin Nordholts f026c52478 Bug 568445 – Closing the Toolbox causes the program to close
Instead of invoking the file-quit action when closing the toolbox, use
gimp_dialog_factory_hide_dialog().
2009-08-02 14:57:46 +02:00
Martin Nordholts 8fb779aeaa app: Formating 2009-08-02 14:09:37 +02:00
Christopher Howard cc7e372a84 Bug 589665 – Minor mistakes in gimprc documentation
Adjust code which auto-generates the gimprc man page to:
 - fix spelling mistakes.
 - remove unintentional indentation.
 - remove out of place punctuation.
2009-08-02 14:07:54 +02:00
Michael Natterer c1c882b4ec Change control+tab layer cycling to work within one group
This is probably wrong and should use a flattened list of all layers,
but at least it will not be buggy code when we actually get layer
trees.
2009-08-02 13:16:31 +02:00
Michael Natterer 72cfe6c701 Use gimp_image_get_channels() instead of image->channels 2009-08-02 13:03:52 +02:00
Michael Natterer ccc167994c Remove some old and unused GimpImage API cruft
Get rid of gimp_image_active_layer,channel,vectors_changed(),
they are unused and it's even conceptually wrong to have them
in the public API.
2009-08-02 12:45:04 +02:00
Michael Natterer 7805bd2186 Use the new item counting functions where appropriate 2009-08-02 12:24:06 +02:00
Michael Natterer 6be068ceab Add functions to count the items in an image
* app/core/gimpitemstack.[ch]: add gimp_item_stack_get_n_items()
  which counts a stack's items recursively.

* app/core/gimpimage.[ch]: add get_n_layers(), get_n_channels()
  and get_n_vectors().
2009-08-02 12:13:55 +02:00
Michael Natterer b3e0147598 Make layer selecting by actions work on the right container 2009-08-02 12:02:18 +02:00
Martin Nordholts 77e233f4c7 Bug 325564 – Use CIE LCH instead of HSL for layer mode "Color"
When GEGL is used for the projection, use CIE LCH instead of HSL for
the "Color" layer mode. This give much more accurate and intuitive
results. Requires at least 12d5cc4c1bcfb of babl.
2009-08-02 11:07:40 +02:00
Michael Natterer 251ee3a7be Move get_item_by_tattoo() and by_name() functions from GimpImage to GimpItemStack 2009-08-02 01:39:51 +02:00
Michael Natterer 9381358b6b Make setting the active layer, channel, vectors work for items in groups 2009-08-02 01:03:58 +02:00
Michael Natterer 99ceaf984a Make getting items by name work on trees 2009-08-02 00:21:31 +02:00
Michael Natterer 227076b6d1 Make getting items by tattoo work on trees 2009-08-02 00:15:53 +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 603d3441e7 Use gimp_item_get_container_iter() instead of the GimpImage iter APIs
Using the new function makes sure the sensitivity of the raise and
lower actions corresponds to what is possible (raising and lowering
within the group).
2009-08-01 22:54:49 +02:00
Michael Natterer 5f66faf953 Should try the code before pushing... 2009-08-01 22:53:31 +02:00
Michael Natterer 6e29b94bd0 Add gimp_item_get_container_iter()
This is just a utility function like gimp_image_get_layer_iter()
in order to avoid including "core/gimplist.h" whenever a file needs
access to the actual GList inside the container.
2009-08-01 22:40:32 +02:00
Michael Natterer 571d26a198 Add functions for getting lists of all an image's items
* app/core/gimpitemstack.[ch]: add gimp_item_stack_get_item_list()
  which returns a GList of all the stack's items, in depth-first
  order if the stack is in fact a tree.

* app/core/gimpimage.[ch]: add gimp_image_get_layer_list(),
  channel_list(), vectors_list() which use above new function.
2009-08-01 21:59:45 +02:00
Michael Natterer 2f018dfcc2 Use the new item APIs for layer/channel/vectors reordering
Don't use image->layers, ->channels and ->vectors in the raise, lower
and position functions; use gimp_item_get_container() and
gimp_item_get_index() instead.
2009-08-01 21:37:19 +02:00
Michael Natterer 88f49a5ddb Use gimp_item_get_index() all over the place
Remove gimp_image_get_layer,channel,vectors_index() and
use the new function everywhere.
2009-08-01 20:49:55 +02:00
Michael Natterer a3cb1191b9 Actually assign the new get_container() impl to the vtable 2009-08-01 20:32:13 +02:00
Michael Natterer 297c2f0082 Add gimp_item_get_container() and gimp_item_get_index()
* app/core/gimpitem.[ch]: add virtual function ::get_container() plus
  pubic API wrapper which returns the children of the item's parent
  viewable, or the right toplevel container of its image.
  Add utility function get_index() which returns the item's index
  within its container.

* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: implement get_container() and return
  the right image container.

* app/core/gimplayer.[ch]: same here, and remove previously added
  public get_container() API.

* app/core/gimplayermask.c
* app/core/gimpselection.c: implement get_container() for these GimpChannel
  subclasses and return NULL.
2009-08-01 20:22:07 +02:00
Michael Natterer fd8ebdacef gimp_item_is_attached(): an item is attached if its parent item is attached 2009-08-01 19:39:10 +02:00
Michael Natterer f4f5fc5f55 Add utility function gimp_layer_get_container()
The new function returns a layer's container, which is either its
parent viewable's children, or image->layers. Scheduled for being
moved to a virtual function on GimpItem.
2009-08-01 19:27:45 +02:00
Michael Natterer ad66250f90 Invalidate all the item stack's previews recursively 2009-08-01 19:23:59 +02:00
Michael Natterer 464ce841aa When an item is removed, emit "removed" on all its children 2009-08-01 19:21:43 +02:00
Michael Natterer ee022e907e Add basic support for trees of containers in GimpContainerView classes
* app/widgets/gimpcontainerview.[ch]: add and remove container trees
  recursively. Change virtual function ::add_item() to pass the
  insert_data of the parent viewable.

* app/widgets/gimpcontainercombobox.c
* app/widgets/gimpcontainerentry.c
* app/widgets/gimpcontainergridview.c: changed accordingly.

* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c: dito, but actually use the passed
  parent_insert_data to insert the item at the right place in the
  GtkTreeView.
2009-08-01 19:13:35 +02:00
Michael Natterer 1e5da3939b Add basic infrastructure for trees of viewables
- add member "GimpViewable *parent" and accessors to get/set it
  (no property or signals yet)
- add virtual function ::get_children() which is supposed to return
  a GimpContainer of the viewable's children
2009-08-01 19:04:33 +02:00
Stephen Griffiths 6a41c872f6 app: Make GimpToolEditor changes cancellable
Allow the user to cancel rearrangements of tool order and visibility
in Preferences. See enhancement request/bug #500930.
2009-08-01 16:27:34 +02:00
Michael Natterer 9c4a2ab4ea Move layer mask related functions together 2009-07-30 18:59:12 +02:00
Michael Natterer 96126034c9 Get rid of antique code duplication
Factor out large portions of identical code into new utility functions
gimp_container_view_connect_context() and
gimp_container_view_disconnect_context().
2009-07-28 21:02:32 +02:00
Michael Natterer 3ae83c5ced Fix setting a context for the unlikely case that the container is frozen 2009-07-28 19:17:42 +02:00
Michael Natterer eff6d4f930 Cosmetic changes 2009-07-28 19:15:36 +02:00
Michael Natterer b54a0fdf88 Replace the name_changed_handler_id GQuark by a hash of quarks
Keep around the handler IDs for the "name-changed" signals of the
container's children in a hash table that maps containers to handler
IDs and move adding/removing of the handler to
add_container()/remove_container(). This way the name-changed code is
prepared for handling multiple containers.
2009-07-28 19:08:07 +02:00
Michael Natterer 13ec6cca81 Add utility functions for adding/removing a container to/from the view
In preparation of having a tree of containers, added

gimp_container_view_add_container(),
gimp_container_view_remove_container() and
gimp_container_view_remove_foreach()

which do all the job of inserting/removing items and
connecting/disconnecting the "add", "remove" and "reorder" signals.

Also refactored things so when the toplevel container freezes/thaws,
it simply gets removed from the view instead of ignoring its signals.

gimp_container_view_real_set_container()
gimp_container_view_freeze()
gimp_container_view_thaw(): use the new add_container() and
remove_container() APIs and fix the code for the unlikely case
that a frozen container gets added/removed.
2009-07-28 16:47:28 +02:00
Michael Natterer 1b759561ce Keep the item hash table around permanently
GHashTable has g_hash_table_remove_all() since GLib 2.12, so there is
no need any longer to clear the hash table by destroyung it. Instead,
keep the hash around during the view's entire lifetime and remove all
re-creation code and all checks for its existence.
2009-07-28 15:04:43 +02:00
Michael Natterer b78b6f6274 Set the tree view's "show-expanders" to FALSE
Don't waste the expander space in all GimpContainerTreeViews. We can
later set it to TRUE in individual subclasses which actually display a
tree and not only a list.
2009-07-26 14:19:58 +02:00
Michael Natterer bc51e8f98c Use the right area for click detection on treeview cells
Use gtk_tree_view_get_cell_area() instead of
gtk_tree_view_get_background_area() because the latter includes things
like expanders, indentation and padding and messes up the x coordinate
of our naive click detection.
2009-07-26 14:13:30 +02:00
Michael Natterer 07ecd55b1c Rename private->hash_table to private->item_hash 2009-07-25 18:21:23 +02:00
Michael Natterer 344f52bbc2 Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView 2009-07-25 17:38:03 +02:00
Michael Natterer 472bf62b67 Some straightforward tool editor cleanups
- split up button callbacks into one callback per button
- add stephen to copyright
- some minor whitespace fixups
2009-07-23 10:28:04 +02:00
Martin Nordholts 4572cb9e74 app: Add the GimpToolEditor to preferences
Add the new GimpToolEditor to the Toolbox tab in preferences, which is
a more natural place to have this. See bug #500930.
2009-07-22 00:21:32 +02:00
Martin Nordholts ce5cfe0f1c app: Rename gimptoolview.[ch] to gimptooleditor.[ch]
Rename gimptoolview.[ch] to gimptooleditor.[ch]. The contents of the
file has already gone through this change, we do the file name change
separately for better diffs. Part of fix for bug #500930.
2009-07-22 00:21:31 +02:00
Stephen Griffiths 450db18abb app: Convert GimpToolView into a non-dockable GimpToolEditor
Convert the GimpToolView dockable to a non-dockable GimpToolEditor,
but wait with renaming the file so that we get better diffs. Part of
fix for bug #500930.
2009-07-22 00:21:31 +02:00
Stephen Griffiths c53113d0cc app: Remove Tools dockable
Remove the Tools dockable. The toolbox will be configured from the
Toolbox page in preferences instead. This is part of the fix for
bug #500930.
2009-07-22 00:21:31 +02:00
Martin Nordholts f65905f083 app: Remove blurb for removed menu-mnemonics gimprc setting 2009-07-21 17:12:40 +02:00
Martin Nordholts c6818c5710 app: Remove transient-docks gimprc setting
Remove the transient-docks setting for gimprc. What GIMP tried to
accomplish with this enabled is much better accomplished by the window
manager with the docks set to the 'Utility window' window hint. See
discussion in bug #322577.
2009-07-21 17:12:34 +02:00
Martin Nordholts cfbcdbd207 app: Add WM debug output 2009-07-20 13:16:30 +02:00
Martin Nordholts 6318349bf8 app: Add GIMP_LOG_WM
Add GIMP_LOG_WM domain to be used for window management related
output.
2009-07-20 13:16:30 +02:00
Martin Nordholts 1c0dea5772 app: Use gtk_window_set_title() instead of gdk_window_set_title()
Get rid of the last calls to gdk_window_set_title() and instead use
gdk_window_set_title(). The gdk_window_set_title() calls in
gimpdisplayshell-title.c is a legacy from the initial import of the
project.
2009-07-20 13:16:28 +02:00
Martin Nordholts 5ad570e3cc Fix compilation errors
Fix compilation errors with obvious fixes.
2009-07-20 12:48:05 +02:00
Martin Nordholts b2b2b41e62 Get rid of artificial compiler warnings
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
2009-07-20 12:47:59 +02:00
Michael Natterer e564cc2e4e Fix motion event processing on the tag popup's scroll arrows
Should work properly now wrt detecting the different speed
areas and stopping scolling upon leaving the arrow.
2009-07-18 19:58:33 +02:00
Martin Nordholts 20aa60ac8c app: Fix a free cell renderer for GimpLanguageEntry
We must set the text column with
gtk_entry_completion_set_text_column() in order to get a free cell
renderer.
2009-07-18 19:56:10 +02:00
Michael Natterer 84fd35d832 Connect to widget signals in init() instead of constructor() 2009-07-18 19:34:42 +02:00
Michael Natterer 48a8b89bea Only redraw the affected tags when prelight changes, not the entire widget 2009-07-18 19:31:21 +02:00
Michael Natterer 5d76dd9bc5 Fix unprelighting of the prelighted tag when there is no hit on any tag 2009-07-18 19:23:26 +02:00
Michael Natterer 24209f7625 Use g_value_dup_object() inatead of g_value_get_object() and g_object_ref() 2009-07-18 18:57:15 +02:00
Michael Natterer 6fd729cfb6 Remove the possibility to disable mnemonics (bug #120034)
There is GtkSettings:gtk-enable-mnemonics: now, so there is no
reason to do the same in GIMP:

* app/config/gimpguiconfig.[ch]: turn "menu-mnemonics" into a dummy.

* app/dialogs/preferences-dialog.c: remove its GUI.

* app/widgets/gimpactionfactory.[ch]
* app/widgets/gimpactiongroup.[ch]: remove infrastructure for disabling
  menu mnemonics.

* app/actions/actions.c: bye bye glue code.
2009-07-18 17:51:04 +02:00
Michael Natterer 0d81ce9717 Bug 446171 – select content by click on layer icon
* app/widgets/gimplayertreeview.c (gimp_layer_tree_view_layer_clicked):
  when ALT is pressed, select the layer's alpha. SHIFT and CONTROL work
  as usual to add, subtract and intersect.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpvectorstreeview.c: add "clicked" handlers here too
  and do the same select-on-alt-click thing.
2009-07-18 16:59:43 +02:00
Martin Nordholts 99ce3bd8b2 Bug 120563 – Add an easy way to use the default comment
Add a 'Use default comment' button to the Comment tab in Image
Properties that if clicked sets the image comment to the default
comment set in Preferences.
2009-07-18 09:38:58 +02:00
Mason Thomas fc66ca5169 Clamp levels after input changes applied. 2009-07-16 22:00:38 +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 4da5ed3a8b Use gtk_widget_get_window() instead of widget->window 2009-07-15 15:02:31 +02:00
Michael Natterer 2d442e4576 Use gtk_widget_get_window() instead of widget->window 2009-07-15 14:52:27 +02:00
Michael Natterer 2bfc48df74 Use accessors instead of sealed GTK+ members 2009-07-15 14:29:43 +02:00
Michael Natterer 65421aa0b6 Use accessors instead of widget->style and widget->window 2009-07-15 04:05:24 +02:00
Michael Natterer 84e933d80b Use accessors instead of widget->window and widget->style 2009-07-15 03:58:30 +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
Martin Nordholts 04349c8878 app: Put gimp-file.h in file/Makefile.am 2009-07-12 12:48:06 +02:00
Martin Nordholts 1e7fd6cd27 app: Only show contributors for 2.8 in the about dialog 2009-07-12 12:48:05 +02:00
Michael Natterer 7171dad364 Tag popup scrolling cleanup
- artificially limit the popup's height again so scrolling gets some testing.
- make sure the scroll buttons' sensitivity is always correct.
- remove obsolete utility function and other cleanups.
2009-07-10 20:10:49 +02:00
Michael Natterer 48bc1d1ced Remove more obsolete variables and indentation levels 2009-07-10 20:10:49 +02:00
Michael Natterer 25a8a9ea9f Factor out tag hit detection into a utility function 2009-07-10 20:10:49 +02:00
Michael Natterer 5a26780ed9 Fix tiny miscalculation of the tag name rendering position 2009-07-10 20:10:48 +02:00
Michael Natterer bd00ac3891 More tag popup cleanup
- reorder instance struct and add some spacing
- rename member "timeout_id" to "scroll_timeout_id"
- clean up constructor() even more (still the wrong place to
  do all these things)
2009-07-10 20:10:48 +02:00
Michael Natterer e15e9c222d Some more cleanup and a fix of a tiny earlier cleanup glitch 2009-07-10 20:10:48 +02:00
Michael Natterer 4699152a4f Remove useless member "ignore_button_release" 2009-07-10 20:10:48 +02:00
Michael Natterer dd6b65179e Clean up spacings, tag size calculation and tag rendering
The area sensitive to clicks now corresponds to the area that
is drawn selected, minus a border of one pixel.
2009-07-10 20:10:48 +02:00
Michael Natterer 1f199ba060 Use GTK_SHADOW_OUT for the tag popup's frame 2009-07-10 20:10:48 +02:00
Michael Natterer 8995cdf9d7 Use #defines instead of magic values for the tag spacing constants 2009-07-10 20:10:47 +02:00
Michael Natterer 75ee288278 Remove "close_rectangles" member and the feature it implemented
Closing whatever popup by click on dead space within it is a no no,
otherwise one-pixel mis-clicks inside the widget make it go away,
which is totally unexpected.
2009-07-10 20:10:47 +02:00
Michael Natterer 3d85ee285a Various code cleanups 2009-07-10 20:10:47 +02:00
Michael Natterer 1ecf4bed67 Widget construction / showing cleanup
- create the widgets in init() instead of constructor()
- don't show the popup in constructor()
- don't use gtk_widget_show_all()
2009-07-10 20:10:47 +02:00
Michael Natterer 4d860185c1 Rename member "drawing_area" to "tag_area" 2009-07-10 20:10:47 +02:00
Michael Natterer f350e5ac51 Whitespace and minor code cleanup 2009-07-10 20:10:47 +02:00
Martin Nordholts 8e7c19b76c app: Clarify gimp_display_shell_format_filename()
Clarify gimp_display_shell_format_filename() by using booleans with
nice names in the if conditions.
2009-07-10 19:28:18 +02:00
Massimo Valentini 5be4f235a3 Bug 554658 – Path Dialog: Path preview pics not to see constantly
Always initialize the 'status' member of a newly allocated cairo_path_t
to the value CAIRO_STATUS_SUCCESS as required to successively call
cairo_append_path().
2009-07-07 17:05:42 +02:00
Massimo Valentini c837f25b40 Bug 167604 – gimp_gradient_get_color_at() may return out-of-bounds values
This is not a problem of gimp_gradient_get_color_at(), but a typo
in gradient_editor_right_color_update().
2009-07-07 17:02:32 +02:00
Martin Nordholts 27f12b2505 app: Cleanup gimp_display_shell_format_filename() 2009-07-05 23:58:55 +02:00
Martin Nordholts 073d026f6c app: Show "(overwritten)" and "(exported)" status of image
When an import source has been overwritten with File -> Overwrite
<file.png>, or exported by whatever means, reflect this status in the
title bar of the image window. Do this by adding some string building
logic to gimp_display_shell_format_filename().
2009-07-05 09:28:52 +02:00
Martin Nordholts 1662ff2523 app: Keep track of GimpImage export dirtiness
Since save and export are separate activities we need to keep track of
image dirtiness for both of them. For this purpose, add a
'export_dirty' member to GimpImage which has the same semantics as
'dirty', but for export. Set it to clean whenever a document is
exported by whatever means. Do this with a new function
gimp_image_export_clean_all(). Also add gimp_image_is_export_dirty().
2009-07-05 09:28:52 +02:00
Martin Nordholts c4601b298d app: Make 'Overwrite foo.png' work
In File -> Overwrite, we need to use the import source as the export
URI since there is no explicit export target given yet.
2009-07-05 09:28:52 +02:00
Martin Nordholts c181f4eb05 app: Add and use gimp_image_is_dirty() 2009-07-03 21:11:21 +02:00
Martin Nordholts 0959414cd2 app: Simplify file_actions_update() 2009-07-03 08:20:40 +02:00
Martin Nordholts 46cdf8b16c app: Put 'Export to' above 'Export...' 2009-07-03 08:16:08 +02:00
Martin Nordholts 7deab857b4 app: Update default save name according to spec
Update default save name according to the spec which is
http://gui.gimp.org/index.php/Save_%2B_export_specification in case
someone forgot.
2009-07-02 22:17:36 +02:00
Martin Nordholts 631e128ddd app: Forget import source after saving as XCF
Forget the import source after save. We interpret a save as that the
user is not interested in being able to quickly export back to the
original any longer. The effect of this is that if we have an
'Overwrite' menu item, it becomes insensitive and set to 'Export to'.
2009-07-02 22:17:36 +02:00
Martin Nordholts 8a1e826d99 app: Show "Overwrite <filename>" in File menu
With no export target but with an import source, show
"Overwrite <filename>" in the File menu. This also means we can't set
GIMP_FILE_EXPORT_TO_URI_KEY along with import source any longer.
2009-07-02 22:17:36 +02:00
Martin Nordholts ed9c12d1e7 app: Put "[<filename>] (imported)" in window title for imported files
Put "[<filename>] (imported)" in window title for imported files
instead of "Untitled (imported from <filename>)".
2009-07-02 22:17:35 +02:00
Martin Nordholts d9136aec3f app: Support NULL ext to file_utils_uri_with_new_ext() 2009-07-02 22:17:35 +02:00
Michael Natterer e4976d8ad2 Bump GEGL and BABL versions here too 2009-07-02 12:24:13 +02:00
Martin Nordholts f07d89de2a Bug 587543 – crash in GNU Image Manipulation Program: Pressing shift+-
Not all actions have procedures associated with them, for example
unused "plug-in-recent-[N]" actions, so check for NULL before we
invoke the plug-in action
2009-07-01 21:45:33 +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 afb8d07fcf Use PANGO_WRAP_WORD_CHAR so we don't cut off words which are wider than the layer 2009-06-27 21:10:34 +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
Martin Nordholts 51f81bd15e app: Reuse the GeglProcessor
Reuse the GeglProcessor instead of creating a new one in each call to
gimp_projection_construct_gegl(). Requires at least 0ed57a05da of
GEGL. Does not seem to give any performance improvement at all
unfortunately :(
2009-06-26 08:17:48 +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