2008-10-26 Michael Natterer <mitch@gimp.org>
Add some infrastructure for the on-canvas text editing GSoC
project:
* app/tools/gimptoolcontrol.[ch]: add boolean wants_all_key_events
member and API to set and get it.
* app/tools/gimptool.[ch]: add GimpTool::get_popup() which returns
the tool's context menu if it has one, or NULL otherwise.
* app/tools/tool_manager.[ch]: add tool_manager_get_popup_active()
wrapper.
* app/display/gimpdisplayshell-callbacks.c: check if the tool has
a popup menu and show it instead of the usual right-click menu.
Also call the tool's key_press() unconditionally if it wants all
key events, but this code needs more thinking.
svn path=/trunk/; revision=27416
* app/gegl/gimpoperationpointlayermode.c: For blend modes with
conditions, fix so that the conditions are per color
channel. Acheived by introducing a nice little preprocessor macro.
svn path=/trunk/; revision=27412
* app/gegl/gimpoperationpointlayermode.c: Enable the [0..1]
clamping of the output for Dodge and Burn. Without the clamping
one gets inconsistent results when blending together identical
layers but with different opacities. Maybe we should make the
clamping configurable and introduce a HDR compositing mode or
something?
svn path=/trunk/; revision=27411
* app/gegl/gimpoperationpointlayermode.c: Implemented Grain
Extract and Grain Merge. Also corrected the formula for Divide.
Works the same for 100% opaque layers:
o Grain Extract
o Grain Merge
svn path=/trunk/; revision=27410
* app/gegl/gimpoperationpointlayermode.c: Implement a bunch of
layer modes. Use the exact SVG 1.2 formula for layer modes that
have a counterpart in SVG 1.2. Don't clamp the result to [0..1]
for Dodge and Burn though as we don't need to. Maybe we *should*
clamp from a compositing point of view, I'm not sure. Also
reformat the code a bit for readability.
Keep in mind that we now treat the opacity of all layers the same
indepentant of the layer mode. That is why most of the new
implementations doesn't work the same as the legacy ones when
transparency is involved, only when the layers are completely
opaque. Another important property for all layer modes implemented
below is that compositing onto complete transparency gives the
same result as if the layer would have been in Normal blending
mode.
The status of the new layer mode implementations compared to the
legacy implementations is as follows:
Completely works the same:
o Behind
Works the same for 100% opaque layers:
o Multiply
o Screen
o Difference
o Darken
o Lighten
o Dodge
o Burn
o Hard Light
o Subtract
o Divide
Works different but similar:
o Overlay
Work in progress:
o Soft Light
svn path=/trunk/; revision=27409
* app/gegl/gimpoperationpointlayermode.c: Completed the rename
with gimp:layer-mode -> gimp:point-layer-mode and also did some
formating.
* app/core/gimplayer.c: Changed accordingly.
svn path=/trunk/; revision=27408
* plug-ins/file-psd/psd-save.c
* plug-ins/file-psd/psd-util.c: Add support for reading/writing
PSDs with the Linear Dodge layer mode which is the same as GIMPs
Addition layer mode.
svn path=/trunk/; revision=27407
2008-10-25 Michael Natterer <mitch@gimp.org>
Bug 557870 – "Qmask" message popping up here and there
* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): use
gimp_viewable_get_description() instead of gimp_object_get_name()
for displaying the active drawable's name so the quick mask and
the floating selection have the same names as in the
layers/channels dialogs.
svn path=/trunk/; revision=27405
* app/gegl/gimpoperationlayermode.[ch]: Rename to
* app/gegl/gimpoperationpointlayermode.[ch]: so that we can later
create a common GimpOperationLayerMode class/interface for
non-point layer modes like GimpOperationDissolveLayerMode.
* app/gegl/Makefile.am
* app/gegl/gimp-gegl.c
* app/gegl/gegl-types.h: Adjust accordingly.
svn path=/trunk/; revision=27401
GimpOperationLayerMode instantiable and add a GimpLayerModeEffects
property to it that we check in ::process() to blend pixels
together.
* app/gegl/gimpoperationlayermode.[ch]: Do the change described
above. Currently only Normal and Addition are implemented. Normal
so that we don't need a special case for the gegl:normal op. Also,
the Dissolve layer mode is not a point op and needs to be
implemented elsewhere.
* app/gegl/gimpoperation*mode.c: Removed.
* app/gegl/gimp-gegl-utils.[ch]: Removed
gimp_layer_mode_to_gegl_operation().
* app/core/gimplayer.c
* app/gegl/Makefile.am
* app/gegl/gimp-gegl.c: Adapt.
svn path=/trunk/; revision=27400
2008-10-25 Michael Natterer <mitch@gimp.org>
Merge a modified and enhanced patch from the vector layer branch:
* app/core/gimpdrawable-stroke.[ch]: add new public API
gimp_drawable_fill_boundary() and gimp_drawable_fill_vectors().
Split the internal code up so that there are functions which turn
the BoundSegs and GimpVectors into a GimpScanConvert and changed
gimp_drawable_stroke_scan_convert() so it can either fill the
shape or stroke it.
svn path=/trunk/; revision=27399
* app/gegl/gimpoperationlayermode.c: Make layer modes work on
premultiplied data. This makes compositing 40% faster on my test
image with 10 interlaced Normal and Addition mode layers.
* app/gegl/gimpoperationadditionmode.c: Switch to the
premultiplied algorithm and remove the experimental ones. The new
Addition mode has two important differences over the legacy
Addition mode:
o Addition mode now really is commutative as the GIMP
documentation says (this wasn't previously the case).
o Layers in Addition mode are just as opaque as Normal
layers. That is, their effect on the composite alpha channel
is the same. For discussion, refer to bug #387449.
svn path=/trunk/; revision=27396
2008-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.c (gimp_context_parent_notify): bail out if
the notification is not about one of our own properties
(but from a subclass).
svn path=/trunk/; revision=27394
2008-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpstrokeoptions.[ch]: add "gboolean use_context_color"
parameter to gimp_stroke_options_new() and set the passed context
as parent of the new options only if it's TRUE. Also fixed the
GimpConfig::duplicate() implementation to really duplicate the
object and not just return an object containing default values.
* app/core/gimpfilloptions.[ch]: add gimp_fill_options_new().
* app/actions/select-commands.c
* app/dialogs/stroke-dialog.c
* app/actions/vectors-commands.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb: pass TRUE to gimp_stroke_options_new().
* app/pdb/edit-cmds.c
* app/pdb/paths-cmds.c: regenerated.
svn path=/trunk/; revision=27393
2008-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpfilloptions.[ch]: add non-serializable properties
pattern-view-type and pattern-view-size which are used only by the
new UI below.
* app/widgets/gimpfilleditor.[ch]: added boolean edit-context
property. If TRUE, add widgets to edit the context's foreground and
pattern. Add "edit_context" parameter to gimp_fill_editor_new().
* app/widgets/gimpstrokeeditor.[ch]: add the same parameter here.
* app/widgets/gimpwidgets-utils.[ch]: add gimp_enum_radio_box_add()
which does the same as the existing gimp_enum_radio_frame_add().
* app/dialogs/stroke-dialog.c: pass FALSE for "edit_context"
because this dialog takes its foreground and pattern from the user
context and doesn't need it's own GUI for them.
svn path=/trunk/; revision=27392
2008-10-24 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpfilleditor.[ch]: new widget factored out of
GimpStrokeEditor.
* app/widgets/gimpstrokeeditor.[ch]: derive from GimpFillEditor
and remove UI for the properties of GimpFillOptions.
svn path=/trunk/; revision=27390
2008-10-24 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdialogfactory.c
(gimp_dialog_factories_toggle):
to be on the safe side, always show hidden dialogs when the Tab
key is used. It should not be possible to get a Tab key-press
while all displays are iconified, but you never know ...
svn path=/trunk/; revision=27385
2008-10-24 Sven Neumann <sven@gimp.org>
Bug 556896 – Dialogs don't get minimized with single image
window
* app/widgets/gimpdialogfactory.[ch]: renamed the new methods to
gimp_dialog_factories_{show|hide}_with_display().
Remember if the dialogs were hidden using
gimp_dialog_factories_hide_with_display() or using
gimp_dialog_factories_toggle() and keep this into account when
making them visible again. This ensures that dialogs that were
hidden using the Tab key won't be shown when the image window is
uniconified.
* app/display/gimpdisplayshell.c
(gimp_display_shell_window_state_event): changed accordingly.
svn path=/trunk/; revision=27384
2008-10-24 Michael Natterer <mitch@gimp.org>
Another merge from the vector layer branch:
* app/core/gimpstrokedesc.c (gimp_stroke_desc_new): make sure
each stroke desc always has GimpPaintInfo.
svn path=/trunk/; revision=27383
* app/gegl/gimpoperationadditionmode.c: For alpha compositing
consistency, all layers should affect alpha in the same way
independent of layer mode. Replace the compositing algorithm with
a version without the flaws discovered so far in the previous
ones. Don't use it yet though as it requires premultiplied data.
svn path=/trunk/; revision=27382
2008-10-24 Sven Neumann <sven@gimp.org>
* app/paint-funcs/scale-region.c (scale): use the inverse of the
scale factor so that we can multiply instead of dividing in the
loops.
svn path=/trunk/; revision=27380
2008-10-23 Michael Natterer <mitch@gimp.org>
Merge a part of SOC 2006's vector layer branch:
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpfilloptions.[ch]: new GimpContext subclass factored
out of GimpStrokeOptions. Has "style" and "antialias" properties.
* app/core/gimpstrokeoptions.[ch]: derive from GimpFillOptions
and remove said properties.
* app/core/gimpdrawable-stroke.c
(gimp_drawable_stroke_scan_convert): changed accordingly.
svn path=/trunk/; revision=27378
2008-10-23 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimppluginprocframe.c
(gimp_plug_in_proc_frame_dispose): set proc_frame->procedure to
NULL *after* calling gimp_plug_in_cleanup(). Fixes the crash on
windows in bug #557061 (but not the bug).
svn path=/trunk/; revision=27376
2008-10-23 Sven Neumann <sven@gimp.org>
Bug 556896 – Dialogs don't get minimized with single image
window
* app/display/gimpdisplay-foreach.[ch]: added utility function
to
get the number of visible (not withdrawn or iconified) displays.
* app/widgets/gimpdialogfactory.[ch]: added functions to hide
and
show the dock windows. Changed gimp_dialog_factories_toggle() to
use the new functions.
* app/display/gimpdisplayshell.c
(gimp_display_shell_window_state_event): hide the docks if the
last display is iconified. Unhide them if a display is
uniconified. Probably needs more work ...
svn path=/trunk/; revision=27374
2008-10-23 Sven Neumann <sven@gimp.org>
* configure.in: removed check for Carbon and added a test for
the
target OS being Darwin instead.
* app/config/gimpguiconfig.c: use PLATFORM_OSX instead of
HAVE_CARBON to determine the default "web-browser" command.
svn path=/trunk/; revision=27370
2008-10-22 Sven Neumann <sven@gimp.org>
* plug-ins/print/print-preview.c
(print_preview_leave_notify_event):
check the crossing mode and don't unset the "inside" flag when
the
event is caused by a pointer grab/ungrab.
svn path=/trunk/; revision=27368
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-callbacks.c: Fix calls to
gimp_display_shell_scaled() when Resize window on zoom is enabled.
svn path=/trunk/; revision=27366
2008-10-22 Sven Neumann <sven@gimp.org>
Bug 524615 – Print not to scale
* plug-ins/print/print.c: set the unit for dimensions on the
Cairo
context used for printing to GTK_UNIT_PIXELS.
* plug-ins/print/print-draw-page.c (print_draw_page): changed
the
Cairo scale factors accordingly. Seems to fix printing on
Windows.
svn path=/trunk/; revision=27364
2008-10-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpprogressbox.c: set box->progress to NULL in
destroy() and check for progress being NULL in various places so
we don't crash on API calls after the widget is destroyed.
svn path=/trunk/; revision=27362
2008-10-22 Sven Neumann <sven@gimp.org>
Bug 555246 – gimp crashes when a file is opened while a preview
is
generating
* app/widgets/gimpthumbbox.c: set box->progress to NULL in
destroy() and check for progress being NULL in various places so
we don't crash on API calls after the widget is destroyed.
svn path=/trunk/; revision=27360
2008-10-22 Sven Neumann <sven@gimp.org>
Bug 556741 – Alpha layer automatically added (in psd format) but
not desired
* plug-ins/file-psd/psd-save.c: applied patch from Dennis Ranke
that flattens the projection for indexed images.
svn path=/trunk/; revision=27358
2008-10-21 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.c: set dialog->progress to NULL in
destroy() and check for progress being NULL in various places so
we don't crash on API calls after the widget is destroyed.
svn path=/trunk/; revision=27354