2004-02-23 Michael Natterer <mitch@gimp.org>
* app/core/core-types.h: added #defines for GimpCoords' default
pressure, tilt and wheel values.
* app/display/gimpdisplayshell-callbacks.c
* app/paint/gimppaintcore-stroke.c
* app/text/gimptext-vectors.c
* tools/pdbgen/pdb/paint_tools.pdb: use them. Fixes lots more
buggy default values for tilt (in fact all of them were wrong).
* app/pdb/paint_tools_cmds.c: regenerated.
2004-02-23 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-snap.[ch]: return the snapped coordinates as
gdouble, not gint because we must not round the unsnapped axis
if only one axis snapped.
* app/display/gimpdisplayshell.[ch] (gimp_display_shell_snap_coords):
changed accordingly. Added boolean return value indicating "snapped".
* app/display/gimpdisplayshell-cursor.[ch]
(gimp_display_shell_update_cursor): take both display_x and _x and
(possibly snapped) image_x and _y. Use the snapped values for the
statusbar and the unsnapped ones for updating the info_window.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): applied modified patch
from Simon Budig which moves guide/grid snapping out of the
button_press/motion/button_release handlers and *always* snaps
the image_coords if the active_tool wants them to be snapped.
Makes sure that e.g. the brush preview is drawn at the right
place and fixes bug #134284.
Also pass both display_coords and image_coords to
gimp_display_shell_update_cursor().
2004-02-19 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-qmask.c (gimp_image_get_qmask): new function
which returns the image's QMask.
* app/core/gimpimage.c (gimp_image_channel_name_changed)
* app/gui/qmask-commands.c (qmask_query_response): use it.
2004-02-19 Michael Natterer <mitch@gimp.org>
* app/core/gimp.[ch]: added new signal "buffer_changed" and new
function gimp_set_global_buffer() which emits it when the global
buffer changes.
* app/core/gimp-edit.c (gimp_edit_extract): use it instead
of fiddling with gimp->global_buffer manually.
* app/gui/image-menu.c: connect to "buffer_changed" and set the
"Paste" menu entries sensitive. Fixes bug #134752.
(image_menu_update): changed accordingly. Also changed a lot of
buggy SET_SENSITIVE() lines which made menu items which work fine
on any drawable insensitive when there were no layers (instead
of no drawable).
* app/gui/edit-commands.c: added new macro return_if_new_drawable()
and use it instead of return_if_no_image() so we don't run
into assertions if there is no active drawable.
(cut,copy_named_buffer_callback): unfortunately had to introduce
two new translated messages about not being able to cut/copy when
there is no active drawable.
2004-02-18 Sven Neumann <sven@gimp.org>
* tile-cache.c
* tile-private.h
* tile.[ch]: removed trailing whitespace, added some newlines,
let tile_is_valid() return a gboolean instead of a gint.
* app/core/gimpimage-projection.c
* app/core/gimpimage-undo-push.c
* app/paint/gimppaintcore.c
* app/tools/gimpinktool.c: use the return value from tile_is_valid()
as a boolean.
2004-02-18 Michael Natterer <mitch@gimp.org>
Some code review:
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: removed obsolete code which
made sure serialize_property()/deserialize_property() are only
called for properties of the correct class. We do it the right way
for quite a while now and clear the inherited function pointers in
gimp_config_iface_base_init().
* app/config/gimprc.c (gimp_rc_dispose): don't forget to chain up.
* app/base/gimplut.c
* app/base/lut-funcs.c
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c
* app/config/gimpconfig-types.c
* app/config/gimprc.c
* app/core/gimp-modules.c
* app/core/gimpbrush.c
* app/core/gimpcontainer.c
* app/core/gimpdocumentlist.c
* app/core/gimpitem.c
* app/gui/about-dialog.c
* app/gui/color-notebook.c
* app/gui/gui.c
* app/gui/tips-dialog.c
* app/paint/gimppaintcore.c
* app/paint-funcs/paint-funcs.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainermenuimpl.c
* app/widgets/gimpselectioneditor.c: removed I/O includes from
files which don't use lowlevel APIs any more. Also removes
a whole bunch of G_OS_WIN32 special casing. Removed trailing
whitespace. Misc tiny cleanups.
2004-02-17 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.c (gimp_viewable_calc_preview_size): argh,
take the resolution into account if "dot_for_dot" is FALSE, not
TRUE.
2004-02-17 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-scale.c (gimp_image_scale_check): exclude the
size of the undo stacks so that the memory size is comparable with
the value displayed in the "New Image" dialog. Fixes bug #134512.
2004-02-17 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpprotocol.[ch]: changed wm_name to app_name in
the GimpConfig struct; increased GIMP_PROTOCOL_VERSION.
* app/plug-in/plug-in-run.c (plug_in_run): pass the return value
of g_get_application_name() to the plug-ins.
* libgimp/gimp.[ch]: removed function gimp_wm_name(). Set the
plug-in's application name if an app_name is passed in the config
message.
* libgimp/gimpui.c: removed usage of gimp_wm_name(); it was wrong
to do it this way and caused all plug-ins claim to be the gimp-1.3
executable in their error messages.
* libgimp/gimp.def: removed symbol gimp_wm_name.
* configure.in: reset gimp_binary_age and gimp_interface_age.
* app/core/gimpimage.c (gimp_image_name_changed): removed unused
variable.
2004-02-17 Michael Natterer <mitch@gimp.org>
Make sure each GimpItem emits "removed" when it is removed from
the image so dialogs have a chance to close themselves:
* app/core/gimplayer.c (gimp_layer_apply_mask): emit "removed"
from the mask.
(gimp_layer_removed): new function which emits "removed" from
the layer's mask when the layer gets removed from the image.
* app/core/gimpimage.c (gimp_image_dispose): emit "removed"
from all layers, channels and vectors.
* app/gui/layers-commands.c (layers_scale_layer_query)
(layers_resize_layer_query): removed recently added connections to
"removed" because GimpViewableDialog does this automatically.
2004-02-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdata.c (gimp_data_init): using
FOO_GET_CLASS(instance) in a GInstanceInitFunc doesn't work
because during instance init, the object's class is always set to
be the class of the currently called init function. Use the second
parameter of GInstanceInitFunc instead, which is the instance's
real class. Fixes bug #134274.
2004-02-14 Michael Natterer <mitch@gimp.org>
Fixed lots of QuickMask brokenness by letting the image adjust
its qmask_state automatically:
* app/core/gimpimage-qmask.h: #define GIMP_IMAGE_QMASK_NAME "Qmask".
Use the define in all files below.
* app/core/gimpimage.[ch]: split gimp_image_drawable_add,_remove()
into separate handlers for layers and channels. Added a
"name_changed" handler for all channels. In the channel "add",
"remove" and "name_changed" handlers, check if it was a channel
named "Qmask" that was added, removed or renamed and call
gimp_image_set_qmask_state() accordingly.
* app/core/core-enums.[ch]
* app/core/gimpimage-undo-push.[ch]
* app/core/gimpundo.c: removed all Qmask undo code because the image
does the right thing without undo interaction now.
* app/core/gimpimage-qmask.c (gimp_image_set_qmask_state): set
gimage->qmask_state early so we can return early when called
recursively. Removed calls to gimp_image_undo_push_image_qmask().
Returned "removed" callback (it was utterly broken the way it was
implemented).
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_qmask_toggled): check if the image's
qmask state needs to be changed before changing it.
* app/xcf/xcf-load.c (xcf_load_channel): removed code which
recognized the qmask. GimpImage does this automatically now.
* app/gui/qmask-commands.c: cleanup.
* app/widgets/gimpimagedock.c (gimp_image_dock_constructor):
destroy the "/Select/By Color" and "/Select/Toggle QuickMask" menu
items.
* app/widgets/image-menu.c (image_menu_update): changed accordingly.
2004-02-13 Manish Singh <yosh@gimp.org>
* app/base/temp-buf.c (temp_buf_get_memsize)
* core/gimpviewable.c (gimp_viewable_get_memsize): Add some casts
to gsize for ints to prevent overflows.
* app/base/tile-manager.c (tile_manager_get_memsize): Same as above,
except cast to gint64.
2004-02-13 Simon Budig <simon@gimp.org>
* app/core/gimpimage-guides.[ch]: make a similar fix as in my
last commit for snapping the guides.
* app/tools/gimpmovetool.c: use the fixed version.
2004-02-13 Simon Budig <simon@gimp.org>
* app/core/gimpimage-snap.[ch]: make the snapping width a
parameter of the snapping functions.
* app/display/gimpdisplayshell.c: make sure that the snapping
width always is 5 pixels in the view coordinates.
Fixes bug #134285
2004-02-13 Michael Natterer <mitch@gimp.org>
Fixed GimpData's default "writable" and "deletable" behaviour:
* app/core/gimpdata.c (gimp_data_init): default to writable and
deletable == TRUE (something that has no filename was never loaded
from disk and can't be undeletable or read-only).
Fixes bug #134274.
* app/core/gimpdata.[ch]: added new function
gimp_data_make_internal() which frees the filename and sets the
data's flags accordingly.
* app/core/gimp-gradients.c (gimp_gradients_add_gradient)
* app/core/gimpbrush.c (gimp_brush_get_standard)
* app/core/gimpgradient.c (gimp_gradient_get_standard)
* app/core/gimppalette.c (gimp_palette_get_standard)
* app/core/gimppattern.c (gimp_pattern_get_standard): use the
new function for internal data objects.
* app/core/gimpdata.c (gimp_data_save, gimp_data_delete_from_disk)
* app/core/gimpdatafactory.c (gimp_data_factory_save_single):
bail out with g_return_if_fail() is the data is not writable
or deletable.
* app/widgets/gimpdataeditor.c
* app/widgets/gimpdatafactoryview.c: changed accordingly.
2004-02-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): call
gimp_image_colormap_changed() after installing the colormap.
* app/tools/gimphistogramoptions.h: fixed typedef of
GimpHistogramOptionsClass.
2004-02-12 Michael Natterer <mitch@gimp.org>
Make sure that non-indexed images never have a colormap.
Fixes bug #121033.
* app/core/gimpimage-colormap.c (gimp_image_set_colormap): set
image->cmap to NULL when called with a NULL colormap.
* app/core/gimpimage-undo-push.c: made colormap undo/redo aware
of NULL colormaps.
* app/core/gimpimage-convert.c (gimp_image_convert): remove the
colormap using gimp_image_set_colormap() instead of freeing it
manually.
* app/widgets/gimpcolormapeditor.c: always check if the image
is INDEXED *and* has a colormap before accessing the colormap.
(need this new check because the fixed behaviour of colormap undo
produces undo groups which, when being popped, make the image have
no colormap while still being INDEXED in the small time frame
between the emission of "colormap_changed" and "mode_changed").
2004-02-10 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am (CORE_IMAGES): use the
question stock icon instead of the warning one.
* app/core/gimpviewable.c (gimp_viewable_get_dummy_preview):
return a question icon as dummy preview.
2004-02-10 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.[ch]: added new function
gimp_viewable_get_dummy_preview() which currently returns a
completely white and opaque TempBuf of the requested size. Added
this useless function because this is the place where to implement
a nicer preview if someone volunteers.
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/image.pdb: use the new function if
gimp->config->layer_previews is FALSE instead of returning no
preview at all. Fixes bug #112012.
Cleaned up the preview functions a bit and raised
the limit for drawable previews from 128x128 to 256x256.
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpdrawable_pdb.c: regenerated.
2004-02-07 Hans Breuer <hans@breuer.org>
* gimpdefs.msc : new file to keep common definitions for the msc build
* **/makefile.msc : use common defintions, e.g. GIMP_VER
* Makefile.am : add the former to EXTRA_DIST
2004-02-07 Pedro Gimeno <pggimeno@wanadoo.es>
* app/core/gimpimage-convert.c (median_cut_pass2_no_dither_rgb):
Corrected position for alpha_pix in the case of grayscale images
with custom or mono palette and no dither. Fixes bug #133642.
(median_cut_pass2_fixed_dither_rgb): Ditto for fixed dither
(Positioned Color Dither).
2004-02-05 Michael Natterer <mitch@gimp.org>
Disallow editing of data objects which have no save functionality.
Also fixed the misassumption that "deletable" is always equal to
"writable". Fixes bug #133456.
* app/core/gimpdata.[ch]: added a "deletable" property which is
always equal to "writable" except when the data class does not
implement GimpData::save() (then deletable may be TRUE but
writable is always FALSE).
* app/gui/brushes-menu.c
* app/gui/gradients-menu.c
* app/gui/palettes-menu.c
* app/gui/patterns-menu.c
* app/widgets/gimpdatafactoryview.c: look at data->deletable when
setting the sensitivity of the "Delete" buttons and menu items.
* app/widgets/gimpdatafactoryview.c
(gimp_data_factory_view_tree_name_edited): rename the data
only if it's writable and restore the old name otherwise.
* app/widgets/gimpdataeditor.c: no need to look at data->internal
for figuring if the data is editable, data->editable is enough.
All files above: s/writeable/writable/g
* app/widgets/gimpbrusheditor.c (gimp_brush_editor_set_data):
simplified.
2004-02-05 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-crop.c: removed trailing whitespace.
* app/gui/debug-commands.[ch]
* app/gui/toolbox-menu.c: renamed ENABLE_DEBUG_ENTRIES to
ENABLE_DEBUG_MENU and #define it to be equal to GIMP_UNSTABLE.
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-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.[ch]: use gboolean instead of gint
for "alpha_dither" and "remove_dups" in all public and private
functions. Properly prototyped private functions. Minor cleanup.
* app/gui/convert-dialog.c: pass FALSE instead of 0.
* tools/pdbgen/pdb/convert.pdb: ditto. Also cleaned up a bit: use
generated checks and documentation for enums, removed duplicate
check for enum range (spotted by Kevin Cozens).
* app/pdb/convert_cmds.c
* libgimp/gimpconvert_pdb.c: regenerated.
2004-01-29 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell.[ch]: Store the zoom factor as
float, not as a ratio.
* app/display/gimpdisplayshell-scale.[ch]: change the API to
expose the Float instead a weirdly encoded integer. Implement
functions to get a ratio from the scale factor. Implement a set
as presets as discussed on the mailinglist. Changed Zoom->Other
dialog to enable entering a float.
* app/display/gimpdisplayshell-title.c
* app/display/gimpnavigationview.c
* app/gui/image-menu.c
* app/gui/info-window.c
* app/tools/gimpmagnifytool.c: changed accordingly.
* app/core/gimp.[ch]
* app/display/gimpdisplay.[ch]
* app/gui/gui-vtable.c
* app/widgets/widgets-enums.h: Made the various display-creating
functions accept a float for the scale. Introduce a new
GimpZoomType: GIMP_ZOOM_TO. Generally adjust the API to use
floats instead of weird integers.
* app/core/gimp-edit.c
* app/core/gimptemplate.c
* app/display/gimpdisplayshell-callbacks.c
* app/file/file-open.c
* app/gui/image-commands.c
* app/gui/view-commands.[ch]
* tools/pdbgen/pdb/display.pdb
* app/widgets/gimpimageview.c
* app/widgets/gimptoolbox-dnd.c: changed accordingly
* app/pdb/display_cmds.c: regenerated
2004-01-29 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.[ch]: removed the last artefact of context
signal handling from 1.2:
GimpContext used to connect to e.g. the current brush's
"invalidate_preview" and "name_changed" signals and emitted
"brush_changed" when the callback was invoked. This was needed to
make 1.2 work, but is conceptually broken with the real model <->
view approach implemented in the current code.
This change also optimizes things quite a bit because lots of
signal emissions are saved.
Added utility function which finds a container's current object
after a freeze/thaw.
* app/widgets/gimpcontainerview.[ch]: added new virtual function
GimpContainerView::rename_item(). Connect to "name_changed" of the
corrent container's children and invoke rename_item() accordingly.
* app/widgets/gimpcontainertreeview.[ch]: removed name_changed
handler and implement GimpContainerView::rename_item().
* app/widgets/gimpcontainergridview.c: ditto. the grid view was
still relying on the removed GimpContext behaviour for updating
the label showing the sleected item's name.
2004-01-29 Michael Natterer <mitch@gimp.org>
GimpData code review:
* app/core/gimpdata.c (gimp_data_init): default to
writable = FALSE and dirty = TRUE.
* app/core/gimpbrushgenerated.[ch]: added "const gchar *name" to
gimp_brush_generated_new().
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpbrushpipe.c
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: set all standard datas to clean and
internal, check for g_path_is_absolute() in all load functions,
pass the data's name as construct property to g_object_new()
instead of calling gimp_object_set_name() after creation, fixed
some UTF-8 handling, spacing, indentation, coding style, general
cleanup.
2004-01-28 Michael Natterer <mitch@gimp.org>
Added infrastructure to make sure we don't write to the global
brush, pattern etc. directories. Needed to make this configurable
because we can't rely on the global directories being read-only,
having certain names or being otherwise detectable at runtime in a
sane way. Fixes bug #132214.
* libgimpbase/gimpdatafiles.[ch]: added "const gchar *dirname" to
the GimpDataFileData struct so callbacks don't need to call
g_path_get_dirname() for each file.
* libgimpwidgets/gimpfileentry.c: made it work with non UTF-8
encoded filenames.
* libgimpwidgets/gimppatheditor.[ch]: ditto. Added GUI and API for
setting/getting a second "writable_path". The widget makes sure
that the writable_path is always a subset of the path.
* app/config/gimpconfig-utils.[ch]: added new function
gimp_config_build_writable_path().
* app/config/gimpcoreconfig.[ch]: added separate properties for
the writable brush, pattern, gradient, palette and font paths.
* app/config/gimprc-blurbs.h: added (still empty) blurbs for the
new properties.
* app/core/gimpdata.[ch] (gimp_data_set_filename): added parameter
"gboolean writable". Set data->writable to FALSE by default. If
"writable" is passed as TRUE, still check if we can write to the
file before setting data->writable to TRUE.
(gimp_data_create_filename): changed "data_path" parameter to
"dest_dir" and assume dest_dir is writable.
(gimp_data_duplicate): set data->dirty to TRUE to make sure
duplicated things will be saved.
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpbrushpipe.c
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: don't set the data's filename and don't
touch data->dirty in the _load() functions because that's done by
the data factory now. Don't touch data->dirty in the _duplicate()
functions because that's done by gimp_data_duplicate() itself now.
* app/core/gimpdatafactory.[ch] (gimp_data_factory_new): added
"writable_property_name" and remember it.
Added utility function gimp_data_factory_get_save_dir() which
determines the directory to save new datas to.
Added public function gimp_data_factory_data_save_single() which
saves a single data object.
Make sure new things get saved to the first writable directory
as specified in preferences.
* app/core/gimp.c (gimp_real_initialize): pass the writable_paths'
property names to gimp_data_factory_new().
* app/widgets/gimpdataeditor.c (gimp_data_editor_save_dirty): use
gimp_data_factory_data_save_single() instead of implementing
saving here.
* app/widgets/gimppropwidgets.[ch] (gimp_prop_path_editor_new):
added "const gchar *writable_property_name" parameter (can be
NULL).
Added the needed callbacks to handle the writable_path and made
the path_editor and file_entry code aware of non UTF-8 filename
encodings. Some general cleanup.
* app/gui/preferences-dialog.c: changed accordingly.
2004-01-28 Simon Budig <simon@gimp.org>
Argh, this is getting silly.
* app/core/gimpscanconvert.c: Fix dumb bug I introduced
while fixing bug #132036. Instead of always closing a
polyline to the first point of the vpath close to the
first point of the current polyline
I'll close#132036 for the third time now, feel free to
reopen it when bugs appear...
2004-01-27 Michael Natterer <mitch@gimp.org>
* themes/Default/images/Makefile.am
* themes/Default/images/stock-layer-mask-16.png
* themes/Default/images/stock-layer-mask-24.png
* themes/Default/images/stock-layer-mask-32.png
* themes/Default/images/stock-layer-mask-48.png
* themes/Default/images/stock-selection-border-16.png
* libgimpwidgets/gimpstock.[ch]: added forgotten layer mask and
new "border selection" icons from Jimmac (-32 and -48 ones to be
updated, they are currently copies of the channel icons).
* app/core/gimplayermask.c (gimp_layer_mask_class_init)
* app/gui/image-menu.c (image_menu_entries): use them.
2004-01-26 Simon Budig <simon@gimp.org>
* app/core/gimpscanconvert.c: use the modern libart way
to uncross/rewind a libart SVP. This time really fixes
bug #132036 (please test it though...).
2004-01-26 Michael Natterer <mitch@gimp.org>
* plug-ins/script-fu/scripts/unsharp-mask.scm: add the layer to
the image before pasting to it. Fixes bug #132504.
Fixed the underlying problem: make it impossible to attach
floating selections to drawables which are not currently part of
the image's layer or channel stacks.
Also cleaned up image <-> floating_sel interaction:
* app/core/gimplayer-floating-sel.[ch] (floating_sel_attach):
added assertion that the drawable is part of the image (see below).
Don't call gimp_image_floating_selection_changed(), it's emitted
by gimp_image_add_layer() now.
(floating_sel_remove)
(floating_sel_anchor): don't emit "floating_selection_changed",
it's emitted by gimp_image_remove_layer() now.
(floating_sel_anchor): removed the fix for bug #132162 because
gimp_image_remove_layer() behaves correctly now (see below).
Renamed floating_sel_reset() to floating_sel_activate_drawable().
Added g_return_if_fail() all over the place.
* app/core/gimpimage.[ch]: added new function gimp_image_owns_item()
which return TRUE if the passed item is part of the image.
(gimp_image_add_layer): emit "floating_selection_changed" here if
needed.
(gimp_image_remove_layer): emit "floating_selection_changed" if
needed, don't try to activate a layer if we called
floating_sel_activate_drawable().
This is the real fix for bug #132162.
* app/core/gimpimage-undo-push.c (undo_pop_layer): apply the same
fixes as to gimp_image_add,remove_layer(). Don't call
gimp_drawable_invalidate_preview() on the previously active layer
because that's done by gimp_image_set_active_layer() now.
* app/xcf/xcf-load.c: remember the "floating_sel_drawable" in the
XcfInfo struct and attach it *after* all layers and channels are
loaded to avoid attaching the floating selection to an
out-of-image drawable.
* app/core/gimp-edit.c (gimp_edit_paste)
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_affine,
gimp_drawable_transform_flip, gimp_drawable_transform_rotate)
* app/core/gimpselection.c (gimp_selection_float)
* app/text/gimptext-compat.c (text_render): added checks for
gimp_image_owns_item() in all functions which can produce
floating selections.
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/floating_sel.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/text_tool.pdb
* tools/pdbgen/pdb/transform_tools.pdb: added checks for
gimp_item_owns_image() and return an execution error if invoked
with a drawable which is not part of the image.
* app/pdb/edit_cmds.c
* app/pdb/floating_sel_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/text_tool_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2004-01-26 Manish Singh <yosh@gimp.org>
* app/core/gimpdrawable-blend.c (gradient_fill_region): use memcpy
instead of casted assignment for storing HSV values in rbd.fg/bg,
for C99 aliasing compliance.
* app/xcf/xcf-load.c (xcf_load_layer_mask): use a GimpChannel *
explictly for xcf_load_channel_props, for the above reason.
* app/xcf/xcf-save.c (xcf_save_prop): use a temporary guint32 for
saving property types, for the above reason.
* app/core/gimpparasitelist.c (gimp_parasite_list_deserialize): plug
a memory leak, since data is copied on parasite creation.
2004-01-23 Michael Natterer <mitch@gimp.org>
* app/app_procs.c
* app/errors.c
* app/main.c
* app/config/gimpconfigwriter.c
* app/core/gimpdata.c
* app/core/gimpdatafactory.c
* app/gui/user-install-dialog.c
* app/plug-in/plug-ins.c
* app/vectors/gimpvectors-import.c: some more gimp_filename_to_utf8().
* libgimp/gimp.c
* libgimpmodule/gimpmodule.c
* libgimpmodule/gimpmoduledb.c: use it here, too, now that is in
libgimpbase.
2004-01-22 Michael Natterer <mitch@gimp.org>
* app/core/gimplayer-floating-sel.c (floating_sel_anchor):
explicitly activate the drawable the floating selection was
attached to (function was relying on implicit voodoo that
happened 1.2). Fixes bug #132162.
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.
2004-01-21 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-transform.c: use RINT() instead of ROUND()
to calculate the coordinates of the transformed tiles to avoid
off-by-one errors when affine-transforming, flipping and rotating
drawables with negative offsets.
Fixes the off-by-one part of bug #132089.
2004-01-21 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_paste):
call gimp_drawable_invalidate_boundary() because the drawable's
size may have changed. Fixes bug #132077. Removed call to
floating_sel_invalidate() which is now redundant.
2004-01-21 Simon Budig <simon@gimp.org>
* app/core/gimpscanconvert.c: removed the call to
art_vpath_perturb, since it apparently is responsible for the
artefacts described in bug #132036. I don't really understand
why these artefacts were happening in the first place, because
in theory art_vpath_perturb should not do any harm.
Also properly close closed polygons.
Hopefully fixes#132036, please test this.
2004-01-19 Sven Neumann <sven@gimp.org>
* app/*/*.c: include "libgimpbase/gimpbase.h" where needed; removed
now unnecessary inclusions of "file/file-utils.h".
2004-01-19 Sven Neumann <sven@gimp.org>
* app/file/file-utils.[ch]: removed file_utils_filename_to_utf8() ...
* libgimpbase/gimputils.[ch]: ... and added it here as
gimp_filename_to_utf8(). Added some docs that promise less than
the current implementation holds so that we can change the
implementation later.
* app/*/*.c: use gimp_filename_to_utf8() where
file_utils_filenames_to_utf8() has been used before.
* libgimpbase/gimpbase.def: changed accordingly.
* configure.in: reset GIMP_INTERFACE_AGE.
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_add_layer,remove_layer): in the
spirit of the fix for bug #131721 below, don't try to figure
manually if "alpha_changed" needs to be emitted but simply compare
the old and new values of gimp_image_has_alpha().
* app/gui/preferences-dialog.c (prefs_dialog_new): follow
"foo-window-type" -> "foo-window-hint" change.