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>
* app/widgets/gimphistogramview.c (gimp_histogram_view_button_press):
ignore double clicks so we don't grab the pointer away from the
curves dialog. Fixes bug #132356.
* app/tools/gimpcurvestool.c (curves_graph_events): ignore button
press and release events from all buttons except the first one.
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-12 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.[ch]: derive the text tool from GimpTool
directly. Doesn't look like we are going to use draw_tool
functionality for 2.0.
2004-02-11 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-dnd.c
(gimp_display_shell_bucket_fill): when dropping a color on a text
layer, change the text color. This is a quick hack; we should make
filling a drawable a virtual method that can be overridden by the
text layer.
2004-02-11 Sven Neumann <sven@gimp.org>
* app/plug-in/plug-ins.c (plug_ins_init)
* app/plug-in/plug-in.c (plug_in_close): changed g_warning() to
g_printerr() in a few places where the problem is not an error in
GIMP but a misbehaving plug-in. Suppress some of this output in
the stable branch.
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 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am: added a rule to create a
header containing a warning pixbuf that we can use from the core.
* app/base/temp-buf.c (temp_buf_new): rewritten an optimisation so
that it works for any number of bytes per pixel.
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-10 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolorframe.c (gimp_color_frame_init): make the
value labels selectable as suggested by Mariano Suárez-Alvarez in
bug #133958.
2004-02-09 Michael Natterer <mitch@gimp.org>
* app/gui/gui.c (gui_libs_init): added runtime check for
fontconfig > 2.2.0 and abort with a dialog box telling the
user to upgrade fontconfig if the requirement is not met.
Fixes all bugs like #133818.
2004-02-09 Manish Singh <yosh@gimp.org>
* app/file/Makefile.am
* app/paint/Makefile.am
* app/text/Makefile.am
* app/xcf/Makefile.am: changed GTK_CFLAGS to GDK_PIXBUF_CFLAGS, since
we don't use any gtk/gdk functions here. This especially helps in the
text directory, since it avoids problems on broken setups with old
fontconfig stuff in the X11 directory lying around.
2004-02-08 Sven Neumann <sven@gimp.org>
* app/tools/gimpiscissorstool.c (gimp_iscissors_tool_button_press):
don't activate the iscissors tool if it's already active
(bug #132351).
2004-02-08 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.c (gimp_text_tool_set_layer): implemented
so that double-clicking a text layer now only activates the text
tool but also set the layer's text on the tool options.
2004-02-08 Sven Neumann <sven@gimp.org>
* app/tools/gimptoolcontrol.c (gimp_tool_control_activate)
(gimp_tool_control_halt): put overly picky sanity checks into
#ifdef GIMP_UNSTABLE ... #endif so we won't get these harmless
tool warnings from the stable version (bug #121074).
2004-02-08 Sven Neumann <sven@gimp.org>
* app/plug-in/plug-in-rc.c (plug_in_rc_parse): return FALSE if the
file wasn't found.
* app/plug-in/plug-ins.c (plug_ins_init): don't output the error
message from plug_in_rc_parse() if it failed for file not found.
Fixes bug #133490.
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-07 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-draw.c
(gimp_display_shell_draw_area): intersect the passed in area with
the real area of the image in display coordinates and render the
projection only if there actually is an intersection.
Use gimp_rectangle_intersect() instead of handmade CLAMP()
constructs. Fixes bug #113142.
2004-02-07 Sven Neumann <sven@gimp.org>
* app/plug-in/plug-in-shm.c (plug_in_shm_get_ID): don't
g_return_if_fail() if gimp->plug_in_shm is NULL; return -1 instead.
This allows to run gimp with --no-shm again.
2004-02-07 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell.[ch]: removed all drawing functions.
The file was still too large.
* app/display/Makefile.am
* app/display/gimpdisplayshell-draw.[ch]: new files containing
the drawing functions.
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-handlers.c
* app/tools/gimpmovetool.c: changed #includes accordingly.
* app/display/gimpdisplay-handlers.c
(gimp_display_size_changed_handler): added some #if 0'ed code I'm
not sure about. Actually, some of the handlers in this file could
need the same code, so it could be abstracted as
gimp_display_stop_draw() or something. Please have a look.
2004-02-05 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_mask_bounds):
fixed integer/boolean confusion: s/0/FALSE/.
(gimp_display_shell_draw_cursor): draw the cursor only if
shell->have_cursor is TRUE.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_expose): call the above unconditionally.
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>
* tools/pdbgen/pdb/edit.pdb (edit_paste): don't call
gimp_edit_paste() with a NULL buffer. Instead, return an execution
error if there is no global buffer to paste. Fixes the warning
triggered by bug #133244 (but not the bug itself of course).
* app/pdb/edit_cmds.c: regenerated.
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-05 Michael Natterer <mitch@gimp.org>
* app/tools/gimprectselecttool.c
(gimp_rect_select_tool_rect_select): don't try to CLAMP() the
passed in rectangle to valid image/drawable coordinates manually
when auto-shrinking the selection. Instead, use
gimp_rectangle_intersect(). Also honor the active drawable's
offsets. Fixes bug #133467.
2004-02-05 Raphaël Quinet <quinet@gamers.org>
* configure.in: Added a conditional definition of the preprocessor
symbol GIMP_UNSTABLE if the autoconf symbol GIMP_UNSTABLE is
defined.
* app/errors.c (gimp_errors_init): Replaced the #if test on
GIMP_MINOR_VERSION modulo 2 by #ifdef GIMP_UNSTABLE.
* app/composite/gimp-composite.c (gimp_composite_init): Print the
init messages only in unstable versions. Split the messages in
two lines and mention "supported by gimp_composite" in order to
give a hint that the availability of some features depends also on
what code has been written. Fixes bug #128825.
2004-02-04 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-render.c (struct RenderInfo)
(render_image_accelerate_scaling): use gdouble instead of gfloat
for x and y scale factors so gfloat's limited precision can't add
up to off-by-one pixel errors. Fixes display artefacts (missing
updates) at the bottom and right sides of updated areas at certain
irrational zoom factors like 1:3.
2004-02-04 Sven Neumann <sven@gimp.org>
* app/gui/image-menu.c (image_menu_entries): added percentages to
the View->Zoom menu entries as suggested in bug #131563.
2004-02-04 Sven Neumann <sven@gimp.org>
* app/config/gimprc.[ch]: added the new function
gimp_rc_set_unknown_token() to get autosave working for unknown
gimprc tokens.
* app/config/gimpconfig.c: indentation.
* tools/pdbgen/pdb/gimprc.pdb: gimp->edit_config was used for a
good reason, it's the one that's saved. Reverted a change I did
about a month ago. Use gimp_rc_set_unknown_token() so unknown
tokens get saved. This really fixes gimp_gimprc_set().
* app/pdb/gimprc_cmds.c: regenerated.
2004-02-03 Sven Neumann <sven@gimp.org>
* app/gui/image-menu.c (image_menu_set_zoom): don't mark weird
format strings as translatable.
* data/misc/gimp.desktop.in.in (_Name): use "The GIMP" without an
"(unstable)" suffix. Should give translators the chance to update
their translations before the final 2.0 release.
* configure.in: removed now unused GIMP_VISIBLE_NAME variable.
2004-02-03 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-ins.c (plug_ins_init): use g_clear_error()
instead of g_error_free() and re-use the same GError location for
pluginrc parsing and writing.
(plug_ins_proc_def_insert): when overriding a PlugInProcDef, don't
take over the menu_path and menu_accel of the overridden proc
because (a) it's just plain wrong and (b) we don't need to
preserve the proc_defs' order any more (see below).