2004-04-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "const gchar *stroke_desc" to
the GimpItemClass struct and always push an undo group
around GimpItem::stroke().
* app/core/gimpchannel.c
* app/core/gimpselection.c
* app/vectors/gimpvectors.c: set the stroke_desc accordingly
and don't push undo groups.
* app/text/gimptextlayer.c (gimp_text_layer_class_init): set
all of GimpItemClass' undo_descs.
* app/text/gimptextlayer-transform.c: don't push undo groups here.
2004-04-15 Michael Natterer <mitch@gimp.org>
Context cleanup continued:
* app/core/gimpitem.[ch]: added context parameter to
GimpItem::stroke().
* app/core/gimpchannel.c (gimp_channel_stroke)
* app/vectors/gimpvectors.c (gimp_vectors_stroke): use it to get
default values from instead of gimp_get_user_context().
* app/core/gimpselection.c
* app/gui/stroke-dialog.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb: changed accordingly.
* app/pdb/edit_cmds.c
* app/pdb/paths_cmds.c: regenerated.
* app/plug-in/plug-in.[ch]: added GimpContext member to the PlugIn
struct. Added context parameter to plug_in_new(),
plug_in_call_query() and plug_in_call_init().
* app/plug-in/plug-in-run.[ch]: added context parameters to
plug_in_run() and plug_in_repeat().
* app/gui/plug-in-commands.c
* app/gui/vectors-commands.c
* app/pdb/procedural_db.c
* app/widgets/gimphelp.c: pass a context to plug_in_run() and
plug_in_repeat().
* app/plug-in/plug-in-message.c (plug_in_handle_proc_run): call
procedures with the plug-in's context.
* app/plug-in/plug-ins.c: use a temporary context for running the
plug-ins' query() and init() functions. Use the same context for
running automatic extensions. This temporarily separates the main
Script-Fu extension from the user context (i.e. scripts have no
way of setting/getting the global FG, BG, brush etc.).
2004-04-13 Michael Natterer <mitch@gimp.org>
GimpItem undo group cleanup in preparation of fixing bug #138356:
* app/core/core-enums.[c]: renamed LAYER_SCALE and LAYER_RESIZE
undo groups to ITEM_SCALE and ITEM_RESIZE.
* app/core/gimpitem.[ch]: always push undo groups around
GimpItem::translate(), scale(), resize(), flip(), rotate() and
transform(). Added the resp. undo_desc strings to GimpItemClass.
* app/core/gimpchannel.[ch]
* app/core/gimpdrawable.[ch]
* app/core/gimplayer.c: removed all undo groups from
implementations of the above methods. Removed the undo_desc
strings which were moved to GimpItemClass.
* app/core/gimpimage-crop.c
* app/core/gimpselection.c
* app/gui/layers-commands.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
2004-03-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "gboolean removed" to the GimpItem
struct. Defaults to FALSE. Set it to TRUE in gimp_item_removed().
Added public function gimp_item_is_removed().
* app/core/gimpimage-undo-push.c (undo_pop_layer)
(undo_pop_layer_mask) (undo_pop_channel) (undo_pop_vectors):
set it to FALSE manually when re-adding something from the
undo stack.
* tools/pdbgen/app.pl
* tools/pdbgen/pdb.pl: don't allow any operation on items which
are removed from the image (and exist on the undo stack only).
Fixes bug #138311.
* app/pdb/channel_cmds.c
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/edit_cmds.c
* app/pdb/floating_sel_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/paint_tools_cmds.c
* app/pdb/parasite_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2004-03-13 Michael Natterer <mitch@gimp.org>
Completed the fix for bug #136702:
* app/core/gimpitem.[ch]: added "gboolean supersample" and
"gint recursion_level" to GimpItem::transform().
* app/core/gimpitem-linked.[ch] (gimp_item_linked_transform): ditto.
* app/core/gimpdrawable-transform.[ch]: added "recursion_level"
parameters and removed the RECURSION_LEVEL #define.
* app/core/gimpchannel.c
* app/core/gimpdrawable.c
* app/core/gimplayer.c
* app/vectors/gimpvectors.c: changed accordingly.
* app/tools/gimptransformoptions.[ch]: added new property
"recursion_level" which is not serializable and has no GUI. Pretty
useless, but it's IMHO better to hardcode the default value here
than in gimpdrawable-transform.c
* app/tools/gimptransformtool.c: changed accordingly.
* tools/pdbgen/pdb/transform_tools.pdb: hardcode "recursion_level"
to 3.
* app/pdb/transform_tools_cmds.c: regenerated.
2004-02-01 Michael Natterer <mitch@gimp.org>
Disallow to rename the layer mask. Instead, always name the mask
"<layer name> mask". Fixes bug #133112 along with some other
unreported ones.
* app/core/gimpitem.[ch]: added a boolean return value indicating
success to GimpItem::rename().
(gimp_item_real_rename): push an undo step only if the item is
attached.
* app/core/gimplayer.c (gimp_layer_rename): refuse renaming if
the layer is a floating selection floated from a channel
(renaming a layer's floating selection makes a new layer out
of the floating selection).
(gimp_layer_duplicate): use gimp_layer_add_mask() to attach the
mask's duplicate. Fixes mask refcount brokenness for duplicated
layer masks.
(gimp_layer_name_changed): new function. Automatically renames the
layer mask when the layer's name changes.
* app/core/gimplayermask.c (gimp_layer_mask_rename): new function
which refuses renaming.
(gimp_layer_mask_name_changed): skip the unique name voodoo
GimpItem does by not chaining up.
(gimp_layer_mask_set_layer): change the mask's name whenever it is
attached to a layer.
* app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with
text_layer->auto_rename only if renaming was successful.
* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited):
restore the old name if renaming failed.
* tools/pdbgen/pdb/drawable.pdb (set_name): return an execution
error if renaming failed.
* app/pdb/drawable_cmds.c: regenerated.
2004-01-22 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "gboolean use_default_values"
to GimpItem::stroke().
* app/core/gimpselection.c: changed accordingly.
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: if use_default_values is TRUE, don't
use the GimpPaintOptions passed in the GimpPaintInfo, but create a
new one.
* app/gui/stroke-dialog.c: pass FALSE so the values as set in the
tool options are used.
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb: pass TRUE so tool options settings
don't affect PDB stroke calls. Fixes part 2 of bug #132145.
* app/pdb/edit_cmds.c
* app/pdb/paths_cmds.c: regenerated.
2003-12-09 Michael Natterer <mitch@gimp.org>
Fixed memory management of layers and channels which were created
using the PDB:
* app/core/gimpitem.[ch]: added "gboolean floating" flag to
GimpItem. Items are created with floating == TRUE. Added
gimp_item_sink() which resets the floating flag and unrefs the
item if it was TRUE. Added gimp_item_is_floating() accessor.
* app/core/gimpimage.c (gimp_image_add_layer,channel,vectors):
g_object_ref()/gimp_item_sink() added items to take ownership of
them.
* app/core/gimplayer.c (gimp_layer_add_mask):
g_object_ref()/gimp_item_sink() the mask.
* app/gui/layers-commands.c
* app/xcf/xcf-load.c: don't unref layer masks after adding them to
the layer.
* tools/pdbgen/pdb/drawable.pdb (drawable_delete):
gimp_item_sink() the drawable if it's floating and fail if it's
not. Fixes bug #128881.
* tools/pdbgen/pdb/layer.pdb (layer_create_mask): fixed docs.
* app/pdb/drawable_cmds.c
* app/pdb/layer_cmds.c
* libgimp/gimplayer_pdb.c: regenerated.
2003-09-26 Simon Budig <simon@gimp.org>
* app/core/gimpstrokeoptions.[ch]: New Object, holding the
Options for a Libart-Stroke.
* app/core/Makefile.am
* app/core/core-types.h: Changed accordingly.
* app/core/gimpitem.[ch]: Changed the Signature of
gimp_item_stroke to accept a GimpObject instead of a
GimpPaintInfo. This enables us to pass GimpStrokeOptions
to it. To be cleaned up for 2.2.
* app/core/gimpselection.c
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: Changed accordingly
* app/gui/edit-commands.c
* app/gui/vectors-commands.c
* app/pdb/edit_cmds.c
* app/pdb/paths_cmds.c
* app/widgets/gimpselectioneditor.c
* app/widgets/gimpvectorstreeview.c: Fixed warnings by
casting the GimpPaintInfo to GimpObject.
2003-09-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added new virtual function
GimpItem::stroke().
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: implement GimpItem::stroke().
* app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed
signature to match gimp_item_stroke() (the selection mask *really*
should be a GimpChannel subclass).
Removed global variable "gboolean gimp_image_mask_stroking"...
* app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking"
to the GimpImage struct.
* app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors().
* app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef.
* app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func"
member and use gimp_item_stroke() instead.
* app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new)
* app/gui/edit-commands.c (edit_stroke_cmd_callback)
* app/gui/vectors-commands. (vectors_stroke_cmd_callback)
* app/widgets/gimpselectioneditor.c
(gimp_selection_editor_stroke_clicked)
* tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly.
* app/pdb/edit_cmds.c: regenerated.
Note that there is no GUI for "stroke channel", although it would
be utterly cool to have one, since currently slelection stroking
cannot be masked by a selection (because we stroke the selection).
Anyway, if anyone has an idea how to trigger "stroke channel" with
another drawable active (the one to stroke to), please let me
know...
2003-08-27 Michael Natterer <mitch@gimp.org>
Enabled type-preserving DND of all kinds of items between
different images. Fixes bug #119983.
* app/core/gimpitem.[ch]: added new virtual function
GimpItem::convert() which duplicates an item for another image.
* app/core/gimplayer.[ch]: removed gimp_layer_new_from_drawable()
and made it a GimpItem::convert() implementation.
* app/vectors/gimpvectors.[ch]: removed gimp_vectors_convert() and
made it a GimpItem::convert() implementation.
* app/widgets/gimpitemtreeview.[ch]: removed GimpConvertItemFunc
typedef and function pointer in GimpItemTreeViewClass since
we can simply call gimp_item_convert() now.
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c
* app/display/gimpdisplayshell-dnd.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
2003-05-20 Sven Neumann <sven@gimp.org>
* app/core/core-enums.[ch]: added new enum GimpRotationType.
* app/core/Makefile.am
* app/core/gimpimage-rotate.[ch]: new files.
* app/core/gimpchannel.c
* app/core/gimpdrawable-transform.[ch]
* app/core/gimpdrawable.c
* app/core/gimpitem.[ch]
* app/core/gimplayer.c
* app/vectors/gimpvectors.c: added GimpItem::rotate. Still work in
progress.
* plug-ins/common/rotate.c: don't install any menu entries. The
plug-in is only kept around to provide plug_in_rotate for backward
compatibility.
* app/gui/drawable-commands.[ch]
* app/gui/image-commands.[ch]
* app/gui/image-menu.c: use the new rotate implementation and use
stock icons for the menu entries. Fixes bug #57797.
2003-05-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "gboolean clip_result" to
GimpItem::flip().
* app/vectors/gimpvectors.c
* app/tools/gimpfliptool.c: changed accordingly.
* app/core/gimpdrawable.c: implement GimpItem::flip() and
GimpItem::transform().
* app/core/gimpchannel.c
* app/core/gimplayer.c: chain up in flip() and transform() and do
only the layer/channel specific stuff here.
* app/core/gimpdrawable-transform.[ch]: fixed indentation.
(gimp_drawable_transform_tiles_flip): added "gboolean clip_result"
and warn that it is not yet implemented.
(gimp_drawable_transform_tiles_affine): when transforming a
channel set bg_color to transparent. Clip channels (but not layer
masks) only if the passed tiles have bpp == 1 (the channel is
unfloated).
(gimp_drawable_transform_affine): clip all unfloated channels.
* app/core/gimpitem-linked.[ch]: added gimp_item_linked_get_list()
utility function to avoind iterating all layers/channels/vectors
in all functions.
* app/tools/gimptransformtool.c: clip all unfloated channels.
The clipping fixes above together fix bug #112858.
2003-05-12 Michael Natterer <mitch@gimp.org>
Added support for transforming linked layers, channels
and vectors. Fixes bug #86277.
* app/core/gimpdrawable-transform.[ch]
(gimp_drawable_transform_tiles_flip): added "gdouble axis" and
calculate the resulting drawable offset.
(gimp_drawable_transform_flip): calculate the axis and pass it to
the function above.
(gimp_drawable_transform_[tiles_]affine): reordered parameters.
* app/core/gimpitem.[ch]: added virtual functions GimpItem::flip()
and GimpItem::transform().
* app/core/gimpchannel.c
* app/core/gimplayer.c
* app/vectors/gimpvectors.c: implement flip() and transform().
Note that all functions always transform the whole item,
regardless of a present selection.
* app/core/Makefile.am
* app/core/gimpitem-linked.[ch]: new files containing utility
functions which translate, flip and transform all linked items.
* app/tools/gimpfliptool.c
* app/tools/gimptransformtool.c
* tools/pdbgen/pdb/layer.pdb: use the new gimp_item_linked_*()
functions to translate, flip and transform all linked items.
* tools/pdbgen/pdb/transform_tools.pdb: follow
gimp_drawable_transform_affine() API change.
* app/pdb/layer_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2003-05-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added "gboolean push_undo" to
GimpItem::translate() and don't push and undo in
gimp_item_translate().
* app/core/gimpchannel.[ch]: removed public function
gimp_channel_translate() and implement GimpItem::translate().
* app/core/gimpimage-mask.c
* app/core/gimplayer.c: changed accordingly.
* app/vectors/gimpvectors.c: actually translate the vectors
in translate().
* app/gui/channels-commands.c (channels_new_channel_query): removed
useless call to gimp_channel_translate().
* app/tools/gimpeditselectiontool.c
* tools/pdbgen/pdb/layer.pdb: when translating a linked layer,
also translate all linked channels and vectors. Cleanup.
Note that the "linked" behaviour has changed: before this change,
moving a layer moved all linked layers unconditionally. Now,
linked layers/channels/vectors are moved *only* if the moved layer
is also linked (the linked items behave as a group now and moving
something not in the group does not affect the group).
* app/pdb/layer_cmds.c: regenerated.
2003-05-07 Michael Natterer <mitch@gimp.org>
Started to abstract item transformation so we can easily
transform multiple linked items later:
* app/core/gimpitem.[ch]: added new virtual function
GimpItem::scale() with the same signature as the former
gimp_layer_scale_lowlevel().
* app/core/gimpdrawable.c: implement scale() and do the
common parts of layer/channel scaling here.
* app/core/gimpchannel.[ch]
* app/core/gimplayer.[ch]: implement scale() for the
channel/layer specific parts of scaling.
* app/core/gimplayer.[ch]: renamed gimp_layer_scale() to
gimp_layer_scale_by_origin().
* app/vectors/gimpvectors.c: added empty scale() implementation.
* app/core/gimpimage-scale.c
* app/core/gimpimage-undo-push.c
* app/gui/layers-commands.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
Unrelated:
* app/core/gimpimage-undo-push.c: fixed item rename undo to
take the size of the saved name into account. Removed old
path_undo stuff.
2003-03-17 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added virtual function rename() which
pushes an item rename undo. Added "default_name" and "rename_desc"
to the GimpItemClass struct which are used as default values.
* app/core/gimplayer.c: implement it and special-case floating
selections. set item_clas->default_name and item_class->rename_desc.
* app/core/gimpchannel.c
* app/vectors/gimpvectors.c: set item_class->default_name and
item_class->rename_desc.
* app/widgets/gimpitemtreeview.[ch]: removed rename_item() virtual
function and call gimp_item_rename().
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly.
2003-01-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added gimp_item_configure() and
gimp_item_copy().
* app/core/gimpdrawable.c (gimp_drawable_configure,copy): use them.
* app/vectors/gimpvectors.[ch]: added gimp_vectors_new(),
gimp_vectors_copy() and gimp_vectors_copy_points(). Use the new
GimpItem functions just as GimpDrawable does. Added a
get_memsize() implementation.
* app/vectors/gimpstroke.[ch]: made it a GimpObject and added
a get_memsize() implementation.
* app/undo.c: implemented vectors undo as if the new GimpVectors
functions above worked.
* app/gui/dialogs-constructors.c
* app/gui/vectors-commands.c
* app/tools/gimpvectortool.c: use gimp_vectors_new,copy().
2002-02-26 Michael Natterer <mitch@gimp.org>
* app/undo.[ch]: renamed undo_push_layer_rename() to
undo_push_item_rename(), so channel/vectors renaming is undoable.
Use "gsize" for all undo size variables. Cleanup.
* app/undo_types.h: s/LAYER_RENAME_UNDO/ITEM_RENAME_UNDO/.
* app/core/core-types.h: added LAYER_PROPERTIES_UNDO_GROUP.
* app/core/gimpimage.c: s/Vectors/Path/ in all user-visible strings.
* app/core/gimpitem.[ch]: cleanup.
* app/gui/menus.c: s/"New Path"/"New Path..."/, pass
"vectors_menu_update" to gimp_item_factory_new().
* app/gui/layers-commands.c: renaming the floating layer
transforms it into an ordinary layer. Push an undo group around
around both the "fs_to_layer" and the renaming.
* app/gui/channels-commands.c
* app/gui/vectors-commands.c: made renaming undoable, cleanup.
* app/widgets/gimpitemlistview.c: added an EEKY hack so "Delete"
is not broken any more for floating selections. Need a better
solution...