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 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-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-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 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 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-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.
* app/display/gimpcanvas.c: gimp_canvas_draw_segments():
Do not call gdk_draw_segments() with more than 32000 segments at a
time, because XDrawSegments should never be called with more
segments than that. This should really be fixed at the gdk level,
though.
This fixes bug #122026.
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-27 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): added '%P' which expands to the
PDB id of the active drawable. Moved local variables to local
scopes where they are needed.
* app/config/gimpconfig-dump.c: document it.
2004-01-27 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-dnd.c: some cleanup.
(gimp_display_shell_bucket_fill): don't use the bucket fill
options but behave like "Edit -> Fill" and fill with NORMAL/100%.
Fixes bug #132596.
2004-01-26 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-selection.c: don't draw the
outbounds selection when the selection is hidden (bug #132595).
2004-01-21 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.[ch]: added boolean return value to
GimpTool::initialize(). Returning FALSE means the tool could not
be initialized and doesn't want to receive button events.
Return TRUE from the default implementation.
* app/tools/tool_manager.[ch]: added boolean return value to
tool_manager_initialize_active(). Don't set the tool's display or
drawable if initialize() returns FALSE.
* app/display/gimpdisplayshell-callbacks.c: don't send button
events to the tool if initialize() returns FALSE.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcolorizetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: return FALSE for NULL and indexed
drawables.
* app/tools/gimpimagemaptool.c: always return TRUE because our
subclasses already checked if the active drawable is OK.
* app/tools/gimptransformtool.c: return FALSE for layers with
masks. Fixes bug #132089. Some random cleanups.
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-15 Michael Natterer <mitch@gimp.org>
Fixed bug #78732 (don't paste off screen):
* app/display/gimpdisplayshell-transform.[ch]: added new function
gimp_display_shell_untransform_viewport() which returns the
visible rectangle of the image in image coordinates.
* app/core/gimp-edit.[ch] (gimp_edit_paste): added viewport
parameters and changed positioning of the pasted layer as follows:
- if there is a selection, center on the selection (just as before).
- if there is no viewport, center on the active drawable.
- if the viewport intersects with the active drawable, center
on the intersection.
- if the viewport does *not* intersect with the active drawable,
center on the active drawable (off-screen, but better than pasting
something that will be invisible due to floating selection clipping).
- if there is no active drawable, center on the viewport.
- if there is no active drawable and no viewport, center on the image.
* app/widgets/gimpbufferview.c (gimp_buffer_view_paste_clicked)
(gimp_buffer_view_paste_into_clicked)
* app/display/gimpdisplayshell-dnd.c (gimp_display_shell_drop_buffer)
* app/gui/edit-commands.c (edit_paste_cmd_callback)
(edit_paste_into_cmd_callback): ask the shell for the viewport
and pass it to gimp_edit_paste().
* app/display/gimpdisplayshell-dnd.c
(gimp_display_shell_drop_drawable): center the created layer on
the viewport.
* app/tools/gimpmovetool.c (gimp_move_tool_button_release): use
gimp_display_shell_untransform_viewport() (its code was taken from
here).
* tools/pdbgen/pdb/edit.pdb: pass "no viewport" to gimp_edit_paste().
* app/pdb/edit_cmds.c: regenerated.
2004-01-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-projection.c (gimp_image_invalidate): applied
patch from Pedro Gimeno that makes sure we always invalidate
complete tiles, not parts of it. Fixes bug #116765.
* app/display/gimpdisplay.c (gimp_display_paint_area): calculate
the image area to invalidate using sub-pixel precision and
ceil()/floor() the resulting area to make sure we always
invalidate a superset of the dirty area, not a subset. A rounding
error here has never been reported but would cause effects similar
to #116765.
2004-01-11 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-scale.c: ensure that
"fit image to window" really always fits, despite the
resulting fractions are not as nice compared to the
fractions from zoom in/out.
2004-01-11 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-scale.c: further tweaks.
now excluding fractions where numerator*denominator > 200
(only when both are > 1).
This is a simple heuristic to exclude some absurd looking
fractions.
Also ensure that 1/ratio results in b:a, when ratio results
in a:b.
IMHO fixes bug #124073.
2004-01-11 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-scale.c: calculate the
fraction from the zoom ratio using continued fractions.
This prefers smaller numbers in numerator/denominator.
Adresses bug #124073, but does not completely fix it,
since scaling up/down does not always result in the same
ratios.
2004-01-10 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_scale_zoom_fraction): use G_SQRT2 instead of
the golden ratio (see bug #124073).
2004-01-09 Dave Neary <bolsh@gimp.org>
* app/display/gimpdisplayshell-scale.c: Modify behaviour of
the magnify tool to always change the zoom factor by the
golden ratio, rather than modify the numerator and denominator
directly. Fixes bug #124073.
2004-01-02 Michael Natterer <mitch@gimp.org>
* app/tools/gimppainttool.c: removed GimpTool::cursor_update()
implementation (which was there only to stop drawing the brush
preview when the mouse leaves the canvas). Instead, look at
shell->proximity in GimpTool::oper_update() and just don't start
drawing the preview if proximity is FALSE.
* app/display/gimpdisplay.c (gimp_display_delete): set
gdisp->shell to NULL *before* gtk_widget_destroy()ing the shell so
our tool callbacks don't dispatch stuff while the shell is in the
middle of being destroyed.
Both changes fix bug #129374, though the latter is the fix for the
real problem.
2003-12-21 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-dnd.[ch]: added
gimp_display_shell_drop_svg() (untested because there is no place
to drag an SVG from yet...).
* app/display/gimpdisplayshell.c (gimp_display_shell_init):
connect SVG drops to the new callback.
2003-12-17 Michael Natterer <mitch@gimp.org>
* app/display/gimpcanvas.c (gimp_canvas_gc_new): restore the
cap_style and join_style properties for the XOR GdkGC to the
values GimpDrawTool's GC used to have. Fixes the result of
gdk_draw_segments().
* app/tools/gimpfuzzyselecttool.c (gimp_fuzzy_select_tool_motion):
CLAMP the threshold to its possible values when setting it in the
selection options.
(gimp_fuzzy_select_tool_button_release): restore the original
threshold after selecting.
2003-12-12 Hans Breuer <hans@breuer.org>
[
I've postponed my reservations against pangoft2/fontconfig/freetype2
usage, so The Gimp should now build with msvc without patching it.
]
* app/makefile.msc app/text/makefile.msc : use $(PANGOFT2_CFLAGS) etc.
* libgimpthumb/makefile.msc : (new file)
* makefile.msc : added libgimpthumb
* libgimpthumb/gimpthumbnail.c : include gimpwin32-io.h
* libgimpthumb/gimpthumb-utils.c : don't compare size pointer
with GIMP_THUMB_SIZE_FAIL but *size
* plug-ins/makefile.msc : handle libgimpoldpreview
* plug-ins/common/decompose.c : define cbrt() if not __GLIBC__
* plug-ins/common/winclipboard.c : make it compile without gimpcompat.h
* plug-ins/imagemap/imagemap_csim_lex.c : its a generated file
but still win32/msvc has no unistd.h
* plug-ins/pygimp/makefile.msc : (new file) to use the binary you
need to patch glib, see bug #98737
* plug-ins/libgimpoldpreview.c : use <libgimp/gimp.h> instead of "gimp.h"
* **/Makefile.am : added makefile.msc to EXTRA_DIST
2003-12-11 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_events):
switch off fullscreen mode on Escape key press events only. The shell
should not react on the key release event it gets when a dialog is
closed using the Escape key.
2003-11-24 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-layer-select.c
* app/widgets/gimptoolbox-indicator-area.c: use
gimp_preview_new_by_types() instead of just gimp_preview_new() so
the new preview code remembers the correct GType.
2003-11-22 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgetsmarshal.list
* libgimpwidgets/gimpcolordisplaystack.[ch]: added signals
::added(), ::removed() and ::reordered() and emit them in the
resp. functions.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpcolordisplayeditor.[ch]: new widget implementing
an editable view on a GimpColorDisplayStack. Most code taken from
below...
* app/display/gimpdisplayshell-filter-dialog.c: ...and removed
here. Only creates a GimpDialog around a GimpColorDisplayEditor
now.
2003-11-21 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpcolordisplaystack.h: forgot to declare
gimp_color_display_stack_clone().
* app/display/gimpdisplayshell.[ch]: replaced the GList of
GimpColorDisplays by a single GimpColorDisplayStack.
* app/display/gimpdisplayshell-render.c
(gimp_display_shell_render): changed accordingly.
* app/display/gimpdisplayshell-filter.[ch]: reduced API to a
single function, gimp_display_shell_filter_set(), which exchanges
the whole filter stack. Idle update the display on
GimpColorDisplayStack::update().
* app/display/gimpdisplayshell-filter-dialog.[ch]: changed
accordingly. Return the created dialog instead of assigning
shell->filters_dialog.
* app/gui/view-commands.c (view_display_filters_cmd_callback): set
shell->filters_dialog here and raise it it if already
exists. Don't use the dialog factory to create it because it's a
transient dialog for the display which does not need to be session
managed.
* app/gui/dialogs-constructors.[ch]
* app/gui/dialogs.c: removed display filter dialog stuff.
2003-11-21 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-filter-dialog.c: create the Display
Filter dialog transient for the display shell and destroy it with
its parent.
2003-11-20 Sven Neumann <sven@gimp.org>
* app/config/gimpdisplayconfig.[ch]
* app/config/gimprc-blurbs.h: added a new gimprc option
"activate-on-focus" that allows to configure GIMP to activate an
image when the image window receives the focus. Useful for window
managers using click-to-focus. Defaults to TRUE on OS_WIN32.
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell.c: implemented the new behaviour.
2003-11-19 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
shrink to the size of the monitor, not to the size of the screen
(for Xinerama setups). Fixes bug #121796.
2003-11-16 Hans Breuer <hans@breuer.org>
* app/text/*.c : still unacceptable patched to compile
without FT2, see bug #113681
* **makefile.msc : updated
* app/config/gimpconfig-dump.c : include gimpwin32-io.h
* app/plug-in/plug-ins.c : don't depend on g_print handling
%s with NULL pointers, it doesn't anymore with glib cvs at
least not on win32
* app/widgets/gimppropwidgets.c
libgimpbase/gimputils.c
libgimpwidgets/gimpmemsizeentry.c :
sorry about the mess, need to work-around a stupi not able
to cast from guint64 to double
* app/widgets/gimppropwidgets.c (gimp_prop_memsize_entry_new) :
avoid 'overflow in floating-point constant arithmetic' by disabling
an imho alays questionable g_return_val_if_fail() for _MSC_VER only
* libgimpmodule/gimpmodule.def : sorted
* libgimpwidgets/gimpfileselection.c : removed unused S_ISDIR
definition
* app/gui/themes.c : filenames in rc files need to be escaped
2003-11-15 Sven Neumann <sven@gimp.org>
* app/display/gimpcanvas.c (gimp_canvas_gc_new): no need to set
colors on the GCs that use GDK_INVERT.
* app/display/gimpdisplayshell-render.c (gimp_display_shell_render):
micro cleanup.
2003-11-12 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimphelp-ids.h: replaced the last few html help
links in app/ by help IDs.
2003-11-11 Sven Neumann <sven@gimp.org>
* app/display/gimpcanvas.c: added API docs for the less obvious
functions. Gracefully handle attempts to draw on the unrealized
widget.
* app/display/gimpdisplayshell-selection.c (selection_draw):
removed the redundant check for a realized canvas widget.
Also updated API docs.
2003-11-11 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpcolorbutton.[ch]: added new API
gimp_color_button_[get|set]_update() which configures the button
to emit "color_changed" continuously while the color in the color
selection dialog is being changed. Fixes bug #90091.
Renamed GimpColorButton struct member
"GtkItemFactory *item_factory" to a /*< private >*/ member named
"gpointer popup_menu". This is ugly but fixes bug #125115,
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell.c
* app/widgets/gimpcolorpanel.c: changed accordingly.
* libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection
with a handmade GimpDialog instead of GtkColorSelectionDialog.
Enabled module loading for plug-ins so the color selection
can show the color selectors which are implemented in modules:
* libgimpwidgets/gimpwidgets-private.[ch]: added
GimpEnsureModlesFunc which can be called by modules users.
* app/gui/gui.c (gui_libs_init): pass NULL as
GimpEnsureModulesFunc since the core loads the modules itself.
* libgimp/gimpui.c (gimp_ui_init): pass new private function
gimp_ensure_modules() which will load the modules upon first
invocation.
* libgimp/Makefile.am: link libgimpui against libgimpmodule.
* libgimpwidgets/gimpcolorselection.c: call
_gimp_ensure_modules_func() if it is non-NULL so color selector
modules are available for plug-ins.
* tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper
gimp_get_module_load_inhibit().
* app/pdb/gimprc_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-11 Sven Neumann <sven@gimp.org>
* app/display/gimpcanvas.[ch]: added gimp_canvas_set_clip_region().
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_expose): if gimp_display_shell_pause()
would cause a redraw, make sure that no XOR drawing happens on
areas that have already been cleared by the windowing system.
Fixes bug #115712.