gimp r27244 - in branches/soc-2008-tagging: . app app/actions app/base app/composite app/config app/core app/dialogs app/display app/file app/gegl app/gui app/menus app/paint app/paint-funcs app/pdb app/plug-in app/text app/tools app/vectors app/widgets app/xcf cursors data/images devel-docs devel-docs/app devel-docs/libgimp devel-docs/libgimp/tmpl devel-docs/libgimpbase devel-docs/libgimpbase/tmpl devel-docs/libgimpwidgets devel-docs/libgimpwidgets/tmpl devel-docs/tools docs etc libgimp libgimpbase libgimpconfig libgimpwidgets menus modules plug-ins plug-ins/color-rotate plug-ins/common plug-ins/file-bmp plug-ins/file-faxg3 plug-ins/file-fits plug-ins/file-fli plug-ins/file-ico plug-ins/file-jpeg plug-ins/file-psd plug-ins/file-sgi plug-ins/file-uri plug-ins/file-xjt plug-ins/flame plug-ins/gfig plug-ins/gimpressionist plug-ins/gradient-flare plug-ins/help-browser plug-ins/ifs-compose plug-ins/imagemap plug-ins/lighting plug-ins/map-object plug-ins/print plug-ins/py gimp plug-ins/pygimp/plug-ins plug-ins/script-fu plug-ins/script-fu/re plug-ins/script-fu/scripts plug-ins/script-fu/tinyscheme plug-ins/twain plug-ins/win-snap po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default themes/Default/images themes/Small tools tools/pdbgen tools/pdbgen/pdb



Author: aurisj
Date: Sun Oct 12 15:38:02 2008
New Revision: 27244
URL: http://svn.gnome.org/viewvc/gimp?rev=27244&view=rev

Log:
Merged from trunk revisions 26631:27242.

Added:
   branches/soc-2008-tagging/ChangeLog.pre-2-6
      - copied, changed from r27242, /trunk/ChangeLog.pre-2-6
   branches/soc-2008-tagging/NEWS.pre-2-6
      - copied unchanged from r27242, /trunk/NEWS.pre-2-6
   branches/soc-2008-tagging/app/actions/config-actions.c
      - copied unchanged from r27242, /trunk/app/actions/config-actions.c
   branches/soc-2008-tagging/app/actions/config-actions.h
      - copied unchanged from r27242, /trunk/app/actions/config-actions.h
   branches/soc-2008-tagging/app/actions/config-commands.c
      - copied unchanged from r27242, /trunk/app/actions/config-commands.c
   branches/soc-2008-tagging/app/actions/config-commands.h
      - copied unchanged from r27242, /trunk/app/actions/config-commands.h
   branches/soc-2008-tagging/app/core/gimpdrawablestack.c
      - copied unchanged from r27242, /trunk/app/core/gimpdrawablestack.c
   branches/soc-2008-tagging/app/core/gimpdrawablestack.h
      - copied unchanged from r27242, /trunk/app/core/gimpdrawablestack.h
   branches/soc-2008-tagging/app/gegl/gimpoperationadditionmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationadditionmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationadditionmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationadditionmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationantierasemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationantierasemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationantierasemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationantierasemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationbehindmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationbehindmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationbehindmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationbehindmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationburnmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationburnmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationburnmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationburnmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationcolorerasemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationcolorerasemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationcolorerasemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationcolorerasemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationcolormode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationcolormode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationcolormode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationcolormode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationdarkenonlymode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdarkenonlymode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationdarkenonlymode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdarkenonlymode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationdifferencemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdifferencemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationdifferencemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdifferencemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationdissolvemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdissolvemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationdissolvemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdissolvemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationdividemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdividemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationdividemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdividemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationdodgemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdodgemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationdodgemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationdodgemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationerasemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationerasemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationerasemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationerasemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationgrainextractmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationgrainextractmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationgrainextractmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationgrainextractmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationgrainmergemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationgrainmergemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationgrainmergemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationgrainmergemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationhardlightmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationhardlightmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationhardlightmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationhardlightmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationhuemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationhuemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationhuemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationhuemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationlightenonlymode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationlightenonlymode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationlightenonlymode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationlightenonlymode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationmultiplymode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationmultiplymode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationmultiplymode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationmultiplymode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationoverlaymode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationoverlaymode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationoverlaymode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationoverlaymode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationpointcomposer.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationpointcomposer.c
   branches/soc-2008-tagging/app/gegl/gimpoperationpointcomposer.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationpointcomposer.h
   branches/soc-2008-tagging/app/gegl/gimpoperationreplacemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationreplacemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationreplacemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationreplacemode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationsaturationmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsaturationmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationsaturationmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsaturationmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationscreenmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationscreenmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationscreenmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationscreenmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationsoftlightmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsoftlightmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationsoftlightmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsoftlightmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationsubtractmode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsubtractmode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationsubtractmode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationsubtractmode.h
   branches/soc-2008-tagging/app/gegl/gimpoperationvaluemode.c
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationvaluemode.c
   branches/soc-2008-tagging/app/gegl/gimpoperationvaluemode.h
      - copied unchanged from r27242, /trunk/app/gegl/gimpoperationvaluemode.h
   branches/soc-2008-tagging/app/widgets/gimpactioneditor.c
      - copied unchanged from r27242, /trunk/app/widgets/gimpactioneditor.c
   branches/soc-2008-tagging/app/widgets/gimpactioneditor.h
      - copied unchanged from r27242, /trunk/app/widgets/gimpactioneditor.h
   branches/soc-2008-tagging/data/images/gimp-devel-logo.png
      - copied unchanged from r27242, /trunk/data/images/gimp-devel-logo.png
   branches/soc-2008-tagging/plug-ins/common/file-compressor.c
      - copied unchanged from r27242, /trunk/plug-ins/common/file-compressor.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-eval.c
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-eval.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-eval.h
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-eval.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-regex.c
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-regex.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-regex.h
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-regex.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-script.c
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-script.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-script.h
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-script.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-utils.c
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-utils.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-utils.h
      - copied unchanged from r27242, /trunk/plug-ins/script-fu/script-fu-utils.h
   branches/soc-2008-tagging/po-libgimp/LINGUAS
      - copied unchanged from r27242, /trunk/po-libgimp/LINGUAS
   branches/soc-2008-tagging/po-libgimp/sr latin po
      - copied unchanged from r27242, /trunk/po-libgimp/sr latin po
   branches/soc-2008-tagging/po-plug-ins/LINGUAS
      - copied unchanged from r27242, /trunk/po-plug-ins/LINGUAS
   branches/soc-2008-tagging/po-plug-ins/sr latin po
      - copied unchanged from r27242, /trunk/po-plug-ins/sr latin po
   branches/soc-2008-tagging/po-python/LINGUAS
      - copied unchanged from r27242, /trunk/po-python/LINGUAS
   branches/soc-2008-tagging/po-python/sr latin po
      - copied unchanged from r27242, /trunk/po-python/sr latin po
   branches/soc-2008-tagging/po-script-fu/LINGUAS
      - copied unchanged from r27242, /trunk/po-script-fu/LINGUAS
   branches/soc-2008-tagging/po-script-fu/sr latin po
      - copied unchanged from r27242, /trunk/po-script-fu/sr latin po
   branches/soc-2008-tagging/po-tips/LINGUAS
      - copied unchanged from r27242, /trunk/po-tips/LINGUAS
   branches/soc-2008-tagging/po-tips/sr latin po
      - copied unchanged from r27242, /trunk/po-tips/sr latin po
   branches/soc-2008-tagging/po/LINGUAS
      - copied unchanged from r27242, /trunk/po/LINGUAS
   branches/soc-2008-tagging/po/sr latin po
      - copied unchanged from r27242, /trunk/po/sr latin po
   branches/soc-2008-tagging/po/zh_HK.po
      - copied unchanged from r27242, /trunk/po/zh_HK.po
Removed:
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimphruler.sgml
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpvruler.sgml
   branches/soc-2008-tagging/libgimpwidgets/gimphruler.c
   branches/soc-2008-tagging/libgimpwidgets/gimphruler.h
   branches/soc-2008-tagging/libgimpwidgets/gimpvruler.c
   branches/soc-2008-tagging/libgimpwidgets/gimpvruler.h
   branches/soc-2008-tagging/plug-ins/common/compressor.c
   branches/soc-2008-tagging/plug-ins/script-fu/re/
   branches/soc-2008-tagging/po-libgimp/sr Latn po
   branches/soc-2008-tagging/po-libgimp/tt.po
   branches/soc-2008-tagging/po-plug-ins/eo.po
   branches/soc-2008-tagging/po-plug-ins/sr Latn po
   branches/soc-2008-tagging/po-plug-ins/tt.po
   branches/soc-2008-tagging/po-python/he.po
   branches/soc-2008-tagging/po-python/id.po
   branches/soc-2008-tagging/po-python/sr Latn po
   branches/soc-2008-tagging/po-python/tt.po
   branches/soc-2008-tagging/po-python/yi.po
   branches/soc-2008-tagging/po-script-fu/sr Latn po
   branches/soc-2008-tagging/po-script-fu/tt.po
   branches/soc-2008-tagging/po-tips/el.po
   branches/soc-2008-tagging/po-tips/ga.po
   branches/soc-2008-tagging/po-tips/id.po
   branches/soc-2008-tagging/po-tips/oc.po
   branches/soc-2008-tagging/po-tips/sr Latn po
   branches/soc-2008-tagging/po-tips/tr.po
   branches/soc-2008-tagging/po-tips/tt.po
   branches/soc-2008-tagging/po-tips/xh.po
   branches/soc-2008-tagging/po-tips/yi.po
   branches/soc-2008-tagging/po/sr Latn po
Modified:
   branches/soc-2008-tagging/AUTHORS
   branches/soc-2008-tagging/ChangeLog
   branches/soc-2008-tagging/INSTALL
   branches/soc-2008-tagging/Makefile.am
   branches/soc-2008-tagging/NEWS
   branches/soc-2008-tagging/README
   branches/soc-2008-tagging/README.i18n
   branches/soc-2008-tagging/app/   (props changed)
   branches/soc-2008-tagging/app/Makefile.am
   branches/soc-2008-tagging/app/actions/Makefile.am
   branches/soc-2008-tagging/app/actions/actions.c
   branches/soc-2008-tagging/app/actions/buffers-commands.c
   branches/soc-2008-tagging/app/actions/channels-actions.c
   branches/soc-2008-tagging/app/actions/channels-commands.c
   branches/soc-2008-tagging/app/actions/colormap-actions.c
   branches/soc-2008-tagging/app/actions/colormap-commands.c
   branches/soc-2008-tagging/app/actions/context-actions.c
   branches/soc-2008-tagging/app/actions/context-commands.c
   branches/soc-2008-tagging/app/actions/debug-actions.c
   branches/soc-2008-tagging/app/actions/dialogs-actions.c
   branches/soc-2008-tagging/app/actions/documents-actions.c
   branches/soc-2008-tagging/app/actions/drawable-actions.c
   branches/soc-2008-tagging/app/actions/drawable-commands.c
   branches/soc-2008-tagging/app/actions/edit-actions.c
   branches/soc-2008-tagging/app/actions/edit-commands.c
   branches/soc-2008-tagging/app/actions/file-actions.c
   branches/soc-2008-tagging/app/actions/file-commands.c
   branches/soc-2008-tagging/app/actions/image-actions.c
   branches/soc-2008-tagging/app/actions/image-commands.c
   branches/soc-2008-tagging/app/actions/images-actions.c
   branches/soc-2008-tagging/app/actions/images-commands.c
   branches/soc-2008-tagging/app/actions/layers-actions.c
   branches/soc-2008-tagging/app/actions/layers-commands.c
   branches/soc-2008-tagging/app/actions/makefile.msc
   branches/soc-2008-tagging/app/actions/plug-in-actions.c
   branches/soc-2008-tagging/app/actions/plug-in-commands.c
   branches/soc-2008-tagging/app/actions/quick-mask-actions.c
   branches/soc-2008-tagging/app/actions/quick-mask-commands.c
   branches/soc-2008-tagging/app/actions/select-actions.c
   branches/soc-2008-tagging/app/actions/select-commands.c
   branches/soc-2008-tagging/app/actions/vectors-actions.c
   branches/soc-2008-tagging/app/actions/vectors-commands.c
   branches/soc-2008-tagging/app/actions/view-actions.c
   branches/soc-2008-tagging/app/actions/view-commands.c
   branches/soc-2008-tagging/app/actions/view-commands.h
   branches/soc-2008-tagging/app/actions/window-actions.c
   branches/soc-2008-tagging/app/actions/windows-actions.c
   branches/soc-2008-tagging/app/base/Makefile.am
   branches/soc-2008-tagging/app/base/base-utils.c
   branches/soc-2008-tagging/app/base/base-utils.h
   branches/soc-2008-tagging/app/base/colorize.c
   branches/soc-2008-tagging/app/base/makefile.msc
   branches/soc-2008-tagging/app/base/pixel-surround.c
   branches/soc-2008-tagging/app/base/pixel-surround.h
   branches/soc-2008-tagging/app/base/tile-cache.c
   branches/soc-2008-tagging/app/base/tile-manager-crop.c
   branches/soc-2008-tagging/app/base/tile-manager.c
   branches/soc-2008-tagging/app/base/tile-private.h
   branches/soc-2008-tagging/app/base/tile.c
   branches/soc-2008-tagging/app/composite/make-installer.py
   branches/soc-2008-tagging/app/composite/ns.py
   branches/soc-2008-tagging/app/config/Makefile.am
   branches/soc-2008-tagging/app/config/gimpbaseconfig.c
   branches/soc-2008-tagging/app/config/gimpcoreconfig.c
   branches/soc-2008-tagging/app/config/gimpguiconfig.c
   branches/soc-2008-tagging/app/config/gimpguiconfig.h
   branches/soc-2008-tagging/app/config/gimprc-blurbs.h
   branches/soc-2008-tagging/app/config/gimprc-deserialize.c
   branches/soc-2008-tagging/app/config/makefile.msc
   branches/soc-2008-tagging/app/core/Makefile.am
   branches/soc-2008-tagging/app/core/core-types.h
   branches/soc-2008-tagging/app/core/gimp-edit.c
   branches/soc-2008-tagging/app/core/gimp-gui.c
   branches/soc-2008-tagging/app/core/gimp-modules.c
   branches/soc-2008-tagging/app/core/gimp-transform-region.c
   branches/soc-2008-tagging/app/core/gimp-user-install.c
   branches/soc-2008-tagging/app/core/gimp.c
   branches/soc-2008-tagging/app/core/gimp.h
   branches/soc-2008-tagging/app/core/gimpbrush.c
   branches/soc-2008-tagging/app/core/gimpbrushclipboard.c
   branches/soc-2008-tagging/app/core/gimpbrushgenerated.c
   branches/soc-2008-tagging/app/core/gimpchannel-combine.c
   branches/soc-2008-tagging/app/core/gimpchannel-select.c
   branches/soc-2008-tagging/app/core/gimpchannel.c
   branches/soc-2008-tagging/app/core/gimpchannel.h
   branches/soc-2008-tagging/app/core/gimpchannelpropundo.c
   branches/soc-2008-tagging/app/core/gimpchannelundo.c
   branches/soc-2008-tagging/app/core/gimpcontainer.c
   branches/soc-2008-tagging/app/core/gimpcontext.c
   branches/soc-2008-tagging/app/core/gimpcurve.c
   branches/soc-2008-tagging/app/core/gimpdata.h
   branches/soc-2008-tagging/app/core/gimpdrawable-blend.c
   branches/soc-2008-tagging/app/core/gimpdrawable-bucket-fill.c
   branches/soc-2008-tagging/app/core/gimpdrawable-colorize.c
   branches/soc-2008-tagging/app/core/gimpdrawable-combine.c
   branches/soc-2008-tagging/app/core/gimpdrawable-convert.c
   branches/soc-2008-tagging/app/core/gimpdrawable-equalize.c
   branches/soc-2008-tagging/app/core/gimpdrawable-foreground-extract.c
   branches/soc-2008-tagging/app/core/gimpdrawable-histogram.c
   branches/soc-2008-tagging/app/core/gimpdrawable-offset.c
   branches/soc-2008-tagging/app/core/gimpdrawable-preview.c
   branches/soc-2008-tagging/app/core/gimpdrawable-process.c
   branches/soc-2008-tagging/app/core/gimpdrawable-shadow.c
   branches/soc-2008-tagging/app/core/gimpdrawable-stroke.c
   branches/soc-2008-tagging/app/core/gimpdrawable-transform.c
   branches/soc-2008-tagging/app/core/gimpdrawable.c
   branches/soc-2008-tagging/app/core/gimpdrawable.h
   branches/soc-2008-tagging/app/core/gimpdrawablemodundo.c
   branches/soc-2008-tagging/app/core/gimpdrawableundo.c
   branches/soc-2008-tagging/app/core/gimpfloatingselundo.c
   branches/soc-2008-tagging/app/core/gimpgradient.c
   branches/soc-2008-tagging/app/core/gimpguideundo.c
   branches/soc-2008-tagging/app/core/gimpimage-arrange.c
   branches/soc-2008-tagging/app/core/gimpimage-colorhash.c
   branches/soc-2008-tagging/app/core/gimpimage-colormap.c
   branches/soc-2008-tagging/app/core/gimpimage-contiguous-region.c
   branches/soc-2008-tagging/app/core/gimpimage-convert.c
   branches/soc-2008-tagging/app/core/gimpimage-crop.c
   branches/soc-2008-tagging/app/core/gimpimage-duplicate.c
   branches/soc-2008-tagging/app/core/gimpimage-flip.c
   branches/soc-2008-tagging/app/core/gimpimage-grid.c
   branches/soc-2008-tagging/app/core/gimpimage-guides.c
   branches/soc-2008-tagging/app/core/gimpimage-item-list.c
   branches/soc-2008-tagging/app/core/gimpimage-merge.c
   branches/soc-2008-tagging/app/core/gimpimage-new.c
   branches/soc-2008-tagging/app/core/gimpimage-pick-color.c
   branches/soc-2008-tagging/app/core/gimpimage-preview.c
   branches/soc-2008-tagging/app/core/gimpimage-quick-mask.c
   branches/soc-2008-tagging/app/core/gimpimage-resize.c
   branches/soc-2008-tagging/app/core/gimpimage-rotate.c
   branches/soc-2008-tagging/app/core/gimpimage-sample-points.c
   branches/soc-2008-tagging/app/core/gimpimage-scale.c
   branches/soc-2008-tagging/app/core/gimpimage-snap.c
   branches/soc-2008-tagging/app/core/gimpimage-undo-push.c
   branches/soc-2008-tagging/app/core/gimpimage-undo-push.h
   branches/soc-2008-tagging/app/core/gimpimage-undo.c
   branches/soc-2008-tagging/app/core/gimpimage.c
   branches/soc-2008-tagging/app/core/gimpimage.h
   branches/soc-2008-tagging/app/core/gimpimagefile.c
   branches/soc-2008-tagging/app/core/gimpimagemap.c
   branches/soc-2008-tagging/app/core/gimpimageundo.c
   branches/soc-2008-tagging/app/core/gimpimageundo.h
   branches/soc-2008-tagging/app/core/gimpitem-linked.c
   branches/soc-2008-tagging/app/core/gimpitem-preview.c
   branches/soc-2008-tagging/app/core/gimpitem.c
   branches/soc-2008-tagging/app/core/gimpitemundo.c
   branches/soc-2008-tagging/app/core/gimplayer-floating-sel.c
   branches/soc-2008-tagging/app/core/gimplayer.c
   branches/soc-2008-tagging/app/core/gimplayer.h
   branches/soc-2008-tagging/app/core/gimplayermask.c
   branches/soc-2008-tagging/app/core/gimplayermaskpropundo.c
   branches/soc-2008-tagging/app/core/gimplayermaskundo.c
   branches/soc-2008-tagging/app/core/gimplayerpropundo.c
   branches/soc-2008-tagging/app/core/gimplayerundo.c
   branches/soc-2008-tagging/app/core/gimplist.c
   branches/soc-2008-tagging/app/core/gimpmarshal.list
   branches/soc-2008-tagging/app/core/gimpmaskundo.c
   branches/soc-2008-tagging/app/core/gimppalette-import.c
   branches/soc-2008-tagging/app/core/gimppalette-load.c
   branches/soc-2008-tagging/app/core/gimppalette.c
   branches/soc-2008-tagging/app/core/gimpparamspecs.c
   branches/soc-2008-tagging/app/core/gimppattern.c
   branches/soc-2008-tagging/app/core/gimppatternclipboard.c
   branches/soc-2008-tagging/app/core/gimppickable.c
   branches/soc-2008-tagging/app/core/gimpprojection-construct.c
   branches/soc-2008-tagging/app/core/gimpprojection.c
   branches/soc-2008-tagging/app/core/gimpprojection.h
   branches/soc-2008-tagging/app/core/gimpsamplepointundo.c
   branches/soc-2008-tagging/app/core/gimpselection.c
   branches/soc-2008-tagging/app/core/gimptemplate.c
   branches/soc-2008-tagging/app/core/gimptemplate.h
   branches/soc-2008-tagging/app/core/gimpundo.c
   branches/soc-2008-tagging/app/core/gimpundo.h
   branches/soc-2008-tagging/app/core/gimpundostack.c
   branches/soc-2008-tagging/app/core/makefile.msc
   branches/soc-2008-tagging/app/dialogs/Makefile.am
   branches/soc-2008-tagging/app/dialogs/about-dialog.c
   branches/soc-2008-tagging/app/dialogs/authors.xsl
   branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c
   branches/soc-2008-tagging/app/dialogs/convert-dialog.c
   branches/soc-2008-tagging/app/dialogs/dialogs-constructors.c
   branches/soc-2008-tagging/app/dialogs/dialogs.c
   branches/soc-2008-tagging/app/dialogs/fade-dialog.c
   branches/soc-2008-tagging/app/dialogs/file-open-dialog.c
   branches/soc-2008-tagging/app/dialogs/file-save-dialog.c
   branches/soc-2008-tagging/app/dialogs/grid-dialog.c
   branches/soc-2008-tagging/app/dialogs/image-merge-layers-dialog.c
   branches/soc-2008-tagging/app/dialogs/image-new-dialog.c
   branches/soc-2008-tagging/app/dialogs/image-properties-dialog.c
   branches/soc-2008-tagging/app/dialogs/image-scale-dialog.c
   branches/soc-2008-tagging/app/dialogs/keyboard-shortcuts-dialog.c
   branches/soc-2008-tagging/app/dialogs/layer-add-mask-dialog.c
   branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c
   branches/soc-2008-tagging/app/dialogs/makefile.msc
   branches/soc-2008-tagging/app/dialogs/offset-dialog.c
   branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c
   branches/soc-2008-tagging/app/dialogs/print-size-dialog.c
   branches/soc-2008-tagging/app/dialogs/resize-dialog.c
   branches/soc-2008-tagging/app/dialogs/resolution-calibrate-dialog.c
   branches/soc-2008-tagging/app/dialogs/scale-dialog.c
   branches/soc-2008-tagging/app/dialogs/stroke-dialog.c
   branches/soc-2008-tagging/app/dialogs/tips-dialog.c
   branches/soc-2008-tagging/app/dialogs/vectors-export-dialog.c
   branches/soc-2008-tagging/app/dialogs/vectors-import-dialog.c
   branches/soc-2008-tagging/app/dialogs/vectors-options-dialog.c
   branches/soc-2008-tagging/app/display/Makefile.am
   branches/soc-2008-tagging/app/display/display-enums.c
   branches/soc-2008-tagging/app/display/display-enums.h
   branches/soc-2008-tagging/app/display/gimpcanvas.c
   branches/soc-2008-tagging/app/display/gimpcanvas.h
   branches/soc-2008-tagging/app/display/gimpdisplay-foreach.c
   branches/soc-2008-tagging/app/display/gimpdisplay-handlers.c
   branches/soc-2008-tagging/app/display/gimpdisplay.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.h
   branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.h
   branches/soc-2008-tagging/app/display/gimpdisplayshell-dnd.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-filter-dialog.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-handlers.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-icon.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-layer-select.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-preview.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scale-dialog.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h
   branches/soc-2008-tagging/app/display/gimpdisplayshell-selection.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-title.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell.c
   branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
   branches/soc-2008-tagging/app/display/gimpstatusbar.c
   branches/soc-2008-tagging/app/display/gimpstatusbar.h
   branches/soc-2008-tagging/app/display/makefile.msc
   branches/soc-2008-tagging/app/file/Makefile.am
   branches/soc-2008-tagging/app/file/file-open.c
   branches/soc-2008-tagging/app/file/file-save.c
   branches/soc-2008-tagging/app/file/file-utils.c
   branches/soc-2008-tagging/app/gegl/Makefile.am
   branches/soc-2008-tagging/app/gegl/gegl-types.h
   branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.c
   branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.h
   branches/soc-2008-tagging/app/gegl/gimp-gegl.c
   branches/soc-2008-tagging/app/gegl/gimpbrightnesscontrastconfig.c
   branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c
   branches/soc-2008-tagging/app/gegl/gimplevelsconfig.c
   branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c
   branches/soc-2008-tagging/app/gegl/gimpoperationpointfilter.c
   branches/soc-2008-tagging/app/gegl/makefile.msc
   branches/soc-2008-tagging/app/gimp-log.c
   branches/soc-2008-tagging/app/gimp-log.h
   branches/soc-2008-tagging/app/gimpcore.def
   branches/soc-2008-tagging/app/gui/Makefile.am
   branches/soc-2008-tagging/app/gui/gimpdbusservice.c
   branches/soc-2008-tagging/app/gui/gui-unique.c
   branches/soc-2008-tagging/app/gui/gui-vtable.c
   branches/soc-2008-tagging/app/gui/gui.c
   branches/soc-2008-tagging/app/gui/makefile.msc
   branches/soc-2008-tagging/app/gui/splash.c
   branches/soc-2008-tagging/app/makefile.msc
   branches/soc-2008-tagging/app/menus/Makefile.am
   branches/soc-2008-tagging/app/menus/makefile.msc
   branches/soc-2008-tagging/app/menus/menus.c
   branches/soc-2008-tagging/app/menus/windows-menu.c
   branches/soc-2008-tagging/app/paint-funcs/Makefile.am
   branches/soc-2008-tagging/app/paint-funcs/paint-funcs.c
   branches/soc-2008-tagging/app/paint-funcs/paint-funcs.h
   branches/soc-2008-tagging/app/paint-funcs/scale-region.c
   branches/soc-2008-tagging/app/paint/Makefile.am
   branches/soc-2008-tagging/app/paint/gimpairbrush.c
   branches/soc-2008-tagging/app/paint/gimpbrushcore.c
   branches/soc-2008-tagging/app/paint/gimpclone.c
   branches/soc-2008-tagging/app/paint/gimpconvolve.c
   branches/soc-2008-tagging/app/paint/gimpdodgeburn.c
   branches/soc-2008-tagging/app/paint/gimperaser.c
   branches/soc-2008-tagging/app/paint/gimpheal.c
   branches/soc-2008-tagging/app/paint/gimpink.c
   branches/soc-2008-tagging/app/paint/gimpinkoptions.c
   branches/soc-2008-tagging/app/paint/gimppaintbrush.c
   branches/soc-2008-tagging/app/paint/gimppaintcore-stroke.c
   branches/soc-2008-tagging/app/paint/gimppaintcore.c
   branches/soc-2008-tagging/app/paint/gimppaintoptions.c
   branches/soc-2008-tagging/app/paint/gimpperspectiveclone.c
   branches/soc-2008-tagging/app/paint/gimpperspectiveclone.h
   branches/soc-2008-tagging/app/paint/gimpsmudge.c
   branches/soc-2008-tagging/app/paint/gimpsourcecore.c
   branches/soc-2008-tagging/app/pdb/Makefile.am
   branches/soc-2008-tagging/app/pdb/brush-cmds.c
   branches/soc-2008-tagging/app/pdb/brush-select-cmds.c
   branches/soc-2008-tagging/app/pdb/brushes-cmds.c
   branches/soc-2008-tagging/app/pdb/buffer-cmds.c
   branches/soc-2008-tagging/app/pdb/channel-cmds.c
   branches/soc-2008-tagging/app/pdb/color-cmds.c
   branches/soc-2008-tagging/app/pdb/context-cmds.c
   branches/soc-2008-tagging/app/pdb/convert-cmds.c
   branches/soc-2008-tagging/app/pdb/display-cmds.c
   branches/soc-2008-tagging/app/pdb/drawable-cmds.c
   branches/soc-2008-tagging/app/pdb/drawable-transform-cmds.c
   branches/soc-2008-tagging/app/pdb/edit-cmds.c
   branches/soc-2008-tagging/app/pdb/fileops-cmds.c
   branches/soc-2008-tagging/app/pdb/floating-sel-cmds.c
   branches/soc-2008-tagging/app/pdb/font-select-cmds.c
   branches/soc-2008-tagging/app/pdb/fonts-cmds.c
   branches/soc-2008-tagging/app/pdb/gimppdb-utils.c
   branches/soc-2008-tagging/app/pdb/gimppdb-utils.h
   branches/soc-2008-tagging/app/pdb/gimpprocedure.c
   branches/soc-2008-tagging/app/pdb/gimpprocedure.h
   branches/soc-2008-tagging/app/pdb/gimprc-cmds.c
   branches/soc-2008-tagging/app/pdb/gradient-cmds.c
   branches/soc-2008-tagging/app/pdb/gradient-select-cmds.c
   branches/soc-2008-tagging/app/pdb/gradients-cmds.c
   branches/soc-2008-tagging/app/pdb/grid-cmds.c
   branches/soc-2008-tagging/app/pdb/guides-cmds.c
   branches/soc-2008-tagging/app/pdb/help-cmds.c
   branches/soc-2008-tagging/app/pdb/image-cmds.c
   branches/soc-2008-tagging/app/pdb/internal-procs.c
   branches/soc-2008-tagging/app/pdb/layer-cmds.c
   branches/soc-2008-tagging/app/pdb/makefile.msc
   branches/soc-2008-tagging/app/pdb/message-cmds.c
   branches/soc-2008-tagging/app/pdb/misc-cmds.c
   branches/soc-2008-tagging/app/pdb/paint-tools-cmds.c
   branches/soc-2008-tagging/app/pdb/palette-cmds.c
   branches/soc-2008-tagging/app/pdb/palette-select-cmds.c
   branches/soc-2008-tagging/app/pdb/palettes-cmds.c
   branches/soc-2008-tagging/app/pdb/parasite-cmds.c
   branches/soc-2008-tagging/app/pdb/paths-cmds.c
   branches/soc-2008-tagging/app/pdb/pattern-cmds.c
   branches/soc-2008-tagging/app/pdb/pattern-select-cmds.c
   branches/soc-2008-tagging/app/pdb/patterns-cmds.c
   branches/soc-2008-tagging/app/pdb/plug-in-cmds.c
   branches/soc-2008-tagging/app/pdb/procedural-db-cmds.c
   branches/soc-2008-tagging/app/pdb/progress-cmds.c
   branches/soc-2008-tagging/app/pdb/selection-cmds.c
   branches/soc-2008-tagging/app/pdb/selection-tools-cmds.c
   branches/soc-2008-tagging/app/pdb/text-layer-cmds.c
   branches/soc-2008-tagging/app/pdb/text-tool-cmds.c
   branches/soc-2008-tagging/app/pdb/transform-tools-cmds.c
   branches/soc-2008-tagging/app/pdb/undo-cmds.c
   branches/soc-2008-tagging/app/pdb/unit-cmds.c
   branches/soc-2008-tagging/app/pdb/vectors-cmds.c
   branches/soc-2008-tagging/app/plug-in/Makefile.am
   branches/soc-2008-tagging/app/plug-in/gimpplugin-cleanup.c
   branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c
   branches/soc-2008-tagging/app/plug-in/gimpplugin.c
   branches/soc-2008-tagging/app/plug-in/gimpplugin.h
   branches/soc-2008-tagging/app/plug-in/gimpplugindebug.c
   branches/soc-2008-tagging/app/plug-in/gimpplugindebug.h
   branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c
   branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.c
   branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.h
   branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.c
   branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.h
   branches/soc-2008-tagging/app/plug-in/gimppluginshm.c
   branches/soc-2008-tagging/app/plug-in/gimptemporaryprocedure.c
   branches/soc-2008-tagging/app/plug-in/plug-in-icc-profile.c
   branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c
   branches/soc-2008-tagging/app/text/Makefile.am
   branches/soc-2008-tagging/app/text/gimptext-compat.c
   branches/soc-2008-tagging/app/text/gimptext-vectors.c
   branches/soc-2008-tagging/app/text/gimptextlayer-transform.c
   branches/soc-2008-tagging/app/text/gimptextlayer-xcf.c
   branches/soc-2008-tagging/app/text/gimptextlayer.c
   branches/soc-2008-tagging/app/text/gimptextlayout-render.c
   branches/soc-2008-tagging/app/text/gimptextlayout.c
   branches/soc-2008-tagging/app/text/gimptextundo.c
   branches/soc-2008-tagging/app/tools/Makefile.am
   branches/soc-2008-tagging/app/tools/gimpaligntool.c
   branches/soc-2008-tagging/app/tools/gimpblendtool.c
   branches/soc-2008-tagging/app/tools/gimpbrushtool.c
   branches/soc-2008-tagging/app/tools/gimpbucketfilltool.c
   branches/soc-2008-tagging/app/tools/gimpbycolorselecttool.c
   branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c
   branches/soc-2008-tagging/app/tools/gimpcolorpickertool.c
   branches/soc-2008-tagging/app/tools/gimpcolortool.c
   branches/soc-2008-tagging/app/tools/gimpcroptool.c
   branches/soc-2008-tagging/app/tools/gimpcurvestool.c
   branches/soc-2008-tagging/app/tools/gimpcurvestool.h
   branches/soc-2008-tagging/app/tools/gimpdrawtool.c
   branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c
   branches/soc-2008-tagging/app/tools/gimpellipseselecttool.c
   branches/soc-2008-tagging/app/tools/gimpfliptool.c
   branches/soc-2008-tagging/app/tools/gimpforegroundselecttool.c
   branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
   branches/soc-2008-tagging/app/tools/gimpfuzzyselecttool.c
   branches/soc-2008-tagging/app/tools/gimpgegltool.c
   branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c
   branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
   branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
   branches/soc-2008-tagging/app/tools/gimpiscissorstool.c
   branches/soc-2008-tagging/app/tools/gimplevelstool.c
   branches/soc-2008-tagging/app/tools/gimplevelstool.h
   branches/soc-2008-tagging/app/tools/gimpmagnifytool.c
   branches/soc-2008-tagging/app/tools/gimpmeasuretool.c
   branches/soc-2008-tagging/app/tools/gimpmovetool.c
   branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c
   branches/soc-2008-tagging/app/tools/gimppainttool.c
   branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.c
   branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.h
   branches/soc-2008-tagging/app/tools/gimpperspectivetool.c
   branches/soc-2008-tagging/app/tools/gimprectangleselecttool.c
   branches/soc-2008-tagging/app/tools/gimprectangletool.c
   branches/soc-2008-tagging/app/tools/gimpregionselecttool.c
   branches/soc-2008-tagging/app/tools/gimprotatetool.c
   branches/soc-2008-tagging/app/tools/gimpscaletool.c
   branches/soc-2008-tagging/app/tools/gimpselectiontool.c
   branches/soc-2008-tagging/app/tools/gimpsheartool.c
   branches/soc-2008-tagging/app/tools/gimpsourcetool.c
   branches/soc-2008-tagging/app/tools/gimptexttool.c
   branches/soc-2008-tagging/app/tools/gimptool.c
   branches/soc-2008-tagging/app/tools/gimptool.h
   branches/soc-2008-tagging/app/tools/gimptoolcontrol.c
   branches/soc-2008-tagging/app/tools/gimptoolcontrol.h
   branches/soc-2008-tagging/app/tools/gimptransformtool.c
   branches/soc-2008-tagging/app/tools/gimpvectortool.c
   branches/soc-2008-tagging/app/tools/makefile.msc
   branches/soc-2008-tagging/app/tools/tool_manager.c
   branches/soc-2008-tagging/app/vectors/Makefile.am
   branches/soc-2008-tagging/app/vectors/gimpanchor.c
   branches/soc-2008-tagging/app/vectors/gimpvectors-compat.c
   branches/soc-2008-tagging/app/vectors/gimpvectors-export.c
   branches/soc-2008-tagging/app/vectors/gimpvectors-import.c
   branches/soc-2008-tagging/app/vectors/gimpvectors-preview.c
   branches/soc-2008-tagging/app/vectors/gimpvectors.c
   branches/soc-2008-tagging/app/vectors/gimpvectorspropundo.c
   branches/soc-2008-tagging/app/vectors/gimpvectorsundo.c
   branches/soc-2008-tagging/app/widgets/Makefile.am
   branches/soc-2008-tagging/app/widgets/gimpaction.c
   branches/soc-2008-tagging/app/widgets/gimpactionview.c
   branches/soc-2008-tagging/app/widgets/gimpactionview.h
   branches/soc-2008-tagging/app/widgets/gimpbufferview.c
   branches/soc-2008-tagging/app/widgets/gimpchanneltreeview.c
   branches/soc-2008-tagging/app/widgets/gimpcolorframe.c
   branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c
   branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c
   branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c
   branches/soc-2008-tagging/app/widgets/gimpcontrollereditor.c
   branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c
   branches/soc-2008-tagging/app/widgets/gimpcontrollerwheel.c
   branches/soc-2008-tagging/app/widgets/gimpcursorview.c
   branches/soc-2008-tagging/app/widgets/gimpdialogfactory.c
   branches/soc-2008-tagging/app/widgets/gimpdialogfactory.h
   branches/soc-2008-tagging/app/widgets/gimpdnd-xds.c
   branches/soc-2008-tagging/app/widgets/gimpdnd.c
   branches/soc-2008-tagging/app/widgets/gimpdock.c
   branches/soc-2008-tagging/app/widgets/gimpdockable.c
   branches/soc-2008-tagging/app/widgets/gimpdockseparator.c
   branches/soc-2008-tagging/app/widgets/gimpdockseparator.h
   branches/soc-2008-tagging/app/widgets/gimpdrawabletreeview.c
   branches/soc-2008-tagging/app/widgets/gimpfiledialog.c
   branches/soc-2008-tagging/app/widgets/gimpfiledialog.h
   branches/soc-2008-tagging/app/widgets/gimphelp-ids.h
   branches/soc-2008-tagging/app/widgets/gimphelp.c
   branches/soc-2008-tagging/app/widgets/gimphistogrameditor.c
   branches/soc-2008-tagging/app/widgets/gimpimagecommenteditor.c
   branches/soc-2008-tagging/app/widgets/gimpimageeditor.c
   branches/soc-2008-tagging/app/widgets/gimpimageparasiteview.c
   branches/soc-2008-tagging/app/widgets/gimpimageprofileview.c
   branches/soc-2008-tagging/app/widgets/gimpimagepropview.c
   branches/soc-2008-tagging/app/widgets/gimpimageview.c
   branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c
   branches/soc-2008-tagging/app/widgets/gimpitemtreeview.h
   branches/soc-2008-tagging/app/widgets/gimplayertreeview.c
   branches/soc-2008-tagging/app/widgets/gimpmenudock.c
   branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
   branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c
   branches/soc-2008-tagging/app/widgets/gimpradioaction.c
   branches/soc-2008-tagging/app/widgets/gimpsamplepointeditor.c
   branches/soc-2008-tagging/app/widgets/gimpselectiondata.c
   branches/soc-2008-tagging/app/widgets/gimpselectioneditor.c
   branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c
   branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h
   branches/soc-2008-tagging/app/widgets/gimpstringaction.c
   branches/soc-2008-tagging/app/widgets/gimptemplateview.c
   branches/soc-2008-tagging/app/widgets/gimptoggleaction.c
   branches/soc-2008-tagging/app/widgets/gimptoolbox-dnd.c
   branches/soc-2008-tagging/app/widgets/gimptoolbox-image-area.c
   branches/soc-2008-tagging/app/widgets/gimptoolbox.c
   branches/soc-2008-tagging/app/widgets/gimpuimanager.c
   branches/soc-2008-tagging/app/widgets/gimpundoeditor.c
   branches/soc-2008-tagging/app/widgets/gimpvectorstreeview.c
   branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c
   branches/soc-2008-tagging/app/widgets/gimpviewrenderer-utils.c
   branches/soc-2008-tagging/app/widgets/gimpviewrendererdrawable.c
   branches/soc-2008-tagging/app/widgets/gimpviewrendererimage.c
   branches/soc-2008-tagging/app/widgets/gimpviewrendererlayer.c
   branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c
   branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c
   branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.h
   branches/soc-2008-tagging/app/widgets/gtkscalebutton.c
   branches/soc-2008-tagging/app/widgets/makefile.msc
   branches/soc-2008-tagging/app/widgets/widgets-types.h
   branches/soc-2008-tagging/app/xcf/Makefile.am
   branches/soc-2008-tagging/app/xcf/xcf-load.c
   branches/soc-2008-tagging/app/xcf/xcf-save.c
   branches/soc-2008-tagging/app/xcf/xcf.c
   branches/soc-2008-tagging/authors.xml
   branches/soc-2008-tagging/configure.in
   branches/soc-2008-tagging/cursors/makefile.msc
   branches/soc-2008-tagging/data/images/Makefile.am
   branches/soc-2008-tagging/data/images/gimp-splash.png
   branches/soc-2008-tagging/devel-docs/ChangeLog
   branches/soc-2008-tagging/devel-docs/app/Makefile.am
   branches/soc-2008-tagging/devel-docs/app/app-sections.txt
   branches/soc-2008-tagging/devel-docs/app/app.types
   branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt
   branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimp.sgml
   branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpimage.sgml
   branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimplayer.sgml
   branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpplugin.sgml
   branches/soc-2008-tagging/devel-docs/libgimpbase/libgimpbase-sections.txt
   branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-docs.sgml
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets.types
   branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpruler.sgml
   branches/soc-2008-tagging/devel-docs/release-howto.txt
   branches/soc-2008-tagging/devel-docs/tools/shadow.c
   branches/soc-2008-tagging/docs/   (props changed)
   branches/soc-2008-tagging/docs/gimprc.5.in
   branches/soc-2008-tagging/etc/gimprc
   branches/soc-2008-tagging/gimpdefs.msc
   branches/soc-2008-tagging/libgimp/gimp.c
   branches/soc-2008-tagging/libgimp/gimp.def
   branches/soc-2008-tagging/libgimp/gimp.h
   branches/soc-2008-tagging/libgimp/gimpenums.c.tail
   branches/soc-2008-tagging/libgimp/gimpexport.c
   branches/soc-2008-tagging/libgimp/gimpimage.c
   branches/soc-2008-tagging/libgimp/gimpimage_pdb.c
   branches/soc-2008-tagging/libgimp/gimpimage_pdb.h
   branches/soc-2008-tagging/libgimp/gimplayer_pdb.c
   branches/soc-2008-tagging/libgimp/gimplayer_pdb.h
   branches/soc-2008-tagging/libgimp/gimpplugin_pdb.c
   branches/soc-2008-tagging/libgimp/gimpplugin_pdb.h
   branches/soc-2008-tagging/libgimp/gimpprocview.c
   branches/soc-2008-tagging/libgimp/gimpprocview.h
   branches/soc-2008-tagging/libgimp/gimpselection_pdb.c
   branches/soc-2008-tagging/libgimp/gimpzoompreview.c
   branches/soc-2008-tagging/libgimp/makefile.msc
   branches/soc-2008-tagging/libgimpbase/gimpbase.def
   branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c
   branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h
   branches/soc-2008-tagging/libgimpbase/gimpbasetypes.h
   branches/soc-2008-tagging/libgimpbase/gimpreloc.c
   branches/soc-2008-tagging/libgimpbase/makefile.msc
   branches/soc-2008-tagging/libgimpconfig/gimpconfig-utils.c
   branches/soc-2008-tagging/libgimpwidgets/Makefile.am
   branches/soc-2008-tagging/libgimpwidgets/gimpbutton.c
   branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c
   branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c
   branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c
   branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c
   branches/soc-2008-tagging/libgimpwidgets/gimpruler.c
   branches/soc-2008-tagging/libgimpwidgets/gimpruler.h
   branches/soc-2008-tagging/libgimpwidgets/gimpscaleentry.c
   branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c
   branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.h
   branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.c
   branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.def
   branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.h
   branches/soc-2008-tagging/libgimpwidgets/makefile.msc
   branches/soc-2008-tagging/makefile.msc
   branches/soc-2008-tagging/menus/Makefile.am
   branches/soc-2008-tagging/menus/image-menu.xml.in
   branches/soc-2008-tagging/menus/makefile.msc
   branches/soc-2008-tagging/modules/color-selector-water.c
   branches/soc-2008-tagging/modules/color-selector-wheel.c
   branches/soc-2008-tagging/modules/makefile.msc
   branches/soc-2008-tagging/plug-ins/Makefile.am
   branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c
   branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.h
   branches/soc-2008-tagging/plug-ins/common/   (props changed)
   branches/soc-2008-tagging/plug-ins/common/Makefile.am
   branches/soc-2008-tagging/plug-ins/common/align-layers.c
   branches/soc-2008-tagging/plug-ins/common/animation-play.c
   branches/soc-2008-tagging/plug-ins/common/blur-gauss.c
   branches/soc-2008-tagging/plug-ins/common/blur-motion.c
   branches/soc-2008-tagging/plug-ins/common/cartoon.c
   branches/soc-2008-tagging/plug-ins/common/curve-bend.c
   branches/soc-2008-tagging/plug-ins/common/displace.c
   branches/soc-2008-tagging/plug-ins/common/edge-dog.c
   branches/soc-2008-tagging/plug-ins/common/edge-neon.c
   branches/soc-2008-tagging/plug-ins/common/edge-sobel.c
   branches/soc-2008-tagging/plug-ins/common/file-cel.c
   branches/soc-2008-tagging/plug-ins/common/file-csource.c
   branches/soc-2008-tagging/plug-ins/common/file-dicom.c
   branches/soc-2008-tagging/plug-ins/common/file-gbr.c
   branches/soc-2008-tagging/plug-ins/common/file-gif-load.c
   branches/soc-2008-tagging/plug-ins/common/file-gif-save.c
   branches/soc-2008-tagging/plug-ins/common/file-gih.c
   branches/soc-2008-tagging/plug-ins/common/file-header.c
   branches/soc-2008-tagging/plug-ins/common/file-html-table.c
   branches/soc-2008-tagging/plug-ins/common/file-mng.c
   branches/soc-2008-tagging/plug-ins/common/file-pat.c
   branches/soc-2008-tagging/plug-ins/common/file-pcx.c
   branches/soc-2008-tagging/plug-ins/common/file-pdf.c
   branches/soc-2008-tagging/plug-ins/common/file-pix.c
   branches/soc-2008-tagging/plug-ins/common/file-png.c
   branches/soc-2008-tagging/plug-ins/common/file-pnm.c
   branches/soc-2008-tagging/plug-ins/common/file-ps.c
   branches/soc-2008-tagging/plug-ins/common/file-psp.c
   branches/soc-2008-tagging/plug-ins/common/file-raw.c
   branches/soc-2008-tagging/plug-ins/common/file-sunras.c
   branches/soc-2008-tagging/plug-ins/common/file-svg.c
   branches/soc-2008-tagging/plug-ins/common/file-tga.c
   branches/soc-2008-tagging/plug-ins/common/file-tiff-load.c
   branches/soc-2008-tagging/plug-ins/common/file-tiff-save.c
   branches/soc-2008-tagging/plug-ins/common/file-wmf.c
   branches/soc-2008-tagging/plug-ins/common/file-xbm.c
   branches/soc-2008-tagging/plug-ins/common/file-xpm.c
   branches/soc-2008-tagging/plug-ins/common/file-xwd.c
   branches/soc-2008-tagging/plug-ins/common/filter-pack.c
   branches/soc-2008-tagging/plug-ins/common/guillotine.c
   branches/soc-2008-tagging/plug-ins/common/hot.c
   branches/soc-2008-tagging/plug-ins/common/lcms.c
   branches/soc-2008-tagging/plug-ins/common/mail.c
   branches/soc-2008-tagging/plug-ins/common/nova.c
   branches/soc-2008-tagging/plug-ins/common/photocopy.c
   branches/soc-2008-tagging/plug-ins/common/pixelize.c
   branches/soc-2008-tagging/plug-ins/common/plugin-defs.pl
   branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
   branches/soc-2008-tagging/plug-ins/common/screenshot.c
   branches/soc-2008-tagging/plug-ins/common/softglow.c
   branches/soc-2008-tagging/plug-ins/common/web-browser.c
   branches/soc-2008-tagging/plug-ins/file-bmp/bmp-read.c
   branches/soc-2008-tagging/plug-ins/file-bmp/bmp-write.c
   branches/soc-2008-tagging/plug-ins/file-bmp/bmp.c
   branches/soc-2008-tagging/plug-ins/file-bmp/bmp.h
   branches/soc-2008-tagging/plug-ins/file-faxg3/faxg3.c
   branches/soc-2008-tagging/plug-ins/file-fits/fits-io.c
   branches/soc-2008-tagging/plug-ins/file-fits/fits-io.h
   branches/soc-2008-tagging/plug-ins/file-fits/fits.c
   branches/soc-2008-tagging/plug-ins/file-fli/fli-gimp.c
   branches/soc-2008-tagging/plug-ins/file-ico/ico-load.c
   branches/soc-2008-tagging/plug-ins/file-ico/ico-load.h
   branches/soc-2008-tagging/plug-ins/file-ico/ico-save.c
   branches/soc-2008-tagging/plug-ins/file-ico/ico-save.h
   branches/soc-2008-tagging/plug-ins/file-ico/ico.c
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.c
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.h
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.c
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.h
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.c
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.h
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.c
   branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.h
   branches/soc-2008-tagging/plug-ins/file-psd/psd-load.c
   branches/soc-2008-tagging/plug-ins/file-psd/psd-load.h
   branches/soc-2008-tagging/plug-ins/file-psd/psd-save.c
   branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.c
   branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.h
   branches/soc-2008-tagging/plug-ins/file-psd/psd.c
   branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.c
   branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.h
   branches/soc-2008-tagging/plug-ins/file-sgi/sgi.c
   branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gnomevfs.c
   branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gvfs.c
   branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-libcurl.c
   branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-wget.c
   branches/soc-2008-tagging/plug-ins/file-uri/uri.c
   branches/soc-2008-tagging/plug-ins/file-xjt/xjt.c
   branches/soc-2008-tagging/plug-ins/flame/rect.c
   branches/soc-2008-tagging/plug-ins/gfig/gfig-dobject.h
   branches/soc-2008-tagging/plug-ins/gfig/gfig-preview.c
   branches/soc-2008-tagging/plug-ins/gfig/gfig-style.c
   branches/soc-2008-tagging/plug-ins/gimpressionist/gimpressionist.h
   branches/soc-2008-tagging/plug-ins/gimpressionist/presets.c
   branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c
   branches/soc-2008-tagging/plug-ins/gradient-flare/gradient-flare.c
   branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
   branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose-storage.c
   branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_lex.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_parse.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_lex.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_parse.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.h
   branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_lex.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_parse.c
   branches/soc-2008-tagging/plug-ins/imagemap/imap_object.h
   branches/soc-2008-tagging/plug-ins/imagemap/imap_preview.c
   branches/soc-2008-tagging/plug-ins/lighting/lighting-ui.c
   branches/soc-2008-tagging/plug-ins/makefile.msc
   branches/soc-2008-tagging/plug-ins/map-object/map-object-ui.c
   branches/soc-2008-tagging/plug-ins/print/print-draw-page.c
   branches/soc-2008-tagging/plug-ins/print/print.c
   branches/soc-2008-tagging/plug-ins/pygimp/gimpfu.py
   branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c
   branches/soc-2008-tagging/plug-ins/pygimp/gimpshelf.py
   branches/soc-2008-tagging/plug-ins/pygimp/gimpthumbmodule.c
   branches/soc-2008-tagging/plug-ins/pygimp/gimpui.defs
   branches/soc-2008-tagging/plug-ins/pygimp/gimpui.override
   branches/soc-2008-tagging/plug-ins/pygimp/gimpui.py
   branches/soc-2008-tagging/plug-ins/pygimp/gimpuimodule.c
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/foggify.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-offset.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-sort.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-to-gradient.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/py-slice.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/pyconsole.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-console.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-eval.py
   branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/whirlpinch.py
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h
   branches/soc-2008-tagging/plug-ins/script-fu/Makefile.am
   branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c
   branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-server.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.c
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu-types.h
   branches/soc-2008-tagging/plug-ins/script-fu/script-fu.c
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/3d-outline.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/3dTruchet.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/add-bevel.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-arrow.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bar.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bullet.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-button.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-neon-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic1-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic2-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-button.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-button.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-heading.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/blended-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/bovinated-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/camo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/carved-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/chalk.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/chip-away.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/chrome-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/comic-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/coolmetal-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/crystal-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/flatland.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/frosty-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-headers.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-labels.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/glossy.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/glowing-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/gradient-bevel-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/i26-gunya2.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/land.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/neon-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/news-text.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/pupi-button.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/rendermap.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/sota-chrome-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/speed-text.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/starscape-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirltile.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirly-pattern.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/t-o-p-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/text-circle.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/textured-logo.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/title-header.scm
   branches/soc-2008-tagging/plug-ins/script-fu/scripts/truchet.scm
   branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/CHANGES
   branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/dynload.c
   branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.c
   branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.h
   branches/soc-2008-tagging/plug-ins/twain/Makefile.am
   branches/soc-2008-tagging/plug-ins/twain/tw_func.c
   branches/soc-2008-tagging/plug-ins/twain/tw_util.c
   branches/soc-2008-tagging/plug-ins/twain/tw_win.c
   branches/soc-2008-tagging/plug-ins/twain/twain.c
   branches/soc-2008-tagging/plug-ins/twain/twain.h
   branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c
   branches/soc-2008-tagging/po-libgimp/ChangeLog
   branches/soc-2008-tagging/po-libgimp/POTFILES.skip
   branches/soc-2008-tagging/po-libgimp/be.po
   branches/soc-2008-tagging/po-libgimp/ca.po
   branches/soc-2008-tagging/po-libgimp/et.po
   branches/soc-2008-tagging/po-libgimp/eu.po
   branches/soc-2008-tagging/po-libgimp/fi.po
   branches/soc-2008-tagging/po-libgimp/fr.po
   branches/soc-2008-tagging/po-libgimp/gl.po
   branches/soc-2008-tagging/po-libgimp/it.po
   branches/soc-2008-tagging/po-libgimp/ja.po
   branches/soc-2008-tagging/po-libgimp/km.po
   branches/soc-2008-tagging/po-libgimp/ko.po
   branches/soc-2008-tagging/po-libgimp/mk.po
   branches/soc-2008-tagging/po-libgimp/nb.po
   branches/soc-2008-tagging/po-libgimp/pa.po
   branches/soc-2008-tagging/po-libgimp/pt_BR.po
   branches/soc-2008-tagging/po-libgimp/ro.po
   branches/soc-2008-tagging/po-libgimp/ru.po
   branches/soc-2008-tagging/po-libgimp/sl.po
   branches/soc-2008-tagging/po-libgimp/sr.po
   branches/soc-2008-tagging/po-libgimp/sv.po
   branches/soc-2008-tagging/po-libgimp/zh_CN.po
   branches/soc-2008-tagging/po-plug-ins/ChangeLog
   branches/soc-2008-tagging/po-plug-ins/Makefile.in.in
   branches/soc-2008-tagging/po-plug-ins/POTFILES.in
   branches/soc-2008-tagging/po-plug-ins/POTFILES.skip
   branches/soc-2008-tagging/po-plug-ins/be.po
   branches/soc-2008-tagging/po-plug-ins/ca.po
   branches/soc-2008-tagging/po-plug-ins/de.po
   branches/soc-2008-tagging/po-plug-ins/eu.po
   branches/soc-2008-tagging/po-plug-ins/fi.po
   branches/soc-2008-tagging/po-plug-ins/fr.po
   branches/soc-2008-tagging/po-plug-ins/gl.po
   branches/soc-2008-tagging/po-plug-ins/it.po
   branches/soc-2008-tagging/po-plug-ins/ja.po
   branches/soc-2008-tagging/po-plug-ins/km.po
   branches/soc-2008-tagging/po-plug-ins/ko.po
   branches/soc-2008-tagging/po-plug-ins/mk.po
   branches/soc-2008-tagging/po-plug-ins/nb.po
   branches/soc-2008-tagging/po-plug-ins/pt_BR.po
   branches/soc-2008-tagging/po-plug-ins/ro.po
   branches/soc-2008-tagging/po-plug-ins/ru.po
   branches/soc-2008-tagging/po-plug-ins/sl.po
   branches/soc-2008-tagging/po-plug-ins/sr.po
   branches/soc-2008-tagging/po-plug-ins/sv.po
   branches/soc-2008-tagging/po-plug-ins/zh_CN.po
   branches/soc-2008-tagging/po-python/ChangeLog
   branches/soc-2008-tagging/po-python/POTFILES.skip
   branches/soc-2008-tagging/po-python/ca.po
   branches/soc-2008-tagging/po-python/eu.po
   branches/soc-2008-tagging/po-python/fi.po
   branches/soc-2008-tagging/po-python/ja.po
   branches/soc-2008-tagging/po-python/km.po
   branches/soc-2008-tagging/po-python/ko.po
   branches/soc-2008-tagging/po-python/mk.po
   branches/soc-2008-tagging/po-python/nb.po
   branches/soc-2008-tagging/po-python/pt_BR.po
   branches/soc-2008-tagging/po-python/ro.po
   branches/soc-2008-tagging/po-python/ru.po
   branches/soc-2008-tagging/po-python/sl.po
   branches/soc-2008-tagging/po-python/sr.po
   branches/soc-2008-tagging/po-python/zh_CN.po
   branches/soc-2008-tagging/po-script-fu/ChangeLog
   branches/soc-2008-tagging/po-script-fu/POTFILES.in
   branches/soc-2008-tagging/po-script-fu/POTFILES.skip
   branches/soc-2008-tagging/po-script-fu/be.po
   branches/soc-2008-tagging/po-script-fu/ca.po
   branches/soc-2008-tagging/po-script-fu/de.po
   branches/soc-2008-tagging/po-script-fu/eu.po
   branches/soc-2008-tagging/po-script-fu/fr.po
   branches/soc-2008-tagging/po-script-fu/gl.po
   branches/soc-2008-tagging/po-script-fu/it.po
   branches/soc-2008-tagging/po-script-fu/ja.po
   branches/soc-2008-tagging/po-script-fu/km.po
   branches/soc-2008-tagging/po-script-fu/ko.po
   branches/soc-2008-tagging/po-script-fu/mk.po
   branches/soc-2008-tagging/po-script-fu/pa.po
   branches/soc-2008-tagging/po-script-fu/pt_BR.po
   branches/soc-2008-tagging/po-script-fu/ro.po
   branches/soc-2008-tagging/po-script-fu/ru.po
   branches/soc-2008-tagging/po-script-fu/sl.po
   branches/soc-2008-tagging/po-script-fu/sr.po
   branches/soc-2008-tagging/po-script-fu/sv.po
   branches/soc-2008-tagging/po-script-fu/zh_CN.po
   branches/soc-2008-tagging/po-tips/ChangeLog
   branches/soc-2008-tagging/po-tips/POTFILES.skip
   branches/soc-2008-tagging/po-tips/ca.po
   branches/soc-2008-tagging/po-tips/ja.po
   branches/soc-2008-tagging/po-tips/km.po
   branches/soc-2008-tagging/po-tips/ko.po
   branches/soc-2008-tagging/po-tips/mk.po
   branches/soc-2008-tagging/po-tips/nb.po
   branches/soc-2008-tagging/po-tips/pa.po
   branches/soc-2008-tagging/po-tips/pt_BR.po
   branches/soc-2008-tagging/po-tips/ro.po
   branches/soc-2008-tagging/po-tips/sr.po
   branches/soc-2008-tagging/po-tips/zh_CN.po
   branches/soc-2008-tagging/po/ChangeLog
   branches/soc-2008-tagging/po/POTFILES.in
   branches/soc-2008-tagging/po/POTFILES.skip
   branches/soc-2008-tagging/po/be.po
   branches/soc-2008-tagging/po/ca.po
   branches/soc-2008-tagging/po/de.po
   branches/soc-2008-tagging/po/et.po
   branches/soc-2008-tagging/po/eu.po
   branches/soc-2008-tagging/po/fi.po
   branches/soc-2008-tagging/po/fr.po
   branches/soc-2008-tagging/po/ga.po
   branches/soc-2008-tagging/po/gl.po
   branches/soc-2008-tagging/po/it.po
   branches/soc-2008-tagging/po/ja.po
   branches/soc-2008-tagging/po/km.po
   branches/soc-2008-tagging/po/ko.po
   branches/soc-2008-tagging/po/mk.po
   branches/soc-2008-tagging/po/nb.po
   branches/soc-2008-tagging/po/pa.po
   branches/soc-2008-tagging/po/pl.po
   branches/soc-2008-tagging/po/pt_BR.po
   branches/soc-2008-tagging/po/ro.po
   branches/soc-2008-tagging/po/ru.po
   branches/soc-2008-tagging/po/sl.po
   branches/soc-2008-tagging/po/sr.po
   branches/soc-2008-tagging/po/sv.po
   branches/soc-2008-tagging/po/zh_CN.po
   branches/soc-2008-tagging/po/zh_TW.po
   branches/soc-2008-tagging/themes/Default/gtkrc
   branches/soc-2008-tagging/themes/Default/images/makefile.msc
   branches/soc-2008-tagging/themes/Small/gtkrc
   branches/soc-2008-tagging/tools/   (props changed)
   branches/soc-2008-tagging/tools/Makefile.am
   branches/soc-2008-tagging/tools/defcheck.py
   branches/soc-2008-tagging/tools/gimppath2svg.py
   branches/soc-2008-tagging/tools/gimptool.c
   branches/soc-2008-tagging/tools/pdbgen/app.pl
   branches/soc-2008-tagging/tools/pdbgen/enums.pl
   branches/soc-2008-tagging/tools/pdbgen/pdb/drawable.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/gradient.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/image.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/layer.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/paths.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/plug_in.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/selection.pdb
   branches/soc-2008-tagging/tools/test-clipboard.c

Modified: branches/soc-2008-tagging/AUTHORS
==============================================================================
--- branches/soc-2008-tagging/AUTHORS	(original)
+++ branches/soc-2008-tagging/AUTHORS	Sun Oct 12 15:38:02 2008
@@ -14,6 +14,7 @@
  Henrik Brix Andersen
  Karl-Johan Andersson
  Nicola Archibald
+ Luis Barrancos
  John Beale
  Zach Beane
  Tom Bech
@@ -35,6 +36,7 @@
  Winston Chang
  Stephane Chauveau
  Zbigniew Chyla
+ Lars-Peter Clausen
  Branko Collin
  Ed Connel
  Piers Cornwell
@@ -42,6 +44,8 @@
  Daniel Cotting
  Jay Cox
  Kevin Cozens
+ Michael Deal
+ Alexia Death
  Brian Degenhardt
  Karine Delvare
  Andreas Dilger
@@ -49,7 +53,9 @@
  Scott Draves
  Daniel Dunbar
  Misha Dynin
+ Daniel Eddeland
  Daniel Egger
+ Ulf-D. Ehlert
  Morton Eriksen
  Larry Ewing
  Pedro Alonso Ferrer
@@ -76,6 +82,7 @@
  Pavel Grinfeld
  Dov Grobgeld
  Michael Hammel
+ Marcus Heese
  Robert Helgesson
  James Henstridge
  Eric Hernes
@@ -83,7 +90,9 @@
  Christoph Hoegl
  Wolfgang Hofer
  Alan Horkan
+ Daniel Hornung
  Jan HubiÄka
+ Barak Itkin
  Ben Jackson
  Tim Janik
  Kristian Jantz
@@ -106,6 +115,7 @@
  Marco Lamberto
  Jens Lautenbacher
  Laramie Leavitt
+ Tom Lechner
  Elliot Lee
  Marc Lehmann
  Ray Lehtiniemi
@@ -119,6 +129,7 @@
  Josh MacDonald
  Ed Mackey
  Vidar Madsen
+ Luidnel Maignan
  Ian Main
  Kjartan Maraas
  John Marshall
@@ -162,6 +173,7 @@
  Nils Philippsen
  Ari Pollak
  RaphaÃl Quinet
+ Dennis Ranke
  Tom Rathborne
  Jens Restemeier
  Maurits Rijk
@@ -218,9 +230,12 @@
 
  Lapo Calamandrei
  Paul Davey
+ Alexia Death
+ Aurore Derriennic
  Tuomas Kuosmanen
  Karl La Rocca
  Andreas Nilsson
+ Ville PÃtsi
  Mike Schaeffer
  Carol Spears
  Jakub Steiner
@@ -229,6 +244,8 @@
 
 The following people have helped to document GIMP:
 
+ Ignacio AntI
+ Åygimantas BeruÄka
  Carey Bunks
  Marco Ciampa
  Dust
@@ -243,9 +260,15 @@
  Semka KuloviÃ-Debals
  Karin Kylander
  Olof S Kylander
+ Jean-Pierre Litzler
+ Vitaly Lomov
  Ed Mackey
  Ian Main
+ Pierre Perrier
+ Alexandre Prokoudine
  Manuel QuiÃones
  James Robinson
  Nickolay V. Shmyrev
+ Patrycja Stawiarska
+ KolbjÃrn StuestÃl
  Axel Wernicke

Copied: branches/soc-2008-tagging/ChangeLog.pre-2-6 (from r27242, /trunk/ChangeLog.pre-2-6)
==============================================================================
--- /trunk/ChangeLog.pre-2-6	(original)
+++ branches/soc-2008-tagging/ChangeLog.pre-2-6	Sun Oct 12 15:38:02 2008
@@ -2578,6 +2578,23 @@
 	(gimp_display_shell_canvas_size_allocate): If the size-allocate
 	comes from a top level window resize, apply centering logic.
 
+2008-08-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.c (gimp_tag_cache_save):
+	* app/widgets/gimptagentry.c (gimp_tag_entry_commit_tags):
+	removed debugging output.
+
+2008-08-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.h: described the meaning of gimp tag entry
+	text mask.
+
+2008-08-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_auto_complete):
+	sort autocompletion candidates so that they can be cycled in correct
+	order.
+
 2008-08-16  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-scroll.c
@@ -2962,6 +2979,21 @@
 	* plug-ins/pygimp/plug-ins/python-console.py: renamed the dialog
 	class to ConsoleDialog to avoid confusion with pyconsole.Console.
 
+2008-08-14  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_select_jellybean): made
+	jellybean selection with mouse work again.
+
+2008-08-14  Aurimas JuÅka  <auris auris-laptop>
+
+	* app/core/gimptagcache.c (gimp_tag_cache_object_add): fixed
+	identifier remapping when resource files are renamed.
+
+2008-08-14  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpdata.c (gimp_data_get_identifier): fixed crash when
+	creating new resource (which has NULL filename).
+
 2008-08-13  Sven Neumann  <sven gimp org>
 
 	* plug-ins/pygimp/plug-ins/python-console.py: instead of calling
@@ -3102,6 +3134,25 @@
 
 	* modules/Makefile.am: fixed library dependencies.
 
+2008-08-12  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpfilteredcontainer.[ch]
+	* app/core/gimptag.[ch]
+	* app/widgets/gimptagentry.c
+	* app/widgets/gimptagpopup.h: improvements and fixes for documentation
+	reference comments.
+
+2008-08-12  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_select_jellybean):
+	some fixes of directional selections.
+
+2008-08-12  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: reposition cursor after whitespace where
+	possible. Also improved whitespace addition as user starts typing
+	tags.
+
 2008-08-11  Michael Natterer  <mitch gimp org>
 
 	* plug-ins/common/cml-explorer.c
@@ -3255,6 +3306,10 @@
 
 	* app/tools/gimptexttool.c: minor coding style cleanups.
 
+2008-08-11  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptag.c: fixed case insensitive tag handling.
+
 2008-08-10  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-callbacks.c
@@ -3395,6 +3450,108 @@
 	* app/display/gimpdisplayshell.c:
 	* app/display/gimpdisplayshell-handlers.c: Use the new names.
 
+2008-08-10  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_border_event): disable
+	single selection mode when mouse button is release outside popup
+	window.
+
+2008-08-10  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c
+	(gimp_tag_entry_strip_extra_whitespace): reposition cursor after a
+	whitespace when there are no tags before (last position).
+
+2008-08-10  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: tab key cycles completion variants.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: add space when insert tag in the middle
+	of tags list.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: some auto-completion tweaks.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: force policy where there is one space
+	after each tag's separator.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_select_jellybean): try to
+	select closest tag on delete only when there is no selection already.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimptagentry.c
+	* app/widgets/gimptagentry.h: do not popup tag list when there are no
+	possible selections.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_add_to_recent):
+	disable add to recently used tag list when working in tag assignment
+	mode.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: select tags with shift + left/right
+	arrow keys.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: invalid tag querying always gives empty
+	set of results.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: fixed cursor reposition when committing
+	tags.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptag.c
+	* app/widgets/gimptagentry.c: always normalize tag names.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c
+	* app/widgets/gimptagpopup.c: smartly add spaces when necessary.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: when deleting a tag, in which side to
+	delete whitespace depends whether Delete or Backspace keys are used.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: multiple tag deletion.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c (gimp_combo_tag_entry_event):
+	when arrow is clicked indicate that event is handled.
+
+2008-08-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: improved tag auto-completion handling.
+
+2008-08-08  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c (gimp_combo_tag_entry_new):
+	fixed with of combo box arrow area so that entry's cursor would
+	not be covered by it.
+
+2008-08-08  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: reorganized and rewritten jellybean
+	  handling code.
+
 2008-08-08  Michael Natterer  <mitch gimp org>
 
 	Bug #545990: GIMP color wheel is not antialiased
@@ -3582,6 +3739,20 @@
 	instead of hardcoding the switch, as it isn't valid, and would be
 	pointless, when building a 64-bit GIMP.
 
+2008-08-07  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_layout_tags): improved
+	handling of clicking empty area in popup makes it close.
+
+2008-08-07  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpfilteredcontainer.[ch]
+	* app/core/gimptag.[ch]
+	* app/core/gimptagcache.[ch]
+	* app/widgets/gimpcombotagentry.[ch]
+	* app/widgets/gimptagentry.[ch]
+	* app/widgets/gimptagpopup.c: code cleanup and documentation.
+
 2008-08-06  Sven Neumann  <sven gimp org>
 
 	* app/core/gimpdrawable-shadow.c: removed unused include.
@@ -3602,6 +3773,48 @@
 
 	* app/gui/gimpdbusservice.c: minor cleanups.
 
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_new): removed left and
+	right border which used to be displayed only when scrolling was on.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimptagpopup.c: fixed owner/child responsibilities.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_new): upper scroll arrow
+	is initialy insensitive as it is at the minimum scroll position.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimptagentry.c
+	* app/widgets/gimptagpopup.c: implemented RTL text direction support.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.[ch]
+	* app/widgets/gimpdatafactoryview.c
+	* app/widgets/gimptagentry.[ch]
+	* app/widgets/gimptagpopup.c: cleaned up and reorganized code in
+	order to prepare widget code for RTL support.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]
+	* app/widgets/gimptagpopup.c: since tags can be changed to make them
+	valid, they are now reloaded after assignment and cursor is positioned
+	at the previously edited tag.
+
+2008-08-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c
+	* app/widgets/gimptagpopup.c: use any UNICODE terminal punctuation
+	character as separator.
+
 2008-08-05  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale):
@@ -3692,6 +3905,40 @@
 	asking the user for input) and we need to respond to the D-Bus
 	call before it times out.
 
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagged.c (gimp_tagged_base_init): marshal GimpTags as
+	objects.
+
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.[ch]: horizontal space at the end of each
+	line can be used to close tag popup.
+
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_try_select_jellybean):
+	when selecting with mouse at the end of tag entry, don't try to select
+	jellybean, but allow appending tags.
+
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptag.[ch]
+	* app/core/gimptagcache.c (gimp_tag_cache_load_text)
+	* app/widgets/gimptagentry.c (gimp_tag_entry_assign_tags): added rules
+	tag names.
+
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpfilteredcontainer.[ch]
+	* app/widgets/gimpcombotagentry.[ch]: make tag popup arrow insensitive
+	when tag list is empty.
+
+2008-08-05  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_layout_tags),
+	(gimp_tag_popup_list_expose): decreased height of tag highlight.
+
 2008-08-04  Sven Neumann  <sven gimp org>
 
 	* app/paint-funcs/scale-region.c: applied patch from Geert
@@ -3760,6 +4007,36 @@
 	* app/dialogs/tips-parser.[ch]: parse the help IDs from the tips
 	file and show a "Learn more" link in the tips dialog.
 
+2008-08-04  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c (gimp_combo_tag_entry_style_set):
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_list_expose):
+	underline highlighted tags in popup list.
+
+2008-08-04  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_new),
+	(gimp_tag_popup_border_event): support scrolling with mouse wheel.
+
+2008-08-03  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c (gimp_tag_popup_list_expose):
+	don't draw focus rectangle on insensitive item.
+
+2008-08-03  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_activate): fixed
+	requirements for resource to which tags are set: it only needs to be
+	visible in view.
+
+2008-08-03  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpdata.c (gimp_data_get_identifier)
+	* app/core/gimptagcache.c (gimp_tag_cache_object_add),
+	(tagged_to_cache_record_foreach)
+	* app/core/gimptagged.c: GimpTagged identifier is now always UTF-8
+	string.
+
 2008-08-03  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell.c (gimp_display_shell_new): Center
@@ -3817,10 +4094,41 @@
 	Supply information about the previous-origin of the image to the
 	size-changed signals and the undo system.
 
+2008-08-02  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.c (gimp_tag_cache_load): fixed small memory
+	leak.
+
+2008-08-01  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.c: close tag popup on keyboard input.
+
+2008-08-01  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_focus_in),
+	(gimp_tag_entry_key_press): fixed usage of tab key.
+
+2008-08-01  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: hide tags on assign tag entry when
+	selected item is not visible in the view.
+
 2008-07-31  Sven Neumann  <sven gimp org>
 
 	* app/core/gimpimage-scale.c (gimp_image_scale): formatting.
 
+2008-07-31  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.[ch]
+	* app/widgets/gimptagpopup.[ch]: when selecting tags in the popup
+	list, grayout tags which if selected would result in empty resource
+	list.
+
+2008-07-31  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_assign_tags): don't unref
+	tags since they are currently only referenced by tagged objects.
+
 2008-07-30  Jakub Steiner <jimmac ximian com>
 
 	* data/images/gimp-splash.png: new devel splash from 
@@ -3834,6 +4142,18 @@
 	* app/actions/file-commands.c (file_open_dialog_show): use the
 	last opened URI as a fallback for initializing the dialog.
 
+2008-07-30  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_dispose): free recently
+	used tags list.
+
+2008-07-30  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagpopup.[ch]: added support for single tag
+	selection in tag popup. User can press mouse button, drag to select a
+	tag and release mouse button. Selected tag is toggled
+	selected/deselected and popup is closed.
+
 2008-07-29  Sven Neumann  <sven gimp org>
 
 	* plug-ins/common/Makefile.am
@@ -3850,6 +4170,26 @@
 
 	* app/pdb/vectors-cmds.c: regenerated.
 
+2008-07-29  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: added support for switching between
+	recently used tags using up and down arrow keys. (Bill Skaggs's idea).
+
+2008-07-29  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: based on user behaviour track if tags
+	should be considered "accepted" (delete operates on jellybeans) or "not
+	accepted" (delete operates on characters).
+
+2008-07-29  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/Makefile.am
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimptagpopup.[ch]
+	* app/widgets/widgets-types.h: popup part of GimpComboTagEntry has
+	been moved to a separate class GimpTagPopup in order to prepare for
+	upcoming feature additions.
+
 2008-07-28  Sven Neumann  <sven gimp org>
 
 	* tools/pdbgen/pdb/edit.pdb (edit_stroke_vectors_invoker): check
@@ -3890,6 +4230,52 @@
 
 	* plug-ins/psd/Makefile.am: renamed executable to 'psd-load'.
 
+2008-07-27  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c: ported GimpComboTagEntry to use
+	menu-like scrolling. There is quite much additional code which makes
+	it necessary to move popup list code to another class later.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/core-types.h
+	* app/core/gimpdata.c
+	* app/core/gimpfilteredcontainer.c
+	* app/core/gimptag.[ch]
+	* app/core/gimptagcache.c
+	* app/core/gimptagged.[ch]
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimptagentry.c: made GimpTag an object and updated all
+	places to treat it as such. This allows correctly compare various tags
+	and change implementation in one place.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.c (gimp_tag_cache_save): escape identifiers
+	and tags when saving to cache.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_select_jellybean):
+	removed debugging printfs which are not needed anymore.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_backspace),
+	(gimp_tag_entry_select_jellybean): tag jellybeans are now selected in
+	such way that after deleting tag next backspace or delete press would
+	result in selection of another tag.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: do not autocomplete when tags are
+	selected from tag popup list.
+
+2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.[ch]: improved tag drawing in popup
+	list.
+
 2008-07-24  Sven Neumann  <sven gimp org>
 
 	* app/widgets/gtkscalebutton.c: added missing prototypes.
@@ -4035,6 +4421,19 @@
 
 	* app/gui/session.c (session_init): plugged a small memory leak.
 
+2008-07-22  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	* app/widgets/gimpdatafactoryview.c
+	* app/widgets/gimptagentry.[ch]: trigger immediate tag assignment when
+	toggling tags in the popup list.
+
+2008-07-22  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_focus_in),
+	(gimp_tag_entry_toggle_desc): fixed ill recursion which later results
+	in segmentation fault.
+
 2008-07-21  Sven Neumann  <sven gimp org>
 
 	* app/widgets/gimphistogrameditor.c
@@ -4081,6 +4480,60 @@
 
 	* configure.in (ALL_LINGUAS): added 'be' (Belarusian).
 
+2008-07-21  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpdatafactoryview.c
+	(gimp_data_factory_view_construct): sort GimpData resources in correct
+	order.
+
+2008-07-21  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.c (gimp_tag_cache_finalize),
+	(gimp_tag_cache_get_memsize): some fixes to finalization and memsize
+	calculations.
+
+2008-07-21  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	(gimp_combo_tag_entry_popup_list): focus tag entry when tag popup is
+	dropped down to give user better feedback and get rid of description
+	text.
+
+2008-07-21  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	(gimp_combo_tag_entry_popup_list): correctly possition popup window
+	when it appears on top of tag entry.
+
+2008-07-20  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_class_init),
+	(gimp_tag_entry_dispose): cleaned up a bit: marked some strings for
+	translation, free resources on dispose.
+
+2008-07-20  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_changed),
+	(gimp_tag_entry_toggle_desc): properly check if there is at least one
+	valid tag entered.
+
+2008-07-20  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: allow jellybean selection with mouse
+	button 1 (normally left).
+
+2008-07-20  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: treat tags as jellybeans (as atomic
+	objects). When pressing backspace or delete, first select the whole
+	tag, on the second press actually delete.
+
+2008-07-20  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c
+	(gimp_combo_tag_entry_popup_list): fixed popup width to properly match
+	tag entry width.
+
 2008-07-19  Martin Nordholts  <martinn svn gnome org>
 
 	* app/widgets/gimpnavigationview.[ch]: Don't expose implementation
@@ -4090,6 +4543,17 @@
 	(gimp_navigation_editor_popup): Use the new interface instead of
 	directly accessing the members of the navigation view.
 
+2008-07-19  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.[ch]: highlight selected tags in popup
+	list.
+
+2008-07-19  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.[ch]: added gray italic description text,
+	which is displayed when GimpTagEntry is not focused and there is no
+	text typed.
+
 2008-07-18  Sven Neumann  <sven gimp org>
 
 	* app/core/core-types.h: removed delta_time, delta_x, delta_y,
@@ -4165,6 +4629,22 @@
 
 	* libgimp/gimpui.c: improved the documentation of gimpui_init().
 
+2008-07-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_load_selection): display
+	sorted assigned tag list, so that user could find needed tags faster.
+
+	* app/core/Makefile.am
+	* app/core/gimptag.[ch]: move common tag functions to a single place.
+
+	* app/widgets/gimpcombotagentry.c: use the common functions.
+
+2008-07-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpbrushfactoryview.c
+	* app/widgets/gimpdatafactoryview.c: tag assigment entry visualy
+	connected to data view.
+
 2008-07-16  Sven Neumann  <sven gimp org>
 
 	* configure.in: bumped version to 2.5.3.
@@ -4343,6 +4823,48 @@
 	ask gimp_display_shell_set_initial_scale() for display size, we
 	don't care anyway.
 
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c: if scrollbar appears in popup
+	window, re-layout tags.
+
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c: correctly calculate border
+	thickness so that scrollbars would not appear when unneeded.
+
+
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimp.c: cache pattern, gradient and palette tags in addition
+	to brush tags.
+
+	* app/core/gimpbrush.c (gimp_brush_get_checksum)
+	* app/core/gimpgradient.c (gimp_gradient_tagged_init),
+	(gimp_gradient_get_checksum)
+	* app/core/gimppalette.c (gimp_palette_tagged_init),
+	(gimp_palette_get_checksum)
+	* app/core/gimppattern.c (gimp_pattern_tagged_init),
+	(gimp_pattern_get_checksum): implemented get_checksum method for all
+	tagged objects.
+
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_auto_complete):
+	  autocomplete only user typed text, not what was autocompleted in
+	  previous step.
+
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c: tag popup displays alphabetically
+	sorted tags. Set maximum popup window height and fixed scrolling when
+	mouse pointer is grabbed.
+
+2008-07-13  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_query_tag): fixed use of
+	  uninitialized variable.
+
 2008-07-12  Martin Nordholts  <martinn svn gnome org>
 
 	The following change is conceptually based on a patch by
@@ -4448,6 +4970,19 @@
 	and use gimp_display_shell_get_disp_offset() and
 	gimp_display_shell_get_render_start_offset() instead.
 
+2008-07-12  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.[ch]: detect resource file renames/moves and
+	  update tag cache accordingly. If identifier (filename) changes,
+	  objects are identified using checksum.
+
+	* app/core/gimpbrush.c (gimp_brush_tagged_init),
+	(gimp_brush_get_checksum)
+	* app/core/gimpdata.c (gimp_data_tagged_iface_init),
+	(gimp_data_get_checksum)
+	* app/core/gimptagged.c (gimp_tagged_get_checksum)
+	* app/core/gimptagged.h: checksum support for tagged objects.
+
 2008-07-11  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-scale.c
@@ -4588,6 +5123,12 @@
 	* app/display/gimpnavigationeditor.c
 	(gimp_navigation_editor_update_marker): Use it here.
 
+2008-07-11  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.c: improved usability on closing tag
+	popup window. It now can be closed by clicking anywhere outside the
+	popup window.
+
 2008-07-10  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-scroll.[ch]
@@ -4685,6 +5226,13 @@
 	* app/tools/gimppainttool.c (gimp_paint_tool_motion): don't paint
 	while the Shift key is pressed for line drawing (bug #529434).
 
+2008-07-09  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpcombotagentry.[ch]
+	* app/widgets/gimptagentry.[ch]: tag manipulation using
+	GimpComboTagEntry. Allows selecting or deselecting tags with mouse or
+	other pointing device without using keyboard.
+
 2008-07-08  Martin Nordholts  <martinn svn gnome org>
 
 	* plug-ins/pygimp/gimpmodule.c (gimp_methods): Remove duplicate
@@ -4746,6 +5294,14 @@
 
 	* plug-ins/help/gimphelpdomain.c: improved error messages.
 
+2008-07-06  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/Makefile.am
+	* app/widgets/gimpcombotagentry.[ch]
+	* app/widgets/gimpdatafactoryview.c
+	* app/widgets/widgets-types.h: added GimpComboTagEntry widget which
+	wraps GimpTagEntry and will provide UI similar to combo box.
+
 2008-07-05  Martin Nordholts  <martinn svn gnome org>
 
 	* app/display/gimpdisplayshell-scroll.c
@@ -4811,6 +5367,13 @@
 	* app/core/gimpgrid.c: changed default grid to a 10x10 grid of
 	solid lines (bug #539318).
 
+2008-07-04  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c: support tag autocompletion.
+
+	* app/core/gimpfilteredcontainer.[ch]: maintain tag reference count
+	of all items contained in source container.
+
 2008-07-03  Sven Neumann  <sven gimp org>
 
 	* app/actions/dialogs-actions.c (dialogs_toplevel_actions):
@@ -4869,6 +5432,12 @@
 
 	* themes/Default/images/stock-gegl.svg: added SVG version.
 
+2008-07-01  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimptagentry.c (gimp_tag_entry_set_selected_items),
+	(gimp_tag_entry_load_selection): display tags assigned to selected
+	item.
+
 2008-06-30  Michael Natterer  <mitch gimp org>
 
 	* app/widgets/gimphistogrambox.c
@@ -4881,6 +5450,20 @@
 	restore code that sets the dialog back to sensitive when opening
 	fails because it stays open. Fixes bug #540801.
 
+2008-06-30  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.[ch]: cleaned up and removed unnenecessarry
+	responsibilities.
+
+2008-06-30  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/gimpdatafactoryview.[ch]
+	* app/widgets/gimptagentry.[ch]: tag assignment GUI support.
+
+2008-06-30  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.[ch]: properly save changed tags.
+
 2008-06-29  Michael Natterer  <mitch gimp org>
 
 	* app/tools/gimpgegltool.c (gimp_gegl_tool_dialog): remove size
@@ -4927,6 +5510,11 @@
 	* plug-ins/win-snap/winsnap.c: use accessors instead of accessing
 	members of GTK+ widgets directly.
 
+2008-06-29  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpfilteredcontainer.c
+	* app/widgets/gimptagentry.c: multiple tag querying support.
+
 2008-06-28  Michael Natterer  <mitch gimp org>
 
 	* pygimp-pdb.c:
@@ -5112,12 +5700,34 @@
 	* app/widgets/gimpaction.c (gimp_action_set_proxy): simplify the
 	logic of setting "color" or "viewable" previews on menuitems.
 
+2008-06-28  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/widgets/Makefile.am
+	* app/widgets/widgets-types.h
+	* app/widgets/gimptagentry.[ch]: added GimpTagEntry widget.
+
+	* app/widgets/gimpdatafactoryview.c: use GimpTagEntry instead of GtkEntry.
+
+2008-06-28  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimpfilteredcontainer.c: detect source container changes.
+
 2008-06-27  Michael Natterer  <mitch gimp org>
 
 	* app/tools/gimppaintoptions-gui.c (gimp_paint_options_gui): swap
 	the angles of the dynamics matrix' labels in RTL and LTR mode so
 	the beginning of the words are aligned and on bottom.
 
+2008-06-27  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/Makefile.am
+	* app/core/core-types.h
+	* app/core/gimpfilteredcontainer.[ch]: added GimpFilteredContainer
+	which can be used to filter containers based on object tags.
+
+	* app/widgets/gimpbrushfactoryview.c
+	* app/widgets/gimpdatafactoryview.[ch]: simple tag query from GUI.
+
 2008-06-26  Michael Natterer  <mitch gimp org>
 
 	* app/widgets/gimpscalebutton.c (gimp_scale_button_init): hide the
@@ -5225,6 +5835,16 @@
 	* app/widgets/gimpsettingsbox.[ch]: add "Manage Settings" menu item
 	and show a dialog containing the new widget.
 
+2008-06-22  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimp.c: save and uninitialize tag cache properly.
+
+2008-06-22  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.c: added tag cache loading from file
+	functionality. Improved tag assignment to objects.
+
+
 2008-06-21  Martin Nordholts  <martinn svn gnome org>
 
 	* app/tools/gimpfreeselecttool.c
@@ -5232,6 +5852,17 @@
 	constraints on the first segment vertex, base on the last segment
 	vertex rather than not applying any constraint at all.
 
+2008-06-21  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/gimptagcache.[ch]: extended cache system
+	functionality and added tag cache saving to file.
+
+	* app/core/gimp.c: further integration of
+	gimp tag cache.
+
+	* app/core/gimptagged.[ch]: fixed repeated get
+	in function name.
+
 2008-06-20  Martin Nordholts  <martinn svn gnome org>
 
 	Make angle constraints with the Free Select Tool by using Ctrl
@@ -5279,6 +5910,35 @@
 	* plug-ins/common/sample-colorize.c
 	* plug-ins/imagemap/imap_main.c: s/GtkSignalFunc/GCallback/.
 
+2008-06-20  Aurimas JuÅka   <aurisj svn gnome org>
+
+	* app/core/gimpdata.[ch]
+	* app/core/gimptagcache.c (gimp_tag_cache_update)
+	* app/core/gimptagged.[ch]: extended object identification
+	  capabilities. Each tagged object now provides unique
+	  identification string. In case it can change between sessions,
+	  objects can provide digest calculation which would help to remap
+	  to new identification string.
+
+	* app/core/gimp-gradients.c
+	* app/core/gimp.c
+	* app/core/gimpbrush.c
+	* app/core/gimpcurve.c
+	* app/core/gimpgradient.c (gimp_gradient_get_standard)
+	* app/core/gimppalette.c (gimp_palette_get_standard)
+	* app/core/gimppattern.c (gimp_pattern_get_standard): provide
+	  unique name for internal objects.
+
+2008-06-17  Aurimas JuÅka  <aurisj svn gnome org>
+
+	* app/core/Makefile.am
+	* app/core/core-types.h
+	* app/core/gimp.c
+	* app/core/gimp.h: integrated GimpTagCache.
+	* app/core/gimptagcache.c
+	* app/core/gimptagcache.h: added GimpTagCache which currently doesn't
+	  have any real functionality.
+
 2008-06-15  Michael Natterer  <mitch gimp org>
 
 	* configure.in: in the check for xfixes, add "true" as

Modified: branches/soc-2008-tagging/INSTALL
==============================================================================
--- branches/soc-2008-tagging/INSTALL	(original)
+++ branches/soc-2008-tagging/INSTALL	Sun Oct 12 15:38:02 2008
@@ -1,17 +1,19 @@
-Installation instructions for GIMP 2.5
+--------------------------------------
+Installation instructions for GIMP 2.6
 --------------------------------------
 
 There are some basic steps to building and installing GIMP.
 
-GIMP 2.5 replaces earlier GIMP 2.x versions. It is advised that you
-uninstall them before installing GIMP 2.5. If you want to keep your
-older GIMP 2.x installation in parallel to GIMP 2.5, you have to
+GIMP 2.6 replaces earlier GIMP 2.x versions. It is advised that you
+uninstall them before installing GIMP 2.6. If you want to keep your
+older GIMP 2.x installation in parallel to GIMP 2.6, you have to
 choose a separate prefix which is not in your default library search
 path.
 
-GIMP 2.x is fully backward compatible to GIMP 2.0. Plug-ins and
-scripts written for GIMP 2.0 will continue to work and don't need to
-be changed nor recompiled to be used with GIMP 2.x.
+GIMP 2.6 is fully backward compatible to all earlier GIMP 2.x version.
+Plug-ins and scripts written for GIMP 2.4, or GIMP 2.2 or even 2.0,
+will continue to work and don't need to be changed nor recompiled to
+be used with GIMP 2.x.
 
 The most important part is to make sure the requirements for a build
 are fulfilled.  We depend on a number of tools and libraries which are
@@ -39,7 +41,7 @@
        http://svn.gnome.org/svn/babl/trunk
        http://svn.gnome.org/svn/gegl/trunk
 
-  4. You need to have installed GTK+ version 2.12.1 or newer.  GIMP
+  4. You need to have installed GTK+ version 2.12.5 or newer.  GIMP
      also need a recent versions of GLib (>= 2.16.1) and Pango (>= 1.18.0).
      Sources for these can be grabbed from ftp://ftp.gtk.org/.
 
@@ -57,27 +59,35 @@
   7. We use dbus-glib if available. Grab it from
      http://dbus.freedesktop.org/releases/dbus-glib/
 
-  8. You may want to install other third party libraries or programs
+  8. Access of remote files is implemented in the URI plug-in. There
+     are several possible implementations for this. The implementation
+     used is determined when you configure GIMP. By default the
+     GIO/GVfs backend is used. If you don't have GVfs support on your
+     target platform, you should pass the '--without-gvfs' option to
+     configure. The configure script will then try to detect another
+     method for accessing remote files.
+
+  9. You may want to install other third party libraries or programs
      that are needed for some of the available plugins. We recommend
      to check that the following libraries are installed: lcms,
      libpng, libjpeg, libpoppler, libtiff, webkit, libmng, librsvg
      and libwmf.
 
-  9. The Python extension requires Python development headers to be
+ 10. The Python extension requires Python development headers to be
      present. You will also need PyGTK and the respective development
      headers.
 
- 10. Configure GIMP by running the `configure' script. You may want
+ 11. Configure GIMP by running the `configure' script. You may want
      to pass some options to it, see below.
 
- 11. Build GIMP by running `make'. The use of GNU make is recommended.
+ 12. Build GIMP by running `make'. The use of GNU make is recommended.
      If you need to tweak the build to make it work with other flavours
      of make, we'd appreciate if you'd send us a patch with the changes.
 
- 12. Install GIMP by running `make install'. In order to avoid clashes
-     with other versions of GIMP, we install a binary called gimp-2.5.
+ 13. Install GIMP by running `make install'. In order to avoid clashes
+     with other versions of GIMP, we install a binary called gimp-2.6.
      By default there's also a link created so that you can type 'gimp'
-     to start gimp-2.5.
+     to start gimp-2.6.
 
 Please make sure you don't have any old GTK+-2.x, jpeg, etc. libraries 
 lying around on your system, otherwise configure may fail to find the 
@@ -89,8 +99,8 @@
 might be used to build and install GIMP. The actual configuration,
 compilation and installation output is not shown.
 
-  % tar xvfz gimp-2.5.x.tar.gz   # unpack the sources
-  % cd gimp-2.5.x                # change to the toplevel directory
+  % tar xvfz gimp-2.6.x.tar.gz   # unpack the sources
+  % cd gimp-2.6.x                # change to the toplevel directory
   % ./configure                  # run the `configure' script
   % make                         # build GIMP
   % make install                 # install GIMP
@@ -125,8 +135,8 @@
      is intended primarily as a convenience for developers.
 
   --enable-gimpdir=DIR.  This option changes the default directory
-     GIMP uses to search for its configuration files from ~/.gimp-2.5 
-     (the directory .gimp-2.5 in the users home directory) to DIR.
+     GIMP uses to search for its configuration files from ~/.gimp-2.6 
+     (the directory .gimp-2.6 in the users home directory) to DIR.
 
   --enable-binreloc.  When compiled for Linux with this option enabled,
      GIMP will be binary relocatable.  Plug-ins and data files will
@@ -149,11 +159,16 @@
      causing any trouble at compile-time, you can build --without-exif.
      Get libexif from http://www.sourceforge.net/projects/libexif.
 
-  --without-mng, --without-aa.  The MNG plug-in needs libmng and
-     configure checks for its presense. If for some reason you don't
-     want to build the MNG plug-in even though the library is installed,
-     use --without-mng to disable it expliticely. The same switch exists
-     for aalib, use --without-aa if you run into problems.
+  --without-aa.  The AA plug-in needs libaa and configure checks for
+     its presense. Use --without-aa if you run into problems.
+
+  --without-mng.  The MNG plug-in needs libmng and configure checks
+     for its presense. If for some reason you don't want to build the
+     MNG plug-in even though the library is installed, use
+     --without-mng to disable it explicitly.
+
+  --without-wmf.  The WMF plug-in needs libwmf2 and configure checks for
+     its presense. Use --without-aa if you run into problems.
 
   --without-webkit.  If for some reason you don't want to build the 
      helpbrowser plug-in, you can use --without-webkit to disable 
@@ -224,8 +239,8 @@
      if you call configure with --without-desktop-dir.
 
   --disable-default-binary. Use this option if you don't want to make
-     gimp-2.5 the default gimp installation. Otherwise a link called
-     gimp pointing to the gimp-2.5 executable will be installed.
+     gimp-2.6 the default gimp installation. Otherwise a link called
+     gimp pointing to the gimp-2.6 executable will be installed.
 
   --disable-gimp-console.  Use this option if you don't want the
      gimp-console binary to be built in addition to the standard binary.
@@ -246,7 +261,7 @@
  - A bunch of public libraries in the directories starting with 'libgimp'.
  - The plug-in programs in the 'plug-ins' directory.
  - Some modules in the 'modules' subdirectory.
- - The main GIMP program 'gimp-2.5' in `app'.
+ - The main GIMP program 'gimp-2.6' in `app'.
 
 The `make install' commands installs the gimp header files associated 
 with the libgimp libraries, the plug-ins, some data files and the GIMP 

Modified: branches/soc-2008-tagging/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/Makefile.am	(original)
+++ branches/soc-2008-tagging/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -55,6 +55,7 @@
 	ChangeLog.pre-2-0	\
 	ChangeLog.pre-2-2	\
 	ChangeLog.pre-2-4	\
+	ChangeLog.pre-2-6	\
 	HACKING			\
 	INSTALL			\
 	LICENSE			\
@@ -62,6 +63,7 @@
 	NEWS.pre-2-0		\
 	NEWS.pre-2-2		\
 	NEWS.pre-2-4		\
+	NEWS.pre-2-6		\
 	README			\
 	README.i18n		\
 	authors.dtd		\
@@ -70,8 +72,7 @@
 	config.h.win32		\
 	gimp-zip.in		\
 	gimpdefs.msc		\
-	makefile.msc		\
-	mkinstalldirs
+	makefile.msc
 
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc

Modified: branches/soc-2008-tagging/NEWS
==============================================================================
--- branches/soc-2008-tagging/NEWS	(original)
+++ branches/soc-2008-tagging/NEWS	Sun Oct 12 15:38:02 2008
@@ -1,168 +1,4 @@
                    ------------------------------
                    GNU Image Manipulation Program
-                         Development Branch
+                          Development Branch
                    ------------------------------
-
-This is the unstable development branch of GIMP.  Here we are working
-towards the next stable release, which will be GIMP 2.6.
-
-
-Changes in GIMP 2.5.2
-=====================
-
- - final touches on the combined Freehand/Polygon Select tool
- - added a dockable dialog for managing Color tool settings
- - prepared the code for changes in the upcoming GTK+ release
- - improved popup scale button
- - mark the center of rectangles/bounding rectangles during moves
- - added dialog to query for using the online user manual
- - allow to map dynamics to hardness for the Eraser tool
- - provide gimp-remote functionality on Windows
- - disable the build and install of the gimp-remote tool by default
- - allow to scroll beyond the image borders
- - added new PDB data type for transferring color arrays
- - added new PDB function gimp-palette-get-colors
- - added text search to the Help Browser plug-in
- - bug fixes and code cleanup
-
-
-Contributors:
-
-  Sven Neumann, Michael Natterer, Martin Nordholts, Manish Singh,
-  Lars-Peter Clausen, Alexia Death, Tor Lillqvist, RÃman Joost,
-  Jakub Steiner
-
-
-Changes in GIMP 2.5.1
-=====================
-
- - further improvements to the status bar
- - made the center point of rectangles snap to the grid and rulers
- - improved Alpha to Logo filters
- - better cursor feedback in the Intelligent Scissors tool
- - rotate JPEG thumbnails according to the EXIF orientation
- - improved event smoothing for paint tools
- - prepared PSP plug-in to deal with newer versions of the file format
- - allow plug-ins to work in parallel on different layers of the same image
- - pass through GEGL command-line options
- - added 22 new variations to the Flame plugin
- - only show operations from relevant categories in the GEGL tool
- - allow to enter the zoom ratio in the status bar
- - don't keep the file-chooser dialogs around
- - ported scan-convert code to Cairo, removing libart dependency
- - allow the paint velocity to affect brush size, opacity and the like
- - allow for random variations of the brush size, opacity and the like
- - renamed Dialogs menu to Windows
- - keep a list of recently closed docks in the Windows menu
- - allow to go from Brightness-Contrast to Levels to Curves
- - improved the handling of color tool settings
- - merged the new Polygon Selection tool with the Freehand Select tool
- - allow to lock dockables
- - made Desaturate into a tool with preview in the image window
- - ported translation contexts to msgctxt
- - added GimpRuler widgets, an improved version of GtkRuler
- - moving the selection mask now commits a pending rectangle selection
- - added keyboard shortcut for resetting the brush scale (Backslash)
- - ported the Help Browser plug-in to WebKit
- - allow to use the online user manual
- - added new translation (Icelandic)
- - bug fixes and code cleanup
-
-
-Contributors:
-
-  Sven Neumann, Michael Natterer, Martin Nordholts, Ãyvind KolÃs,
-  Alexia Death, Ulf-D. Ehlert, Daniel Hornung, Michael Deal, Aurimas JuÅka,
-  Luis Barrancos
-
-
-
-Changes in GIMP 2.5.0
-=====================
-
-Core:
-
- - improved rectangle tool drawing for narrow mode
- - ported lots (but not all) drawing code to Cairo
- - optimized image rendering by using pre-multiplied alpha
- - use new GLib features such as GRegex
- - use new GTK+ features such as the new GtkTooltip API
- - much improved GimpCurve object
- - cleaner and smaller tool options
- - enable brush scaling for the Smudge tool
- - added debugging framework that can be enabled at run-time
- - depend on GEGL and use it optionally in some color operations
- - optional GEGL processing for all color tools
- - add proper settings objects for all color tools
- - add list of recently used settings to all color tools
- - added experimental GEGL tool to use arbitrary GEGL operations
- - event filtering and smoothing for better paint tool performance
- - added motion constraints in the Move Tool
- - some operations do not any longer automatically add an alpha channel
- - some preparation for tagging resource files
- - cutting a selection doesn't clear the selection any longer
- - added new polygon select tool
- - load brushes and other data files recursively (search through subdirs)
- - started work on language selector for the text tool (unfinished)
- - allow to set opacity of the transform tool preview
- - merged toolbox menu into the image menu
- - always keep an image window around
- - improved image statusbar
- - dropped 'documents' in favor of ~/.recently-used.xbel
- - started to work on text box functionality in the text tool
- - numerous bug fixes and cleanups
-
-
-Plug-ins:
-
- - dicom: improved handling of 16 bit image data
- - help: use GIO to access the help index
- - print: moved Page Setup out of the Print dialog
- - psd-load: rewritten, cleaner and more features
- - randomize: added previews
- - ripple:  added a Phase Shift control
- - screenshot: optionally add the mouse cursor image on an extra layer
- - uri: use GIO/GVfs where available
- - whirlpinch: allow a larger range for the whirl angle
-
-
-Python binding:
-
- - allow to specify colors using CSS color names
- - added new method Image.new_layer()
-
-
-Script-Fu:
-
- - enforce R5RS syntax for 'let'
- - improved Frosty Logo script
-
-
-PDB:
-
- - added new text layer API
- - added gimp-vectors-export-to-file and gimp-vectors-export-to-string
- - added procedure to test for existance of a procedure in the PDB
- - improved error handling for procedures
-
-
-Libraries:
-
- - added some Cairo utilities
- - allow to use markup in tooltips
- - libgimpthumb doesn't any longer depend on other GIMP libraries
-
-
-Miscellaneous:
-
- - use the gimptool program on Unix, too, instead of the gimptool script
- - create the list of supported MIME types at compile-time
- - gimp shows library versions when called with '--version --verbose'
-
-
-Contributors:
-
-  Sven Neumann, Michael Natterer, Martin Nordholts, Bill Skaggs,
-  Ãyvind KolÃs, Manish Singh, Kevin Cozens, Alexia Death, Tor Lillqvist,
-  Marcus Heese, John Marshall, Joao S. O. Bueno, Jakub Steiner,
-  Simon Budig, Tom Lechner, Hans Breuer, ...

Modified: branches/soc-2008-tagging/README
==============================================================================
--- branches/soc-2008-tagging/README	(original)
+++ branches/soc-2008-tagging/README	Sun Oct 12 15:38:02 2008
@@ -3,13 +3,9 @@
                          Development Branch
                    ------------------------------
 
-This is the unstable development branch of GIMP. It is intended to
-developers only. If you are a user, please use the stable gimp-2-4
-branch or a tarball release from the 2.4 series.
-
-GIMP 2.5 replaces earlier GIMP 2.x versions. It is advised that you
-uninstall them before installing GIMP 2.5. If you want to keep your
-older GIMP 2.x installation in parallel to GIMP 2.5, you have to
+GIMP 2.7 replaces earlier GIMP 2.x versions. It is advised that you
+uninstall them before installing GIMP 2.7. If you want to keep your
+older GIMP 2.x installation in parallel to GIMP 2.7, you have to
 choose a separate prefix which is not in your default library search
 path. Otherwise your GIMP 2.4 or GIMP 2.2 installation will start to
 use the new libraries. You have been warned.
@@ -93,13 +89,13 @@
 The look of GIMP's interface can be customized like any other GTK app
 by editing the ~/.gtkrc-2.0 file or by using "themes" (ready-made
 customizations).  For downloadable themes and further details, see
-http://gtk.themes.org.  Additionally, GIMP reads ~/.gimp-2.4/gtkrc so
+http://gtk.themes.org.  Additionally, GIMP reads ~/.gimp-2.7/gtkrc so
 you can have settings that only apply to GIMP.
 
 Included is a set of keybindings similar to those in Adobe Photoshop.
 You can find them in the ps-menurc file.  To use them, copy this file
-to ~/.gimp-2.5/menurc. You can also manually change the keybindings to
-any of your choice by editing ~/.gimp-2.5/menurc.
+to ~/.gimp-2.7/menurc. You can also manually change the keybindings to
+any of your choice by editing ~/.gimp-2.7/menurc.
 
 
 Have fun,
@@ -111,3 +107,4 @@
   Sven Neumann
   Michael Natterer
   Dave Neary
+  Martin Nordholts

Modified: branches/soc-2008-tagging/README.i18n
==============================================================================
--- branches/soc-2008-tagging/README.i18n	(original)
+++ branches/soc-2008-tagging/README.i18n	Sun Oct 12 15:38:02 2008
@@ -1,170 +1,28 @@
-This document exists to document the important things to care
-for because of locale support. It is aimed at developers and
-translators. If you are a translator, you can skip the first
-sections, but you definitely want to read sections 5 - 9.
-
- Table of Contents
-
-   1. Why localisation?
-   2. How
-   3. Deep inside ...
-   4. Some magic ...
-   5. Tools and how to use them
-   6. Gimp is different
-   7. Adding additional textdomains
-   8. Tip of the Day messages
-   9. How to contribute
-  10. And more ?
-
-
-1. Why localisation?
-
- Many persons from many countries start to get used to Linux.
- Unfortunately not everyone is able to understand English. But
- even those people sometimes like to use good and free software
- without using a dictionary to get the unknown words.
- So why not simply localise the software to make it available to
- the mass which isn't wholly English native? Of course this also
- eases the migration from PhotoX to GIMP. :))
-
-2. How?
-
- GNU provides a very nice package called gettext. This one offers
- the possibility to translate chosen messages from the native language
- of the program into that one of the users if a necessary catalog is
- provided. Gettext therefore provides some easy tools to create and
- maintain such catalogs and a few functions which can be called by the
- program to enable automatic translation at runtime. The program gets
- linked to the gettext library or glibc2 which already provides that
- functionality and everything is fine.
-
-3. Deep inside...
-
- GIMP provides header files called gimpintl.h and stdplugins-intl.h in
- the libgimp directory which check whether gettext is available on the
- system which GIMP is compiled on and will deactivate language support
- if it's not.
-
- If the gettext system is there it will declare 3 functions which will be
- described below.
-
-3.1 _() [more correctly: char * _( char * )]
-
- This one is a macro for the function gettext(). You can wrap any text
- with it that is allowed to be a return value of a function. If you
- use it then libintl will try to translate it into the native language
- of the user according to his/her environmental settings.
- The gettext() function will do a lookup in the hashed catalog which
- contains all the translated texts.
-
- - If it is found a pointer to the string will be returned to the caller.
- - If not, the caller will receive a pointer to the original string.
-
- This way it is ensured that there isn't any harm caused to the program
- if no useful catalog is installed.
-
- Please note that it is important to use _() directly (and not gettext())
- for simple messages because of reasons that will be mentioned below.
-
- NOTE: I know some of the developer like short functions like _() but
- for a better source understanding I suggest to use it consistently only
- for text (like _("That's text!")) and not for variables (like _(text)).
- Use gettext(text) instead.
-
-
-3.2 N_() [more correctly: const char * ( const char * ) ]
-
- This one is a macro for the function gettext_noop(). As you can see
- and guess it doesn't really do anything in the programm i.e. it is a
- dummy macro but nevertheless important. As it isn't possible to call
- functions in a structure as seen here:
-
- struct blurb
- {
-  _("This won't work\n");
- }
-
- you have to do it in some other way. In GIMP such structures are
- often used to create menus or similar things very simply. Here you
- have to use the dummy to allow the generation of the template catalog
- which will be described below. This one doesn't do anything but it
- marks the text as important to the xgettext extractor.
-
- The text has to be translated manually with the next function.
-
-3.3 gettext()
-
- This function is the same as that macro in 3.1. But there is one big
- difference: The _()'s and N_()'s are the only expressions which get
- parsed by the template generator.
- If you have strings that should be translated but are unfortunately
- in a structure you have to do that on your own which means that you
- have to parse the fields with the messages in a loop and translate
- the texts with this gettext() function.
-
- Please note that it may be necessary to free or allocate memory in
- this case!
-
-4. Some magic...
-
- As you have seen we only did the programming part until now but this
- isn't all by far. To use catalogs we'll have to create them. Now
- there are 3 different files which are importart:
-
- gimp.pot:
-
- This one is the so called template. It contains the messages which
- are extracted from the sources and empty fields which have to get
- filled by the author. It is used to start a new catalog or to update
- the an already available one.
-
- The Makefile will automatically call the program gettext which will
- extract all messages that are wrapped by a _() or a N_() (but NOT
- gettext()) and concat them to this template.
-
- [language].po:
-
- This file has to be an edited gimp.pot and contains the original
- messages plus the translated ones. This file will be delivered
- together with GIMP and is the base for the final catalog.
-
- [language].mo:
-
- This file is a compiled version of [language.po] which will be
- automatically compiled by the Makefile system and installed in the
- locale directory of the system. It contains everything that the .po
- file contains except not translated messages, comments and other
- overhead. For maximum speed it is also hashed to allow gettext a
- faster search.
-
-5. Tools and how to use them
-
- As mentioned the to be translated strings are extracted directly from
- the source and written to the template.
-
- I guess many of you will now ask if it is necessary to add new
- strings directly to the template or if there's a tool to achieve
- that. I think I can calm down those of you who fear lots of had work
- just to update the language files. There's a program called msgmerge
- which will add all strings that are in the template but not in the
- uncompiled catalog to it. Msgmerge does this job very nicely and also
- tries to use some kind of fuzzy logic method for already translated
- strings for possible reduction of translators work: If an original
- string seems similar to a new one and it already has a translation,
- it will be taken over to the new catalog together with a remark that
-this one may not necessarily fit.
+This file contains some important hints for translators.
 
-6. Gimp is different
 
- Gimp is a complex application which has a bunch of scripts and
+The current status of the GIMP translation can be checked at
+
+  http://l10n.gnome.org/module/gimp
+
+
+Translation of the GNU Image Manipulation Program is handled by the
+GNOME Translation Project (see http://l10n.gnome.org/). If you want to
+help, we suggest that you get in touch with the translation team of
+your language (see http://l10n.gnome.org/teams/).
+
+
+GIMP is different
+
+ GIMP is a complex application which has a bunch of scripts and
  plug-ins that all want to be internationalized. Therefore there is
- not one catalog but many. For a full translation of GIMP's UI,
- you will have to add translations for the following catalogs:
+ not one catalog but many. For a full translation of GIMP's UI, you
+ will have to add translations for the following catalogs:
 
    po/gimp20.po                       --  the core
    po-libgimp/gimp20-libgimp.pot      --  the libgimp library
-   po-python/gimp20-python.pot        --  the pygimp plug-ins
    po-plugins/gimp20-std-plugins.pot  --  the C plug-ins
+   po-python/gimp20-python.pot        --  the pygimp plug-ins
    po-script-fu/gimp20-script-fu.pot  --  the script-fu scripts
    po-tips/gimp20-tips.pot            --  the startup tips
 
@@ -172,32 +30,12 @@
  gimp-perl has been moved into it's own Subversion module called
  gimp-perl.
 
- The version of GIMP you are holding in your hand uses GTK+-2.0. 
- GTK+-2.0 requires that all strings are UTF-8 encoded. Therefore to
- make internationalisation work, po files need to be UTF-8 encoded. If
- your editor doesn't support UTF-8, you need to convert it to an
- encoding your editor can handle and convert it back to UTF-8 before
- commiting your changes back. The gnome-i18n module in Subversion has
- some scripts that help with this task, but it can also easily done
- using iconv.
-
-7. Adding additional textdomains
-
- Third-party plug-ins (plug-ins that are not distributed with The
- GIMP) can't have their messages in the gimp-std-plugins textdomain.
- We have therefore provided a mechanism that allows plug-ins to
- install their own message catalogs and tell GIMP to bind to that
- textdomain. This is necessary so that GIMP can correctly translate
- the menu paths the plug-in registers. Basically the plug-in has to
- call gimp_plugin_domain_add() or gimp_domain_plugin_add_with_path()
- before it registers any functions. Have a look at the script-fu
- plug-in to see how this is done in detail.
 
-8. Tip of the Day messages
+GIMP Tips dialog
 
- In addition to message catalogs Gimp provides a file with tips that
- are displayed in a Tip of The Day window. This file is in XML format
- and can be found in the tips directory. The english tips messages are
+ In addition to message catalogs GIMP provides a file with tips that
+ are displayed in the Tips dialog. This file is in XML format and can
+ be found in the tips directory. The english tips messages are
  extracted from gimp-tips.xml.in so translators can use the usual
  tools to create a <lang>.po file that holds the translations. All
  translations are then merged into gimp-tips.xml with language
@@ -208,27 +46,19 @@
  message catalog that needs to be translated correctly. For a german
  translation of the tips this would look like this:
 
- #: app/gui/tips-parser.c:158
+ #: ../app/dialogs/tips-parser.c:188
  msgid "tips-locale:C"
  msgstr "tips-locale:de"
 
-9. How to contribute
-
- Any help with translations is appreciated. If you want to help,
- please get in contact with the people from the GNOME Translation
- Project who coordinate all translation efforts in the GNOME
- Subversion tree. They have a nice web-page at
-	http://developer.gnome.org/projects/gtp/.
-
-10. And more?
-
- We hope we mentioned everything that is worth it and hope that this
- document will clarify some things. If it doesn't please write us a
- mail. This text of course contains errors, so if you find one tell
- us...
-
 
-Happy Gimping.
-	Daniel Egger
-	Sven Neumann
+Localization of third-party plug-ins
 
+ Third-party plug-ins (plug-ins that are not distributed with GIMP)
+ can't have their messages in the gimp-std-plugins textdomain.  We
+ have therefore provided a mechanism that allows plug-ins to install
+ their own message catalogs and tell GIMP to bind to that
+ textdomain. This is necessary so that GIMP can correctly translate
+ the menu paths the plug-in registers. Basically the plug-in has to
+ call gimp_plugin_domain_add() or gimp_domain_plugin_add_with_path()
+ before it registers any functions. Have a look at the script-fu
+ plug-in to see how this is done in detail.

Modified: branches/soc-2008-tagging/app/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -33,9 +33,9 @@
 
 
 if ENABLE_GIMP_CONSOLE
-bin_PROGRAMS = gimp-2.5 gimp-console-2.5
+bin_PROGRAMS = gimp-2.7 gimp-console-2.7
 else
-bin_PROGRAMS = gimp-2.5
+bin_PROGRAMS = gimp-2.7
 endif
 
 app_sources = \
@@ -59,7 +59,7 @@
 	gimp-log.h	\
 	gimp-intl.h
 
-gimp_2_5_SOURCES = $(app_sources)
+gimp_2_7_SOURCES = $(app_sources)
 
 
 EXTRA_DIST = \
@@ -102,9 +102,9 @@
 	-u $(SYMPREFIX)gimp_image_map_config_get_type	\
 	-u $(SYMPREFIX)gimp_plug_in_manager_restore
 
-gimp_2_5_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags) 
+gimp_2_7_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags) 
 
-gimp_2_5_LDADD = \
+gimp_2_7_LDADD = \
 	gui/libappgui.a			\
 	actions/libappactions.a		\
 	dialogs/libappdialogs.a		\
@@ -133,7 +133,6 @@
 	$(libgimpmath)			\
 	$(libgimpconfig)		\
 	$(libgimpbase)			\
-	$(REGEXREPL)			\
 	$(GTK_LIBS)			\
 	$(PANGOFT2_LIBS)		\
 	$(FONTCONFIG_LIBS)		\
@@ -147,13 +146,13 @@
 
 if ENABLE_GIMP_CONSOLE
 
-gimp_console_2_5_SOURCES = $(app_sources)
+gimp_console_2_7_SOURCES = $(app_sources)
 
-gimp_console_2_5_CPPFLAGS = \
+gimp_console_2_7_CPPFLAGS = \
 	$(AM_CPPFLAGS)			\
 	-DGIMP_CONSOLE_COMPILATION
 
-gimp_console_2_5_LDADD = \
+gimp_console_2_7_LDADD = \
 	widgets/widgets-enums.o		\
 	display/display-enums.o		\
 	display/gimpdisplayoptions.o	\
@@ -177,7 +176,6 @@
 	$(libgimpmath)			\
 	$(libgimpconfig)		\
 	$(libgimpbase)			\
-	$(REGEXREPL)			\
 	$(GDK_PIXBUF_LIBS)		\
 	$(CAIRO_LIBS)			\
 	$(PANGOFT2_LIBS)		\

Modified: branches/soc-2008-tagging/app/actions/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/actions/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/actions/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Actions\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GTK_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappactions.a
 
 libappactions_a_SOURCES = \
@@ -23,6 +35,10 @@
 	colormap-actions.h		\
 	colormap-commands.c		\
 	colormap-commands.h		\
+	config-actions.c		\
+	config-actions.h		\
+	config-commands.c		\
+	config-commands.h		\
 	context-actions.c		\
 	context-actions.h		\
 	context-commands.c		\
@@ -158,18 +174,4 @@
 	windows-commands.c		\
 	windows-commands.h
 
-
-EXTRA_DIST = \
-	makefile.msc
-
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Actions\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GTK_CFLAGS)		\
-	$(GEGL_CFLAGS)		\
-	-I$(includedir)
+EXTRA_DIST = makefile.msc

Modified: branches/soc-2008-tagging/app/actions/actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -52,6 +53,7 @@
 #include "buffers-actions.h"
 #include "channels-actions.h"
 #include "colormap-actions.h"
+#include "config-actions.h"
 #include "context-actions.h"
 #include "cursor-info-actions.h"
 #include "debug-actions.h"
@@ -112,7 +114,10 @@
   { "colormap", N_("Colormap"), GIMP_STOCK_COLORMAP,
     colormap_actions_setup,
     colormap_actions_update },
-  { "context", N_("Context"), NULL,
+  { "config", N_("Configuration"), GTK_STOCK_PREFERENCES,
+    config_actions_setup,
+    config_actions_update },
+  { "context", N_("Context"), GIMP_STOCK_TOOL_OPTIONS /* well... */,
     context_actions_setup,
     context_actions_update },
   { "cursor-info", N_("Pointer Information"), NULL,

Modified: branches/soc-2008-tagging/app/actions/buffers-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/buffers-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/buffers-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "actions-types.h"

Modified: branches/soc-2008-tagging/app/actions/channels-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/channels-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/channels-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/channels-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/channels-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/channels-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -166,7 +167,7 @@
                               action_data_get_context (data),
                               GIMP_TRANSPARENT_FILL);
 
-  gimp_image_add_channel (image, new_channel, -1);
+  gimp_image_add_channel (image, new_channel, -1, TRUE);
 
   gimp_image_undo_group_end (image);
 
@@ -181,7 +182,7 @@
   GimpChannel *channel;
   return_if_no_channel (image, channel, data);
 
-  gimp_image_raise_channel (image, channel);
+  gimp_image_raise_channel (image, channel, NULL);
   gimp_image_flush (image);
 }
 
@@ -205,7 +206,7 @@
   GimpChannel *channel;
   return_if_no_channel (image, channel, data);
 
-  gimp_image_lower_channel (image, channel);
+  gimp_image_lower_channel (image, channel, NULL);
   gimp_image_flush (image);
 }
 
@@ -262,7 +263,7 @@
                                            G_TYPE_FROM_INSTANCE (channel)));
     }
 
-  gimp_image_add_channel (image, new_channel, -1);
+  gimp_image_add_channel (image, new_channel, -1, TRUE);
   gimp_image_flush (image);
 }
 
@@ -274,7 +275,7 @@
   GimpChannel *channel;
   return_if_no_channel (image, channel, data);
 
-  gimp_image_remove_channel (image, channel);
+  gimp_image_remove_channel (image, channel, TRUE, NULL);
   gimp_image_flush (image);
 }
 
@@ -356,7 +357,7 @@
                                       GIMP_TRANSPARENT_FILL);
         }
 
-      gimp_image_add_channel (options->image, new_channel, -1);
+      gimp_image_add_channel (options->image, new_channel, -1, TRUE);
       gimp_image_flush (options->image);
     }
 

Modified: branches/soc-2008-tagging/app/actions/colormap-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/colormap-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/colormap-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/colormap-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/colormap-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/colormap-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/actions/context-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/context-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/context-actions.c	Sun Oct 12 15:38:02 2008
@@ -77,31 +77,31 @@
 static GimpEnumActionEntry context_palette_foreground_actions[] =
 {
   { "context-palette-foreground-set", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Set", NULL, NULL,
+    "Foreground Palette Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-palette-foreground-first", GIMP_STOCK_PALETTE,
-    "Foreground Palette color First", NULL, NULL,
+    "Foreground Palette Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-palette-foreground-last", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Last", NULL, NULL,
+    "Foreground Palette Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-palette-foreground-previous", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Previous", NULL, NULL,
+    "Foreground Palette Color Previous", NULL, NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-palette-foreground-next", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Next", NULL, NULL,
+    "Foreground Palette Color Next", NULL, NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-palette-foreground-previous-skip", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Skip Back", NULL, NULL,
+    "Foreground Palette Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-palette-foreground-next-skip", GIMP_STOCK_PALETTE,
-    "Foreground Palette color Skip Forward", NULL, NULL,
+    "Foreground Palette Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -109,31 +109,31 @@
 static GimpEnumActionEntry context_palette_background_actions[] =
 {
   { "context-palette-background-set", GIMP_STOCK_PALETTE,
-    "Background Palette color Set", NULL, NULL,
+    "Background Palette Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-palette-background-first", GIMP_STOCK_PALETTE,
-    "Background Palette color First", NULL, NULL,
+    "Background Palette Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-palette-background-last", GIMP_STOCK_PALETTE,
-    "Background Palette color Last", NULL, NULL,
+    "Background Palette Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-palette-background-previous", GIMP_STOCK_PALETTE,
-    "Background Palette color Previous", NULL, NULL,
+    "Background Palette Color Previous", NULL, NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-palette-background-next", GIMP_STOCK_PALETTE,
-    "Background Palette color Next", NULL, NULL,
+    "Background Palette Color Next", NULL, NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-palette-background-previous-skip", GIMP_STOCK_PALETTE,
-    "Background Palette color Skip Back", NULL, NULL,
+    "Background Palette Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-palette-background-next-skip", GIMP_STOCK_PALETTE,
-    "Background Palette color Skip ahead", NULL, NULL,
+    "Background Palette Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -141,31 +141,31 @@
 static GimpEnumActionEntry context_colormap_foreground_actions[] =
 {
   { "context-colormap-foreground-set", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Set", NULL, NULL,
+    "Foreground Colormap Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-colormap-foreground-first", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color First", NULL, NULL,
+    "Foreground Colormap Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-colormap-foreground-last", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Last", NULL, NULL,
+    "Foreground Colormap Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-colormap-foreground-previous", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Previous", NULL, NULL,
+    "Foreground Colormap Color Previous", NULL, NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-colormap-foreground-next", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Next", NULL, NULL,
+    "Foreground Colormap Color Next", NULL, NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-colormap-foreground-previous-skip", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Skip Back", NULL, NULL,
+    "Foreground Colormap Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-colormap-foreground-next-skip", GIMP_STOCK_COLORMAP,
-    "Foreground Colormap color Skip Forward", NULL, NULL,
+    "Foreground Colormap Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -173,31 +173,31 @@
 static GimpEnumActionEntry context_colormap_background_actions[] =
 {
   { "context-colormap-background-set", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Set", NULL, NULL,
+    "Background Colormap Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-colormap-background-first", GIMP_STOCK_COLORMAP,
-    "Background Colormap color First", NULL, NULL,
+    "Background Colormap Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-colormap-background-last", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Last", NULL, NULL,
+    "Background Colormap Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-colormap-background-previous", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Previous", NULL, NULL,
+    "Background Colormap Color Previous", NULL, NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-colormap-background-next", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Next", NULL, NULL,
+    "Background Colormap Color Next", NULL, NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-colormap-background-previous-skip", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Skip Back", NULL, NULL,
+    "Background Colormap Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-colormap-background-next-skip", GIMP_STOCK_COLORMAP,
-    "Background Colormap color Skip ahead", NULL, NULL,
+    "Background Colormap Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -205,31 +205,31 @@
 static GimpEnumActionEntry context_swatch_foreground_actions[] =
 {
   { "context-swatch-foreground-set", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Set", NULL, NULL,
+    "Foreground Swatch Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-swatch-foreground-first", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color First", NULL, NULL,
+    "Foreground Swatch Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-swatch-foreground-last", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Last", NULL, NULL,
+    "Foreground Swatch Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-swatch-foreground-previous", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Previous", "9", NULL,
+    "Foreground Swatch Color Previous", "9", NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-swatch-foreground-next", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Next", "0", NULL,
+    "Foreground Swatch Color Next", "0", NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-swatch-foreground-previous-skip", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Skip Back", NULL, NULL,
+    "Foreground Swatch Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-swatch-foreground-next-skip", GIMP_STOCK_PALETTE,
-    "Foreground Swatch color Skip Forward", NULL, NULL,
+    "Foreground Swatch Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -237,31 +237,31 @@
 static GimpEnumActionEntry context_swatch_background_actions[] =
 {
   { "context-swatch-background-set", GIMP_STOCK_PALETTE,
-    "Background Swatch color Set", NULL, NULL,
+    "Background Swatch Color Set", NULL, NULL,
     GIMP_ACTION_SELECT_SET, FALSE,
     NULL },
   { "context-swatch-background-first", GIMP_STOCK_PALETTE,
-    "Background Swatch color First", NULL, NULL,
+    "Background Swatch Color First", NULL, NULL,
     GIMP_ACTION_SELECT_FIRST, FALSE,
     NULL },
   { "context-swatch-background-last", GIMP_STOCK_PALETTE,
-    "Background Swatch color Last", NULL, NULL,
+    "Background Swatch Color Last", NULL, NULL,
     GIMP_ACTION_SELECT_LAST, FALSE,
     NULL },
   { "context-swatch-background-previous", GIMP_STOCK_PALETTE,
-    "Background Swatch color Previous", NULL, NULL,
+    "Background Swatch Color Previous", NULL, NULL,
     GIMP_ACTION_SELECT_PREVIOUS, FALSE,
     NULL },
   { "context-swatch-background-next", GIMP_STOCK_PALETTE,
-    "Background Swatch color Next", NULL, NULL,
+    "Background Swatch Color Next", NULL, NULL,
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-swatch-background-previous-skip", GIMP_STOCK_PALETTE,
-    "Background Swatch color Skip Back", NULL, NULL,
+    "Background Swatch Color Skip Back", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-swatch-background-next-skip", GIMP_STOCK_PALETTE,
-    "Background Swatch color Skip ahead", NULL, NULL,
+    "Background Swatch Color Skip Forward", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };
@@ -1061,11 +1061,11 @@
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "context-brush-angle-decrease-skip", GIMP_STOCK_BRUSH,
-    "Rotate Right 15 degrees", NULL, NULL,
+    "Rotate Right 15Â", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "context-brush-angle-increase-skip", GIMP_STOCK_BRUSH,
-    "Rotate Left 15 degrees", NULL, NULL,
+    "Rotate Left 15Â", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL }
 };

Modified: branches/soc-2008-tagging/app/actions/context-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/context-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/context-commands.c	Sun Oct 12 15:38:02 2008
@@ -118,7 +118,7 @@
   gimp_context_swap_colors (context);
 }
 
-#define SELECT_COLOR_CMD_CALLBACK(name, fgbg, usec, usep) \
+#define SELECT_COLOR_CMD_CALLBACK(name, fgbg, use_colormap, use_palette) \
 void \
 context_##name##_##fgbg##ground_cmd_callback (GtkAction *action, \
                                               gint       value, \
@@ -129,7 +129,8 @@
   return_if_no_context (context, data); \
 \
   gimp_context_get_##fgbg##ground (context, &color); \
-  context_select_color ((GimpActionSelectType) value, &color, usec, usep); \
+  context_select_color ((GimpActionSelectType) value, &color, \
+                        use_colormap, use_palette); \
   gimp_context_set_##fgbg##ground (context, &color); \
 }
 

Modified: branches/soc-2008-tagging/app/actions/debug-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/debug-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/debug-actions.c	Sun Oct 12 15:38:02 2008
@@ -24,6 +24,8 @@
 
 #include "actions-types.h"
 
+#include "core/gimp.h"
+
 #include "widgets/gimpactiongroup.h"
 
 #include "debug-actions.h"

Modified: branches/soc-2008-tagging/app/actions/dialogs-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/dialogs-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/dialogs-actions.c	Sun Oct 12 15:38:02 2008
@@ -119,7 +119,7 @@
     "gimp-brush-grid|gimp-brush-list",
     GIMP_HELP_BRUSH_DIALOG },
 
-  { "dialogs-brush-editor", NULL,
+  { "dialogs-brush-editor", GIMP_STOCK_BRUSH,
     N_("Brush Editor"), NULL,
     N_("Open the brush editor"),
     "gimp-brush-editor",
@@ -137,7 +137,7 @@
     "gimp-gradient-list|gimp-gradient-grid",
     GIMP_HELP_GRADIENT_DIALOG },
 
-  { "dialogs-gradient-editor", NULL,
+  { "dialogs-gradient-editor", GIMP_STOCK_GRADIENT,
     N_("Gradient Editor"), NULL,
     N_("Open the gradient editor"),
     "gimp-gradient-editor",
@@ -149,7 +149,7 @@
     "gimp-palette-list|gimp-palette-grid",
     GIMP_HELP_PALETTE_DIALOG },
 
-  { "dialogs-palette-editor", NULL,
+  { "dialogs-palette-editor", GIMP_STOCK_PALETTE,
     N_("Palette Editor"), NULL,
     N_("Open the palette editor"),
     "gimp-palette-editor",
@@ -173,7 +173,7 @@
     "gimp-image-list|gimp-image-grid",
     GIMP_HELP_IMAGE_DIALOG },
 
-  { "dialogs-document-history", GTK_STOCK_OPEN,
+  { "dialogs-document-history", "document-open-recent",
     N_("Document Histor_y"), "",
     N_("Open the document history dialog"),
     "gimp-document-list|gimp-document-grid",

Modified: branches/soc-2008-tagging/app/actions/documents-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/documents-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/documents-actions.c	Sun Oct 12 15:38:02 2008
@@ -38,7 +38,7 @@
 
 static const GimpActionEntry documents_actions[] =
 {
-  { "documents-popup", GTK_STOCK_OPEN,
+  { "documents-popup", "document-open-recent",
     N_("Documents Menu"), NULL, NULL, NULL,
     GIMP_HELP_DOCUMENT_DIALOG },
 
@@ -48,13 +48,13 @@
     G_CALLBACK (documents_open_cmd_callback),
     GIMP_HELP_DOCUMENT_OPEN },
 
-  { "documents-raise-or-open", GTK_STOCK_OPEN,
+  { "documents-raise-or-open", NULL,
     N_("_Raise or Open Image"), "",
     N_("Raise window if already open"),
     G_CALLBACK (documents_raise_or_open_cmd_callback),
     GIMP_HELP_DOCUMENT_OPEN },
 
-  { "documents-file-open-dialog", GTK_STOCK_OPEN,
+  { "documents-file-open-dialog", NULL,
     N_("File Open _Dialog"), "",
     N_("Open image dialog"),
     G_CALLBACK (documents_file_open_dialog_cmd_callback),
@@ -84,13 +84,13 @@
     G_CALLBACK (documents_recreate_preview_cmd_callback),
     GIMP_HELP_DOCUMENT_REFRESH },
 
-  { "documents-reload-previews", GTK_STOCK_REFRESH,
+  { "documents-reload-previews", NULL,
     N_("Reload _all Previews"), "",
     N_("Reload all previews"),
     G_CALLBACK (documents_reload_previews_cmd_callback),
     GIMP_HELP_DOCUMENT_REFRESH },
 
-  { "documents-remove-dangling", GTK_STOCK_REFRESH,
+  { "documents-remove-dangling", NULL,
     N_("Remove Dangling E_ntries"), "",
     N_("Remove dangling entries"),
     G_CALLBACK (documents_remove_dangling_cmd_callback),

Modified: branches/soc-2008-tagging/app/actions/drawable-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/drawable-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/drawable-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/drawable-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/drawable-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/drawable-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/edit-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/edit-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/edit-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -118,7 +119,7 @@
 
   { "edit-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
     N_("Copy _Visible"), "<control><shift>C",
-    N_("Copy what is visible in the the selected region"),
+    N_("Copy what is visible in the selected region"),
     G_CALLBACK (edit_copy_visible_cmd_callback),
     GIMP_HELP_EDIT_COPY_VISIBLE },
 
@@ -254,7 +255,7 @@
 edit_actions_update (GimpActionGroup *group,
                      gpointer         data)
 {
-  GimpImage    *image       = action_data_get_image (data);
+  GimpImage    *image        = action_data_get_image (data);
   GimpDrawable *drawable     = NULL;
   gchar        *undo_name    = NULL;
   gchar        *redo_name    = NULL;
@@ -264,38 +265,43 @@
 
   if (image)
     {
-      GimpUndo *undo;
-      GimpUndo *redo;
-
       drawable = gimp_image_get_active_drawable (image);
 
       undo_enabled = gimp_image_undo_is_enabled (image);
 
       if (undo_enabled)
         {
-          undo = gimp_undo_stack_peek (image->undo_stack);
-          redo = gimp_undo_stack_peek (image->redo_stack);
+          GimpUndo *undo = gimp_undo_stack_peek (image->undo_stack);
+          GimpUndo *redo = gimp_undo_stack_peek (image->redo_stack);
 
           if (undo)
-            undo_name =
-              g_strdup_printf (_("_Undo %s"),
-                               gimp_object_get_name (GIMP_OBJECT (undo)));
+            {
+              undo_name =
+                g_strdup_printf (_("_Undo %s"),
+                                 gimp_object_get_name (GIMP_OBJECT (undo)));
+            }
 
           if (redo)
-            redo_name =
-              g_strdup_printf (_("_Redo %s"),
-                               gimp_object_get_name (GIMP_OBJECT (redo)));
+            {
+              redo_name =
+                g_strdup_printf (_("_Redo %s"),
+                                 gimp_object_get_name (GIMP_OBJECT (redo)));
+            }
 
           undo = gimp_image_undo_get_fadeable (image);
 
           if (GIMP_IS_DRAWABLE_UNDO (undo) &&
               GIMP_DRAWABLE_UNDO (undo)->src2_tiles)
-            fade_enabled = TRUE;
+            {
+              fade_enabled = TRUE;
+            }
 
           if (fade_enabled)
-            fade_name =
-              g_strdup_printf (_("_Fade %s..."),
-                               gimp_object_get_name (GIMP_OBJECT (undo)));
+            {
+              fade_name =
+                g_strdup_printf (_("_Fade %s..."),
+                                 gimp_object_get_name (GIMP_OBJECT (undo)));
+            }
         }
     }
 

Modified: branches/soc-2008-tagging/app/actions/edit-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/edit-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/edit-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -339,7 +340,7 @@
                                          GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
       g_object_unref (buffer);
 
-      gimp_image_add_layer (image, layer, -1);
+      gimp_image_add_layer (image, layer, -1, TRUE);
 
       gimp_image_flush (image);
     }

Modified: branches/soc-2008-tagging/app/actions/file-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/file-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/file-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -64,7 +65,7 @@
 static const GimpActionEntry file_actions[] =
 {
   { "file-menu",             NULL, N_("_File")        },
-  { "file-new-menu",         NULL, N_("Ne_w")         },
+  { "file-create-menu",      NULL, N_("Create")       },
   { "file-open-recent-menu", NULL, N_("Open _Recent") },
 
   { "file-open", GTK_STOCK_OPEN,
@@ -235,7 +236,6 @@
 #define SET_SENSITIVE(action,condition) \
         gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
 
-  SET_SENSITIVE ("file-open-as-layers",   image);
   SET_SENSITIVE ("file-save",             image && drawable);
   SET_SENSITIVE ("file-save-as",          image && drawable);
   SET_SENSITIVE ("file-save-a-copy",      image && drawable);

Modified: branches/soc-2008-tagging/app/actions/file-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/file-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/file-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -64,8 +65,9 @@
 
 /*  local function prototypes  */
 
-static void   file_open_dialog_show        (GtkWidget   *parent,
-                                            Gimp        *gimp,
+static void   file_open_dialog_show        (Gimp        *gimp,
+                                            GtkWidget   *parent,
+                                            const gchar *title,
                                             GimpImage   *image,
                                             const gchar *uri,
                                             gboolean     open_as_layers);
@@ -92,18 +94,16 @@
                         gpointer   data)
 {
   Gimp        *gimp;
-  GimpImage   *image;
   GtkWidget   *widget;
-  const gchar *uri = NULL;
+  GimpImage   *image;
   return_if_no_gimp (gimp, data);
   return_if_no_widget (widget, data);
 
   image = action_data_get_image (data);
 
-  if (image)
-    uri = gimp_object_get_name (GIMP_OBJECT (image));
-
-  file_open_dialog_show (widget, gimp, NULL, uri, FALSE);
+  file_open_dialog_show (gimp, widget,
+                         _("Open Image"),
+                         image, NULL, FALSE);
 }
 
 void
@@ -111,18 +111,20 @@
                                   gpointer   data)
 {
   Gimp        *gimp;
-  GimpDisplay *display;
   GtkWidget   *widget;
-  GimpImage   *image;
-  const gchar *uri;
+  GimpDisplay *display;
+  GimpImage   *image = NULL;
   return_if_no_gimp (gimp, data);
-  return_if_no_display (display, data);
   return_if_no_widget (widget, data);
 
-  image = display->image;
-  uri = gimp_object_get_name (GIMP_OBJECT (image));
+  display = action_data_get_display (data);
+
+  if (display)
+    image = display->image;
 
-  file_open_dialog_show (widget, gimp, image, uri, TRUE);
+  file_open_dialog_show (gimp, widget,
+                         _("Open Image as Layers"),
+                         image, NULL, TRUE);
 }
 
 void
@@ -445,15 +447,18 @@
                        const gchar *uri,
                        GtkWidget   *parent)
 {
-  file_open_dialog_show (parent, gimp, NULL, uri, FALSE);
+  file_open_dialog_show (gimp, parent,
+                         _("Open Image"),
+                         NULL, uri, FALSE);
 }
 
 
 /*  private functions  */
 
 static void
-file_open_dialog_show (GtkWidget   *parent,
-                       Gimp        *gimp,
+file_open_dialog_show (Gimp        *gimp,
+                       GtkWidget   *parent,
+                       const gchar *title,
                        GimpImage   *image,
                        const gchar *uri,
                        gboolean     open_as_layers)
@@ -466,27 +471,23 @@
 
   if (dialog)
     {
+      if (! uri && image)
+        uri = gimp_object_get_name (GIMP_OBJECT (image));
+
       if (! uri)
         uri = g_object_get_data (G_OBJECT (gimp), "gimp-file-open-last-uri");
 
       if (uri)
         gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dialog), uri);
 
-      if (open_as_layers)
-        {
-          gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image as Layers"));
-          GIMP_FILE_DIALOG (dialog)->image = image;
-        }
-      else
-        {
-          gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image"));
-          GIMP_FILE_DIALOG (dialog)->image = NULL;
-        }
+      gimp_file_dialog_set_open_image (GIMP_FILE_DIALOG (dialog),
+                                       image, open_as_layers);
 
       parent = gtk_widget_get_toplevel (parent);
 
       if (GTK_IS_WINDOW (parent))
-        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+        gtk_window_set_transient_for (GTK_WINDOW (dialog),
+                                      GTK_WINDOW (parent));
 
       gtk_window_present (GTK_WINDOW (dialog));
     }
@@ -528,8 +529,8 @@
     {
       gtk_window_set_title (GTK_WINDOW (dialog), title);
 
-      gimp_file_dialog_set_image (GIMP_FILE_DIALOG (dialog),
-                                  image, save_a_copy, close_after_saving);
+      gimp_file_dialog_set_save_image (GIMP_FILE_DIALOG (dialog),
+                                       image, save_a_copy, close_after_saving);
 
       gtk_window_present (GTK_WINDOW (dialog));
     }

Modified: branches/soc-2008-tagging/app/actions/image-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/image-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/image-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/image-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/image-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/image-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/images-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/images-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/images-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/images-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/images-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/images-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "actions-types.h"

Modified: branches/soc-2008-tagging/app/actions/layers-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/layers-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/layers-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/layers-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/layers-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/layers-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -328,7 +329,7 @@
                               layer_fill_type);
   gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
 
-  gimp_image_add_layer (image, new_layer, -1);
+  gimp_image_add_layer (image, new_layer, -1, TRUE);
 
   gimp_image_undo_group_end (image);
 
@@ -351,7 +352,7 @@
                                      gimp_image_base_type_with_alpha (image),
                                      _("Visible"),
                                      GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
-  gimp_image_add_layer (image, layer, -1);
+  gimp_image_add_layer (image, layer, -1, TRUE);
 
   gimp_image_flush (image);
 }
@@ -387,7 +388,7 @@
   GimpLayer *layer;
   return_if_no_layer (image, layer, data);
 
-  gimp_image_raise_layer (image, layer);
+  gimp_image_raise_layer (image, layer, NULL);
   gimp_image_flush (image);
 }
 
@@ -411,7 +412,7 @@
   GimpLayer *layer;
   return_if_no_layer (image, layer, data);
 
-  gimp_image_lower_layer (image, layer);
+  gimp_image_lower_layer (image, layer, NULL);
   gimp_image_flush (image);
 }
 
@@ -438,7 +439,7 @@
 
   new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
                                                G_TYPE_FROM_INSTANCE (layer)));
-  gimp_image_add_layer (image, new_layer, -1);
+  gimp_image_add_layer (image, new_layer, -1, TRUE);
 
   gimp_image_flush (image);
 }
@@ -482,7 +483,7 @@
   if (gimp_layer_is_floating_sel (layer))
     floating_sel_remove (layer);
   else
-    gimp_image_remove_layer (image, layer);
+    gimp_image_remove_layer (image, layer, TRUE, NULL);
 
   gimp_image_flush (image);
 }
@@ -517,7 +518,7 @@
       gimp_item_offsets (GIMP_ITEM (layer), &x, &y);
       gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
 
-      gimp_image_add_vectors (image, vectors, -1);
+      gimp_image_add_vectors (image, vectors, -1, TRUE);
       gimp_image_set_active_vectors (image, vectors);
 
       gimp_image_flush (image);
@@ -545,7 +546,7 @@
 
       gimp_item_set_visible (GIMP_ITEM (new_vectors), TRUE, FALSE);
 
-      gimp_image_add_vectors (image, new_vectors, -1);
+      gimp_image_add_vectors (image, new_vectors, -1, TRUE);
       gimp_image_set_active_vectors (image, new_vectors);
 
       gimp_image_flush (image);
@@ -961,7 +962,7 @@
           gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
                                       dialog->context,
                                       layer_fill_type);
-          gimp_image_add_layer (dialog->image, layer, -1);
+          gimp_image_add_layer (dialog->image, layer, -1, TRUE);
 
           gimp_image_flush (dialog->image);
         }
@@ -1049,7 +1050,7 @@
       if (layer_mask_invert)
         gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
 
-      gimp_layer_add_mask (layer, mask, TRUE);
+      gimp_layer_add_mask (layer, mask, TRUE, NULL);
 
       gimp_image_undo_group_end (image);
 

Modified: branches/soc-2008-tagging/app/actions/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/actions/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/actions/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -11,6 +11,7 @@
 	-I$(PRJ_TOP) \
 	-I$(PRJ_TOP)/app \
 	$(GTK2_CFLAGS) \
+	$(GEGL_CFLAGS)
 
 DEFINES = \
 	-DGIMP_COMPILATION \
@@ -35,6 +36,8 @@
 	context-commands.obj \
 	colormap-actions.obj \
 	colormap-commands.obj \
+	config-actions.obj \
+	config-commands.obj \
 	cursor-info-actions.obj \
 	cursor-info-commands.obj \
 	data-commands.obj \
@@ -98,6 +101,8 @@
 	view-commands.obj \
 	window-actions.obj \
 	window-commands.obj \
+	windows-actions.obj \
+	windows-commands.obj \
 
 
 $(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32

Modified: branches/soc-2008-tagging/app/actions/plug-in-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/plug-in-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/plug-in-actions.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -488,6 +489,8 @@
       gchar       *reshow;
       gboolean     sensitive = FALSE;
 
+      label = gimp_plug_in_procedure_get_label (proc);
+
       /*  copy the sensitivity of the plug-in procedure's actual action
        *  instead of calling plug_in_actions_update() because doing the
        *  latter would set the sensitivity of this image's action on
@@ -498,8 +501,6 @@
       if (actual_action)
         sensitive = gtk_action_get_sensitive (actual_action);
 
-      label = gimp_plug_in_procedure_get_label (proc);
-
       repeat = g_strdup_printf (_("Re_peat \"%s\""),  label);
       reshow = g_strdup_printf (_("R_e-Show \"%s\""), label);
 
@@ -527,16 +528,28 @@
 
   for (i = 0; i < gimp_plug_in_manager_history_length (manager); i++)
     {
-      GtkAction *action;
-      GtkAction *actual_action;
-      gchar     *name      = g_strdup_printf ("plug-in-recent-%02d", i + 1);
-      gboolean   sensitive = FALSE;
+      GtkAction   *action;
+      GtkAction   *actual_action;
+      const gchar *label;
+      gchar       *name;
+      gboolean     sensitive = FALSE;
 
+      name = g_strdup_printf ("plug-in-recent-%02d", i + 1);
       action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
       g_free (name);
 
       proc = gimp_plug_in_manager_history_nth (manager, i);
 
+      if (proc->menu_label)
+        {
+          label = dgettext (gimp_plug_in_procedure_get_locale_domain (proc),
+                            proc->menu_label);
+        }
+      else
+        {
+          label = gimp_plug_in_procedure_get_label (proc);
+        }
+
       /*  see comment above  */
       actual_action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
                                                    GIMP_OBJECT (proc)->name);
@@ -547,7 +560,7 @@
                     "visible",   TRUE,
                     "sensitive", sensitive,
                     "procedure", proc,
-                    "label",     gimp_plug_in_procedure_get_label (proc),
+                    "label",     label,
                     "stock-id",  gimp_plug_in_procedure_get_stock_id (proc),
                     "tooltip",   gimp_plug_in_procedure_get_blurb (proc),
                     NULL);

Modified: branches/soc-2008-tagging/app/actions/plug-in-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/plug-in-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/plug-in-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/quick-mask-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/quick-mask-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/quick-mask-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/quick-mask-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/quick-mask-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/quick-mask-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/actions/select-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/select-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/select-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/select-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/select-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/select-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/actions/vectors-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/vectors-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/vectors-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/vectors-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/vectors-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/vectors-commands.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -187,7 +188,7 @@
   new_vectors = gimp_vectors_new (image,
                                   vectors_name ? vectors_name : _("New Path"));
 
-  gimp_image_add_vectors (image, new_vectors, -1);
+  gimp_image_add_vectors (image, new_vectors, -1, TRUE);
 
   gimp_image_flush (image);
 }
@@ -200,7 +201,7 @@
   GimpVectors *vectors;
   return_if_no_vectors (image, vectors, data);
 
-  gimp_image_raise_vectors (image, vectors);
+  gimp_image_raise_vectors (image, vectors, NULL);
   gimp_image_flush (image);
 }
 
@@ -224,7 +225,7 @@
   GimpVectors *vectors;
   return_if_no_vectors (image, vectors, data);
 
-  gimp_image_lower_vectors (image, vectors);
+  gimp_image_lower_vectors (image, vectors, NULL);
   gimp_image_flush (image);
 }
 
@@ -251,7 +252,7 @@
 
   new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
                                                    G_TYPE_FROM_INSTANCE (vectors)));
-  gimp_image_add_vectors (image, new_vectors, -1);
+  gimp_image_add_vectors (image, new_vectors, -1, TRUE);
   gimp_image_flush (image);
 }
 
@@ -263,7 +264,7 @@
   GimpVectors *vectors;
   return_if_no_vectors (image, vectors, data);
 
-  gimp_image_remove_vectors (image, vectors);
+  gimp_image_remove_vectors (image, vectors, TRUE, NULL);
   gimp_image_flush (image);
 }
 
@@ -603,7 +604,7 @@
 
       new_vectors = gimp_vectors_new (options->image, vectors_name);
 
-      gimp_image_add_vectors (options->image, new_vectors, -1);
+      gimp_image_add_vectors (options->image, new_vectors, -1, TRUE);
 
       gimp_image_flush (options->image);
     }

Modified: branches/soc-2008-tagging/app/actions/view-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/view-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/view-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -31,6 +32,7 @@
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
+#include "core/gimpprojection.h"
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimprender.h"
@@ -231,7 +233,14 @@
     N_("Toggle fullscreen view"),
     G_CALLBACK (view_fullscreen_cmd_callback),
     FALSE,
-    GIMP_HELP_VIEW_FULLSCREEN }
+    GIMP_HELP_VIEW_FULLSCREEN },
+
+  { "view-use-gegl", GIMP_STOCK_GEGL,
+    "Use GEGL", NULL,
+    "Use GEGL to create this window's projection",
+    G_CALLBACK (view_use_gegl_cmd_callback),
+    FALSE,
+    NULL }
 };
 
 static const GimpEnumActionEntry view_zoom_actions[] =
@@ -656,6 +665,7 @@
   SET_SENSITIVE ("view-shrink-wrap", image);
   SET_SENSITIVE ("view-fullscreen",  image);
   SET_ACTIVE    ("view-fullscreen",  display && fullscreen);
+  SET_ACTIVE    ("view-use-gegl",    image && display->image->projection->use_gegl);
 
   if (GIMP_IS_DISPLAY (group->user_data) ||
       GIMP_IS_GIMP (group->user_data))

Modified: branches/soc-2008-tagging/app/actions/view-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/view-commands.c	(original)
+++ branches/soc-2008-tagging/app/actions/view-commands.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -30,6 +31,7 @@
 #include "core/gimp.h"
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
+#include "core/gimpprojection.h"
 
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplay-foreach.h"
@@ -134,27 +136,45 @@
   switch ((GimpActionSelectType) value)
     {
     case GIMP_ACTION_SELECT_FIRST:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_OUT_MAX, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_OUT_MAX,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     case GIMP_ACTION_SELECT_LAST:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_IN_MAX, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_IN_MAX,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     case GIMP_ACTION_SELECT_PREVIOUS:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_OUT, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_OUT,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     case GIMP_ACTION_SELECT_NEXT:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_IN, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_IN,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     case GIMP_ACTION_SELECT_SKIP_PREVIOUS:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_OUT_MORE, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_OUT_MORE,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     case GIMP_ACTION_SELECT_SKIP_NEXT:
-      gimp_display_shell_scale (shell, GIMP_ZOOM_IN_MORE, 0.0);
+      gimp_display_shell_scale (shell,
+                                GIMP_ZOOM_IN_MORE,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
       break;
 
     default:
@@ -171,7 +191,10 @@
         /* scale = min *  (max / min)**(i/n), i = 0..n  */
         scale = pow (65536.0, scale / 512.0) / 256.0;
 
-        gimp_display_shell_scale (shell, GIMP_ZOOM_TO, scale);
+        gimp_display_shell_scale (shell,
+                                  GIMP_ZOOM_TO,
+                                  scale,
+                                  GIMP_ZOOM_FOCUS_BEST_GUESS);
         break;
       }
     }
@@ -194,7 +217,10 @@
   if (value != 0 /* not Other... */)
     {
       if (fabs (value - gimp_zoom_model_get_factor (shell->zoom)) > 0.0001)
-        gimp_display_shell_scale (shell, GIMP_ZOOM_TO, (gdouble) value / 10000);
+        gimp_display_shell_scale (shell,
+                                  GIMP_ZOOM_TO,
+                                  (gdouble) value / 10000,
+                                  GIMP_ZOOM_FOCUS_IMAGE_CENTER);
     }
 }
 
@@ -658,6 +684,25 @@
   gimp_display_shell_set_fullscreen (shell, active);
 }
 
+void
+view_use_gegl_cmd_callback (GtkAction *action,
+                            gpointer   data)
+{
+  GimpImage        *image;
+  GimpDisplay      *display;
+  GimpDisplayShell *shell;
+  gboolean   active;
+  return_if_no_image (image, data);
+  return_if_no_display (display, data);
+
+  shell = GIMP_DISPLAY_SHELL (display->shell);
+
+  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+
+  image->projection->use_gegl = active;
+  gimp_display_shell_expose_full (shell);
+}
+
 
 /*  private functions  */
 

Modified: branches/soc-2008-tagging/app/actions/view-commands.h
==============================================================================
--- branches/soc-2008-tagging/app/actions/view-commands.h	(original)
+++ branches/soc-2008-tagging/app/actions/view-commands.h	Sun Oct 12 15:38:02 2008
@@ -87,5 +87,8 @@
 void   view_fullscreen_cmd_callback            (GtkAction *action,
                                                 gpointer   data);
 
+void   view_use_gegl_cmd_callback              (GtkAction *action,
+                                                gpointer   data);
+
 
 #endif /* __VIEW_COMMANDS_H__ */

Modified: branches/soc-2008-tagging/app/actions/window-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/window-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/window-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/actions/windows-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/windows-actions.c	(original)
+++ branches/soc-2008-tagging/app/actions/windows-actions.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -212,7 +213,7 @@
           entry.accelerator = NULL;
           entry.tooltip     = NULL;
           entry.callback    = G_CALLBACK (windows_show_display_cmd_callback);
-          entry.help_id     = GIMP_HELP_WINDOWS_SHOW_IMAGE_WINDOW;
+          entry.help_id     = NULL;
 
           gimp_action_group_add_actions (group, &entry, 1);
 
@@ -268,7 +269,8 @@
 {
   GtkAction       *action;
   GimpActionEntry  entry;
-  gchar           *action_name = g_strdup_printf ("windows-dock-%04d", dock->ID);
+  gchar           *action_name = g_strdup_printf ("windows-dock-%04d",
+                                                  dock->ID);
 
   entry.name        = action_name;
   entry.stock_id    = NULL;

Modified: branches/soc-2008-tagging/app/base/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/base/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/base/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,16 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Base\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GLIB_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappbase.a
 
 libappbase_a_SOURCES = \
@@ -63,21 +74,8 @@
 	tile-swap.c		\
 	tile-swap.h
 
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Base\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GLIB_CFLAGS)		\
-	-I$(includedir)
-
-
 EXTRA_DIST = makefile.msc
 
-
 #
 # rules to generate built sources
 #

Modified: branches/soc-2008-tagging/app/base/base-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/base/base-utils.c	(original)
+++ branches/soc-2008-tagging/app/base/base-utils.c	Sun Oct 12 15:38:02 2008
@@ -38,10 +38,10 @@
 
 /*  public functions  */
 
-GPid
+gint
 get_pid (void)
 {
-  return getpid ();
+  return (gint) getpid ();
 }
 
 gint

Modified: branches/soc-2008-tagging/app/base/base-utils.h
==============================================================================
--- branches/soc-2008-tagging/app/base/base-utils.h	(original)
+++ branches/soc-2008-tagging/app/base/base-utils.h	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 #define __BASE_H__
 
 
-GPid     get_pid                  (void);
+gint     get_pid                  (void);
 gint     get_number_of_processors (void);
 guint64  get_physical_memory_size (void);
 

Modified: branches/soc-2008-tagging/app/base/colorize.c
==============================================================================
--- branches/soc-2008-tagging/app/base/colorize.c	(original)
+++ branches/soc-2008-tagging/app/base/colorize.c	Sun Oct 12 15:38:02 2008
@@ -67,9 +67,13 @@
 
       gimp_hsl_to_rgb (&hsl, &rgb);
 
-      colorize->final_red_lookup[i]   = i * rgb.r;
-      colorize->final_green_lookup[i] = i * rgb.g;
-      colorize->final_blue_lookup[i]  = i * rgb.b;
+      /*  this used to read i * rgb.r,g,b in GIMP 2.4, but this produced
+       *  darkened results, multiplying with 255 is correct and preserves
+       *  the lightness unless modified with the slider.
+       */
+      colorize->final_red_lookup[i]   = 255.0 * rgb.r;
+      colorize->final_green_lookup[i] = 255.0 * rgb.g;
+      colorize->final_blue_lookup[i]  = 255.0 * rgb.b;
     }
 }
 

Modified: branches/soc-2008-tagging/app/base/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/base/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/base/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -25,6 +25,7 @@
 	colorize.obj \
 	cpercep.obj \
 	curves.obj \
+	desaturate.obj \
 	gimphistogram.obj \
 	gimplut.obj \
 	hue-saturation.obj \

Modified: branches/soc-2008-tagging/app/base/pixel-surround.c
==============================================================================
--- branches/soc-2008-tagging/app/base/pixel-surround.c	(original)
+++ branches/soc-2008-tagging/app/base/pixel-surround.c	Sun Oct 12 15:38:02 2008
@@ -33,6 +33,8 @@
 struct _PixelSurround
 {
   TileManager *mgr;        /*  tile manager to access tiles from    */
+  gint         xmax;       /*  largest x coordinate in tile manager */
+  gint         ymax;       /*  largest y coordinate in tile manager */
   gint         bpp;        /*  bytes per pixel in tile manager      */
   gint         w;          /*  width of pixel surround area         */
   gint         h;          /*  height of pixel surround area        */
@@ -44,106 +46,73 @@
   gint         rowstride;  /*  rowstride of buffers                 */
   guchar      *bg;         /*  buffer filled with background color  */
   guchar      *buf;        /*  buffer used for combining tile data  */
+  PixelSurroundMode  mode;
 };
 
+static const guchar * pixel_surround_get_data (PixelSurround *surround,
+                                               gint           x,
+                                               gint           y,
+                                               gint          *w,
+                                               gint          *h,
+                                               gint          *rowstride);
 
-/*  inlining this function gives a few percent speedup  */
-static inline const guchar *
-pixel_surround_get_data (PixelSurround *surround,
-                         gint           x,
-                         gint           y,
-                         gint          *w,
-                         gint          *h,
-                         gint          *rowstride)
-{
-  /*  do we still have a tile lock that we can use?  */
-  if (surround->tile)
-    {
-      if (x < surround->tile_x || x >= surround->tile_x + surround->tile_w ||
-          y < surround->tile_y || y >= surround->tile_y + surround->tile_h)
-        {
-          tile_release (surround->tile, FALSE);
-          surround->tile = NULL;
-        }
-    }
-
-  /*  if not, try to get one for the target pixel  */
-  if (! surround->tile)
-    {
-      surround->tile = tile_manager_get_tile (surround->mgr, x, y, TRUE, FALSE);
-
-      if (surround->tile)
-        {
-          /*  store offset and size of the locked tile  */
-          surround->tile_x = x & ~(TILE_WIDTH - 1);
-          surround->tile_y = y & ~(TILE_HEIGHT - 1);
-          surround->tile_w = tile_ewidth (surround->tile);
-          surround->tile_h = tile_eheight (surround->tile);
-        }
-    }
-
-  if (surround->tile)
-    {
-      *w = surround->tile_x + surround->tile_w - x;
-      *h = surround->tile_y + surround->tile_h - y;
-
-      *rowstride = surround->tile_w * surround->bpp;
-
-      return tile_data_pointer (surround->tile,
-                                x % TILE_WIDTH, y % TILE_HEIGHT);
-    }
-  else
-    {
-      /*   return a pointer to a virtual background tile  */
-      if (x < 0)
-        *w = MIN (- x, surround->w);
-      else
-        *w = surround->w;
-
-      if (y < 0)
-        *h = MIN (- y, surround->h);
-      else
-        *h = surround->h;
-
-      *rowstride = surround->rowstride;
-
-      return surround->bg;
-    }
-}
 
 /**
  * pixel_surround_new:
  * @tiles:  tile manager
  * @width:  width of surround region
  * @height: height of surround region
- * @bg:     color to use for pixels that are not covered by the tile manager
+ * @mode:   how to deal with pixels that are not covered by the tile manager
+ *
+ * PixelSurround provides you a contiguous read-only view of the area
+ * surrounding a pixel. It is an efficient pixel access strategy for
+ * interpolation algorithms.
  *
  * Return value: a new #PixelSurround.
  */
 PixelSurround *
-pixel_surround_new (TileManager  *tiles,
-                    gint          width,
-                    gint          height,
-                    const guchar  bg[MAX_CHANNELS])
+pixel_surround_new (TileManager       *tiles,
+                    gint               width,
+                    gint               height,
+                    PixelSurroundMode  mode)
 {
   PixelSurround *surround;
-  guchar        *dest;
-  gint           pixels;
 
   g_return_val_if_fail (tiles != NULL, NULL);
+  g_return_val_if_fail (width < TILE_WIDTH, NULL);
+  g_return_val_if_fail (height < TILE_WIDTH, NULL);
 
   surround = g_slice_new0 (PixelSurround);
 
   surround->mgr       = tiles;
+  surround->xmax      = tile_manager_width (surround->mgr) - 1;
+  surround->ymax      = tile_manager_height (surround->mgr) - 1;
   surround->bpp       = tile_manager_bpp (tiles);
   surround->w         = width;
   surround->h         = height;
   surround->rowstride = width * surround->bpp;
-  surround->bg        = g_new (guchar, surround->rowstride * height);
+  surround->bg        = g_new0 (guchar, surround->rowstride * height);
   surround->buf       = g_new (guchar, surround->rowstride * height);
+  surround->mode      = mode;
 
-  dest = surround->bg;
-  pixels = width * height;
+  return surround;
+}
+
+/**
+ * pixel_surround_set_bg:
+ * @surround: a #PixelSurround
+ * @bg:       background color
+ *
+ * This sets the color that the #PixelSurround uses when in
+ * %PIXEL_SURROUND_BACKGROUND mode for pixels that are not covered by
+ * the tile manager.
+ */
+void
+pixel_surround_set_bg (PixelSurround *surround,
+                       const guchar  *bg)
+{
+  guchar *dest   = surround->bg;
+  gint    pixels = surround->w * surround->h;
 
   while (pixels--)
     {
@@ -152,8 +121,6 @@
       for (i = 0; i < surround->bpp; i++)
         *dest++ = bg[i];
     }
-
-  return surround;
 }
 
 /**
@@ -281,3 +248,173 @@
 
   g_slice_free (PixelSurround, surround);
 }
+
+
+enum
+{
+  LEFT   = 1 << 0,
+  RIGHT  = 1 << 1,
+  TOP    = 1 << 2,
+  BOTTOM = 1 << 3
+};
+
+static void
+pixel_surround_fill_row (PixelSurround *surround,
+                         const guchar  *src,
+                         gint           w)
+{
+  guchar *dest  = surround->bg;
+  gint    bytes = MIN (w, surround->w) * surround->bpp;
+  gint    rows  = surround->h;
+
+  while (rows--)
+    {
+      memcpy (dest, src, bytes);
+      dest += surround->rowstride;
+    }
+}
+
+static void
+pixel_surround_fill_col (PixelSurround *surround,
+                         const guchar  *src,
+                         gint           rowstride,
+                         gint           h)
+{
+  guchar *dest = surround->bg;
+  gint    cols = surround->w;
+  gint    rows = MIN (h, surround->h);
+
+  while (cols--)
+    {
+      const guchar *s = src;
+      guchar       *d = dest;
+      gint          r = rows;
+
+      while (r--)
+        {
+          memcpy (d, s, surround->bpp);
+
+          s += rowstride;
+          d += surround->rowstride;
+        }
+
+      dest += surround->bpp;
+    }
+}
+
+static const guchar *
+pixel_surround_get_data (PixelSurround *surround,
+                         gint           x,
+                         gint           y,
+                         gint          *w,
+                         gint          *h,
+                         gint          *rowstride)
+{
+  /*  do we still have a tile lock that we can use?  */
+  if (surround->tile)
+    {
+      if (x < surround->tile_x || x >= surround->tile_x + surround->tile_w ||
+          y < surround->tile_y || y >= surround->tile_y + surround->tile_h)
+        {
+          tile_release (surround->tile, FALSE);
+          surround->tile = NULL;
+        }
+    }
+
+  /*  if not, try to get one for the target pixel  */
+  if (! surround->tile)
+    {
+      surround->tile = tile_manager_get_tile (surround->mgr, x, y, TRUE, FALSE);
+
+      if (surround->tile)
+        {
+          /*  store offset and size of the locked tile  */
+          surround->tile_x = x & ~(TILE_WIDTH - 1);
+          surround->tile_y = y & ~(TILE_HEIGHT - 1);
+          surround->tile_w = tile_ewidth (surround->tile);
+          surround->tile_h = tile_eheight (surround->tile);
+        }
+    }
+
+  if (surround->tile)
+    {
+      *w = surround->tile_x + surround->tile_w - x;
+      *h = surround->tile_y + surround->tile_h - y;
+
+      *rowstride = surround->tile_w * surround->bpp;
+
+      return tile_data_pointer (surround->tile, x, y);
+    }
+
+  if (surround->mode == PIXEL_SURROUND_SMEAR)
+    {
+      const guchar *edata;
+      gint          ex = x;
+      gint          ey = y;
+      gint          ew, eh;
+      gint          estride;
+      gint          ecode = 0;
+
+      if (ex < 0)
+        {
+          ex = 0;
+          ecode |= LEFT;
+        }
+      else if (ex > surround->xmax)
+        {
+          ex = surround->xmax;
+          ecode |= RIGHT;
+        }
+
+      if (ey < 0)
+        {
+          ey = 0;
+          ecode |= TOP;
+        }
+      else if (ey > surround->ymax)
+        {
+          ey = surround->ymax;
+          ecode |= BOTTOM;
+        }
+
+      /*  call ourselves with corrected coordinates  */
+      edata = pixel_surround_get_data (surround, ex, ey, &ew, &eh, &estride);
+
+      /*  fill the virtual background tile  */
+      switch (ecode)
+        {
+        case (TOP | LEFT):
+        case (TOP | RIGHT):
+        case (BOTTOM | LEFT):
+        case (BOTTOM | RIGHT):
+          pixel_surround_set_bg (surround, edata);
+          break;
+
+        case (TOP):
+        case (BOTTOM):
+          pixel_surround_fill_row (surround, edata, ew);
+          break;
+
+        case (LEFT):
+        case (RIGHT):
+          pixel_surround_fill_col (surround, edata, estride, eh);
+          break;
+        }
+    }
+
+  /*   return a pointer to the virtual background tile  */
+
+  if (x < 0)
+    *w = MIN (- x, surround->w);
+  else
+    *w = surround->w;
+
+  if (y < 0)
+    *h = MIN (- y, surround->h);
+  else
+    *h = surround->h;
+
+  *rowstride = surround->rowstride;
+
+  return surround->bg;
+}

Modified: branches/soc-2008-tagging/app/base/pixel-surround.h
==============================================================================
--- branches/soc-2008-tagging/app/base/pixel-surround.h	(original)
+++ branches/soc-2008-tagging/app/base/pixel-surround.h	Sun Oct 12 15:38:02 2008
@@ -24,24 +24,31 @@
  *  region around a pixel in a tile manager
  */
 
+typedef enum
+{
+  PIXEL_SURROUND_SMEAR,
+  PIXEL_SURROUND_BACKGROUND
+} PixelSurroundMode;
 
-PixelSurround * pixel_surround_new      (TileManager   *tiles,
-                                         gint           width,
-                                         gint           height,
-                                         const guchar   bg[MAX_CHANNELS]);
+
+PixelSurround * pixel_surround_new      (TileManager       *tiles,
+                                         gint               width,
+                                         gint               height,
+                                         PixelSurroundMode  mode);
+void            pixel_surround_set_bg   (PixelSurround     *surround,
+                                         const guchar      *bg);
 
 /* return a pointer to a buffer which contains all the surrounding pixels
  * strategy: if we are in the middle of a tile, use the tile storage
  * otherwise just copy into our own malloced buffer and return that
  */
-const guchar  * pixel_surround_lock     (PixelSurround *surround,
-                                         gint           x,
-                                         gint           y,
-                                         gint          *rowstride);
-
-void            pixel_surround_release  (PixelSurround *surround);
+const guchar  * pixel_surround_lock     (PixelSurround     *surround,
+                                         gint               x,
+                                         gint               y,
+                                         gint              *rowstride);
 
-void            pixel_surround_destroy  (PixelSurround *surround);
+void            pixel_surround_release  (PixelSurround     *surround);
+void            pixel_surround_destroy  (PixelSurround     *surround);
 
 
 #endif /* __PIXEL_SURROUND_H__ */

Modified: branches/soc-2008-tagging/app/base/tile-cache.c
==============================================================================
--- branches/soc-2008-tagging/app/base/tile-cache.c	(original)
+++ branches/soc-2008-tagging/app/base/tile-cache.c	Sun Oct 12 15:38:02 2008
@@ -38,34 +38,32 @@
 static gboolean  tile_idle_preswap         (gpointer  data);
 
 
-static gboolean initialize = TRUE;
-
 typedef struct _TileList
 {
   Tile *first;
   Tile *last;
 } TileList;
 
-static const gulong  max_tile_size   = TILE_WIDTH * TILE_HEIGHT * 4;
-static gulong        cur_cache_size  = 0;
-static gulong        max_cache_size  = 0;
-static gulong        cur_cache_dirty = 0;
-static TileList      clean_list      = { NULL, NULL };
-static TileList      dirty_list      = { NULL, NULL };
-static guint         idle_swapper    = 0;
+static const gulong  max_tile_size    = TILE_WIDTH * TILE_HEIGHT * 4;
+static gulong        cur_cache_size   = 0;
+static gulong        max_cache_size   = 0;
+static gulong        cur_cache_dirty  = 0;
+static TileList      clean_list       = { NULL, NULL };
+static TileList      dirty_list       = { NULL, NULL };
+static guint         idle_swapper     = 0;
 
 
 #ifdef ENABLE_MP
 
-static GStaticMutex   tile_cache_mutex = G_STATIC_MUTEX_INIT;
+static GMutex       *tile_cache_mutex = NULL;
 
-#define CACHE_LOCK    g_static_mutex_lock (&tile_cache_mutex)
-#define CACHE_UNLOCK  g_static_mutex_unlock (&tile_cache_mutex)
+#define TILE_CACHE_LOCK    g_mutex_lock (tile_cache_mutex)
+#define TILE_CACHE_UNLOCK  g_mutex_unlock (tile_cache_mutex)
 
 #else
 
-#define CACHE_LOCK   /* nothing */
-#define CACHE_UNLOCK /* nothing */
+#define TILE_CACHE_LOCK   /* nothing */
+#define TILE_CACHE_UNLOCK /* nothing */
 
 #endif
 
@@ -73,15 +71,16 @@
 void
 tile_cache_init (gulong tile_cache_size)
 {
-  if (initialize)
-    {
-      initialize = FALSE;
+#ifdef ENABLE_MP
+  g_return_if_fail (tile_cache_mutex == NULL);
 
-      clean_list.first = clean_list.last = NULL;
-      dirty_list.first = dirty_list.last = NULL;
+  tile_cache_mutex = g_mutex_new ();
+#endif
 
-      max_cache_size = tile_cache_size;
-    }
+  clean_list.first = clean_list.last = NULL;
+  dirty_list.first = dirty_list.last = NULL;
+
+  max_cache_size = tile_cache_size;
 }
 
 void
@@ -97,6 +96,11 @@
     g_warning ("tile cache not empty (%ld bytes left)", cur_cache_size);
 
   tile_cache_set_size (0);
+
+#ifdef ENABLE_MP
+  g_mutex_free (tile_cache_mutex);
+  tile_cache_mutex = NULL;
+#endif
 }
 
 void
@@ -105,7 +109,7 @@
   TileList *list;
   TileList *newlist;
 
-  CACHE_LOCK;
+  TILE_CACHE_LOCK;
 
   if (! tile->data)
     goto out;
@@ -191,23 +195,23 @@
     }
 
 out:
-  CACHE_UNLOCK;
+  TILE_CACHE_UNLOCK;
 }
 
 void
 tile_cache_flush (Tile *tile)
 {
-  CACHE_LOCK;
+  TILE_CACHE_LOCK;
 
   tile_cache_flush_internal (tile);
 
-  CACHE_UNLOCK;
+  TILE_CACHE_UNLOCK;
 }
 
 void
 tile_cache_set_size (gulong cache_size)
 {
-  CACHE_LOCK;
+  TILE_CACHE_LOCK;
 
   max_cache_size = cache_size;
 
@@ -217,7 +221,7 @@
         break;
     }
 
-  CACHE_UNLOCK;
+  TILE_CACHE_UNLOCK;
 }
 
 static void
@@ -291,7 +295,7 @@
       return FALSE;
     }
 
-  CACHE_LOCK;
+  TILE_CACHE_LOCK;
 
   if ((tile = dirty_list.first))
     {
@@ -317,7 +321,7 @@
       cur_cache_dirty -= tile->size;
     }
 
-  CACHE_UNLOCK;
+  TILE_CACHE_UNLOCK;
 
   return TRUE;
 }

Modified: branches/soc-2008-tagging/app/base/tile-manager-crop.c
==============================================================================
--- branches/soc-2008-tagging/app/base/tile-manager-crop.c	(original)
+++ branches/soc-2008-tagging/app/base/tile-manager-crop.c	Sun Oct 12 15:38:02 2008
@@ -35,14 +35,13 @@
 tile_manager_crop (TileManager *tiles,
                    gint         border)
 {
-  PixelRegion   PR;
-  TileManager  *new_tiles;
-  gint          bytes, alpha;
-  gint          x1, y1, x2, y2;
-  gboolean      found;
-  gboolean      empty;
-  gpointer      pr;
-  const guchar  black[MAX_CHANNELS] = { 0, 0, 0, 0 };
+  PixelRegion  region;
+  TileManager *new_tiles;
+  gint         bytes, alpha;
+  gint         x1, y1, x2, y2;
+  gboolean     found;
+  gboolean     empty;
+  gpointer     pr;
 
   g_return_val_if_fail (tiles != NULL, NULL);
 
@@ -55,22 +54,22 @@
   x2 = 0;
   y2 = 0;
 
-  pixel_region_init (&PR, tiles, 0, 0, x1, y1, FALSE);
+  pixel_region_init (&region, tiles, 0, 0, x1, y1, FALSE);
 
-  for (pr = pixel_regions_register (1, &PR);
+  for (pr = pixel_regions_register (1, &region);
        pr != NULL;
        pr = pixel_regions_process (pr))
     {
-      const guchar *data = PR.data + alpha;
-      gint          ex   = PR.x + PR.w;
-      gint          ey   = PR.y + PR.h;
+      const guchar *data = region.data + alpha;
+      gint          ex   = region.x + region.w;
+      gint          ey   = region.y + region.h;
       gint          x, y;
 
-      for (y = PR.y; y < ey; y++)
+      for (y = region.y; y < ey; y++)
         {
           found = FALSE;
 
-          for (x = PR.x; x < ex; x++, data += bytes)
+          for (x = region.x; x < ex; x++, data += bytes)
             if (*data)
               {
                 if (x < x1)
@@ -129,22 +128,22 @@
           pixel_region_init (&destPR, new_tiles,
                              0, 0, new_width, border,
                              TRUE);
-          color_region (&destPR, black);
+          clear_region (&destPR);
 
           pixel_region_init (&destPR, new_tiles,
                              0, border, border, (y2 - y1),
                              TRUE);
-          color_region (&destPR, black);
+          clear_region (&destPR);
 
           pixel_region_init (&destPR, new_tiles,
                              new_width - border, border, border, (y2 - y1),
                              TRUE);
-          color_region (&destPR, black);
+          clear_region (&destPR);
 
           pixel_region_init (&destPR, new_tiles,
                              0, new_height - border, new_width, border,
                              TRUE);
-          color_region (&destPR, black);
+          clear_region (&destPR);
         }
 
       pixel_region_init (&srcPR, tiles,

Modified: branches/soc-2008-tagging/app/base/tile-manager.c
==============================================================================
--- branches/soc-2008-tagging/app/base/tile-manager.c	(original)
+++ branches/soc-2008-tagging/app/base/tile-manager.c	Sun Oct 12 15:38:02 2008
@@ -679,21 +679,21 @@
   for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
     for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
       {
-        Tile         *t = tile_manager_get_tile (tm, x, y, TRUE, FALSE);
-        const guchar *s = tile_data_pointer (t, x, y);
-        guchar       *d = buffer + stride * (y - y1) + tm->bpp * (x - x1);
+        Tile         *tile = tile_manager_get_tile (tm, x, y, TRUE, FALSE);
+        const guchar *s    = TILE_DATA_POINTER (tile, x, y);
+        guchar       *d    = buffer + stride * (y - y1) + tm->bpp * (x - x1);
         guint         rows, cols;
         guint         srcstride;
 
-        rows = tile_eheight (t) - y % TILE_HEIGHT;
+        rows = tile->eheight - y % TILE_HEIGHT;
         if (rows > (y2 - y + 1))
           rows = y2 - y + 1;
 
-        cols = tile_ewidth (t) - x % TILE_WIDTH;
+        cols = tile->ewidth - x % TILE_WIDTH;
         if (cols > (x2 - x + 1))
           cols = x2 - x + 1;
 
-        srcstride = tile_ewidth (t) * tile_bpp (t);
+        srcstride = tile->ewidth * tile->bpp;
 
         while (rows--)
           {
@@ -703,7 +703,7 @@
             d += stride;
           }
 
-        tile_release (t, FALSE);
+        tile_release (tile, FALSE);
       }
 }
 
@@ -721,21 +721,21 @@
   for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
     for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
       {
-        Tile         *t = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
-        const guchar *s = buffer + stride * (y - y1) + tm->bpp * (x - x1);
-        guchar       *d = tile_data_pointer (t, x, y);
+        Tile         *tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
+        const guchar *s    = buffer + stride * (y - y1) + tm->bpp * (x - x1);
+        guchar       *d    = TILE_DATA_POINTER (tile, x, y);
         guint         rows, cols;
         guint         dststride;
 
-        rows = tile_eheight (t) - y % TILE_HEIGHT;
+        rows = tile->eheight - y % TILE_HEIGHT;
         if (rows > (y2 - y + 1))
           rows = y2 - y + 1;
 
-        cols = tile_ewidth (t) - x % TILE_WIDTH;
+        cols = tile->ewidth - x % TILE_WIDTH;
         if (cols > (x2 - x + 1))
           cols = x2 - x + 1;
 
-        dststride = tile_ewidth (t) * tile_bpp (t);
+        dststride = tile->ewidth * tile->bpp;
 
         while (rows--)
           {
@@ -745,7 +745,7 @@
             d += dststride;
           }
 
-        tile_release (t, TRUE);
+        tile_release (tile, TRUE);
       }
 }
 
@@ -755,50 +755,49 @@
                    gint         y,
                    guchar      *buffer)
 {
-  if (x >= 0 && y >= 0 && x < tm->width && y < tm->height)
-    {
-      gint num = tile_manager_get_tile_num (tm, x, y);
+  const gint num = tile_manager_get_tile_num (tm, x, y);
+
+  if (num < 0)
+    return;
 
-      if (num != tm->cached_num)    /* must fetch a new tile */
-        {
-          Tile *tile;
-
-          if (tm->cached_tile)
-            tile_release (tm->cached_tile, FALSE);
-
-          tm->cached_num  = -1;
-          tm->cached_tile = NULL;
-
-          /*  use a temporary variable instead of assigning to
-           *  tm->cached_tile directly to make sure tm->cached_num
-           *  and tm->cached_tile are always in a consistent state.
-           *  (the requested tile might be invalid and needs to be
-           *  validated, which would call tile_manager_get() recursively,
-           *  which in turn would clear the cached tile) See bug #472770.
-           */
-          tile = tile_manager_get (tm, num, TRUE, FALSE);
-
-          tm->cached_num  = num;
-          tm->cached_tile = tile;
-        }
+  if (num != tm->cached_num)    /* must fetch a new tile */
+    {
+      Tile *tile;
 
       if (tm->cached_tile)
-        {
-          const guchar *src = tile_data_pointer (tm->cached_tile, x, y);
+        tile_release (tm->cached_tile, FALSE);
+
+      tm->cached_num  = -1;
+      tm->cached_tile = NULL;
+
+      /*  use a temporary variable instead of assigning to
+       *  tm->cached_tile directly to make sure tm->cached_num
+       *  and tm->cached_tile are always in a consistent state.
+       *  (the requested tile might be invalid and needs to be
+       *  validated, which would call tile_manager_get() recursively,
+       *  which in turn would clear the cached tile) See bug #472770.
+       */
+      tile = tile_manager_get (tm, num, TRUE, FALSE);
 
-           switch (tm->bpp)
-             {
-             case 4:
-               *buffer++ = *src++;
-             case 3:
-               *buffer++ = *src++;
-             case 2:
-               *buffer++ = *src++;
-             case 1:
-               *buffer++ = *src++;
-             }
-        }
+      tm->cached_num  = num;
+      tm->cached_tile = tile;
     }
+
+  {
+    const guchar *src = TILE_DATA_POINTER (tm->cached_tile, x, y);
+
+    switch (tm->bpp)
+      {
+      case 4:
+        *buffer++ = *src++;
+      case 3:
+        *buffer++ = *src++;
+      case 2:
+        *buffer++ = *src++;
+      case 1:
+        *buffer++ = *src++;
+      }
+  }
 }
 
 void
@@ -808,7 +807,7 @@
                     const guchar *buffer)
 {
   Tile   *tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
-  guchar *dest = tile_data_pointer (tile, x, y);
+  guchar *dest = TILE_DATA_POINTER (tile, x, y);
 
   switch (tm->bpp)
     {

Modified: branches/soc-2008-tagging/app/base/tile-private.h
==============================================================================
--- branches/soc-2008-tagging/app/base/tile-private.h	(original)
+++ branches/soc-2008-tagging/app/base/tile-private.h	Sun Oct 12 15:38:02 2008
@@ -77,4 +77,11 @@
 };
 
 
+/*  tile_data_pointer() as a macro so that it can be inlined  */
+
+#define TILE_DATA_POINTER(tile,x,y) \
+  ((tile)->data + \
+   (((y) % TILE_HEIGHT) * (tile)->ewidth + ((x) % TILE_WIDTH)) * (tile)->bpp)
+
+
 #endif /* __TILE_PRIVATE_H__ */

Modified: branches/soc-2008-tagging/app/base/tile.c
==============================================================================
--- branches/soc-2008-tagging/app/base/tile.c	(original)
+++ branches/soc-2008-tagging/app/base/tile.c	Sun Oct 12 15:38:02 2008
@@ -53,7 +53,7 @@
 #endif
 
 
-static void tile_destroy (Tile *tile);
+static void  tile_destroy (Tile *tile);
 
 
 Tile *
@@ -333,9 +333,7 @@
                    gint  xoff,
                    gint  yoff)
 {
-  gsize offset = (yoff % TILE_HEIGHT) * tile->ewidth + (xoff % TILE_WIDTH);
-
-  return (gpointer) (tile->data + offset * tile->bpp);
+  return TILE_DATA_POINTER (tile, xoff, yoff);
 }
 
 gint

Modified: branches/soc-2008-tagging/app/composite/make-installer.py
==============================================================================
--- branches/soc-2008-tagging/app/composite/make-installer.py	(original)
+++ branches/soc-2008-tagging/app/composite/make-installer.py	Sun Oct 12 15:38:02 2008
@@ -102,7 +102,7 @@
 def mode_name(mode):
   s = string.replace(mode.lower(), "gimp_composite_", "")
   return (s)
-  
+
 def pixel_depth_name(pixel_format):
   s = string.replace(pixel_format.lower(), "gimp_pixelformat_", "")
   return (s)
@@ -135,7 +135,7 @@
 
   if len(function_table) < 1:
     return;
- 
+
   print >>fpout, 'static const struct install_table {'
   print >>fpout, '  GimpCompositeOperation mode;'
   print >>fpout, '  GimpPixelFormat A;'
@@ -148,7 +148,7 @@
   for r in requirements:
     print >>fpout, '#if %s' % (r)
     pass
-  
+
   for mode in composite_modes:
     for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
       for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
@@ -168,9 +168,9 @@
 
   print >>fpout, ' { 0, 0, 0, 0, NULL }'
   print >>fpout, '};'
-  
+
   return
-  
+
 def print_function_table_name(fpout, name, function_table):
 
   print >>fpout, ''
@@ -197,9 +197,9 @@
     pass
 
   print >>fpout, '};\n'
-  
+
   return
-  
+
 def load_function_table(filename):
   nmx = ns.nmx(filename)
 
@@ -210,12 +210,12 @@
       for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
         for D in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
           key = "%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))
-            
+
           for a in ["GIMP_PIXELFORMAT_ANY", A]:
             for b in ["GIMP_PIXELFORMAT_ANY", B]:
               for d in ["GIMP_PIXELFORMAT_ANY", D]:
                 key = "%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(a), pixel_depth_name(b), pixel_depth_name(d))
-                  
+
                 f = nmx.exports_re(key + ".*")
                 if f != None: gimp_composite_function["%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))] =  [f]
                 pass
@@ -231,7 +231,7 @@
 
 def merge_function_tables(tables):
   main_table = copy.deepcopy(tables[0][1])
-  
+
   for t in tables[1:]:
     #print >>sys.stderr, t[0]
     for mode in composite_modes:
@@ -248,7 +248,7 @@
         pass
       pass
     pass
-            
+
   return (main_table)
 
 
@@ -281,7 +281,7 @@
   for r in options.requires:
     print >>fpout, '#if %s' % (r)
     pass
-  
+
   print >>fpout, '  GimpCompositeContext generic_ctx;'
   print >>fpout, '  GimpCompositeContext special_ctx;'
   print >>fpout, '  double ft0;'
@@ -349,11 +349,11 @@
 
             print >>fpout, '  gimp_composite_context_init (&generic_ctx, %s, %s, %s, %s, %s, n_pixels, (unsigned char *) %sA, (unsigned char *) %sB, (unsigned char *) %sB, (unsigned char *) %sD1);' % (
               mode, A, B, D, D, pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D), pixel_depth_name(D))
-              
+
             print >>fpout, '  ft0 = gimp_composite_regression_time_function (iterations, %s, &generic_ctx);' % ("gimp_composite_dispatch")
             print >>fpout, '  ft1 = gimp_composite_regression_time_function (iterations, %s, &special_ctx);' % (generic_table[key][0])
             print >>fpout, '  if (gimp_composite_regression_compare_contexts ("%s", &generic_ctx, &special_ctx))' % (mode_name(mode))
-            
+
             print >>fpout, '    {'
             print >>fpout, '      printf("%s_%s_%s_%s failed\\n");' % (mode_name(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))
             print >>fpout, '      return (1);'
@@ -364,11 +364,11 @@
         pass
       pass
     pass
-  
+
   for r in options.requires:
     print >>fpout, '#endif'
     pass
-  
+
   print >>fpout, '  return (0);'
   print >>fpout, '}'
 
@@ -434,7 +434,7 @@
   else:
     print >>fpout, '  /* nothing to do */'
     pass
-  
+
   print >>fpout, ''
   print >>fpout, '  return (FALSE);'
   print >>fpout, '}'
@@ -499,7 +499,7 @@
   print >>fpout, 'void %s_install (void);' % (functionnameify(name))
   print >>fpout, ''
   print >>fpout, 'typedef void (*%s_table[%s][%s][%s][%s]);' % (functionnameify(name), "GIMP_COMPOSITE_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N")
-  
+
   return
 
 def gimp_composite_cfile(fpout, name, function_table, requirements=[], cpu_feature=[]):

Modified: branches/soc-2008-tagging/app/composite/ns.py
==============================================================================
--- branches/soc-2008-tagging/app/composite/ns.py	(original)
+++ branches/soc-2008-tagging/app/composite/ns.py	Sun Oct 12 15:38:02 2008
@@ -42,7 +42,7 @@
     def __init__(self, objfile=None):
         self.objects = dict()
         self.filename = None
-        
+
         if objfile != None:
             self.update(objfile)
             pass
@@ -71,7 +71,7 @@
             pass
 
         object = objfile
-        
+
         for (type, symbol) in symbols:
             if not self.objects.has_key(object):
                 self.objects.update({ object : dict({ "exports" : dict(), "imports" : dict() }) })

Modified: branches/soc-2008-tagging/app/config/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/config/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/config/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -7,6 +7,18 @@
 libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
 libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Config\"	\
+	-DGIMP_APP_VERSION_STRING=\"$(GIMP_APP_VERSION)\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GDK_PIXBUF_CFLAGS)	\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappconfig.a
 
 libappconfig_a_SOURCES = \
@@ -39,20 +51,6 @@
 	gimpxmlparser.c			\
 	gimpxmlparser.h
 
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Config\"	\
-	-DGIMP_APP_VERSION_STRING=\"$(GIMP_APP_VERSION)\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
-	-I$(includedir)
-
-
 EXTRA_PROGRAMS = test-config
 
 EXTRA_DIST = makefile.msc
@@ -104,5 +102,4 @@
 	$(GEGL_LIBS)				\
 	$(GLIB_LIBS)
 
-
 CLEANFILES = $(EXTRA_PROGRAMS) foorc

Modified: branches/soc-2008-tagging/app/config/gimpbaseconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpbaseconfig.c	(original)
+++ branches/soc-2008-tagging/app/config/gimpbaseconfig.c	Sun Oct 12 15:38:02 2008
@@ -48,7 +48,10 @@
   PROP_TEMP_PATH,
   PROP_SWAP_PATH,
   PROP_NUM_PROCESSORS,
-  PROP_TILE_CACHE_SIZE
+  PROP_TILE_CACHE_SIZE,
+
+  /* ignored, only for backward compatibility: */
+  PROP_STINGY_MEMORY_USE
 };
 
 
@@ -107,6 +110,12 @@
                                     1 << 30, /* 1GB */
                                     GIMP_PARAM_STATIC_STRINGS |
                                     GIMP_CONFIG_PARAM_CONFIRM);
+
+  /*  only for backward compatibility:  */
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_STINGY_MEMORY_USE,
+                                    "stingy-memory-use", NULL,
+                                    FALSE,
+                                    GIMP_CONFIG_PARAM_IGNORE);
 }
 
 static void
@@ -150,6 +159,10 @@
       base_config->tile_cache_size = g_value_get_uint64 (value);
       break;
 
+    case PROP_STINGY_MEMORY_USE:
+      /* ignored */
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -179,6 +192,10 @@
       g_value_set_uint64 (value, base_config->tile_cache_size);
       break;
 
+    case PROP_STINGY_MEMORY_USE:
+      /* ignored */
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;

Modified: branches/soc-2008-tagging/app/config/gimpcoreconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpcoreconfig.c	(original)
+++ branches/soc-2008-tagging/app/config/gimpcoreconfig.c	Sun Oct 12 15:38:02 2008
@@ -363,9 +363,8 @@
   /*  not serialized  */
   g_object_class_install_property (object_class, PROP_USE_GEGL,
                                    g_param_spec_boolean ("use-gegl",
-                                                         "Use GEGL",
-                                                         "Use GEGL",
-                                                         TRUE,
+                                                         "Use GEGL", NULL,
+                                                         FALSE,
                                                          GIMP_PARAM_READWRITE |
                                                          G_PARAM_CONSTRUCT));
 }

Modified: branches/soc-2008-tagging/app/config/gimpguiconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpguiconfig.c	(original)
+++ branches/soc-2008-tagging/app/config/gimpguiconfig.c	Sun Oct 12 15:38:02 2008
@@ -70,6 +70,7 @@
   PROP_TOOLBOX_COLOR_AREA,
   PROP_TOOLBOX_FOO_AREA,
   PROP_TOOLBOX_IMAGE_AREA,
+  PROP_TOOLBOX_WILBER,
   PROP_THEME_PATH,
   PROP_THEME,
   PROP_USE_HELP,
@@ -82,7 +83,12 @@
   PROP_TOOLBOX_WINDOW_HINT,
   PROP_DOCK_WINDOW_HINT,
   PROP_TRANSIENT_DOCKS,
-  PROP_CURSOR_FORMAT
+  PROP_CURSOR_FORMAT,
+
+  /* ignored, only for backward compatibility: */
+  PROP_INFO_WINDOW_PER_DISPLAY,
+  PROP_SHOW_TOOL_TIPS,
+  PROP_SHOW_TIPS
 };
 
 
@@ -196,6 +202,11 @@
                                     TOOLBOX_IMAGE_AREA_BLURB,
                                     FALSE,
                                     GIMP_PARAM_STATIC_STRINGS);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_WILBER,
+                                    "toolbox-wilber",
+                                    TOOLBOX_WILBER_BLURB,
+                                    TRUE,
+                                    GIMP_PARAM_STATIC_STRINGS);
   path = gimp_config_build_data_path ("themes");
   GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
                                  "theme-path", THEME_PATH_BLURB,
@@ -262,6 +273,24 @@
                                  GIMP_TYPE_CURSOR_FORMAT,
                                  GIMP_CURSOR_FORMAT_PIXBUF,
                                  GIMP_PARAM_STATIC_STRINGS);
+
+  /*  only for backward compatibility:  */
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_INFO_WINDOW_PER_DISPLAY,
+                                    "info-window-per-display",
+                                    NULL,
+                                    FALSE,
+                                    GIMP_PARAM_STATIC_STRINGS |
+                                    GIMP_CONFIG_PARAM_IGNORE);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TOOL_TIPS,
+                                    "show-tool-tips", NULL,
+                                    FALSE,
+                                    GIMP_PARAM_STATIC_STRINGS |
+                                    GIMP_CONFIG_PARAM_IGNORE);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_TIPS,
+                                    "show-tips", NULL,
+                                    FALSE,
+                                    GIMP_PARAM_STATIC_STRINGS |
+                                    GIMP_CONFIG_PARAM_IGNORE);
 }
 
 static void
@@ -347,7 +376,10 @@
     case PROP_TOOLBOX_IMAGE_AREA:
       gui_config->toolbox_image_area = g_value_get_boolean (value);
       break;
-    case PROP_THEME_PATH:
+    case PROP_TOOLBOX_WILBER:
+      gui_config->toolbox_wilber = g_value_get_boolean (value);
+      break;
+     case PROP_THEME_PATH:
       g_free (gui_config->theme_path);
       gui_config->theme_path = g_value_dup_string (value);
       break;
@@ -392,6 +424,12 @@
       gui_config->cursor_format = g_value_get_enum (value);
       break;
 
+    case PROP_INFO_WINDOW_PER_DISPLAY:
+    case PROP_SHOW_TOOL_TIPS:
+    case PROP_SHOW_TIPS:
+      /* ignored */
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -462,6 +500,9 @@
     case PROP_TOOLBOX_IMAGE_AREA:
       g_value_set_boolean (value, gui_config->toolbox_image_area);
       break;
+    case PROP_TOOLBOX_WILBER:
+      g_value_set_boolean (value, gui_config->toolbox_wilber);
+      break;
     case PROP_THEME_PATH:
       g_value_set_string (value, gui_config->theme_path);
       break;
@@ -502,6 +543,12 @@
       g_value_set_enum (value, gui_config->cursor_format);
       break;
 
+    case PROP_INFO_WINDOW_PER_DISPLAY:
+    case PROP_SHOW_TOOL_TIPS:
+    case PROP_SHOW_TIPS:
+      /* ignored */
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;

Modified: branches/soc-2008-tagging/app/config/gimpguiconfig.h
==============================================================================
--- branches/soc-2008-tagging/app/config/gimpguiconfig.h	(original)
+++ branches/soc-2008-tagging/app/config/gimpguiconfig.h	Sun Oct 12 15:38:02 2008
@@ -58,6 +58,7 @@
   gboolean             toolbox_color_area;
   gboolean             toolbox_foo_area;
   gboolean             toolbox_image_area;
+  gboolean             toolbox_wilber;
   gchar               *theme_path;
   gchar               *theme;
   gboolean             use_help;

Modified: branches/soc-2008-tagging/app/config/gimprc-blurbs.h
==============================================================================
--- branches/soc-2008-tagging/app/config/gimprc-blurbs.h	(original)
+++ branches/soc-2008-tagging/app/config/gimprc-blurbs.h	Sun Oct 12 15:38:02 2008
@@ -386,9 +386,17 @@
    "work on images that wouldn't fit into memory otherwise.  If you have a " \
    "lot of RAM, you may want to set this to a higher value.")
 
-#define TOOLBOX_COLOR_AREA_BLURB NULL
-#define TOOLBOX_FOO_AREA_BLURB NULL
-#define TOOLBOX_IMAGE_AREA_BLURB NULL
+#define TOOLBOX_COLOR_AREA_BLURB \
+N_("Show the current foreground and background colors in the toolbox.")
+
+#define TOOLBOX_FOO_AREA_BLURB \
+N_("Show the currently selected brush, pattern and gradient in the toolbox.")
+
+#define TOOLBOX_IMAGE_AREA_BLURB \
+N_("Show the currently active image in the toolbox.")
+
+#define TOOLBOX_WILBER_BLURB \
+"Show the GIMP mascot at the top of the toolbox."
 
 #define TOOLBOX_WINDOW_HINT_BLURB \
 N_("The window type hint that is set on the toolbox. This may affect " \

Modified: branches/soc-2008-tagging/app/config/gimprc-deserialize.c
==============================================================================
--- branches/soc-2008-tagging/app/config/gimprc-deserialize.c	(original)
+++ branches/soc-2008-tagging/app/config/gimprc-deserialize.c	Sun Oct 12 15:38:02 2008
@@ -51,8 +51,8 @@
   guint          i;
   guint          scope_id;
   guint          old_scope_id;
-  GTokenType         token;
-  GTokenType         next;
+  GTokenType     token;
+  GTokenType     next;
 
   g_return_val_if_fail (GIMP_IS_CONFIG (config), FALSE);
 
@@ -86,9 +86,8 @@
     {
       next = g_scanner_peek_next_token (scanner);
 
-      if (G_UNLIKELY (next != token &&
-                      ! (token == G_TOKEN_SYMBOL &&
-                         next  == G_TOKEN_IDENTIFIER)))
+      if (G_UNLIKELY (next != token && ! (token == G_TOKEN_SYMBOL &&
+                                          next  == G_TOKEN_IDENTIFIER)))
         {
           break;
         }

Modified: branches/soc-2008-tagging/app/config/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/config/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/config/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -49,7 +49,8 @@
 #	-DG_DISABLE_CAST_CHECKS
 
 DEFINES = \
-	-DG_LOG_DOMAIN=\"Gimp-Config\"
+	-DG_LOG_DOMAIN=\"Gimp-Config\" \
+	$(GIMP_VERSION_DEFINES)
 
 all : \
 	$(PRJ_TOP)\config.h \

Modified: branches/soc-2008-tagging/app/core/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/core/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/core/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -9,10 +9,9 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
 	$(CAIRO_CFLAGS)		\
-	$(GLIB_CFLAGS)		\
 	$(GEGL_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
 	-I$(includedir)
 
 noinst_LIBRARIES = libappcore.a
@@ -157,6 +156,8 @@
 	gimpdrawable-transform.h		\
 	gimpdrawablemodundo.c			\
 	gimpdrawablemodundo.h			\
+	gimpdrawablestack.c			\
+	gimpdrawablestack.h			\
 	gimpdrawableundo.c			\
 	gimpdrawableundo.h			\
 	gimpfilteredcontainer.c			\

Modified: branches/soc-2008-tagging/app/core/core-types.h
==============================================================================
--- branches/soc-2008-tagging/app/core/core-types.h	(original)
+++ branches/soc-2008-tagging/app/core/core-types.h	Sun Oct 12 15:38:02 2008
@@ -71,6 +71,7 @@
 typedef struct _GimpFilteredContainer   GimpFilteredContainer;
 typedef struct _GimpList            GimpList;
 typedef struct _GimpDocumentList    GimpDocumentList;
+typedef struct _GimpDrawableStack   GimpDrawableStack;
 typedef struct _GimpToolPresets     GimpToolPresets;
 
 

Modified: branches/soc-2008-tagging/app/core/gimp-edit.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-edit.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp-edit.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <stdlib.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 
@@ -272,7 +272,7 @@
   if (drawable)
     floating_sel_attach (layer, drawable);
   else
-    gimp_image_add_layer (image, layer, 0);
+    gimp_image_add_layer (image, layer, 0, TRUE);
 
   /*  end the group undo  */
   gimp_image_undo_group_end (image);
@@ -332,7 +332,7 @@
       return NULL;
     }
 
-  gimp_image_add_layer (image, layer, 0);
+  gimp_image_add_layer (image, layer, 0, TRUE);
 
   gimp_image_undo_enable (image);
 

Modified: branches/soc-2008-tagging/app/core/gimp-gui.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-gui.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp-gui.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimp-modules.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-modules.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp-modules.c	Sun Oct 12 15:38:02 2008
@@ -179,7 +179,7 @@
     {
       GimpConfigWriter *writer;
       GString          *str;
-      gchar            *p;
+      const gchar      *p;
       gchar            *filename;
       GError           *error = NULL;
 

Modified: branches/soc-2008-tagging/app/core/gimp-transform-region.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-transform-region.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp-transform-region.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <stdlib.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
@@ -117,51 +117,50 @@
                                             gdouble           *u,
                                             gdouble           *v);
 
-static inline gboolean supersample_dtest   (gdouble u0,
-                                            gdouble v0,
-                                            gdouble u1,
-                                            gdouble v1,
-                                            gdouble u2,
-                                            gdouble v2,
-                                            gdouble u3,
-                                            gdouble v3);
-
-static void     sample_adapt      (TileManager   *tm,
-                                   gdouble        uc,
-                                   gdouble        vc,
-                                   gdouble        u0,
-                                   gdouble        v0,
-                                   gdouble        u1,
-                                   gdouble        v1,
-                                   gdouble        u2,
-                                   gdouble        v2,
-                                   gdouble        u3,
-                                   gdouble        v3,
-                                   gint           level,
+static inline gboolean supersample_dtest   (const gdouble u0,
+                                            const gdouble v0,
+                                            const gdouble u1,
+                                            const gdouble v1,
+                                            const gdouble u2,
+                                            const gdouble v2,
+                                            const gdouble u3,
+                                            const gdouble v3);
+
+static void     sample_adapt      (PixelSurround *surround,
+                                   const gdouble  uc,
+                                   const gdouble  vc,
+                                   const gdouble  u0,
+                                   const gdouble  v0,
+                                   const gdouble  u1,
+                                   const gdouble  v1,
+                                   const gdouble  u2,
+                                   const gdouble  v2,
+                                   const gdouble  u3,
+                                   const gdouble  v3,
+                                   const  gint    level,
                                    guchar        *color,
-                                   const guchar  *bg_color,
-                                   gint           bpp,
-                                   gint           alpha);
+                                   const gint     bpp,
+                                   const gint     alpha);
 
 static void     sample_linear     (PixelSurround *surround,
-                                   gdouble        u,
-                                   gdouble        v,
+                                   const gdouble  u,
+                                   const gdouble  v,
                                    guchar        *color,
-                                   gint           bytes,
-                                   gint           alpha);
+                                   const gint     bytes,
+                                   const gint     alpha);
 static void     sample_cubic      (PixelSurround *surround,
-                                   gdouble        u,
-                                   gdouble        v,
+                                   const gdouble  u,
+                                   const gdouble  v,
                                    guchar        *color,
-                                   gint           bytes,
-                                   gint           alpha);
+                                   const gint     bytes,
+                                   const gint     alpha);
 static void     sample_lanczos    (PixelSurround *surround,
                                    const gfloat  *lanczos,
-                                   gdouble        u,
-                                   gdouble        v,
+                                   const gdouble  u,
+                                   const gdouble  v,
                                    guchar        *color,
-                                   gint           bytes,
-                                   gint           alpha);
+                                   const gint     bytes,
+                                   const gint     alpha);
 
 
 /*  public functions  */
@@ -394,7 +393,8 @@
   gint           n;
   gpointer       pr;
 
-  surround = pixel_surround_new (orig_tiles, 2, 2, bg_color);
+  surround = pixel_surround_new (orig_tiles, 2, 2, PIXEL_SURROUND_BACKGROUND);
+  pixel_surround_set_bg (surround, bg_color);
 
   uinc = m->coeff[0][0];
   vinc = m->coeff[1][0];
@@ -431,14 +431,14 @@
               if (supersample_dtest (u[1], v[1], u[2], v[2],
                                      u[3], v[3], u[4], v[4]))
                 {
-                  sample_adapt (orig_tiles,
+                  sample_adapt (surround,
                                 u[0] - u1, v[0] - v1,
                                 u[1] - u1, v[1] - v1,
                                 u[2] - u1, v[2] - v1,
                                 u[3] - u1, v[3] - v1,
                                 u[4] - u1, v[4] - v1,
                                 recursion_level,
-                                d, bg_color, destPR->bytes, alpha);
+                                d, destPR->bytes, alpha);
                 }
               else
                 {
@@ -496,7 +496,8 @@
   gint           n;
   gpointer       pr;
 
-  surround = pixel_surround_new (orig_tiles, 4, 4, bg_color);
+  surround = pixel_surround_new (orig_tiles, 4, 4, PIXEL_SURROUND_BACKGROUND);
+  pixel_surround_set_bg (surround, bg_color);
 
   uinc = m->coeff[0][0];
   vinc = m->coeff[1][0];
@@ -532,14 +533,14 @@
               if (supersample_dtest (u[1], v[1], u[2], v[2],
                                      u[3], v[3], u[4], v[4]))
                 {
-                  sample_adapt (orig_tiles,
+                  sample_adapt (surround,
                                 u[0] - u1, v[0] - v1,
                                 u[1] - u1, v[1] - v1,
                                 u[2] - u1, v[2] - v1,
                                 u[3] - u1, v[3] - v1,
                                 u[4] - u1, v[4] - v1,
                                 recursion_level,
-                                d, bg_color, destPR->bytes, alpha);
+                                d, destPR->bytes, alpha);
                 }
               else
                 {
@@ -599,7 +600,9 @@
   gpointer       pr;
 
   surround = pixel_surround_new (orig_tiles,
-                                 LANCZOS_WIDTH2, LANCZOS_WIDTH2, bg_color);
+                                 LANCZOS_WIDTH2, LANCZOS_WIDTH2,
+                                 PIXEL_SURROUND_BACKGROUND);
+  pixel_surround_set_bg (surround, bg_color);
 
   /* allocate and fill lanczos lookup table */
   lanczos = create_lanczos_lookup ();
@@ -638,14 +641,14 @@
               if (supersample_dtest (u[1], v[1], u[2], v[2],
                                      u[3], v[3], u[4], v[4]))
                 {
-                  sample_adapt (orig_tiles,
+                  sample_adapt (surround,
                                 u[0] - u1, v[0] - v1,
                                 u[1] - u1, v[1] - v1,
                                 u[2] - u1, v[2] - v1,
                                 u[3] - u1, v[3] - v1,
                                 u[4] - u1, v[4] - v1,
                                 recursion_level,
-                                d, bg_color, destPR->bytes, alpha);
+                                d, destPR->bytes, alpha);
                 }
               else
                 {
@@ -685,8 +688,8 @@
 
 static inline void
 untransform_coords (const GimpMatrix3 *m,
-                    gint               x,
-                    gint               y,
+                    const gint         x,
+                    const gint         y,
                     gdouble           *tu,
                     gdouble           *tv,
                     gdouble           *tw)
@@ -751,16 +754,16 @@
    */
 static void
 sample_linear (PixelSurround *surround,
-               gdouble        u,
-               gdouble        v,
+               const gdouble  u,
+               const gdouble  v,
                guchar        *color,
-               gint           bytes,
-               gint           alpha)
+               const gint     bytes,
+               const gint     alpha)
 {
   gdouble       a_val, a_recip;
   gint          i;
-  gint          iu = floor (u);
-  gint          iv = floor (v);
+  const gint    iu = floor (u);
+  const gint    iv = floor (v);
   gint          rowstride;
   gdouble       du, dv;
   const guchar *alphachan;
@@ -835,56 +838,42 @@
     bilinear interpolation of a fixed point pixel
 */
 static void
-sample_bi (TileManager  *tm,
-           gint          x,
-           gint          y,
-           guchar       *color,
-           const guchar *bg_color,
-           gint          bpp,
-           gint          alpha)
+sample_bi (PixelSurround *surround,
+           const gint     x,
+           const gint     y,
+           guchar        *color,
+           const gint     bpp,
+           const gint     alpha)
 {
-  guchar C[4][4];
-  gint   i;
-  gint   xscale = (x & (FIXED_UNIT-1));
-  gint   yscale = (y & (FIXED_UNIT-1));
-
-  gint   x0 = x >> FIXED_SHIFT;
-  gint   y0 = y >> FIXED_SHIFT;
-  gint   x1 = x0 + 1;
-  gint   y1 = y0 + 1;
-
-
-  /*  fill the color with default values, since read_pixel_data_1
-   *  does nothing, when accesses are out of bounds.
-   */
-  for (i = 0; i < 4; i++)
-    *(guint*) (&C[i]) = *(guint*) (bg_color);
-
-  read_pixel_data_1 (tm, x0, y0, C[0]);
-  read_pixel_data_1 (tm, x1, y0, C[2]);
-  read_pixel_data_1 (tm, x0, y1, C[1]);
-  read_pixel_data_1 (tm, x1, y1, C[3]);
+  const gint    xscale = x & (FIXED_UNIT - 1);
+  const gint    yscale = y & (FIXED_UNIT - 1);
+  const gint    x0     = x >> FIXED_SHIFT;
+  const gint    y0     = y >> FIXED_SHIFT;
+  gint          rowstride;
+  const guchar *src    = pixel_surround_lock (surround, x0, y0, &rowstride);
+  const guchar *s0     = src;
+  const guchar *s1     = src + bpp;
+  const guchar *s2     = src + rowstride;
+  const guchar *s3     = src + rowstride + bpp;
+  gint          i;
 
 #define lerp(v1, v2, r) \
         (((guint)(v1) * (FIXED_UNIT - (guint)(r)) + \
           (guint)(v2) * (guint)(r)) >> FIXED_SHIFT)
 
-  color[alpha]= lerp (lerp (C[0][alpha], C[1][alpha], yscale),
-                      lerp (C[2][alpha], C[3][alpha], yscale), xscale);
+  color[alpha]= lerp (lerp (s0[alpha], s1[alpha], yscale),
+                      lerp (s2[alpha], s3[alpha], yscale), xscale);
 
   if (color[alpha])
-    { /* to avoid problems, calculate with premultiplied alpha */
+    {
+      /* to avoid problems, calculate with premultiplied alpha */
       for (i = 0; i < alpha; i++)
         {
-          C[0][i] = (C[0][i] * C[0][alpha] / 255);
-          C[1][i] = (C[1][i] * C[1][alpha] / 255);
-          C[2][i] = (C[2][i] * C[2][alpha] / 255);
-          C[3][i] = (C[3][i] * C[3][alpha] / 255);
+          color[i] = lerp (lerp (s0[i] * s0[alpha] / 255,
+                                 s1[i] * s1[alpha] / 255, yscale),
+                           lerp (s2[i] * s2[alpha] / 255,
+                                 s3[i] * s3[alpha] / 255, yscale), xscale);
         }
-
-      for (i = 0; i < alpha; i++)
-        color[i] = lerp (lerp (C[0][i], C[1][i], yscale),
-                         lerp (C[2][i], C[3][i], yscale), xscale);
     }
   else
     {
@@ -902,10 +891,10 @@
  * subdivision should be used.
  */
 static inline gboolean
-supersample_test (gint x0, gint y0,
-                  gint x1, gint y1,
-                  gint x2, gint y2,
-                  gint x3, gint y3)
+supersample_test (const gint x0, const gint y0,
+                  const gint x1, const gint y1,
+                  const gint x2, const gint y2,
+                  const gint x3, const gint y3)
 {
   return (abs (x0 - x1) > FIXED_UNIT ||
           abs (x1 - x2) > FIXED_UNIT ||
@@ -925,10 +914,10 @@
  * rotations.
  */
 static inline gboolean
-supersample_dtest (gdouble x0, gdouble y0,
-                   gdouble x1, gdouble y1,
-                   gdouble x2, gdouble y2,
-                   gdouble x3, gdouble y3)
+supersample_dtest (const gdouble x0, const gdouble y0,
+                   const gdouble x1, const gdouble y1,
+                   const gdouble x2, const gdouble y2,
+                   const gdouble x3, const gdouble y3)
 {
   return (fabs (x0 - x1) > G_SQRT2 ||
           fabs (x1 - x2) > G_SQRT2 ||
@@ -947,30 +936,29 @@
     0..3 is a cycle around the quad
 */
 static void
-get_sample (TileManager  *tm,
-            gint          xc,
-            gint          yc,
-            gint          x0,
-            gint          y0,
-            gint          x1,
-            gint          y1,
-            gint          x2,
-            gint          y2,
-            gint          x3,
-            gint          y3,
-            gint         *cc,
-            gint          level,
-            guint        *color,
-            const guchar *bg_color,
-            gint          bpp,
-            gint          alpha)
+get_sample (PixelSurround *surround,
+            const gint     xc,
+            const gint     yc,
+            const gint     x0,
+            const gint     y0,
+            const gint     x1,
+            const gint     y1,
+            const gint     x2,
+            const gint     y2,
+            const gint     x3,
+            const gint     y3,
+            gint          *cc,
+            const gint     level,
+            guint         *color,
+            const gint     bpp,
+            const gint     alpha)
 {
   if (!level || !supersample_test (x0, y0, x1, y1, x2, y2, x3, y3))
     {
       gint   i;
       guchar C[4];
 
-      sample_bi (tm, xc, yc, C, bg_color, bpp, alpha);
+      sample_bi (surround, xc, yc, C, bpp, alpha);
 
       for (i = 0; i < bpp; i++)
         color[i]+= C[i];
@@ -1004,45 +992,44 @@
       bry = (y2 + yc) / 2;
       by  = (y3 + y2) / 2;
 
-      get_sample (tm,
+      get_sample (surround,
                   tlx,tly,
                   x0,y0, tx,ty, xc,yc, lx,ly,
-                  cc, level-1, color, bg_color, bpp, alpha);
+                  cc, level-1, color, bpp, alpha);
 
-      get_sample (tm,
+      get_sample (surround,
                   trx,try,
                   tx,ty, x1,y1, rx,ry, xc,yc,
-                  cc, level-1, color, bg_color, bpp, alpha);
+                  cc, level-1, color, bpp, alpha);
 
-      get_sample (tm,
+      get_sample (surround,
                   brx,bry,
                   xc,yc, rx,ry, x2,y2, bx,by,
-                  cc, level-1, color, bg_color, bpp, alpha);
+                  cc, level-1, color, bpp, alpha);
 
-      get_sample (tm,
+      get_sample (surround,
                   blx,bly,
                   lx,ly, xc,yc, bx,by, x3,y3,
-                  cc, level-1, color, bg_color, bpp, alpha);
+                  cc, level-1, color, bpp, alpha);
     }
 }
 
 static void
-sample_adapt (TileManager  *tm,
-              gdouble       xc,
-              gdouble       yc,
-              gdouble       x0,
-              gdouble       y0,
-              gdouble       x1,
-              gdouble       y1,
-              gdouble       x2,
-              gdouble       y2,
-              gdouble       x3,
-              gdouble       y3,
-              gint          level,
-              guchar       *color,
-              const guchar *bg_color,
-              gint          bpp,
-              gint          alpha)
+sample_adapt (PixelSurround *surround,
+              const gdouble  xc,
+              const gdouble  yc,
+              const gdouble  x0,
+              const gdouble  y0,
+              const gdouble  x1,
+              const gdouble  y1,
+              const gdouble  x2,
+              const gdouble  y2,
+              const gdouble  x3,
+              const gdouble  y3,
+              const gint     level,
+              guchar        *color,
+              const gint     bpp,
+              const gint     alpha)
 {
     gint  cc = 0;
     gint  i;
@@ -1050,13 +1037,13 @@
 
     C[0] = C[1] = C[2] = C[3] = 0;
 
-    get_sample (tm,
+    get_sample (surround,
                 DOUBLE2FIXED (xc), DOUBLE2FIXED (yc),
                 DOUBLE2FIXED (x0), DOUBLE2FIXED (y0),
                 DOUBLE2FIXED (x1), DOUBLE2FIXED (y1),
                 DOUBLE2FIXED (x2), DOUBLE2FIXED (y2),
                 DOUBLE2FIXED (x3), DOUBLE2FIXED (y3),
-                &cc, level, C, bg_color, bpp, alpha);
+                &cc, level, C, bpp, alpha);
 
     if (!cc)
       cc=1;
@@ -1092,11 +1079,11 @@
 /*  Note: cubic function no longer clips result. */
 /*  Inlining this function makes sample_cubic() run about 10% faster. (Sven) */
 static inline gdouble
-gimp_drawable_transform_cubic (gdouble dx,
-                               gint    jm1,
-                               gint    j,
-                               gint    jp1,
-                               gint    jp2)
+gimp_drawable_transform_cubic (const gdouble dx,
+                               const gint    jm1,
+                               const gint    j,
+                               const gint    jp1,
+                               const gint    jp2)
 {
   gdouble result;
 
@@ -1127,18 +1114,18 @@
    */
 static void
 sample_cubic (PixelSurround *surround,
-              gdouble        u,
-              gdouble        v,
+              const gdouble  u,
+              const gdouble  v,
               guchar        *color,
-              gint           bytes,
-              gint           alpha)
+              const gint     bytes,
+              const gint     alpha)
 {
   gdouble       a_val, a_recip;
   gint          i;
-  gint          iu = floor(u);
-  gint          iv = floor(v);
-  gint          rowstride;
+  const gint    iu = floor(u);
+  const gint    iv = floor(v);
   gdouble       du, dv;
+  gint          rowstride;
   const guchar *data;
 
   /* lock the pixel surround */
@@ -1207,11 +1194,11 @@
 static void
 sample_lanczos (PixelSurround *surround,
                 const gfloat  *lanczos,
-                gdouble        u,
-                gdouble        v,
+                const gdouble  u,
+                const gdouble  v,
                 guchar        *color,
-                gint           bytes,
-                gint           alpha)
+                const gint     bytes,
+                const gint     alpha)
 {
   gdouble       x_kernel[LANCZOS_WIDTH2]; /* 1-D kernels of window coeffs */
   gdouble       y_kernel[LANCZOS_WIDTH2];

Modified: branches/soc-2008-tagging/app/core/gimp-user-install.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-user-install.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp-user-install.c	Sun Oct 12 15:38:02 2008
@@ -212,7 +212,7 @@
     {
       gint i;
 
-      for (i = 4; i >= 0; i -= 2)
+      for (i = (GIMP_MINOR_VERSION & ~1); i >= 0; i -= 2)
         {
           /*  we assume that GIMP_APP_VERSION is in the form '2.x'  */
           g_snprintf (version + 2, 2, "%d", i);

Modified: branches/soc-2008-tagging/app/core/gimp.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp.c	(original)
+++ branches/soc-2008-tagging/app/core/gimp.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h> /* strlen */
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpconfig/gimpconfig.h"
@@ -187,6 +187,8 @@
   gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
   gimp->pdb_compat_mode  = GIMP_PDB_COMPAT_OFF;
 
+  gimp->restored         = FALSE;
+
   gimp_gui_init (gimp);
 
   gimp->busy                = 0;
@@ -637,6 +639,8 @@
 
   gimp_plug_in_manager_restore (gimp->plug_in_manager,
                                 gimp_get_user_context (gimp), status_callback);
+
+  gimp->restored = TRUE;
 }
 
 static gboolean
@@ -883,6 +887,21 @@
 }
 
 /**
+ * gimp_is_restored:
+ * @gimp: a #Gimp object
+ *
+ * Return value: %TRUE if GIMP is completely started, %FALSE otherwise.
+ **/
+gboolean
+gimp_is_restored (Gimp *gimp)
+{
+  g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
+
+  return gimp->restored;
+}
+
+
+/**
  * gimp_exit:
  * @gimp: a #Gimp object
  * @force: whether to force the application to quit

Modified: branches/soc-2008-tagging/app/core/gimp.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp.h	(original)
+++ branches/soc-2008-tagging/app/core/gimp.h	Sun Oct 12 15:38:02 2008
@@ -53,7 +53,9 @@
   GimpStackTraceMode      stack_trace_mode;
   GimpPDBCompatMode       pdb_compat_mode;
 
-  GimpGui                 gui; /* gui vtable */
+  GimpGui                 gui;         /* gui vtable */
+
+  gboolean                restored;    /* becomes TRUE in gimp_restore() */
 
   gint                    busy;
   guint                   busy_idle_id;
@@ -152,6 +154,7 @@
                                           GimpInitStatusFunc   status_callback);
 void           gimp_restore              (Gimp                *gimp,
                                           GimpInitStatusFunc   status_callback);
+gboolean       gimp_is_restored          (Gimp                *gimp);
 
 void           gimp_exit                 (Gimp                *gimp,
                                           gboolean             force);

Modified: branches/soc-2008-tagging/app/core/gimpbrush.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpbrush.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpbrush.c	Sun Oct 12 15:38:02 2008
@@ -51,36 +51,36 @@
 
 static void        gimp_brush_tagged_init           (GimpTaggedInterface    *iface);
 
-static void        gimp_brush_set_property          (GObject       *object,
-                                                     guint          property_id,
-                                                     const GValue  *value,
-                                                     GParamSpec    *pspec);
-static void        gimp_brush_get_property          (GObject       *object,
-                                                     guint          property_id,
-                                                     GValue        *value,
-                                                     GParamSpec    *pspec);
-static void        gimp_brush_finalize              (GObject       *object);
-
-static gint64      gimp_brush_get_memsize           (GimpObject    *object,
-                                                     gint64        *gui_size);
-
-static gboolean    gimp_brush_get_size              (GimpViewable  *viewable,
-                                                     gint          *width,
-                                                     gint          *height);
-static TempBuf   * gimp_brush_get_new_preview       (GimpViewable  *viewable,
-                                                     GimpContext   *context,
-                                                     gint           width,
-                                                     gint           height);
-static gchar     * gimp_brush_get_description       (GimpViewable  *viewable,
-                                                     gchar        **tooltip);
-static gchar     * gimp_brush_get_extension         (GimpData      *data);
-
-static GimpBrush * gimp_brush_real_select_brush     (GimpBrush     *brush,
-                                                     GimpCoords    *last_coords,
-                                                     GimpCoords    *cur_coords);
-static gboolean    gimp_brush_real_want_null_motion (GimpBrush     *brush,
-                                                     GimpCoords    *last_coords,
-                                                     GimpCoords    *cur_coords);
+static void          gimp_brush_set_property          (GObject       *object,
+                                                       guint          property_id,
+                                                       const GValue  *value,
+                                                       GParamSpec    *pspec);
+static void          gimp_brush_get_property          (GObject       *object,
+                                                       guint          property_id,
+                                                       GValue        *value,
+                                                       GParamSpec    *pspec);
+static void          gimp_brush_finalize              (GObject       *object);
+
+static gint64        gimp_brush_get_memsize           (GimpObject    *object,
+                                                       gint64        *gui_size);
+
+static gboolean      gimp_brush_get_size              (GimpViewable  *viewable,
+                                                       gint          *width,
+                                                       gint          *height);
+static TempBuf     * gimp_brush_get_new_preview       (GimpViewable  *viewable,
+                                                       GimpContext   *context,
+                                                       gint           width,
+                                                       gint           height);
+static gchar       * gimp_brush_get_description       (GimpViewable  *viewable,
+                                                       gchar        **tooltip);
+static const gchar * gimp_brush_get_extension         (GimpData      *data);
+
+static GimpBrush   * gimp_brush_real_select_brush     (GimpBrush     *brush,
+                                                       GimpCoords    *last_coords,
+                                                       GimpCoords    *cur_coords);
+static gboolean      gimp_brush_real_want_null_motion (GimpBrush     *brush,
+                                                       GimpCoords    *last_coords,
+                                                       GimpCoords    *cur_coords);
 
 static gchar     * gimp_brush_get_checksum          (GimpTagged    *tagged);
 
@@ -348,7 +348,7 @@
                           brush->mask->height);
 }
 
-static gchar *
+static const gchar *
 gimp_brush_get_extension (GimpData *data)
 {
   return GIMP_BRUSH_FILE_EXTENSION;

Modified: branches/soc-2008-tagging/app/core/gimpbrushclipboard.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpbrushclipboard.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpbrushclipboard.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpbrushgenerated.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpbrushgenerated.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpbrushgenerated.c	Sun Oct 12 15:38:02 2008
@@ -51,47 +51,48 @@
 
 /*  local function prototypes  */
 
-static void       gimp_brush_generated_set_property  (GObject      *object,
-                                                      guint         property_id,
-                                                      const GValue *value,
-                                                      GParamSpec   *pspec);
-static void       gimp_brush_generated_get_property  (GObject      *object,
-                                                      guint         property_id,
-                                                      GValue       *value,
-                                                      GParamSpec   *pspec);
-static void       gimp_brush_generated_dirty         (GimpData     *data);
-static gchar    * gimp_brush_generated_get_extension (GimpData     *data);
-static GimpData * gimp_brush_generated_duplicate     (GimpData     *data);
-
-static void       gimp_brush_generated_scale_size    (GimpBrush    *gbrush,
-                                                      gdouble       scale,
-                                                      gint         *width,
-                                                      gint         *height);
-static TempBuf  * gimp_brush_generated_scale_mask    (GimpBrush    *gbrush,
-                                                      gdouble       scale);
-
-static TempBuf  * gimp_brush_generated_calc          (GimpBrushGenerated      *brush,
-                                                      GimpBrushGeneratedShape  shape,
-                                                      gfloat                   radius,
-                                                      gint                     spikes,
-                                                      gfloat                   hardness,
-                                                      gfloat                   aspect_ratio,
-                                                      gfloat                   angle,
-                                                      GimpVector2             *xaxis,
-                                                      GimpVector2             *yaxis);
-static void       gimp_brush_generated_get_half_size (GimpBrushGenerated      *gbrush,
-                                                      GimpBrushGeneratedShape  shape,
-                                                      gfloat                   radius,
-                                                      gint                     spikes,
-                                                      gfloat                   hardness,
-                                                      gfloat                   aspect_ratio,
-                                                      gdouble                  angle_in_degrees,
-                                                      gint                    *half_width,
-                                                      gint                    *half_height,
-                                                      gdouble                 *_s,
-                                                      gdouble                 *_c,
-                                                      GimpVector2             *_x_axis,
-                                                      GimpVector2             *_y_axis);
+static void          gimp_brush_generated_set_property  (GObject      *object,
+                                                         guint         property_id,
+                                                         const GValue *value,
+                                                         GParamSpec   *pspec);
+static void          gimp_brush_generated_get_property  (GObject      *object,
+                                                         guint         property_id,
+                                                         GValue       *value,
+                                                         GParamSpec   *pspec);
+
+static void          gimp_brush_generated_dirty         (GimpData     *data);
+static const gchar * gimp_brush_generated_get_extension (GimpData     *data);
+static GimpData    * gimp_brush_generated_duplicate     (GimpData     *data);
+
+static void          gimp_brush_generated_scale_size    (GimpBrush    *gbrush,
+                                                         gdouble       scale,
+                                                         gint         *width,
+                                                         gint         *height);
+static TempBuf     * gimp_brush_generated_scale_mask    (GimpBrush    *gbrush,
+                                                         gdouble       scale);
+
+static TempBuf     * gimp_brush_generated_calc          (GimpBrushGenerated      *brush,
+                                                         GimpBrushGeneratedShape  shape,
+                                                         gfloat                   radius,
+                                                         gint                     spikes,
+                                                         gfloat                   hardness,
+                                                         gfloat                   aspect_ratio,
+                                                         gfloat                   angle,
+                                                         GimpVector2             *xaxis,
+                                                         GimpVector2             *yaxis);
+static void          gimp_brush_generated_get_half_size (GimpBrushGenerated      *gbrush,
+                                                         GimpBrushGeneratedShape  shape,
+                                                         gfloat                   radius,
+                                                         gint                     spikes,
+                                                         gfloat                   hardness,
+                                                         gfloat                   aspect_ratio,
+                                                         gdouble                  angle_in_degrees,
+                                                         gint                    *half_width,
+                                                         gint                    *half_height,
+                                                         gdouble                 *_s,
+                                                         gdouble                 *_c,
+                                                         GimpVector2             *_x_axis,
+                                                         GimpVector2             *_y_axis);
 
 
 G_DEFINE_TYPE (GimpBrushGenerated, gimp_brush_generated, GIMP_TYPE_BRUSH)
@@ -256,7 +257,7 @@
   GIMP_DATA_CLASS (parent_class)->dirty (data);
 }
 
-static gchar *
+static const gchar *
 gimp_brush_generated_get_extension (GimpData *data)
 {
   return GIMP_BRUSH_GENERATED_FILE_EXTENSION;

Modified: branches/soc-2008-tagging/app/core/gimpchannel-combine.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannel-combine.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannel-combine.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpchannel-select.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannel-select.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannel-select.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpchannel.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannel.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannel.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
@@ -65,6 +65,13 @@
 };
 
 
+#ifdef __GNUC__
+#warning FIXME: gegl_node_add_child() needs to be public
+#endif
+GeglNode * gegl_node_add_child (GeglNode *self,
+                                GeglNode *child);
+
+
 static void gimp_channel_pickable_iface_init (GimpPickableInterface *iface);
 
 static void       gimp_channel_finalize      (GObject          *object);
@@ -75,6 +82,7 @@
 static gchar  * gimp_channel_get_description (GimpViewable     *viewable,
                                               gchar           **tooltip);
 
+static void       gimp_channel_visibility_changed (GimpItem    *item);
 static gboolean   gimp_channel_is_attached   (GimpItem         *item);
 static GimpItem * gimp_channel_duplicate     (GimpItem         *item,
                                               GType             new_type);
@@ -150,6 +158,7 @@
                                               GimpImageType     type,
                                               gint              offset_x,
                                               gint              offset_y);
+static GeglNode * gimp_channel_get_node      (GimpDrawable     *drawable);
 static void      gimp_channel_swap_pixels    (GimpDrawable     *drawable,
                                               TileManager      *tiles,
                                               gboolean          sparse,
@@ -244,31 +253,33 @@
   viewable_class->get_description  = gimp_channel_get_description;
   viewable_class->default_stock_id = "gimp-channel";
 
-  item_class->is_attached    = gimp_channel_is_attached;
-  item_class->duplicate      = gimp_channel_duplicate;
-  item_class->convert        = gimp_channel_convert;
-  item_class->translate      = gimp_channel_translate;
-  item_class->scale          = gimp_channel_scale;
-  item_class->resize         = gimp_channel_resize;
-  item_class->flip           = gimp_channel_flip;
-  item_class->rotate         = gimp_channel_rotate;
-  item_class->transform      = gimp_channel_transform;
-  item_class->stroke         = gimp_channel_stroke;
-  item_class->default_name   = _("Channel");
-  item_class->rename_desc    = _("Rename Channel");
-  item_class->translate_desc = _("Move Channel");
-  item_class->scale_desc     = _("Scale Channel");
-  item_class->resize_desc    = _("Resize Channel");
-  item_class->flip_desc      = _("Flip Channel");
-  item_class->rotate_desc    = _("Rotate Channel");
-  item_class->transform_desc = _("Transform Channel");
-  item_class->stroke_desc    = _("Stroke Channel");
+  item_class->visibility_changed   = gimp_channel_visibility_changed;
+  item_class->is_attached          = gimp_channel_is_attached;
+  item_class->duplicate            = gimp_channel_duplicate;
+  item_class->convert              = gimp_channel_convert;
+  item_class->translate            = gimp_channel_translate;
+  item_class->scale                = gimp_channel_scale;
+  item_class->resize               = gimp_channel_resize;
+  item_class->flip                 = gimp_channel_flip;
+  item_class->rotate               = gimp_channel_rotate;
+  item_class->transform            = gimp_channel_transform;
+  item_class->stroke               = gimp_channel_stroke;
+  item_class->default_name         = _("Channel");
+  item_class->rename_desc          = _("Rename Channel");
+  item_class->translate_desc       = _("Move Channel");
+  item_class->scale_desc           = _("Scale Channel");
+  item_class->resize_desc          = _("Resize Channel");
+  item_class->flip_desc            = _("Flip Channel");
+  item_class->rotate_desc          = _("Rotate Channel");
+  item_class->transform_desc       = _("Transform Channel");
+  item_class->stroke_desc          = _("Stroke Channel");
 
   drawable_class->invalidate_boundary   = gimp_channel_invalidate_boundary;
   drawable_class->get_active_components = gimp_channel_get_active_components;
   drawable_class->apply_region          = gimp_channel_apply_region;
   drawable_class->replace_region        = gimp_channel_replace_region;
   drawable_class->set_tiles             = gimp_channel_set_tiles;
+  drawable_class->get_node              = gimp_channel_get_node;
   drawable_class->swap_pixels           = gimp_channel_swap_pixels;
 
   klass->boundary       = gimp_channel_real_boundary;
@@ -325,6 +336,12 @@
 {
   GimpChannel *channel = GIMP_CHANNEL (object);
 
+  if (channel->node)
+    {
+      g_object_unref (channel->node);
+      channel->node = NULL;
+    }
+
   if (channel->segs_in)
     {
       g_free (channel->segs_in);
@@ -366,6 +383,39 @@
                                                               tooltip);
 }
 
+static void
+gimp_channel_visibility_changed (GimpItem *item)
+{
+  GimpChannel *channel = GIMP_CHANNEL (item);
+
+  if (channel->node)
+    {
+      GeglNode *input;
+      GeglNode *output;
+
+      input  = gegl_node_get_input_proxy (channel->node, "input");
+      output = gegl_node_get_output_proxy (channel->node, "output");
+
+      if (gimp_item_get_visible (item))
+        {
+          gegl_node_connect_to (input,              "output",
+                                channel->mode_node, "input");
+          gegl_node_connect_to (channel->mode_node, "output",
+                                output,             "input");
+        }
+      else
+        {
+          gegl_node_disconnect (channel->mode_node, "input");
+
+          gegl_node_connect_to (input,  "output",
+                                output, "input");
+        }
+    }
+
+  if (GIMP_ITEM_CLASS (parent_class)->visibility_changed)
+    GIMP_ITEM_CLASS (parent_class)->visibility_changed (item);
+}
+
 static gboolean
 gimp_channel_is_attached (GimpItem *item)
 {
@@ -494,7 +544,6 @@
   GimpChannel *tmp_mask = NULL;
   gint         width, height;
   PixelRegion  srcPR, destPR;
-  guchar       empty = TRANSPARENT_OPACITY;
   gint         x1, y1, x2, y2;
 
   gimp_channel_bounds (channel, &x1, &y1, &x2, &y2);
@@ -539,7 +588,7 @@
                      0, 0,
                      gimp_item_width  (GIMP_ITEM (channel)),
                      gimp_item_height (GIMP_ITEM (channel)), TRUE);
-  color_region (&srcPR, &empty);
+  clear_region (&srcPR);
 
   if (width != 0 && height != 0)
     {
@@ -823,6 +872,89 @@
   GIMP_CHANNEL (drawable)->bounds_known = FALSE;
 }
 
+static GeglNode *
+gimp_channel_get_node (GimpDrawable *drawable)
+{
+  GimpChannel *channel = GIMP_CHANNEL (drawable);
+  GeglNode    *source;
+  GeglNode    *input;
+  GeglNode    *output;
+  GeglColor   *color;
+
+  g_printerr ("%s 1\n", G_STRFUNC);
+
+  if (channel->node)
+    return channel->node;
+
+  g_printerr ("%s 2\n", G_STRFUNC);
+
+  channel->node = gegl_node_new ();
+
+  source = gimp_drawable_get_source_node (drawable);
+  gegl_node_add_child (channel->node, source);
+
+  color = gegl_color_new (NULL);
+  gegl_color_set_rgba (color,
+                       channel->color.r,
+                       channel->color.g,
+                       channel->color.b,
+                       channel->color.a);
+
+  channel->color_node = gegl_node_new_child (channel->node,
+                                             "operation", "color",
+                                             "value",     color,
+                                             NULL);
+
+  g_object_unref (color);
+
+  channel->mask_node = gegl_node_new_child (channel->node,
+                                            "operation", "opacity",
+                                            NULL);
+  gegl_node_connect_to (channel->color_node, "output",
+                        channel->mask_node,  "input");
+
+  channel->invert_node = gegl_node_new_child (channel->node,
+                                              "operation", "invert",
+                                              NULL);
+
+  if (channel->show_masked)
+    {
+      gegl_node_connect_to (source,               "output",
+                            channel->invert_node, "input");
+      gegl_node_connect_to (channel->invert_node, "output",
+                            channel->mask_node,   "aux");
+    }
+  else
+    {
+      gegl_node_connect_to (source,             "output",
+                            channel->mask_node, "aux");
+    }
+
+  channel->mode_node = gegl_node_new_child (channel->node,
+                                            "operation", "normal",
+                                            NULL);
+  gegl_node_connect_to (channel->mask_node, "output",
+                        channel->mode_node, "aux");
+
+  input  = gegl_node_get_input_proxy (channel->node, "input");
+  output = gegl_node_get_output_proxy (channel->node, "output");
+
+  if (gimp_item_get_visible (GIMP_ITEM (channel)))
+    {
+      gegl_node_connect_to (input,              "output",
+                            channel->mode_node, "input");
+      gegl_node_connect_to (channel->mode_node, "output",
+                            output,             "input");
+    }
+  else
+    {
+      gegl_node_connect_to (input,  "output",
+                            output, "input");
+    }
+
+  return channel->node;
+}
+
 static void
 gimp_channel_swap_pixels (GimpDrawable *drawable,
                           TileManager  *tiles,
@@ -1195,7 +1327,6 @@
                          gboolean     push_undo)
 {
   PixelRegion maskPR;
-  guchar      bg = TRANSPARENT_OPACITY;
 
   if (push_undo)
     {
@@ -1216,7 +1347,7 @@
                          channel->x1, channel->y1,
                          channel->x2 - channel->x1,
                          channel->y2 - channel->y1, TRUE);
-      color_region (&maskPR, &bg);
+      clear_region (&maskPR);
     }
   else
     {
@@ -1226,7 +1357,7 @@
                          0, 0,
                          gimp_item_width  (GIMP_ITEM (channel)),
                          gimp_item_height (GIMP_ITEM (channel)), TRUE);
-      color_region (&maskPR, &bg);
+      clear_region (&maskPR);
     }
 
   /*  we know the bounds  */
@@ -1636,6 +1767,24 @@
 
       channel->color = *color;
 
+      if (channel->color_node)
+        {
+          GeglColor *gegl_color;
+
+          gegl_color = gegl_color_new (NULL);
+          gegl_color_set_rgba (gegl_color,
+                               channel->color.r,
+                               channel->color.g,
+                               channel->color.b,
+                               channel->color.a);
+
+          gegl_node_set (channel->color_node,
+                         "value", gegl_color,
+                         NULL);
+
+          g_object_unref (gegl_color);
+        }
+
       gimp_drawable_update (GIMP_DRAWABLE (channel),
                             0, 0,
                             gimp_item_width  (GIMP_ITEM (channel)),
@@ -1684,6 +1833,24 @@
 
       channel->color.a = opacity;
 
+      if (channel->color_node)
+        {
+          GeglColor *gegl_color;
+
+          gegl_color = gegl_color_new (NULL);
+          gegl_color_set_rgba (gegl_color,
+                               channel->color.r,
+                               channel->color.g,
+                               channel->color.b,
+                               channel->color.a);
+
+          gegl_node_set (channel->color_node,
+                         "value", gegl_color,
+                         NULL);
+
+          g_object_unref (gegl_color);
+        }
+
       gimp_drawable_update (GIMP_DRAWABLE (channel),
                             0, 0,
                             gimp_item_width  (GIMP_ITEM (channel)),
@@ -1711,6 +1878,28 @@
     {
       channel->show_masked = show_masked ? TRUE : FALSE;
 
+      if (channel->invert_node)
+        {
+          GeglNode *source;
+
+          source = gimp_drawable_get_source_node (GIMP_DRAWABLE (channel));
+
+          if (channel->show_masked)
+            {
+              gegl_node_connect_to (source,               "output",
+                                    channel->invert_node, "input");
+              gegl_node_connect_to (channel->invert_node, "output",
+                                    channel->mask_node,   "aux");
+            }
+          else
+            {
+              gegl_node_disconnect (channel->invert_node, "input");
+
+              gegl_node_connect_to (source,             "output",
+                                    channel->mask_node, "aux");
+            }
+        }
+
       gimp_drawable_update (GIMP_DRAWABLE (channel),
                             0, 0,
                             gimp_item_width  (GIMP_ITEM (channel)),

Modified: branches/soc-2008-tagging/app/core/gimpchannel.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannel.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannel.h	Sun Oct 12 15:38:02 2008
@@ -40,6 +40,12 @@
   gboolean      show_masked;       /*  Show masked areas--as          */
                                    /*  opposed to selected areas      */
 
+  GeglNode     *node;
+  GeglNode     *color_node;
+  GeglNode     *invert_node;
+  GeglNode     *mask_node;
+  GeglNode     *mode_node;
+
   /*  Selection mask variables  */
   gboolean      boundary_known;    /*  is the current boundary valid  */
   BoundSeg     *segs_in;           /*  outline of selected region     */

Modified: branches/soc-2008-tagging/app/core/gimpchannelpropundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannelpropundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannelpropundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpchannelundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpchannelundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpchannelundo.c	Sun Oct 12 15:38:02 2008
@@ -18,11 +18,10 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
-#include "gimpcontainer.h"
 #include "gimpimage.h"
 #include "gimpchannel.h"
 #include "gimpchannelundo.h"
@@ -193,17 +192,8 @@
       channel_undo->prev_position = gimp_image_get_channel_index (undo->image,
                                                                   channel);
 
-      gimp_container_remove (undo->image->channels, GIMP_OBJECT (channel));
-      gimp_item_removed (GIMP_ITEM (channel));
-
-      if (channel == gimp_image_get_active_channel (undo->image))
-        {
-          if (channel_undo->prev_channel)
-            gimp_image_set_active_channel (undo->image,
-                                           channel_undo->prev_channel);
-          else
-            gimp_image_unset_active_channel (undo->image);
-        }
+      gimp_image_remove_channel (undo->image, channel, FALSE,
+                                 channel_undo->prev_channel);
     }
   else
     {
@@ -212,9 +202,8 @@
       /*  record the active channel  */
       channel_undo->prev_channel = gimp_image_get_active_channel (undo->image);
 
-      gimp_container_insert (undo->image->channels, GIMP_OBJECT (channel),
-                             channel_undo->prev_position);
-      gimp_image_set_active_channel (undo->image, channel);
+      gimp_image_add_channel (undo->image, channel,
+                              channel_undo->prev_position, FALSE);
 
       GIMP_ITEM (channel)->removed = FALSE;
     }

Modified: branches/soc-2008-tagging/app/core/gimpcontainer.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpcontainer.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpcontainer.c	Sun Oct 12 15:38:02 2008
@@ -88,6 +88,11 @@
 static gint64     gimp_container_get_memsize     (GimpObject       *object,
                                                   gint64           *gui_size);
 
+static void       gimp_container_real_add        (GimpContainer    *container,
+                                                  GimpObject       *object);
+static void       gimp_container_real_remove     (GimpContainer    *container,
+                                                  GimpObject       *object);
+
 static gboolean   gimp_container_serialize       (GimpConfig       *config,
                                                   GimpConfigWriter *writer,
                                                   gpointer          data);
@@ -170,8 +175,8 @@
 
   gimp_object_class->get_memsize = gimp_container_get_memsize;
 
-  klass->add                     = NULL;
-  klass->remove                  = NULL;
+  klass->add                     = gimp_container_real_add;
+  klass->remove                  = gimp_container_real_remove;
   klass->reorder                 = NULL;
   klass->freeze                  = NULL;
   klass->thaw                    = NULL;
@@ -304,6 +309,21 @@
                                                                   gui_size);
 }
 
+static void
+gimp_container_real_add (GimpContainer *container,
+                         GimpObject    *object)
+{
+  container->num_children++;
+}
+
+static void
+gimp_container_real_remove (GimpContainer *container,
+                            GimpObject    *object)
+{
+  container->num_children--;
+}
+
+
 typedef struct
 {
   GimpConfigWriter *writer;
@@ -515,9 +535,8 @@
 gimp_container_add (GimpContainer *container,
                     GimpObject    *object)
 {
-  GimpContainerHandler *handler;
-  GList                *list;
-  gulong                handler_id;
+  GList *list;
+  gint   n_children;
 
   g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
   g_return_val_if_fail (object != NULL, FALSE);
@@ -534,7 +553,8 @@
 
   for (list = container->handlers; list; list = g_list_next (list))
     {
-      handler = (GimpContainerHandler *) list->data;
+      GimpContainerHandler *handler = list->data;
+      gulong                handler_id;
 
       handler_id = g_signal_connect (object,
                                      handler->signame,
@@ -558,10 +578,19 @@
       break;
     }
 
-  container->num_children++;
+  n_children = container->num_children;
 
   g_signal_emit (container, container_signals[ADD], 0, object);
 
+  if (n_children == container->num_children)
+    {
+      g_warning ("%s: GimpContainer::add() implementation did not "
+                 "chain up. Please report this at http://www.gimp.org/bugs/";,
+                 G_STRFUNC);
+
+      container->num_children++;
+    }
+
   return TRUE;
 }
 
@@ -569,9 +598,8 @@
 gimp_container_remove (GimpContainer *container,
                        GimpObject    *object)
 {
-  GimpContainerHandler *handler;
-  GList                *list;
-  gulong                handler_id;
+  GList *list;
+  gint   n_children;
 
   g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
   g_return_val_if_fail (object != NULL, FALSE);
@@ -588,7 +616,8 @@
 
   for (list = container->handlers; list; list = g_list_next (list))
     {
-      handler = (GimpContainerHandler *) list->data;
+      GimpContainerHandler *handler = list->data;
+      gulong                handler_id;
 
       handler_id = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (object),
                                                          handler->quark));
@@ -601,10 +630,18 @@
         }
     }
 
-  container->num_children--;
+  n_children = container->num_children;
+
+  g_signal_emit (container, container_signals[REMOVE], 0, object);
 
-  g_signal_emit (container, container_signals[REMOVE], 0,
-                 object);
+  if (n_children == container->num_children)
+    {
+      g_warning ("%s: GimpContainer::remove() implementation did not "
+                 "chain up. Please report this at http://www.gimp.org/bugs/";,
+                 G_STRFUNC);
+
+      container->num_children--;
+    }
 
   switch (container->policy)
     {

Modified: branches/soc-2008-tagging/app/core/gimpcontext.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpcontext.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpcontext.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -1766,9 +1766,13 @@
 gimp_context_real_set_display (GimpContext *context,
                                gpointer     display)
 {
+  GimpObject *old_display;
+
   if (context->display == display)
     return;
 
+  old_display = context->display;
+
   context->display = display;
 
   if (context->display)
@@ -1782,6 +1786,10 @@
       if (image)
         g_object_unref (image);
     }
+  else if (old_display)
+    {
+      gimp_context_real_set_image (context, NULL);
+    }
 
   g_object_notify (G_OBJECT (context), "display");
   gimp_context_display_changed (context);

Modified: branches/soc-2008-tagging/app/core/gimpcurve.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpcurve.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpcurve.c	Sun Oct 12 15:38:02 2008
@@ -19,7 +19,7 @@
 #include "config.h"
 
 #include <stdlib.h>
-#include <string.h>
+#include <string.h> /* memcmp */
 
 #include <glib-object.h>
 
@@ -48,69 +48,69 @@
 
 /*  local function prototypes  */
 
-static void       gimp_curve_config_iface_init (GimpConfigInterface *iface);
+static void          gimp_curve_config_iface_init (GimpConfigInterface *iface);
 
-static void       gimp_curve_finalize          (GObject          *object);
-static void       gimp_curve_set_property      (GObject          *object,
-                                                guint             property_id,
-                                                const GValue     *value,
-                                                GParamSpec       *pspec);
-static void       gimp_curve_get_property      (GObject          *object,
-                                                guint             property_id,
-                                                GValue           *value,
-                                                GParamSpec       *pspec);
-
-static gint64     gimp_curve_get_memsize       (GimpObject       *object,
-                                                gint64           *gui_size);
-
-static void       gimp_curve_get_preview_size  (GimpViewable     *viewable,
-                                                gint              size,
-                                                gboolean          popup,
-                                                gboolean          dot_for_dot,
-                                                gint             *width,
-                                                gint             *height);
-static gboolean   gimp_curve_get_popup_size    (GimpViewable     *viewable,
-                                                gint              width,
-                                                gint              height,
-                                                gboolean          dot_for_dot,
-                                                gint             *popup_width,
-                                                gint             *popup_height);
-static TempBuf  * gimp_curve_get_new_preview   (GimpViewable     *viewable,
-                                                GimpContext      *context,
-                                                gint              width,
-                                                gint              height);
-static gchar    * gimp_curve_get_description   (GimpViewable     *viewable,
-                                                gchar           **tooltip);
-
-static void       gimp_curve_dirty             (GimpData         *data);
-static gchar    * gimp_curve_get_extension     (GimpData         *data);
-static GimpData * gimp_curve_duplicate         (GimpData         *data);
-
-static gboolean   gimp_curve_serialize         (GimpConfig       *config,
-                                                GimpConfigWriter *writer,
-                                                gpointer          data);
-static gboolean   gimp_curve_deserialize       (GimpConfig       *config,
-                                                GScanner         *scanner,
-                                                gint              nest_level,
-                                                gpointer          data);
-static gboolean   gimp_curve_equal             (GimpConfig       *a,
-                                                GimpConfig       *b);
-static void       _gimp_curve_reset            (GimpConfig       *config);
-static gboolean   gimp_curve_copy              (GimpConfig       *src,
-                                                GimpConfig       *dest,
-                                                GParamFlags       flags);
-
-static void       gimp_curve_set_n_points      (GimpCurve        *curve,
-                                                gint              n_points);
-static void       gimp_curve_set_n_samples     (GimpCurve        *curve,
-                                                gint              n_samples);
-
-static void       gimp_curve_calculate         (GimpCurve        *curve);
-static void       gimp_curve_plot              (GimpCurve        *curve,
-                                                gint              p1,
-                                                gint              p2,
-                                                gint              p3,
-                                                gint              p4);
+static void          gimp_curve_finalize          (GObject          *object);
+static void          gimp_curve_set_property      (GObject          *object,
+                                                   guint             property_id,
+                                                   const GValue     *value,
+                                                   GParamSpec       *pspec);
+static void          gimp_curve_get_property      (GObject          *object,
+                                                   guint             property_id,
+                                                   GValue           *value,
+                                                   GParamSpec       *pspec);
+
+static gint64        gimp_curve_get_memsize       (GimpObject       *object,
+                                                   gint64           *gui_size);
+
+static void          gimp_curve_get_preview_size  (GimpViewable     *viewable,
+                                                   gint              size,
+                                                   gboolean          popup,
+                                                   gboolean          dot_for_dot,
+                                                   gint             *width,
+                                                   gint             *height);
+static gboolean      gimp_curve_get_popup_size    (GimpViewable     *viewable,
+                                                   gint              width,
+                                                   gint              height,
+                                                   gboolean          dot_for_dot,
+                                                   gint             *popup_width,
+                                                   gint             *popup_height);
+static TempBuf     * gimp_curve_get_new_preview   (GimpViewable     *viewable,
+                                                   GimpContext      *context,
+                                                   gint              width,
+                                                   gint              height);
+static gchar       * gimp_curve_get_description   (GimpViewable     *viewable,
+                                                   gchar           **tooltip);
+
+static void          gimp_curve_dirty             (GimpData         *data);
+static const gchar * gimp_curve_get_extension     (GimpData         *data);
+static GimpData    * gimp_curve_duplicate         (GimpData         *data);
+
+static gboolean      gimp_curve_serialize         (GimpConfig       *config,
+                                                   GimpConfigWriter *writer,
+                                                   gpointer          data);
+static gboolean      gimp_curve_deserialize       (GimpConfig       *config,
+                                                   GScanner         *scanner,
+                                                   gint              nest_level,
+                                                   gpointer          data);
+static gboolean      gimp_curve_equal             (GimpConfig       *a,
+                                                   GimpConfig       *b);
+static void          _gimp_curve_reset            (GimpConfig       *config);
+static gboolean      gimp_curve_copy              (GimpConfig       *src,
+                                                   GimpConfig       *dest,
+                                                   GParamFlags       flags);
+
+static void          gimp_curve_set_n_points      (GimpCurve        *curve,
+                                                   gint              n_points);
+static void          gimp_curve_set_n_samples     (GimpCurve        *curve,
+                                                   gint              n_samples);
+
+static void          gimp_curve_calculate         (GimpCurve        *curve);
+static void          gimp_curve_plot              (GimpCurve        *curve,
+                                                   gint              p1,
+                                                   gint              p2,
+                                                   gint              p3,
+                                                   gint              p4);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpCurve, gimp_curve, GIMP_TYPE_DATA,
@@ -358,7 +358,7 @@
 
 static gint64
 gimp_curve_get_memsize (GimpObject *object,
-                          gint64     *gui_size)
+                        gint64     *gui_size)
 {
   GimpCurve *curve   = GIMP_CURVE (object);
   gint64     memsize = 0;
@@ -426,7 +426,7 @@
   GIMP_DATA_CLASS (parent_class)->dirty (data);
 }
 
-static gchar *
+static const gchar *
 gimp_curve_get_extension (GimpData *data)
 {
   return GIMP_CURVE_FILE_EXTENSION;
@@ -503,14 +503,11 @@
 
   gimp_config_sync (G_OBJECT (src), G_OBJECT (dest), flags);
 
-  memcpy (dest_curve->points, src_curve->points,
-          sizeof (GimpVector2) * src_curve->n_points);
-  memcpy (dest_curve->samples, src_curve->samples,
-          sizeof (gdouble) * src_curve->n_samples);
-
   dest_curve->identity = src_curve->identity;
 
-  return FALSE;
+  gimp_data_dirty (GIMP_DATA (dest));
+
+  return TRUE;
 }
 
 
@@ -813,7 +810,12 @@
   g_return_if_fail (point >= 0 && point < curve->n_points);
 
   if (curve->curve_type == GIMP_CURVE_FREE)
-    return;
+    {
+      if (x) *x = -1.0;
+      if (y) *y = -1.0;
+
+      return;
+    }
 
   if (x) *x = curve->points[point].x;
   if (y) *y = curve->points[point].y;
@@ -978,7 +980,7 @@
 
   /*
    * the x values of the inner control points are fixed at
-   * x1 = 1/3*x0 + 2/3*x3   and  x2 = 2/3*x0 + 1/3*x3
+   * x1 = 2/3*x0 + 1/3*x3   and  x2 = 1/3*x0 + 2/3*x3
    * this ensures that the x values increase linearily with the
    * parameter t and enables us to skip the calculation of the x
    * values altogehter - just calculate y(t) evenly spaced.
@@ -1005,8 +1007,7 @@
        * the control handle of the right tangent, to ensure that the curve
        * does not have an inflection point.
        */
-      slope = (curve->points[p4].y - y0) /
-              (curve->points[p4].x - x0);
+      slope = (curve->points[p4].y - y0) / (curve->points[p4].x - x0);
 
       y2 = y3 - slope * dx / 3.0;
       y1 = y0 + (y2 - y0) / 2.0;
@@ -1014,8 +1015,7 @@
   else if (p1 != p2 && p3 == p4)
     {
       /* see previous case */
-      slope = (y3 - curve->points[p1].y) /
-              (x3 - curve->points[p1].x);
+      slope = (y3 - curve->points[p1].y) / (x3 - curve->points[p1].x);
 
       y1 = y0 + slope * dx / 3.0;
       y2 = y3 + (y1 - y3) / 2.0;
@@ -1026,13 +1026,11 @@
        * parallel to the line between the opposite endpoint and the adjacent
        * neighbor.
        */
-      slope = (y3 - curve->points[p1].y) /
-              (x3 - curve->points[p1].x);
+      slope = (y3 - curve->points[p1].y) / (x3 - curve->points[p1].x);
 
       y1 = y0 + slope * dx / 3.0;
 
-      slope = (curve->points[p4].y - y0) /
-              (curve->points[p4].x - x0);
+      slope = (curve->points[p4].y - y0) / (curve->points[p4].x - x0);
 
       y2 = y3 - slope * dx / 3.0;
     }

Modified: branches/soc-2008-tagging/app/core/gimpdata.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdata.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpdata.h	Sun Oct 12 15:38:02 2008
@@ -68,13 +68,13 @@
   GimpViewableClass  parent_class;
 
   /*  signals  */
-  void       (* dirty)         (GimpData  *data);
+  void          (* dirty)         (GimpData  *data);
 
   /*  virtual functions  */
-  gboolean   (* save)          (GimpData  *data,
-                                GError   **error);
-  gchar    * (* get_extension) (GimpData  *data);
-  GimpData * (* duplicate)     (GimpData  *data);
+  gboolean      (* save)          (GimpData  *data,
+                                   GError   **error);
+  const gchar * (* get_extension) (GimpData  *data);
+  GimpData    * (* duplicate)     (GimpData  *data);
 };
 
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-blend.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-blend.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-blend.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-bucket-fill.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-bucket-fill.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-bucket-fill.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-colorize.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-colorize.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-colorize.c	Sun Oct 12 15:38:02 2008
@@ -78,6 +78,8 @@
     {
       Colorize cruft;
 
+      colorize_init (&cruft);
+
       gimp_colorize_config_to_cruft (config, &cruft);
 
       gimp_drawable_process (drawable, progress, _("Colorize"),

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-combine.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-combine.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-combine.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-convert.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-convert.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-convert.c	Sun Oct 12 15:38:02 2008
@@ -19,7 +19,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-equalize.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-equalize.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-equalize.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-foreground-extract.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-foreground-extract.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-foreground-extract.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-histogram.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-histogram.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-histogram.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-offset.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-offset.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-offset.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-preview.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-preview.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-preview.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-process.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-process.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-process.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-shadow.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-shadow.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-shadow.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -38,8 +38,6 @@
 
   item = GIMP_ITEM (drawable);
 
-  g_return_val_if_fail (gimp_item_is_attached (item), NULL);
-
   if (drawable->shadow)
     {
       if ((gimp_item_width  (item) != tile_manager_width  (drawable->shadow)) ||

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-stroke.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-stroke.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-stroke.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/core/gimpdrawable-transform.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable-transform.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable-transform.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpdrawable.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -220,6 +220,7 @@
   klass->replace_region              = gimp_drawable_real_replace_region;
   klass->get_tiles                   = gimp_drawable_real_get_tiles;
   klass->set_tiles                   = gimp_drawable_real_set_tiles;
+  klass->get_node                    = NULL;
   klass->push_undo                   = gimp_drawable_real_push_undo;
   klass->swap_pixels                 = gimp_drawable_real_swap_pixels;
 }
@@ -261,6 +262,12 @@
 
   gimp_drawable_free_shadow_tiles (drawable);
 
+  if (drawable->source_node)
+    {
+      g_object_unref (drawable->source_node);
+      drawable->source_node = NULL;
+    }
+
   if (drawable->preview_cache)
     gimp_preview_cache_invalidate (&drawable->preview_cache);
 
@@ -636,6 +643,25 @@
                            gint          width,
                            gint          height)
 {
+  if (drawable->source_node)
+    {
+      GObject       *operation;
+      GeglRectangle  rect;
+
+      g_object_get (drawable->source_node,
+                    "gegl-operation", &operation,
+                    NULL);
+
+      rect.x      = x;
+      rect.y      = y;
+      rect.width  = width;
+      rect.height = height;
+
+      gegl_operation_invalidate (operation, &rect);
+
+      g_object_unref (operation);
+    }
+
   gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
 }
 
@@ -702,6 +728,11 @@
 
   if (old_has_alpha != gimp_drawable_has_alpha (drawable))
     gimp_drawable_alpha_changed (drawable);
+
+  if (drawable->source_node)
+    gegl_node_set (drawable->source_node,
+                   "tile-manager", drawable->tiles,
+                   NULL);
 }
 
 static void
@@ -839,6 +870,11 @@
   /*  preview variables  */
   drawable->preview_cache = NULL;
   drawable->preview_valid = FALSE;
+
+  if (drawable->source_node)
+    gegl_node_set (drawable->source_node,
+                   "tile-manager", drawable->tiles,
+                   NULL);
 }
 
 void
@@ -1012,6 +1048,36 @@
                         gimp_item_height (item));
 }
 
+GeglNode *
+gimp_drawable_get_source_node (GimpDrawable *drawable)
+{
+  g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
+
+  if (drawable->source_node)
+    return drawable->source_node;
+
+  drawable->source_node = g_object_new (GEGL_TYPE_NODE,
+                                        "operation", "gimp-tilemanager-source",
+                                        NULL);
+  gegl_node_set (drawable->source_node,
+                 "tile-manager", drawable->tiles,
+                 "linear",       TRUE,
+                 NULL);
+
+  return drawable->source_node;
+}
+
+GeglNode *
+gimp_drawable_get_node (GimpDrawable *drawable)
+{
+  g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
+
+  if (GIMP_DRAWABLE_GET_CLASS (drawable)->get_node)
+    return GIMP_DRAWABLE_GET_CLASS (drawable)->get_node (drawable);
+
+  return NULL;
+}
+
 void
 gimp_drawable_swap_pixels (GimpDrawable *drawable,
                            TileManager  *tiles,

Modified: branches/soc-2008-tagging/app/core/gimpdrawable.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawable.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawable.h	Sun Oct 12 15:38:02 2008
@@ -40,6 +40,8 @@
   TileManager   *tiles;              /* tiles for drawable data        */
   TileManager   *shadow;             /* shadow buffer tiles            */
 
+  GeglNode      *source_node;
+
   gint           bytes;              /* bytes per pixel                */
   GimpImageType  type;               /* type of drawable               */
   gboolean       has_alpha;          /* drawable has alpha             */
@@ -93,6 +95,7 @@
                                            GimpImageType         type,
                                            gint                  offset_x,
                                            gint                  offset_y);
+  GeglNode    * (* get_node)              (GimpDrawable         *drawable);
 
   void          (* push_undo)             (GimpDrawable         *drawable,
                                            const gchar          *undo_desc,
@@ -169,6 +172,9 @@
                                                   gint                offset_x,
                                                   gint                offset_y);
 
+GeglNode      * gimp_drawable_get_source_node    (GimpDrawable       *drawable);
+GeglNode      * gimp_drawable_get_node           (GimpDrawable       *drawable);
+
 void            gimp_drawable_swap_pixels        (GimpDrawable       *drawable,
                                                   TileManager        *tiles,
                                                   gboolean            sparse,

Modified: branches/soc-2008-tagging/app/core/gimpdrawablemodundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawablemodundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawablemodundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpdrawableundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdrawableundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpdrawableundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpfloatingselundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpfloatingselundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpfloatingselundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpgradient.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpgradient.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpgradient.c	Sun Oct 12 15:38:02 2008
@@ -39,35 +39,35 @@
 #define EPSILON 1e-10
 
 
-static void       gimp_gradient_tagged_init      (GimpTaggedInterface  *iface);
-static void       gimp_gradient_finalize         (GObject           *object);
+static void          gimp_gradient_tagged_init      (GimpTaggedInterface  *iface);
+static void          gimp_gradient_finalize         (GObject           *object);
 
-static gint64     gimp_gradient_get_memsize      (GimpObject        *object,
-                                                  gint64            *gui_size);
+static gint64        gimp_gradient_get_memsize      (GimpObject        *object,
+                                                     gint64            *gui_size);
 
-static void       gimp_gradient_get_preview_size (GimpViewable      *viewable,
-                                                  gint               size,
-                                                  gboolean           popup,
-                                                  gboolean           dot_for_dot,
-                                                  gint              *width,
-                                                  gint              *height);
-static gboolean   gimp_gradient_get_popup_size   (GimpViewable      *viewable,
-                                                  gint               width,
-                                                  gint               height,
-                                                  gboolean           dot_for_dot,
-                                                  gint              *popup_width,
-                                                  gint              *popup_height);
-static TempBuf  * gimp_gradient_get_new_preview  (GimpViewable      *viewable,
-                                                  GimpContext       *context,
-                                                  gint               width,
-                                                  gint               height);
-static gchar    * gimp_gradient_get_extension    (GimpData          *data);
-static GimpData * gimp_gradient_duplicate        (GimpData          *data);
+static void          gimp_gradient_get_preview_size (GimpViewable      *viewable,
+                                                     gint               size,
+                                                     gboolean           popup,
+                                                     gboolean           dot_for_dot,
+                                                     gint              *width,
+                                                     gint              *height);
+static gboolean      gimp_gradient_get_popup_size   (GimpViewable      *viewable,
+                                                     gint               width,
+                                                     gint               height,
+                                                     gboolean           dot_for_dot,
+                                                     gint              *popup_width,
+                                                     gint              *popup_height);
+static TempBuf     * gimp_gradient_get_new_preview  (GimpViewable      *viewable,
+                                                     GimpContext       *context,
+                                                     gint               width,
+                                                     gint               height);
+static const gchar * gimp_gradient_get_extension    (GimpData          *data);
+static GimpData    * gimp_gradient_duplicate        (GimpData          *data);
 
 static GimpGradientSegment *
-           gimp_gradient_get_segment_at_internal (GimpGradient        *gradient,
-                                                  GimpGradientSegment *seg,
-                                                  gdouble              pos);
+              gimp_gradient_get_segment_at_internal (GimpGradient        *gradient,
+                                                     GimpGradientSegment *seg,
+                                                     gdouble              pos);
 
 
 static inline gdouble  gimp_gradient_calc_linear_factor            (gdouble  middle,
@@ -212,10 +212,10 @@
       seg = gimp_gradient_get_color_at (gradient, context, seg, cur_x,
                                         FALSE, &color);
 
-      *p++ = color.r * 255.0;
-      *p++ = color.g * 255.0;
-      *p++ = color.b * 255.0;
-      *p++ = color.a * 255.0;
+      *p++ = ROUND (color.r * 255.0);
+      *p++ = ROUND (color.g * 255.0);
+      *p++ = ROUND (color.b * 255.0);
+      *p++ = ROUND (color.a * 255.0);
 
       cur_x += dx;
     }
@@ -306,7 +306,7 @@
   return standard_gradient;
 }
 
-static gchar *
+static const gchar *
 gimp_gradient_get_extension (GimpData *data)
 {
   return GIMP_GRADIENT_FILE_EXTENSION;
@@ -1695,8 +1695,10 @@
   return;
 
  premature_return:
-  *final_start_seg = start_seg;
-  *final_end_seg   = end_seg;
+  if (final_start_seg)
+    *final_start_seg = start_seg;
+  if (final_end_seg)
+    *final_end_seg = end_seg;
 }
 
 void

Modified: branches/soc-2008-tagging/app/core/gimpguideundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpguideundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpguideundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-arrange.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-arrange.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-arrange.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-colorhash.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-colorhash.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-colorhash.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-colormap.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-colormap.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-colormap.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-contiguous-region.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-contiguous-region.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-contiguous-region.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <stdlib.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
@@ -73,7 +73,7 @@
                                            gint                 y,
                                            guchar             **s,
                                            guchar             **m);
-static gint find_contiguous_segment       (GimpImage           *image,
+static gboolean find_contiguous_segment   (GimpImage           *image,
                                            const guchar        *col,
                                            PixelRegion         *src,
                                            PixelRegion         *mask,
@@ -458,7 +458,7 @@
   *m = tile_data_pointer (*m_tile, x, y);
 }
 
-static int
+static gboolean
 find_contiguous_segment (GimpImage           *image,
                          const guchar        *col,
                          PixelRegion         *src,
@@ -604,7 +604,7 @@
   Tile   *tile;
   GQueue *coord_stack;
 
-  coord_stack = g_queue_new();
+  coord_stack = g_queue_new ();
 
   /* To avoid excessive memory allocation (y, start, end) tuples are
    * stored in interleaved format:
@@ -624,7 +624,7 @@
       for (x = start + 1; x < end; x++)
         {
           tile = tile_manager_get_tile (mask->tiles, x, y, TRUE, FALSE);
-          val = *(const guchar *) (tile_data_pointer (tile, x, y));
+          val = *(const guchar *) tile_data_pointer (tile, x, y);
           tile_release (tile, FALSE);
           if (val != 0)
             continue;
@@ -654,7 +654,7 @@
             }
         }
     }
-  while (!g_queue_is_empty (coord_stack));
+  while (! g_queue_is_empty (coord_stack));
 
   g_queue_free (coord_stack);
 }

Modified: branches/soc-2008-tagging/app/core/gimpimage-convert.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-convert.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-convert.c	Sun Oct 12 15:38:02 2008
@@ -133,7 +133,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpimage-crop.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-crop.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-crop.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -87,10 +87,14 @@
                  gboolean     crop_layers)
 {
   gint width, height;
+  gint previous_width, previous_height;
 
   g_return_if_fail (GIMP_IS_IMAGE (image));
   g_return_if_fail (GIMP_IS_CONTEXT (context));
 
+  previous_width  = gimp_image_get_width (image);
+  previous_height = gimp_image_get_height (image);
+
   width  = x2 - x1;
   height = y2 - y1;
 
@@ -129,7 +133,12 @@
                                      _("Resize Image"));
 
       /*  Push the image size to the stack  */
-      gimp_image_undo_push_image_size (image, NULL, x1, y1);
+      gimp_image_undo_push_image_size (image,
+                                       NULL,
+                                       x1,
+                                       y1,
+                                       width,
+                                       height);
 
       /*  Set the new width and height  */
       g_object_set (image,
@@ -194,7 +203,7 @@
                                   -(lx1 - off_x),
                                   -(ly1 - off_y));
               else
-                gimp_image_remove_layer (image, GIMP_LAYER (item));
+                gimp_image_remove_layer (image, GIMP_LAYER (item), TRUE, NULL);
             }
         }
 
@@ -267,7 +276,11 @@
                          gimp_image_get_width  (image),
                          gimp_image_get_height (image));
 
-      gimp_image_size_changed_detailed (image, -x1, -y1);
+      gimp_image_size_changed_detailed (image,
+                                        -x1,
+                                        -y1,
+                                        previous_width,
+                                        previous_height);
 
       g_object_thaw_notify (G_OBJECT (image));
     }

Modified: branches/soc-2008-tagging/app/core/gimpimage-duplicate.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-duplicate.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-duplicate.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -137,7 +137,7 @@
         new_floating_sel_drawable = GIMP_DRAWABLE (new_layer);
 
       if (floating_layer != new_layer)
-        gimp_image_add_layer (new_image, new_layer, count++);
+        gimp_image_add_layer (new_image, new_layer, count++, FALSE);
     }
 
   /*  Copy the channels  */
@@ -162,7 +162,7 @@
       if (floating_sel_drawable == GIMP_DRAWABLE (channel))
         new_floating_sel_drawable = GIMP_DRAWABLE (new_channel);
 
-      gimp_image_add_channel (new_image, new_channel, count++);
+      gimp_image_add_channel (new_image, new_channel, count++, FALSE);
     }
 
   /*  Copy any vectors  */
@@ -184,7 +184,7 @@
       if (gimp_image_get_active_vectors (image) == vectors)
         active_vectors = new_vectors;
 
-      gimp_image_add_vectors (new_image, new_vectors, count++);
+      gimp_image_add_vectors (new_image, new_vectors, count++, FALSE);
     }
 
   /*  Copy the selection mask  */

Modified: branches/soc-2008-tagging/app/core/gimpimage-flip.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-flip.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-flip.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-grid.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-grid.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-grid.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpconfig/gimpconfig.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-guides.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-guides.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-guides.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -220,12 +220,6 @@
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
   g_return_val_if_fail (epsilon_x > 0 && epsilon_y > 0, NULL);
 
-  if (x < 0 || x >= gimp_image_get_width  (image) ||
-      y < 0 || y >= gimp_image_get_height (image))
-    {
-      return NULL;
-    }
-
   for (list = image->guides; list; list = g_list_next (list))
     {
       gint position;

Modified: branches/soc-2008-tagging/app/core/gimpimage-item-list.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-item-list.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-item-list.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-merge.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-merge.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-merge.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"
@@ -119,7 +119,7 @@
           GSList *list;
 
           for (list = invisible_list; list; list = g_slist_next (list))
-            gimp_image_remove_layer (image, list->data);
+            gimp_image_remove_layer (image, list->data, TRUE, NULL);
 
           gimp_image_undo_group_end (image);
           g_slist_free (invisible_list);
@@ -260,14 +260,14 @@
       target_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
                                                           GIMP_TYPE_VECTORS));
       pos = gimp_image_get_vectors_index (image, vectors);
-      gimp_image_remove_vectors (image, vectors);
+      gimp_image_remove_vectors (image, vectors, TRUE, NULL);
       cur_item = cur_item->next;
 
       while (cur_item)
         {
           vectors = GIMP_VECTORS (cur_item->data);
           gimp_vectors_add_strokes (vectors, target_vectors);
-          gimp_image_remove_vectors (image, vectors);
+          gimp_image_remove_vectors (image, vectors, TRUE, NULL);
 
           cur_item = g_slist_next (cur_item);
         }
@@ -276,7 +276,7 @@
 
       g_slist_free (merge_list);
 
-      gimp_image_add_vectors (image, target_vectors, pos);
+      gimp_image_add_vectors (image, target_vectors, pos, TRUE);
       gimp_unset_busy (image->gimp);
 
       gimp_image_undo_group_end (image);
@@ -319,7 +319,6 @@
   GimpLayer       *merge_layer;
   GimpLayer       *layer;
   GimpLayer       *bottom_layer;
-  guchar           bg[4] = {0, 0, 0, 0};
   GimpImageType    type;
   gint             count;
   gint             x1, y1, x2, y2;
@@ -418,6 +417,8 @@
   if (merge_type == GIMP_FLATTEN_IMAGE ||
       gimp_drawable_type (GIMP_DRAWABLE (layer)) == GIMP_INDEXED_IMAGE)
     {
+      guchar bg[4] = { 0, 0, 0, 0 };
+
       type = GIMP_IMAGE_TYPE_FROM_BASE_TYPE (gimp_image_base_type (image));
 
       merge_layer = gimp_layer_new (image, (x2 - x1), (y2 - y1),
@@ -471,15 +472,13 @@
       GIMP_ITEM (merge_layer)->offset_x = x1;
       GIMP_ITEM (merge_layer)->offset_y = y1;
 
-      /*  Set the layer to transparent  */
+      /*  clear the layer  */
       pixel_region_init (&src1PR,
                          gimp_drawable_get_tiles (GIMP_DRAWABLE (merge_layer)),
                          0, 0,
                          (x2 - x1), (y2 - y1),
                          TRUE);
-
-      /*  set the region to 0's  */
-      color_region (&src1PR, bg);
+      clear_region (&src1PR);
 
       /*  Find the index in the layer list of the bottom layer--we need this
        *  in order to add the final, merged layer to the layer list correctly
@@ -575,7 +574,7 @@
                        active,
                        operation);
 
-      gimp_image_remove_layer (image, layer);
+      gimp_image_remove_layer (image, layer, TRUE, NULL);
 
       reverse_list = g_slist_next (reverse_list);
     }
@@ -591,16 +590,18 @@
           layer = list->data;
 
           list = g_list_next (list);
-          gimp_image_remove_layer (image, layer);
+          gimp_image_remove_layer (image, layer, TRUE, NULL);
         }
 
-      gimp_image_add_layer (image, merge_layer, position);
+      gimp_image_add_layer (image, merge_layer, position, TRUE);
     }
   else
     {
       /*  Add the layer to the image  */
-      gimp_image_add_layer (image, merge_layer,
-         gimp_container_num_children (image->layers) - position + 1);
+      gimp_image_add_layer
+        (image, merge_layer,
+         gimp_container_num_children (image->layers) - position + 1,
+         TRUE);
     }
 
   /* set the name after the original layers have been removed so we

Modified: branches/soc-2008-tagging/app/core/gimpimage-new.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-new.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-new.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpconfig/gimpconfig.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-pick-color.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-pick-color.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-pick-color.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-preview.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-preview.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-preview.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-quick-mask.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-quick-mask.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-quick-mask.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
@@ -117,7 +117,7 @@
           if (image->quick_mask_inverted)
             gimp_channel_invert (mask, FALSE);
 
-          gimp_image_add_channel (image, mask, 0);
+          gimp_image_add_channel (image, mask, 0, TRUE);
 
           gimp_image_undo_group_end (image);
         }
@@ -138,7 +138,7 @@
             floating_sel_anchor (floating_sel);
 
           gimp_selection_load (gimp_image_get_mask (image), mask);
-          gimp_image_remove_channel (image, mask);
+          gimp_image_remove_channel (image, mask, TRUE, NULL);
 
           if (! channel_was_active)
             gimp_image_unset_active_channel (image);

Modified: branches/soc-2008-tagging/app/core/gimpimage-resize.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-resize.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-resize.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -97,7 +97,12 @@
   old_height = gimp_image_get_height (image);
 
   /*  Push the image size to the stack  */
-  gimp_image_undo_push_image_size (image, NULL, -offset_x, -offset_y);
+  gimp_image_undo_push_image_size (image,
+                                   NULL,
+                                   -offset_x,
+                                   -offset_y,
+                                   new_width,
+                                   new_height);
 
   /*  Set the new width and height  */
   g_object_set (image,
@@ -220,7 +225,11 @@
 
   gimp_image_undo_group_end (image);
 
-  gimp_image_size_changed_detailed (image, offset_x, offset_y);
+  gimp_image_size_changed_detailed (image,
+                                    offset_x,
+                                    offset_y,
+                                    old_width,
+                                    old_height);
 
   g_object_thaw_notify (G_OBJECT (image));
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-rotate.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-rotate.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-rotate.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -61,6 +61,8 @@
   gdouble   progress_current = 1.0;
   gint      new_image_width;
   gint      new_image_height;
+  gint      previous_image_width;
+  gint      previous_image_height;
   gint      offset_x;
   gint      offset_y;
   gboolean  size_changed;
@@ -71,8 +73,11 @@
 
   gimp_set_busy (image->gimp);
 
-  center_x = (gdouble) gimp_image_get_width  (image) / 2.0;
-  center_y = (gdouble) gimp_image_get_height (image) / 2.0;
+  previous_image_width  = gimp_image_get_width  (image);
+  previous_image_height = gimp_image_get_height (image);
+
+  center_x              = previous_image_width  / 2.0;
+  center_y              = previous_image_height / 2.0;
 
   progress_max = (image->channels->num_children +
                   image->layers->num_children   +
@@ -192,7 +197,12 @@
       gdouble xres;
       gdouble yres;
 
-      gimp_image_undo_push_image_size (image, NULL, offset_x, offset_y);
+      gimp_image_undo_push_image_size (image,
+                                       NULL,
+                                       offset_x,
+                                       offset_y,
+                                       new_image_width,
+                                       new_image_height);
 
       g_object_set (image,
                     "width",  new_image_width,
@@ -208,7 +218,11 @@
   gimp_image_undo_group_end (image);
 
   if (size_changed)
-    gimp_image_size_changed_detailed (image, -offset_x, -offset_y);
+    gimp_image_size_changed_detailed (image,
+                                      -offset_x,
+                                      -offset_y,
+                                      previous_image_width,
+                                      previous_image_height);
 
   g_object_thaw_notify (G_OBJECT (image));
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-sample-points.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-sample-points.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-sample-points.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-scale.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-scale.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-scale.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -90,7 +90,12 @@
   offset_y = (old_height - new_height) / 2;
 
   /*  Push the image size to the stack  */
-  gimp_image_undo_push_image_size (image, NULL, offset_x, offset_y);
+  gimp_image_undo_push_image_size (image,
+                                   NULL,
+                                   offset_x,
+                                   offset_y,
+                                   new_width,
+                                   new_height);
 
   /*  Set the new width and height  */
   g_object_set (image,
@@ -168,7 +173,7 @@
     {
       GimpLayer *layer = list->data;
 
-      gimp_image_remove_layer (image, layer);
+      gimp_image_remove_layer (image, layer, TRUE, NULL);
     }
 
   g_list_free (remove);
@@ -212,7 +217,11 @@
 
   g_object_unref (sub_progress);
 
-  gimp_image_size_changed_detailed (image, -offset_x, -offset_y);
+  gimp_image_size_changed_detailed (image,
+                                    -offset_x,
+                                    -offset_y,
+                                    old_width,
+                                    old_height);
 
   g_object_thaw_notify (G_OBJECT (image));
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-snap.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-snap.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-snap.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-undo-push.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-undo-push.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-undo-push.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 
@@ -82,7 +82,9 @@
 gimp_image_undo_push_image_size (GimpImage   *image,
                                  const gchar *undo_desc,
                                  gint         previous_origin_x,
-                                 gint         previous_origin_y)
+                                 gint         previous_origin_y,
+                                 gint         previous_width,
+                                 gint         previous_height)
 {
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
 
@@ -91,6 +93,8 @@
                                GIMP_DIRTY_IMAGE | GIMP_DIRTY_IMAGE_SIZE,
                                "previous-origin-x", previous_origin_x,
                                "previous-origin-y", previous_origin_y,
+                               "previous-width",    previous_width,
+                               "previous-height",   previous_height,
                                NULL);
 }
 

Modified: branches/soc-2008-tagging/app/core/gimpimage-undo-push.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-undo-push.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-undo-push.h	Sun Oct 12 15:38:02 2008
@@ -27,7 +27,9 @@
 GimpUndo * gimp_image_undo_push_image_size          (GimpImage     *image,
                                                      const gchar   *undo_desc,
                                                      gint           previous_origin_x,
-                                                     gint           previous_origin_y);
+                                                     gint           previous_origin_y,
+                                                     gint           previous_width,
+                                                     gint           prevoius_height);
 GimpUndo * gimp_image_undo_push_image_resolution    (GimpImage     *image,
                                                      const gchar   *undo_desc);
 GimpUndo * gimp_image_undo_push_image_grid          (GimpImage     *image,

Modified: branches/soc-2008-tagging/app/core/gimpimage-undo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage-undo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage-undo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -383,7 +383,9 @@
       if (accum.size_changed)
         gimp_image_size_changed_detailed (image,
                                           accum.previous_origin_x,
-                                          accum.previous_origin_y);
+                                          accum.previous_origin_y,
+                                          accum.previous_width,
+                                          accum.previous_height);
 
       if (accum.resolution_changed)
         gimp_image_resolution_changed (image);

Modified: branches/soc-2008-tagging/app/core/gimpimage.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <time.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"
@@ -38,6 +38,7 @@
 #include "gimp-parasites.h"
 #include "gimp-utils.h"
 #include "gimpcontext.h"
+#include "gimpdrawablestack.h"
 #include "gimpgrid.h"
 #include "gimpguide.h"
 #include "gimpimage.h"
@@ -119,6 +120,13 @@
 };
 
 
+#ifdef __GNUC__
+#warning FIXME: gegl_node_add_child() needs to be public
+#endif
+GeglNode * gegl_node_add_child (GeglNode *self,
+                                GeglNode *child);
+
+
 /*  local function prototypes  */
 
 static void     gimp_color_managed_iface_init    (GimpColorManagedInterface *iface);
@@ -151,7 +159,9 @@
 static void     gimp_image_real_size_changed_detailed
                                                  (GimpImage      *image,
                                                   gint            previous_origin_x,
-                                                  gint            previous_origin_y);
+                                                  gint            previous_origin_y,
+                                                  gint            previous_width,
+                                                  gint            previous_height);
 static void     gimp_image_real_colormap_changed (GimpImage      *image,
                                                   gint            color_index);
 static void     gimp_image_real_flush            (GimpImage      *image,
@@ -325,8 +335,10 @@
                   G_SIGNAL_RUN_FIRST,
                   G_STRUCT_OFFSET (GimpImageClass, size_changed_detailed),
                   NULL, NULL,
-                  gimp_marshal_VOID__INT_INT,
-                  G_TYPE_NONE, 2,
+                  gimp_marshal_VOID__INT_INT_INT_INT,
+                  G_TYPE_NONE, 4,
+                  G_TYPE_INT,
+                  G_TYPE_INT,
                   G_TYPE_INT,
                   G_TYPE_INT);
 
@@ -614,8 +626,8 @@
   image->grid                  = NULL;
   image->sample_points         = NULL;
 
-  image->layers                = gimp_list_new (GIMP_TYPE_LAYER,   TRUE);
-  image->channels              = gimp_list_new (GIMP_TYPE_CHANNEL, TRUE);
+  image->layers                = gimp_drawable_stack_new (GIMP_TYPE_LAYER);
+  image->channels              = gimp_drawable_stack_new (GIMP_TYPE_CHANNEL);
   image->vectors               = gimp_list_new (GIMP_TYPE_VECTORS, TRUE);
   image->layer_stack           = NULL;
 
@@ -887,6 +899,12 @@
       image->projection = NULL;
     }
 
+  if (image->graph)
+    {
+      g_object_unref (image->graph);
+      image->graph = NULL;
+    }
+
   if (image->colormap)
     {
       g_free (image->colormap);
@@ -1122,7 +1140,9 @@
 static void
 gimp_image_real_size_changed_detailed (GimpImage *image,
                                        gint       previous_origin_x,
-                                       gint       previous_origin_y)
+                                       gint       previous_origin_y,
+                                       gint       previous_width,
+                                       gint       previous_height)
 {
   /* Whenever GimpImage::size-changed-detailed is emitted, so is
    * GimpViewable::size-changed. Clients choose what signal to listen
@@ -1503,7 +1523,11 @@
       image->yresolution = yresolution;
 
       gimp_image_resolution_changed (image);
-      gimp_image_size_changed_detailed (image, 0, 0);
+      gimp_image_size_changed_detailed (image,
+                                        0,
+                                        0,
+                                        gimp_image_get_width (image),
+                                        gimp_image_get_height (image));
     }
 }
 
@@ -1583,7 +1607,7 @@
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), TRUE);
 
-  layer = (GimpLayer *) gimp_container_get_child_by_index (image->layers, 0);
+  layer = gimp_image_get_layer_by_index (image, 0);
 
   return ((gimp_container_num_children (image->layers) > 1) ||
           (layer && gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))));
@@ -1841,13 +1865,17 @@
 void
 gimp_image_size_changed_detailed (GimpImage *image,
                                   gint       previous_origin_x,
-                                  gint       previous_origin_y)
+                                  gint       previous_origin_y,
+                                  gint       previous_width,
+                                  gint       previous_height)
 {
   g_return_if_fail (GIMP_IS_IMAGE (image));
 
   g_signal_emit (image, gimp_image_signals[SIZE_CHANGED_DETAILED], 0,
                  previous_origin_x,
-                 previous_origin_y);
+                 previous_origin_y,
+                 previous_width,
+                 previous_height);
 }
 
 void
@@ -2517,6 +2545,48 @@
   return image->projection;
 }
 
+GeglNode *
+gimp_image_get_graph (GimpImage *image)
+{
+  GeglNode *layers_node;
+  GeglNode *channels_node;
+  GeglNode *blend_node;
+  GeglNode *output;
+
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  if (image->graph)
+    return image->graph;
+
+  image->graph = gegl_node_new ();
+
+  layers_node =
+    gimp_drawable_stack_get_graph (GIMP_DRAWABLE_STACK (image->layers));
+
+  gegl_node_add_child (image->graph, layers_node);
+
+  channels_node =
+    gimp_drawable_stack_get_graph (GIMP_DRAWABLE_STACK (image->channels));
+
+  gegl_node_add_child (image->graph, channels_node);
+
+  blend_node = gegl_node_new_child (image->graph,
+                                    "operation", "normal",
+                                    NULL);
+
+  gegl_node_connect_to (layers_node,   "output",
+                        blend_node,    "input");
+  gegl_node_connect_to (channels_node, "output",
+                        blend_node,    "aux");
+
+  output = gegl_node_get_output_proxy (image->graph, "output");
+
+  gegl_node_connect_to (blend_node, "output",
+                        output,     "input");
+
+  return image->graph;
+}
+
 
 /*  layers / channels / vectors  */
 
@@ -2760,6 +2830,36 @@
                                          GIMP_OBJECT (vectors));
 }
 
+GimpLayer *
+gimp_image_get_layer_by_index (const GimpImage *image,
+                               gint             index)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return (GimpLayer *) gimp_container_get_child_by_index (image->layers,
+                                                          index);
+}
+
+GimpChannel *
+gimp_image_get_channel_by_index (const GimpImage *image,
+                                 gint             index)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return (GimpChannel *) gimp_container_get_child_by_index (image->channels,
+                                                            index);
+}
+
+GimpVectors *
+gimp_image_get_vectors_by_index (const GimpImage *image,
+                                 gint             index)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return (GimpVectors *) gimp_container_get_child_by_index (image->vectors,
+                                                            index);
+}
+
 static GimpItem *
 gimp_image_get_item_by_tattoo (GimpContainer *items,
                                GimpTattoo     tattoo)
@@ -2840,7 +2940,8 @@
 gboolean
 gimp_image_add_layer (GimpImage *image,
                       GimpLayer *layer,
-                      gint       position)
+                      gint       position,
+                      gboolean   push_undo)
 {
   GimpLayer *active_layer;
   GimpLayer *floating_sel;
@@ -2848,42 +2949,21 @@
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
-
-  if (GIMP_ITEM (layer)->image != NULL &&
-      GIMP_ITEM (layer)->image != image)
-    {
-      g_warning ("%s: attempting to add layer to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->layers, GIMP_OBJECT (layer)))
-    {
-      g_warning ("%s: trying to add layer to image twice.", G_STRFUNC);
-      return FALSE;
-    }
+  g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (layer)), FALSE);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) == image,
+                        FALSE);
 
   floating_sel = gimp_image_floating_sel (image);
 
-  if (floating_sel && gimp_layer_is_floating_sel (layer))
-    {
-      g_warning ("%s: trying to add floating layer to image which alyready "
-                 "has a floating selection.", G_STRFUNC);
-      return FALSE;
-    }
-
   active_layer = gimp_image_get_active_layer (image);
 
   old_has_alpha = gimp_image_has_alpha (image);
 
-  gimp_image_undo_push_layer_add (image, _("Add Layer"),
-                                  layer, active_layer);
-
-  gimp_item_set_image (GIMP_ITEM (layer), image);
-
-  if (layer->mask)
-    gimp_item_set_image (GIMP_ITEM (layer->mask), image);
+  if (push_undo)
+    gimp_image_undo_push_layer_add (image, _("Add Layer"),
+                                    layer, active_layer);
 
-  /*  If the layer is a floating selection, set the ID  */
+  /*  If the layer is a floating selection, set the fs pointer  */
   if (gimp_layer_is_floating_sel (layer))
     image->floating_sel = layer;
 
@@ -2915,7 +2995,7 @@
   gimp_image_set_active_layer (image, layer);
 
   if (old_has_alpha != gimp_image_has_alpha (image))
-    gimp_image_alpha_changed (image);
+    image->flush_accum.alpha_changed = TRUE;
 
   if (gimp_layer_is_floating_sel (layer))
     gimp_image_floating_selection_changed (image);
@@ -2925,7 +3005,9 @@
 
 void
 gimp_image_remove_layer (GimpImage *image,
-                         GimpLayer *layer)
+                         GimpLayer *layer,
+                         gboolean   push_undo,
+                         GimpLayer *new_active)
 {
   GimpLayer *active_layer;
   gint       index;
@@ -2939,6 +3021,14 @@
 
   if (gimp_drawable_has_floating_sel (GIMP_DRAWABLE (layer)))
     {
+      if (! push_undo)
+        {
+          g_warning ("%s() was called from an undo function while the layer "
+                     "had a floating selection. Please report this at "
+                     "http://www.gimp.org/bugs/";, G_STRFUNC);
+          return;
+        }
+
       gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
                                    _("Remove Layer"));
       undo_group = TRUE;
@@ -2953,8 +3043,9 @@
 
   old_has_alpha = gimp_image_has_alpha (image);
 
-  gimp_image_undo_push_layer_remove (image, _("Remove Layer"),
-                                     layer, index, active_layer);
+  if (push_undo)
+    gimp_image_undo_push_layer_remove (image, _("Remove Layer"),
+                                       layer, index, active_layer);
 
   g_object_ref (layer);
 
@@ -2978,7 +3069,11 @@
     }
   else if (layer == active_layer)
     {
-      if (image->layer_stack)
+      if (new_active)
+        {
+          active_layer = new_active;
+        }
+      else if (image->layer_stack)
         {
           active_layer = image->layer_stack->data;
         }
@@ -2990,8 +3085,7 @@
             {
               index = CLAMP (index, 0, n_children - 1);
 
-              active_layer = (GimpLayer *)
-                gimp_container_get_child_by_index (image->layers, index);
+              active_layer = gimp_image_get_layer_by_index (image, index);
             }
           else
             {
@@ -3007,7 +3101,7 @@
   g_object_unref (layer);
 
   if (old_has_alpha != gimp_image_has_alpha (image))
-    gimp_image_alpha_changed (image);
+    image->flush_accum.alpha_changed = TRUE;
 
   if (undo_group)
     gimp_image_undo_group_end (image);
@@ -3071,7 +3165,7 @@
 
       gimp_item_translate (new_item, offset_x, offset_y, FALSE);
 
-      gimp_image_add_layer (image, GIMP_LAYER (new_item), position);
+      gimp_image_add_layer (image, GIMP_LAYER (new_item), position, TRUE);
       position++;
     }
 
@@ -3082,20 +3176,22 @@
 }
 
 gboolean
-gimp_image_raise_layer (GimpImage *image,
-                        GimpLayer *layer)
+gimp_image_raise_layer (GimpImage  *image,
+                        GimpLayer  *layer,
+                        GError    **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->layers,
                                           GIMP_OBJECT (layer));
 
   if (index == 0)
     {
-      g_message (_("Layer cannot be raised higher."));
+      g_set_error (error, 0, 0, "%s", _("Layer cannot be raised higher."));
       return FALSE;
     }
 
@@ -3104,20 +3200,22 @@
 }
 
 gboolean
-gimp_image_lower_layer (GimpImage *image,
-                        GimpLayer *layer)
+gimp_image_lower_layer (GimpImage  *image,
+                        GimpLayer  *layer,
+                        GError    **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->layers,
                                           GIMP_OBJECT (layer));
 
   if (index == gimp_container_num_children (image->layers) - 1)
     {
-      g_message (_("Layer cannot be lowered more."));
+      g_set_error (error, 0, 0, "%s", _("Layer cannot be lowered more."));
       return FALSE;
     }
 
@@ -3198,32 +3296,22 @@
 gboolean
 gimp_image_add_channel (GimpImage   *image,
                         GimpChannel *channel,
-                        gint         position)
+                        gint         position,
+                        gboolean     push_undo)
 {
   GimpChannel *active_channel;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
-
-  if (GIMP_ITEM (channel)->image != NULL &&
-      GIMP_ITEM (channel)->image != image)
-    {
-      g_warning ("%s: attempting to add channel to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->channels, GIMP_OBJECT (channel)))
-    {
-      g_warning ("%s: trying to add channel to image twice.", G_STRFUNC);
-      return FALSE;
-    }
+  g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (channel)), FALSE);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (channel)) == image,
+                        FALSE);
 
   active_channel = gimp_image_get_active_channel (image);
 
-  gimp_image_undo_push_channel_add (image, _("Add Channel"),
-                                    channel, active_channel);
-
-  gimp_item_set_image (GIMP_ITEM (channel), image);
+  if (push_undo)
+    gimp_image_undo_push_channel_add (image, _("Add Channel"),
+                                      channel, active_channel);
 
   /*  add the layer to the list at the specified position  */
   if (position == -1)
@@ -3251,7 +3339,9 @@
 
 void
 gimp_image_remove_channel (GimpImage   *image,
-                           GimpChannel *channel)
+                           GimpChannel *channel,
+                           gboolean     push_undo,
+                           GimpChannel *new_active)
 {
   GimpChannel *active_channel;
   gint         index;
@@ -3264,6 +3354,14 @@
 
   if (gimp_drawable_has_floating_sel (GIMP_DRAWABLE (channel)))
     {
+      if (! push_undo)
+        {
+          g_warning ("%s() was called from an undo function while the channel "
+                     "had a floating selection. Please report this at "
+                     "http://www.gimp.org/bugs/";, G_STRFUNC);
+          return;
+        }
+
       gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
                                    _("Remove Channel"));
       undo_group = TRUE;
@@ -3276,8 +3374,9 @@
   index = gimp_container_get_child_index (image->channels,
                                           GIMP_OBJECT (channel));
 
-  gimp_image_undo_push_channel_remove (image, _("Remove Channel"),
-                                       channel, index, active_channel);
+  if (push_undo)
+    gimp_image_undo_push_channel_remove (image, _("Remove Channel"),
+                                         channel, index, active_channel);
 
   g_object_ref (channel);
 
@@ -3286,21 +3385,30 @@
 
   if (channel == active_channel)
     {
-      gint n_children = gimp_container_num_children (image->channels);
-
-      if (n_children > 0)
+      if (new_active)
         {
-          index = CLAMP (index, 0, n_children - 1);
-
-          active_channel = (GimpChannel *)
-            gimp_container_get_child_by_index (image->channels, index);
-
-          gimp_image_set_active_channel (image, active_channel);
+          active_channel = new_active;
         }
       else
         {
-          gimp_image_unset_active_channel (image);
+          gint n_children = gimp_container_num_children (image->channels);
+
+          if (n_children > 0)
+            {
+              index = CLAMP (index, 0, n_children - 1);
+
+              active_channel = gimp_image_get_channel_by_index (image, index);
+            }
+          else
+            {
+              active_channel = NULL;
+            }
         }
+
+      if (active_channel)
+        gimp_image_set_active_channel (image, active_channel);
+      else
+        gimp_image_unset_active_channel (image);
     }
 
   g_object_unref (channel);
@@ -3310,20 +3418,22 @@
 }
 
 gboolean
-gimp_image_raise_channel (GimpImage   *image,
-                          GimpChannel *channel)
+gimp_image_raise_channel (GimpImage    *image,
+                          GimpChannel  *channel,
+                          GError      **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->channels,
                                           GIMP_OBJECT (channel));
 
   if (index == 0)
     {
-      g_message (_("Channel cannot be raised higher."));
+      g_set_error (error, 0, 0, "%s", _("Channel cannot be raised higher."));
       return FALSE;
     }
 
@@ -3335,39 +3445,31 @@
 gimp_image_raise_channel_to_top (GimpImage   *image,
                                  GimpChannel *channel)
 {
-  gint index;
-
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
 
-  index = gimp_container_get_child_index (image->channels,
-                                          GIMP_OBJECT (channel));
-
-  if (index == 0)
-    {
-      g_message (_("Channel is already on top."));
-      return FALSE;
-    }
-
   return gimp_image_position_channel (image, channel, 0,
                                       TRUE, _("Raise Channel to Top"));
 }
 
+
 gboolean
-gimp_image_lower_channel (GimpImage   *image,
-                          GimpChannel *channel)
+gimp_image_lower_channel (GimpImage    *image,
+                          GimpChannel  *channel,
+                          GError      **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->channels,
                                           GIMP_OBJECT (channel));
 
   if (index == gimp_container_num_children (image->channels) - 1)
     {
-      g_message (_("Channel cannot be lowered more."));
+      g_set_error (error, 0, 0, "%s", _("Channel cannot be lowered more."));
       return FALSE;
     }
 
@@ -3379,23 +3481,13 @@
 gimp_image_lower_channel_to_bottom (GimpImage   *image,
                                     GimpChannel *channel)
 {
-  gint index;
   gint length;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
 
-  index = gimp_container_get_child_index (image->channels,
-                                          GIMP_OBJECT (channel));
-
   length = gimp_container_num_children (image->channels);
 
-  if (index == length - 1)
-    {
-      g_message (_("Channel is already on the bottom."));
-      return FALSE;
-    }
-
   return gimp_image_position_channel (image, channel, length - 1,
                                       TRUE, _("Lower Channel to Bottom"));
 }
@@ -3449,32 +3541,22 @@
 gboolean
 gimp_image_add_vectors (GimpImage   *image,
                         GimpVectors *vectors,
-                        gint         position)
+                        gint         position,
+                        gboolean     push_undo)
 {
   GimpVectors *active_vectors;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
-
-  if (GIMP_ITEM (vectors)->image != NULL &&
-      GIMP_ITEM (vectors)->image != image)
-    {
-      g_warning ("%s: attempting to add vectors to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->vectors, GIMP_OBJECT (vectors)))
-    {
-      g_warning ("%s: trying to add vectors to image twice.", G_STRFUNC);
-      return FALSE;
-    }
+  g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (vectors)), FALSE);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (vectors)) == image,
+                        FALSE);
 
   active_vectors = gimp_image_get_active_vectors (image);
 
-  gimp_image_undo_push_vectors_add (image, _("Add Path"),
-                                    vectors, active_vectors);
-
-  gimp_item_set_image (GIMP_ITEM (vectors), image);
+  if (push_undo)
+    gimp_image_undo_push_vectors_add (image, _("Add Path"),
+                                      vectors, active_vectors);
 
   /*  add the layer to the list at the specified position  */
   if (position == -1)
@@ -3502,7 +3584,9 @@
 
 void
 gimp_image_remove_vectors (GimpImage   *image,
-                           GimpVectors *vectors)
+                           GimpVectors *vectors,
+                           gboolean     push_undo,
+                           GimpVectors *new_active)
 {
   GimpVectors *active_vectors;
   gint         index;
@@ -3517,8 +3601,9 @@
   index = gimp_container_get_child_index (image->vectors,
                                           GIMP_OBJECT (vectors));
 
-  gimp_image_undo_push_vectors_remove (image, _("Remove Path"),
-                                       vectors, index, active_vectors);
+  if (push_undo)
+    gimp_image_undo_push_vectors_remove (image, _("Remove Path"),
+                                         vectors, index, active_vectors);
 
   g_object_ref (vectors);
 
@@ -3527,18 +3612,24 @@
 
   if (vectors == active_vectors)
     {
-      gint n_children = gimp_container_num_children (image->vectors);
-
-      if (n_children > 0)
+      if (new_active)
         {
-          index = CLAMP (index, 0, n_children - 1);
-
-          active_vectors = (GimpVectors *)
-            gimp_container_get_child_by_index (image->vectors, index);
+          active_vectors = new_active;
         }
       else
         {
-          active_vectors = NULL;
+          gint n_children = gimp_container_num_children (image->vectors);
+
+          if (n_children > 0)
+            {
+              index = CLAMP (index, 0, n_children - 1);
+
+              active_vectors = gimp_image_get_vectors_by_index (image, index);
+            }
+          else
+            {
+              active_vectors = NULL;
+            }
         }
 
       gimp_image_set_active_vectors (image, active_vectors);
@@ -3548,20 +3639,22 @@
 }
 
 gboolean
-gimp_image_raise_vectors (GimpImage   *image,
-                          GimpVectors *vectors)
+gimp_image_raise_vectors (GimpImage    *image,
+                          GimpVectors  *vectors,
+                          GError      **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->vectors,
                                           GIMP_OBJECT (vectors));
 
   if (index == 0)
     {
-      g_message (_("Path cannot be raised higher."));
+      g_set_error (error, 0, 0, "%s", _("Path cannot be raised higher."));
       return FALSE;
     }
 
@@ -3573,39 +3666,30 @@
 gimp_image_raise_vectors_to_top (GimpImage   *image,
                                  GimpVectors *vectors)
 {
-  gint index;
-
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
 
-  index = gimp_container_get_child_index (image->vectors,
-                                          GIMP_OBJECT (vectors));
-
-  if (index == 0)
-    {
-      g_message (_("Path is already on top."));
-      return FALSE;
-    }
-
   return gimp_image_position_vectors (image, vectors, 0,
                                       TRUE, _("Raise Path to Top"));
 }
 
 gboolean
-gimp_image_lower_vectors (GimpImage   *image,
-                          GimpVectors *vectors)
+gimp_image_lower_vectors (GimpImage    *image,
+                          GimpVectors  *vectors,
+                          GError      **error)
 {
   gint index;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   index = gimp_container_get_child_index (image->vectors,
                                           GIMP_OBJECT (vectors));
 
   if (index == gimp_container_num_children (image->vectors) - 1)
     {
-      g_message (_("Path cannot be lowered more."));
+      g_set_error (error, 0, 0, "%s", _("Path cannot be lowered more."));
       return FALSE;
     }
 
@@ -3617,23 +3701,13 @@
 gimp_image_lower_vectors_to_bottom (GimpImage   *image,
                                     GimpVectors *vectors)
 {
-  gint index;
   gint length;
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
   g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
 
-  index = gimp_container_get_child_index (image->vectors,
-                                          GIMP_OBJECT (vectors));
-
   length = gimp_container_num_children (image->vectors);
 
-  if (index == length - 1)
-    {
-      g_message (_("Path is already on the bottom."));
-      return FALSE;
-    }
-
   return gimp_image_position_vectors (image, vectors, length - 1,
                                       TRUE, _("Lower Path to Bottom"));
 }

Modified: branches/soc-2008-tagging/app/core/gimpimage.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimage.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpimage.h	Sun Oct 12 15:38:02 2008
@@ -126,6 +126,7 @@
   GimpTattoo         tattoo_state;          /*  the last used tattoo         */
 
   GimpProjection    *projection;            /*  projection layers & channels */
+  GeglNode          *graph;                 /*  GEGL projection graph        */
 
   GList             *guides;                /*  guides                       */
   GimpGrid          *grid;                  /*  grid                         */
@@ -193,7 +194,9 @@
   void (* resolution_changed)           (GimpImage            *image);
   void (* size_changed_detailed)        (GimpImage            *image,
                                          gint                  previous_origin_x,
-                                         gint                  previous_origin_y);
+                                         gint                  previous_origin_y,
+                                         gint                  previous_width,
+                                         gint                  previous_height);
   void (* unit_changed)                 (GimpImage            *image);
   void (* quick_mask_changed)           (GimpImage            *image);
   void (* selection_control)            (GimpImage            *image,
@@ -329,7 +332,9 @@
 void            gimp_image_quick_mask_changed    (GimpImage          *image);
 void            gimp_image_size_changed_detailed (GimpImage          *image,
                                                   gint                previous_origin_x,
-                                                  gint                previous_origin_y);
+                                                  gint                previous_origin_y,
+                                                  gint                previous_width,
+                                                  gint                previous_height);
 
 
 /*  undo  */
@@ -406,6 +411,7 @@
 /*  projection  */
 
 GimpProjection * gimp_image_get_projection       (const GimpImage    *image);
+GeglNode       * gimp_image_get_graph            (GimpImage          *image);
 
 
 /*  layers / channels / vectors  */
@@ -438,6 +444,13 @@
 gint            gimp_image_get_vectors_index     (const GimpImage    *image,
                                                   const GimpVectors  *vectors);
 
+GimpLayer     * gimp_image_get_layer_by_index    (const GimpImage    *image,
+                                                  gint                index);
+GimpChannel   * gimp_image_get_channel_by_index  (const GimpImage    *image,
+                                                  gint                index);
+GimpVectors   * gimp_image_get_vectors_by_index  (const GimpImage    *image,
+                                                  gint                index);
+
 GimpLayer     * gimp_image_get_layer_by_tattoo   (const GimpImage    *image,
                                                   GimpTattoo          tattoo);
 GimpChannel   * gimp_image_get_channel_by_tattoo (const GimpImage    *image,
@@ -454,9 +467,12 @@
 
 gboolean        gimp_image_add_layer             (GimpImage          *image,
                                                   GimpLayer          *layer,
-                                                  gint                position);
+                                                  gint                position,
+                                                  gboolean            push_undo);
 void            gimp_image_remove_layer          (GimpImage          *image,
-                                                  GimpLayer          *layer);
+                                                  GimpLayer          *layer,
+                                                  gboolean            push_undo,
+                                                  GimpLayer          *new_active);
 
 void            gimp_image_add_layers            (GimpImage          *image,
                                                   GList              *layers,
@@ -468,9 +484,11 @@
                                                   const gchar        *undo_desc);
 
 gboolean        gimp_image_raise_layer           (GimpImage          *image,
-                                                  GimpLayer          *layer);
+                                                  GimpLayer          *layer,
+                                                  GError            **error);
 gboolean        gimp_image_lower_layer           (GimpImage          *image,
-                                                  GimpLayer          *layer);
+                                                  GimpLayer          *layer,
+                                                  GError            **error);
 gboolean        gimp_image_raise_layer_to_top    (GimpImage          *image,
                                                   GimpLayer          *layer);
 gboolean        gimp_image_lower_layer_to_bottom (GimpImage          *image,
@@ -483,16 +501,21 @@
 
 gboolean        gimp_image_add_channel           (GimpImage          *image,
                                                   GimpChannel        *channel,
-                                                  gint                position);
+                                                  gint                position,
+                                                  gboolean            push_undo);
 void            gimp_image_remove_channel        (GimpImage          *image,
-                                                  GimpChannel        *channel);
+                                                  GimpChannel        *channel,
+                                                  gboolean            push_undo,
+                                                  GimpChannel        *new_active);
 
 gboolean        gimp_image_raise_channel         (GimpImage          *image,
-                                                  GimpChannel        *channel);
+                                                  GimpChannel        *channel,
+                                                  GError            **error);
 gboolean        gimp_image_raise_channel_to_top  (GimpImage          *image,
                                                   GimpChannel        *channel);
 gboolean        gimp_image_lower_channel         (GimpImage          *image,
-                                                  GimpChannel        *channel);
+                                                  GimpChannel        *channel,
+                                                  GError            **error);
 gboolean      gimp_image_lower_channel_to_bottom (GimpImage          *image,
                                                   GimpChannel        *channel);
 gboolean        gimp_image_position_channel      (GimpImage          *image,
@@ -503,16 +526,21 @@
 
 gboolean        gimp_image_add_vectors           (GimpImage          *image,
                                                   GimpVectors        *vectors,
-                                                  gint                position);
+                                                  gint                position,
+                                                  gboolean            push_undo);
 void            gimp_image_remove_vectors        (GimpImage          *image,
-                                                  GimpVectors        *vectors);
+                                                  GimpVectors        *vectors,
+                                                  gboolean            push_undo,
+                                                  GimpVectors        *new_active);
 
 gboolean        gimp_image_raise_vectors         (GimpImage          *image,
-                                                  GimpVectors        *vectors);
+                                                  GimpVectors        *vectors,
+                                                  GError            **error);
 gboolean        gimp_image_raise_vectors_to_top  (GimpImage          *image,
                                                   GimpVectors        *vectors);
 gboolean        gimp_image_lower_vectors         (GimpImage          *image,
-                                                  GimpVectors        *vectors);
+                                                  GimpVectors        *vectors,
+                                                  GError            **error);
 gboolean      gimp_image_lower_vectors_to_bottom (GimpImage          *image,
                                                   GimpVectors        *vectors);
 gboolean        gimp_image_position_vectors      (GimpImage          *image,

Modified: branches/soc-2008-tagging/app/core/gimpimagefile.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimagefile.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimagefile.c	Sun Oct 12 15:38:02 2008
@@ -25,6 +25,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/core/gimpimagemap.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimagemap.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimagemap.c	Sun Oct 12 15:38:02 2008
@@ -155,7 +155,13 @@
   image_map->apply_data    = NULL;
   image_map->PRI           = NULL;
   image_map->idle_id       = 0;
+
+#ifdef GIMP_UNSTABLE
   image_map->timer         = g_timer_new ();
+#else
+  image_map->timer         = NULL;
+#endif
+
   image_map->pixel_count   = 0;
 
   if (image_map->timer)

Modified: branches/soc-2008-tagging/app/core/gimpimageundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimageundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpimageundo.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -43,6 +43,8 @@
   PROP_0,
   PROP_PREVIOUS_ORIGIN_X,
   PROP_PREVIOUS_ORIGIN_Y,
+  PROP_PREVIOUS_WIDTH,
+  PROP_PREVIOUS_HEIGHT,
   PROP_GRID,
   PROP_PARASITE_NAME
 };
@@ -107,6 +109,22 @@
                                                      0,
                                                      GIMP_PARAM_READWRITE));
 
+  g_object_class_install_property (object_class, PROP_PREVIOUS_WIDTH,
+                                   g_param_spec_int ("previous-width",
+                                                     NULL, NULL,
+                                                     -GIMP_MAX_IMAGE_SIZE,
+                                                     GIMP_MAX_IMAGE_SIZE,
+                                                     0,
+                                                     GIMP_PARAM_READWRITE));
+
+  g_object_class_install_property (object_class, PROP_PREVIOUS_HEIGHT,
+                                   g_param_spec_int ("previous-height",
+                                                     NULL, NULL,
+                                                     -GIMP_MAX_IMAGE_SIZE,
+                                                     GIMP_MAX_IMAGE_SIZE,
+                                                     0,
+                                                     GIMP_PARAM_READWRITE));
+
   g_object_class_install_property (object_class, PROP_GRID,
                                    g_param_spec_object ("grid", NULL, NULL,
                                                         GIMP_TYPE_GRID,
@@ -200,6 +218,12 @@
     case PROP_PREVIOUS_ORIGIN_Y:
       image_undo->previous_origin_y = g_value_get_int (value);
       break;
+    case PROP_PREVIOUS_WIDTH:
+      image_undo->previous_width = g_value_get_int (value);
+      break;
+    case PROP_PREVIOUS_HEIGHT:
+      image_undo->previous_height = g_value_get_int (value);
+      break;
     case PROP_GRID:
       {
         GimpGrid *grid = g_value_get_object (value);
@@ -234,6 +258,12 @@
     case PROP_PREVIOUS_ORIGIN_Y:
       g_value_set_int (value, image_undo->previous_origin_y);
       break;
+    case PROP_PREVIOUS_WIDTH:
+      g_value_set_int (value, image_undo->previous_width);
+      break;
+    case PROP_PREVIOUS_HEIGHT:
+      g_value_set_int (value, image_undo->previous_height);
+      break;
     case PROP_GRID:
       g_value_set_object (value, image_undo->grid);
        break;
@@ -299,17 +329,23 @@
         gint height;
         gint previous_origin_x;
         gint previous_origin_y;
+        gint previous_width;
+        gint previous_height;
 
         width             = image_undo->width;
         height            = image_undo->height;
         previous_origin_x = image_undo->previous_origin_x;
         previous_origin_y = image_undo->previous_origin_y;
+        previous_width    = image_undo->previous_width;
+        previous_height   = image_undo->previous_height;
 
         /* Transform to a redo */
         image_undo->width             = gimp_image_get_width  (image);
         image_undo->height            = gimp_image_get_height (image);
         image_undo->previous_origin_x = -previous_origin_x;
         image_undo->previous_origin_y = -previous_origin_y;
+        image_undo->previous_width    = width;
+        image_undo->previous_height   = height;
 
         g_object_set (image,
                       "width",  width,
@@ -325,6 +361,8 @@
             accum->size_changed      = TRUE;
             accum->previous_origin_x = previous_origin_x;
             accum->previous_origin_y = previous_origin_y;
+            accum->previous_width    = previous_width;
+            accum->previous_height   = previous_height;
           }
       }
       break;

Modified: branches/soc-2008-tagging/app/core/gimpimageundo.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpimageundo.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpimageundo.h	Sun Oct 12 15:38:02 2008
@@ -42,6 +42,8 @@
   gint               height;
   gint               previous_origin_x;
   gint               previous_origin_y;
+  gint               previous_width;
+  gint               previous_height;
   gdouble            xresolution;
   gdouble            yresolution;
   GimpUnit           resolution_unit;

Modified: branches/soc-2008-tagging/app/core/gimpitem-linked.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpitem-linked.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpitem-linked.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpitem-preview.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpitem-preview.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpitem-preview.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpitem.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpitem.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpitem.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/core/gimpitemundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpitemundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpitemundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimplayer-floating-sel.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayer-floating-sel.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayer-floating-sel.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 
@@ -79,7 +79,7 @@
                                               gimp_drawable_bytes (drawable));
 
   /*  add the layer to the image  */
-  gimp_image_add_layer (image, layer, 0);
+  gimp_image_add_layer (image, layer, 0, TRUE);
 
   /*  store the affected area from the drawable in the backing store  */
   floating_sel_rigor (layer, TRUE);
@@ -109,7 +109,7 @@
   gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer));
 
   /*  remove the layer from the image  */
-  gimp_image_remove_layer (image, layer);
+  gimp_image_remove_layer (image, layer, TRUE, NULL);
 
   gimp_image_undo_group_end (image);
 }
@@ -148,7 +148,7 @@
   drawable = layer->fs.drawable;
 
   /*  remove the floating selection  */
-  gimp_image_remove_layer (image, layer);
+  gimp_image_remove_layer (image, layer, TRUE, NULL);
 
   /*  end the group undo  */
   gimp_image_undo_group_end (image);

Modified: branches/soc-2008-tagging/app/core/gimplayer.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayer.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayer.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
@@ -35,6 +35,8 @@
 
 #include "paint-funcs/paint-funcs.h"
 
+#include "gegl/gimp-gegl-utils.h"
+
 #include "gimpcontext.h"
 #include "gimpcontainer.h"
 #include "gimpdrawable-convert.h"
@@ -69,6 +71,19 @@
 };
 
 
+#ifdef __GNUC__
+#warning FIXME: gegl_node_add_child() needs to be public
+#endif
+GeglNode * gegl_node_add_child (GeglNode *self,
+                                GeglNode *child);
+
+#ifdef __GNUC__
+#warning FIXME: gegl_node_remove_child() needs to be public
+#endif
+GeglNode * gegl_node_remove_child (GeglNode *self,
+                                   GeglNode *child);
+
+
 static void   gimp_layer_pickable_iface_init (GimpPickableInterface *iface);
 
 static void       gimp_layer_set_property       (GObject            *object,
@@ -91,6 +106,7 @@
                                                  gchar             **tooltip);
 
 static void       gimp_layer_removed            (GimpItem           *item);
+static void       gimp_layer_visibility_changed (GimpItem           *item);
 static gboolean   gimp_layer_is_attached        (GimpItem           *item);
 static GimpItem * gimp_layer_duplicate          (GimpItem           *item,
                                                  GType               new_type);
@@ -150,6 +166,8 @@
                                                  GimpImageType       type,
                                                  gint                offset_x,
                                                  gint                offset_y);
+static GeglNode * gimp_layer_get_node           (GimpDrawable       *drawable);
+
 static gint    gimp_layer_get_opacity_at        (GimpPickable       *pickable,
                                                  gint                x,
                                                  gint                y);
@@ -235,6 +253,7 @@
   viewable_class->get_description     = gimp_layer_get_description;
 
   item_class->removed                 = gimp_layer_removed;
+  item_class->visibility_changed      = gimp_layer_visibility_changed;
   item_class->is_attached             = gimp_layer_is_attached;
   item_class->duplicate               = gimp_layer_duplicate;
   item_class->convert                 = gimp_layer_convert;
@@ -258,6 +277,7 @@
   drawable_class->invalidate_boundary   = gimp_layer_invalidate_boundary;
   drawable_class->get_active_components = gimp_layer_get_active_components;
   drawable_class->set_tiles             = gimp_layer_set_tiles;
+  drawable_class->get_node              = gimp_layer_get_node;
 
   klass->opacity_changed              = NULL;
   klass->mode_changed                 = NULL;
@@ -376,6 +396,12 @@
       layer->mask = NULL;
     }
 
+  if (layer->node)
+    {
+      g_object_unref (layer->node);
+      layer->node = NULL;
+    }
+
   if (layer->fs.backing_store)
     {
       tile_manager_unref (layer->fs.backing_store);
@@ -490,6 +516,84 @@
     floating_sel_rigor (layer, FALSE);
 }
 
+static GeglNode *
+gimp_layer_get_node (GimpDrawable *drawable)
+{
+  GimpLayer *layer = GIMP_LAYER (drawable);
+  GeglNode  *source;
+  gint       off_x, off_y;
+  GeglNode  *input;
+  GeglNode  *output;
+
+  if (layer->node)
+    return layer->node;
+
+  layer->node = gegl_node_new ();
+
+  source = gimp_drawable_get_source_node (drawable);
+  gegl_node_add_child (layer->node, source);
+
+  if (layer->mask)
+    {
+      GeglNode *mask;
+
+      mask = gimp_drawable_get_source_node (GIMP_DRAWABLE (layer->mask));
+
+      layer->mask_node = gegl_node_new_child (layer->node,
+                                              "operation", "opacity",
+                                              NULL);
+      gegl_node_connect_to (mask,             "output",
+                            layer->mask_node, "aux");
+      gegl_node_connect_to (source,           "output",
+                            layer->mask_node, "input");
+    }
+
+  gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y);
+  layer->shift_node = gegl_node_new_child (layer->node,
+                                           "operation", "shift",
+                                           "x",         (gdouble) off_x,
+                                           "y",         (gdouble) off_y,
+                                           NULL);
+
+  if (layer->mask_node)
+    gegl_node_connect_to (layer->mask_node,  "output",
+                          layer->shift_node, "input");
+  else
+    gegl_node_connect_to (source,            "output",
+                          layer->shift_node, "input");
+
+  layer->opacity_node = gegl_node_new_child (layer->node,
+                                             "operation", "opacity",
+                                             "value",     layer->opacity,
+                                             NULL);
+  gegl_node_connect_to (layer->shift_node,   "output",
+                        layer->opacity_node, "input");
+
+  layer->mode_node = gegl_node_new_child (layer->node,
+                                          "operation", gimp_layer_mode_to_gegl_operation (layer->mode),
+                                          NULL);
+  gegl_node_connect_to (layer->opacity_node, "output",
+                        layer->mode_node,    "aux");
+
+  input  = gegl_node_get_input_proxy (layer->node, "input");
+  output = gegl_node_get_output_proxy (layer->node, "output");
+
+  if (gimp_item_get_visible (GIMP_ITEM (layer)))
+    {
+      gegl_node_connect_to (input,            "output",
+                            layer->mode_node, "input");
+      gegl_node_connect_to (layer->mode_node, "output",
+                            output,           "input");
+    }
+  else
+    {
+      gegl_node_connect_to (input,  "output",
+                            output, "input");
+    }
+
+  return layer->node;
+}
+
 static void
 gimp_layer_removed (GimpItem *item)
 {
@@ -502,6 +606,39 @@
     GIMP_ITEM_CLASS (parent_class)->removed (item);
 }
 
+static void
+gimp_layer_visibility_changed (GimpItem *item)
+{
+  GimpLayer *layer = GIMP_LAYER (item);
+
+  if (layer->node)
+    {
+      GeglNode *input;
+      GeglNode *output;
+
+      input  = gegl_node_get_input_proxy (layer->node, "input");
+      output = gegl_node_get_output_proxy (layer->node, "output");
+
+      if (gimp_item_get_visible (item))
+        {
+          gegl_node_connect_to (input,            "output",
+                                layer->mode_node, "input");
+          gegl_node_connect_to (layer->mode_node, "output",
+                                output,           "input");
+        }
+      else
+        {
+          gegl_node_disconnect (layer->mode_node, "input");
+
+          gegl_node_connect_to (input,  "output",
+                                output, "input");
+        }
+    }
+
+  if (GIMP_ITEM_CLASS (parent_class)->visibility_changed)
+    GIMP_ITEM_CLASS (parent_class)->visibility_changed (item);
+}
+
 static gboolean
 gimp_layer_is_attached (GimpItem *item)
 {
@@ -538,7 +675,7 @@
 
           mask = gimp_item_duplicate (GIMP_ITEM (layer->mask),
                                       G_TYPE_FROM_INSTANCE (layer->mask));
-          gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (mask), FALSE);
+          gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (mask), FALSE, NULL);
         }
     }
 
@@ -692,6 +829,12 @@
   if (gimp_layer_is_floating_sel (layer))
     floating_sel_rigor (layer, FALSE);
 
+  if (layer->shift_node)
+    gegl_node_set (layer->shift_node,
+                   "x", (gdouble) item->offset_x,
+                   "y", (gdouble) item->offset_y,
+                   NULL);
+
   /*  update the new region  */
   gimp_drawable_update (GIMP_DRAWABLE (layer),
                         0, 0,
@@ -1241,31 +1384,29 @@
 }
 
 GimpLayerMask *
-gimp_layer_add_mask (GimpLayer     *layer,
-                     GimpLayerMask *mask,
-                     gboolean       push_undo)
+gimp_layer_add_mask (GimpLayer      *layer,
+                     GimpLayerMask  *mask,
+                     gboolean        push_undo,
+                     GError        **error)
 {
   GimpImage *image;
 
   g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
   g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), NULL);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) ==
+                        gimp_item_get_image (GIMP_ITEM (mask)), NULL);
+  g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
   if (! gimp_item_is_attached (GIMP_ITEM (layer)))
     push_undo = FALSE;
 
   image = gimp_item_get_image (GIMP_ITEM (layer));
 
-  if (! image)
-    {
-      g_message (_("Cannot add layer mask to layer "
-                   "which is not part of an image."));
-      return NULL;
-    }
-
   if (layer->mask)
     {
-      g_message (_("Unable to add a layer mask since "
-                   "the layer already has one."));
+      g_set_error (error, 0, 0,
+                   _("Unable to add a layer mask since "
+                     "the layer already has one."));
       return NULL;
     }
 
@@ -1274,8 +1415,9 @@
       (gimp_item_height (GIMP_ITEM (layer)) !=
        gimp_item_height (GIMP_ITEM (mask))))
     {
-      g_message (_("Cannot add layer mask of different "
-                   "dimensions than specified layer."));
+      g_set_error (error, 0, 0,
+                   _("Cannot add layer mask of different "
+                     "dimensions than specified layer."));
       return NULL;
     }
 
@@ -1287,6 +1429,27 @@
 
   gimp_layer_mask_set_layer (mask, layer);
 
+  if (layer->node)
+    {
+      GeglNode *source;
+      GeglNode *mask;
+
+      layer->mask_node = gegl_node_new_child (layer->node,
+                                              "operation", "opacity",
+                                              NULL);
+
+      source = gimp_drawable_get_source_node (GIMP_DRAWABLE (layer));
+      gegl_node_connect_to (source,           "output",
+                            layer->mask_node, "input");
+
+      mask = gimp_drawable_get_source_node (GIMP_DRAWABLE (layer->mask));
+      gegl_node_connect_to (mask,             "output",
+                            layer->mask_node, "aux");
+
+      gegl_node_connect_to (layer->mask_node,  "output",
+                            layer->shift_node, "input");
+    }
+
   if (gimp_layer_mask_get_apply (mask) ||
       gimp_layer_mask_get_show (mask))
     {
@@ -1611,6 +1774,21 @@
   if (push_undo)
     gimp_image_undo_group_end (image);
 
+  if (layer->node)
+    {
+      GeglNode *source;
+
+      gegl_node_disconnect (layer->mask_node, "input");
+      gegl_node_disconnect (layer->mask_node, "aux");
+
+      gegl_node_remove_child (layer->node, layer->mask_node);
+      layer->mask_node = NULL;
+
+      source = gimp_drawable_get_source_node (GIMP_DRAWABLE (layer));
+      gegl_node_connect_to (source,            "output",
+                            layer->shift_node, "input");
+    }
+
   /*  If applying actually changed the view  */
   if (view_changed)
     {
@@ -1860,6 +2038,11 @@
       g_signal_emit (layer, layer_signals[OPACITY_CHANGED], 0);
       g_object_notify (G_OBJECT (layer), "opacity");
 
+      if (layer->opacity_node)
+        gegl_node_set (layer->opacity_node,
+                       "value", layer->opacity,
+                       NULL);
+
       gimp_drawable_update (GIMP_DRAWABLE (layer),
                             0, 0,
                             gimp_item_width  (GIMP_ITEM (layer)),
@@ -1896,6 +2079,11 @@
       g_signal_emit (layer, layer_signals[MODE_CHANGED], 0);
       g_object_notify (G_OBJECT (layer), "mode");
 
+      if (layer->mode_node)
+        gegl_node_set (layer->mode_node,
+                       "operation", gimp_layer_mode_to_gegl_operation (layer->mode),
+                       NULL);
+
       gimp_drawable_update (GIMP_DRAWABLE (layer),
                             0, 0,
                             gimp_item_width  (GIMP_ITEM (layer)),

Modified: branches/soc-2008-tagging/app/core/gimplayer.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayer.h	(original)
+++ branches/soc-2008-tagging/app/core/gimplayer.h	Sun Oct 12 15:38:02 2008
@@ -43,6 +43,12 @@
 
   GimpLayerMask        *mask;             /*  possible layer mask        */
 
+  GeglNode             *node;
+  GeglNode             *mask_node;
+  GeglNode             *shift_node;
+  GeglNode             *opacity_node;
+  GeglNode             *mode_node;
+
   /*  Floating selections  */
   struct
   {
@@ -103,7 +109,8 @@
                                                 GimpChannel          *channel);
 GimpLayerMask * gimp_layer_add_mask            (GimpLayer            *layer,
                                                 GimpLayerMask        *mask,
-                                                gboolean              push_undo);
+                                                gboolean              push_undo,
+                                                GError              **error);
 void            gimp_layer_apply_mask          (GimpLayer            *layer,
                                                 GimpMaskApplyMode     mode,
                                                 gboolean              push_undo);

Modified: branches/soc-2008-tagging/app/core/gimplayermask.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayermask.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayermask.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/core/gimplayermaskpropundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayermaskpropundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayermaskpropundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimplayermaskundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayermaskundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayermaskundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -188,7 +188,7 @@
     {
       /*  restore layer mask  */
 
-      gimp_layer_add_mask (layer, layer_mask_undo->layer_mask, FALSE);
+      gimp_layer_add_mask (layer, layer_mask_undo->layer_mask, FALSE, NULL);
 
       GIMP_ITEM (layer_mask_undo->layer_mask)->removed = FALSE;
     }

Modified: branches/soc-2008-tagging/app/core/gimplayerpropundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayerpropundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayerpropundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimplayerundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplayerundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplayerundo.c	Sun Oct 12 15:38:02 2008
@@ -18,14 +18,12 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
-#include "gimpcontainer.h"
 #include "gimpimage.h"
 #include "gimplayer.h"
-#include "gimplayer-floating-sel.h"
 #include "gimplayerundo.h"
 
 
@@ -197,44 +195,8 @@
       layer_undo->prev_position = gimp_image_get_layer_index (undo->image,
                                                               layer);
 
-      gimp_container_remove (undo->image->layers, GIMP_OBJECT (layer));
-      undo->image->layer_stack = g_slist_remove (undo->image->layer_stack,
-                                                 layer);
-
-      if (gimp_layer_is_floating_sel (layer))
-        {
-          /*  invalidate the boundary *before* setting the
-           *  floating_sel pointer to NULL because the selection's
-           *  outline is affected by the floating_sel and won't be
-           *  completely cleared otherwise (bug #160247).
-           */
-          gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (layer));
-
-          undo->image->floating_sel = NULL;
-
-          /*  activate the underlying drawable  */
-          floating_sel_activate_drawable (layer);
-
-          gimp_image_floating_selection_changed (undo->image);
-        }
-      else if (layer == gimp_image_get_active_layer (undo->image))
-        {
-          if (layer_undo->prev_layer)
-            {
-              gimp_image_set_active_layer (undo->image, layer_undo->prev_layer);
-            }
-          else if (undo->image->layer_stack)
-            {
-              gimp_image_set_active_layer (undo->image,
-                                           undo->image->layer_stack->data);
-            }
-          else
-            {
-              gimp_image_set_active_layer (undo->image, NULL);
-            }
-        }
-
-      gimp_item_removed (GIMP_ITEM (layer));
+      gimp_image_remove_layer (undo->image, layer, FALSE,
+                               layer_undo->prev_layer);
     }
   else
     {
@@ -243,16 +205,8 @@
       /*  record the active layer  */
       layer_undo->prev_layer = gimp_image_get_active_layer (undo->image);
 
-      /*  if this is a floating selection, set the fs pointer  */
-      if (gimp_layer_is_floating_sel (layer))
-        undo->image->floating_sel = layer;
-
-      gimp_container_insert (undo->image->layers,
-                             GIMP_OBJECT (layer), layer_undo->prev_position);
-      gimp_image_set_active_layer (undo->image, layer);
-
-      if (gimp_layer_is_floating_sel (layer))
-        gimp_image_floating_selection_changed (undo->image);
+      gimp_image_add_layer (undo->image, layer,
+                            layer_undo->prev_position, FALSE);
 
       GIMP_ITEM (layer)->removed = FALSE;
 

Modified: branches/soc-2008-tagging/app/core/gimplist.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimplist.c	(original)
+++ branches/soc-2008-tagging/app/core/gimplist.c	Sun Oct 12 15:38:02 2008
@@ -230,6 +230,8 @@
     list->list = g_list_append (list->list, object);
   else
     list->list = g_list_prepend (list->list, object);
+
+  GIMP_CONTAINER_CLASS (parent_class)->add (container, object);
 }
 
 static void
@@ -244,6 +246,8 @@
                                           list);
 
   list->list = g_list_remove (list->list, object);
+
+  GIMP_CONTAINER_CLASS (parent_class)->remove (container, object);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/core/gimpmarshal.list
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpmarshal.list	(original)
+++ branches/soc-2008-tagging/app/core/gimpmarshal.list	Sun Oct 12 15:38:02 2008
@@ -44,6 +44,7 @@
 VOID: INT, INT
 VOID: INT, INT, INT, INT
 VOID: OBJECT
+VOID: OBJECT, BOOLEAN
 VOID: OBJECT, INT
 VOID: OBJECT, OBJECT
 VOID: OBJECT, POINTER

Modified: branches/soc-2008-tagging/app/core/gimpmaskundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpmaskundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpmaskundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -139,8 +139,6 @@
 
   if (gimp_channel_bounds (channel, &x1, &y1, &x2, &y2))
     {
-      guchar empty = 0;
-
       new_tiles = tile_manager_new (x2 - x1, y2 - y1, 1);
 
       pixel_region_init (&srcPR,
@@ -155,7 +153,7 @@
                          gimp_drawable_get_tiles (GIMP_DRAWABLE (channel)),
                          x1, y1, x2 - x1, y2 - y1, TRUE);
 
-      color_region (&srcPR, &empty);
+      clear_region (&srcPR);
     }
   else
     {

Modified: branches/soc-2008-tagging/app/core/gimppalette-import.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppalette-import.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppalette-import.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/core/gimppalette-load.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppalette-load.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppalette-load.c	Sun Oct 12 15:38:02 2008
@@ -180,7 +180,6 @@
           if (tok)
             r = atoi (tok);
           else
-            /* maybe we should just abort? */
             g_message (_("Reading palette file '%s': "
                          "Missing RED component in line %d."),
                        gimp_filename_to_utf8 (filename), linenum);
@@ -189,7 +188,7 @@
           if (tok)
             g = atoi (tok);
           else
-            g_message (_("Reading palette '%s': "
+            g_message (_("Reading palette file '%s': "
                          "Missing GREEN component in line %d."),
                        gimp_filename_to_utf8 (filename), linenum);
 

Modified: branches/soc-2008-tagging/app/core/gimppalette.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppalette.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppalette.c	Sun Oct 12 15:38:02 2008
@@ -41,37 +41,37 @@
 
 /*  local function prototypes  */
 
-static void       gimp_palette_tagged_init      (GimpTaggedInterface   *iface);
-static void       gimp_palette_finalize         (GObject           *object);
+static void          gimp_palette_tagged_init       (GimpTaggedInterface   *iface);
+static void          gimp_palette_finalize          (GObject           *object);
 
-static gint64     gimp_palette_get_memsize      (GimpObject        *object,
-                                                 gint64            *gui_size);
+static gint64        gimp_palette_get_memsize       (GimpObject        *object,
+                                                     gint64            *gui_size);
 
-static void       gimp_palette_get_preview_size (GimpViewable      *viewable,
-                                                 gint               size,
-                                                 gboolean           popup,
-                                                 gboolean           dot_for_dot,
-                                                 gint              *width,
-                                                 gint              *height);
-static gboolean   gimp_palette_get_popup_size   (GimpViewable      *viewable,
-                                                 gint               width,
-                                                 gint               height,
-                                                 gboolean           dot_for_dot,
-                                                 gint              *popup_width,
-                                                 gint              *popup_height);
-static TempBuf  * gimp_palette_get_new_preview  (GimpViewable      *viewable,
-                                                 GimpContext       *context,
-                                                 gint               width,
-                                                 gint               height);
-static gchar    * gimp_palette_get_description  (GimpViewable      *viewable,
-                                                 gchar            **tooltip);
-static gchar    * gimp_palette_get_extension    (GimpData          *data);
-static GimpData * gimp_palette_duplicate        (GimpData          *data);
-
-static void       gimp_palette_entry_free       (GimpPaletteEntry  *entry);
-static gint64     gimp_palette_entry_get_memsize(GimpPaletteEntry  *entry,
-                                                 gint64            *gui_size);
-static gchar    * gimp_palette_get_checksum     (GimpTagged        *tagged);
+static void          gimp_palette_get_preview_size  (GimpViewable      *viewable,
+                                                     gint               size,
+                                                     gboolean           popup,
+                                                     gboolean           dot_for_dot,
+                                                     gint              *width,
+                                                     gint              *height);
+static gboolean      gimp_palette_get_popup_size    (GimpViewable      *viewable,
+                                                     gint               width,
+                                                     gint               height,
+                                                     gboolean           dot_for_dot,
+                                                     gint              *popup_width,
+                                                     gint              *popup_height);
+static TempBuf     * gimp_palette_get_new_preview   (GimpViewable      *viewable,
+                                                     GimpContext       *context,
+                                                     gint               width,
+                                                     gint               height);
+static gchar       * gimp_palette_get_description   (GimpViewable      *viewable,
+                                                     gchar            **tooltip);
+static const gchar * gimp_palette_get_extension     (GimpData          *data);
+static GimpData    * gimp_palette_duplicate         (GimpData          *data);
+
+static void          gimp_palette_entry_free        (GimpPaletteEntry  *entry);
+static gint64        gimp_palette_entry_get_memsize (GimpPaletteEntry  *entry,
+                                                     gint64            *gui_size);
+static gchar       * gimp_palette_get_checksum      (GimpTagged        *tagged);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpPalette, gimp_palette, GIMP_TYPE_DATA,
@@ -301,7 +301,7 @@
   return standard_palette;
 }
 
-static gchar *
+static const gchar *
 gimp_palette_get_extension (GimpData *data)
 {
   return GIMP_PALETTE_FILE_EXTENSION;

Modified: branches/soc-2008-tagging/app/core/gimpparamspecs.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpparamspecs.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpparamspecs.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimppattern.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppattern.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppattern.c	Sun Oct 12 15:38:02 2008
@@ -35,26 +35,26 @@
 #include "gimp-intl.h"
 
 
-static void       gimp_pattern_tagged_init     (GimpTaggedInterface    *iface);
-static void       gimp_pattern_finalize        (GObject       *object);
+static void          gimp_pattern_tagged_init     (GimpTaggedInterface    *iface);
+static void          gimp_pattern_finalize        (GObject       *object);
 
-static gint64     gimp_pattern_get_memsize     (GimpObject    *object,
-                                                gint64        *gui_size);
+static gint64        gimp_pattern_get_memsize     (GimpObject    *object,
+                                                   gint64        *gui_size);
 
-static gboolean   gimp_pattern_get_size        (GimpViewable  *viewable,
-                                                gint          *width,
-                                                gint          *height);
-static TempBuf  * gimp_pattern_get_new_preview (GimpViewable  *viewable,
-                                                GimpContext   *context,
-                                                gint           width,
-                                                gint           height);
-static gchar    * gimp_pattern_get_description (GimpViewable  *viewable,
-                                                gchar        **tooltip);
-static gchar    * gimp_pattern_get_extension   (GimpData      *data);
-static GimpData * gimp_pattern_duplicate       (GimpData      *data);
+static gboolean      gimp_pattern_get_size        (GimpViewable  *viewable,
+                                                   gint          *width,
+                                                   gint          *height);
+static TempBuf     * gimp_pattern_get_new_preview (GimpViewable  *viewable,
+                                                   GimpContext   *context,
+                                                   gint           width,
+                                                   gint           height);
+static gchar       * gimp_pattern_get_description (GimpViewable  *viewable,
+                                                   gchar        **tooltip);
 
-static gchar    * gimp_pattern_get_checksum    (GimpTagged    *tagged);
+static const gchar * gimp_pattern_get_extension   (GimpData      *data);
+static GimpData    * gimp_pattern_duplicate       (GimpData      *data);
 
+static gchar       * gimp_pattern_get_checksum    (GimpTagged    *tagged);
 
 G_DEFINE_TYPE_WITH_CODE (GimpPattern, gimp_pattern, GIMP_TYPE_DATA,
                          G_IMPLEMENT_INTERFACE (GIMP_TYPE_TAGGED,
@@ -172,7 +172,7 @@
                           pattern->mask->height);
 }
 
-static gchar *
+static const gchar *
 gimp_pattern_get_extension (GimpData *data)
 {
   return GIMP_PATTERN_FILE_EXTENSION;

Modified: branches/soc-2008-tagging/app/core/gimppatternclipboard.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppatternclipboard.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppatternclipboard.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimppickable.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimppickable.c	(original)
+++ branches/soc-2008-tagging/app/core/gimppickable.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpprojection-construct.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpprojection-construct.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpprojection-construct.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
@@ -29,7 +29,6 @@
 
 #include "paint-funcs/paint-funcs.h"
 
-#include "gimpdrawable.h"
 #include "gimpimage.h"
 #include "gimpimage-colormap.h"
 #include "gimplayer.h"
@@ -42,6 +41,11 @@
 
 /*  local function prototypes  */
 
+static void   gimp_projection_construct_gegl     (GimpProjection *proj,
+                                                  gint            x,
+                                                  gint            y,
+                                                  gint            w,
+                                                  gint            h);
 static void   gimp_projection_construct_layers   (GimpProjection *proj,
                                                   gint            x,
                                                   gint            y,
@@ -102,8 +106,7 @@
     {
       GimpDrawable *layer;
 
-      layer = GIMP_DRAWABLE (gimp_container_get_child_by_index (image->layers,
-                                                                0));
+      layer = GIMP_DRAWABLE (gimp_image_get_layer_by_index (image, 0));
 
       if (gimp_drawable_has_alpha (layer)                         &&
           (gimp_item_get_visible (GIMP_ITEM (layer)))             &&
@@ -140,8 +143,6 @@
     }
 #endif
 
-  proj->construct_flag = FALSE;
-
   /*  First, determine if the projection image needs to be
    *  initialized--this is the case when there are no visible
    *  layers that cover the entire canvas--either because layers
@@ -152,14 +153,48 @@
   /*  call functions which process the list of layers and
    *  the list of channels
    */
-  gimp_projection_construct_layers (proj, x, y, w, h);
-  gimp_projection_construct_channels (proj, x, y, w, h);
+  if (proj->use_gegl)
+    {
+      gimp_projection_construct_gegl (proj, x, y, w, h);
+    }
+  else
+    {
+      proj->construct_flag = FALSE;
+
+      gimp_projection_construct_layers (proj, x, y, w, h);
+      gimp_projection_construct_channels (proj, x, y, w, h);
+    }
 }
 
 
 /*  private functions  */
 
 static void
+gimp_projection_construct_gegl (GimpProjection *proj,
+                                gint            x,
+                                gint            y,
+                                gint            w,
+                                gint            h)
+{
+  GeglNode      *sink;
+  GeglProcessor *processor;
+  GeglRectangle  rect;
+
+  sink = gimp_projection_get_sink_node (proj);
+
+  rect.x      = x;
+  rect.y      = y;
+  rect.width  = w;
+  rect.height = h;
+
+  processor = gegl_node_new_processor (sink, &rect);
+
+  while (gegl_processor_work (processor, NULL));
+
+  g_object_unref (processor);
+}
+
+static void
 gimp_projection_construct_layers (GimpProjection *proj,
                                   gint            x,
                                   gint            y,
@@ -337,9 +372,9 @@
  * @w:
  * @h:
  *
- * This function determines whether a visible layer with combine mode Normal
- * provides complete coverage over the specified area.  If not, the projection
- * is initialized to transparent black.
+ * This function determines whether a visible layer with combine mode
+ * Normal provides complete coverage over the specified area.  If not,
+ * the projection is initialized to transparent black.
  */
 static void
 gimp_projection_initialize (GimpProjection *proj,
@@ -363,6 +398,7 @@
 
       if (gimp_item_get_visible (item)                                  &&
           ! gimp_drawable_has_alpha (GIMP_DRAWABLE (item))              &&
+          ! gimp_layer_get_mask (GIMP_LAYER (item))                     &&
           gimp_layer_get_mode (GIMP_LAYER (item)) == GIMP_NORMAL_MODE   &&
           (off_x <= x)                                                  &&
           (off_y <= y)                                                  &&
@@ -376,12 +412,11 @@
 
   if (! coverage)
     {
-      PixelRegion PR;
-      guchar      clear[4] = { 0, 0, 0, 0 };
+      PixelRegion region;
 
-      pixel_region_init (&PR, gimp_projection_get_tiles (proj),
-                         x, y, w, h, TRUE);
-      color_region (&PR, clear);
+      pixel_region_init (&region,
+                         gimp_projection_get_tiles (proj), x, y, w, h, TRUE);
+      clear_region (&region);
     }
 }
 

Modified: branches/soc-2008-tagging/app/core/gimpprojection.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpprojection.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpprojection.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -46,6 +46,13 @@
 };
 
 
+#ifdef __GNUC__
+#warning FIXME: gegl_node_add_child() needs to be public
+#endif
+GeglNode * gegl_node_add_child (GeglNode *self,
+                                GeglNode *child);
+
+
 /*  local function prototypes  */
 
 static void   gimp_projection_pickable_iface_init (GimpPickableInterface *iface);
@@ -185,6 +192,13 @@
       proj->pyramid = NULL;
     }
 
+  if (proj->graph)
+    {
+      g_object_unref (proj->graph);
+      proj->graph     = NULL;
+      proj->sink_node = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -317,6 +331,38 @@
 
 }
 
+GeglNode *
+gimp_projection_get_sink_node (GimpProjection *proj)
+{
+  GeglNode *image_graph;
+
+  g_return_val_if_fail (GIMP_IS_PROJECTION (proj), NULL);
+
+  if (proj->sink_node)
+    return proj->sink_node;
+
+  proj->graph = gegl_node_new ();
+
+  g_object_set (proj->graph,
+                "dont-cache", TRUE,
+                NULL);
+
+  image_graph = gimp_image_get_graph (proj->image);
+  gegl_node_add_child (proj->graph, image_graph);
+
+  proj->sink_node =
+    gegl_node_new_child (proj->graph,
+                         "operation",    "gimp-tilemanager-sink",
+                         "tile-manager", gimp_projection_get_tiles (proj),
+                         "linear",       TRUE,
+                         NULL);
+
+  gegl_node_connect_to (image_graph,     "output",
+                        proj->sink_node, "input");
+
+  return proj->sink_node;
+}
+
 TileManager *
 gimp_projection_get_tiles_at_level (GimpProjection *proj,
                                     gint            level,
@@ -333,6 +379,15 @@
       tile_pyramid_set_validate_proc (proj->pyramid,
                                       (TileValidateProc) gimp_projection_validate_tile,
                                       proj);
+
+      if (proj->sink_node)
+        {
+          TileManager *tiles = tile_pyramid_get_tiles (proj->pyramid, 0, NULL);
+
+          gegl_node_set (proj->sink_node,
+                         "tile-manager", tiles,
+                         NULL);
+        }
     }
 
   return tile_pyramid_get_tiles (proj->pyramid, level, is_premult);

Modified: branches/soc-2008-tagging/app/core/gimpprojection.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpprojection.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpprojection.h	Sun Oct 12 15:38:02 2008
@@ -56,12 +56,16 @@
   GimpImage                *image;
 
   TilePyramid              *pyramid;
+  GeglNode                 *graph;
+  GeglNode                 *sink_node;
 
   GSList                   *update_areas;
   GimpProjectionIdleRender  idle_render;
 
   gboolean                  construct_flag;
   gboolean                  invalidate_preview;
+
+  gboolean                  use_gegl;
 };
 
 struct _GimpProjectionClass
@@ -82,6 +86,7 @@
 GimpProjection * gimp_projection_new              (GimpImage            *image);
 
 TileManager    * gimp_projection_get_tiles        (GimpProjection       *proj);
+GeglNode       * gimp_projection_get_sink_node    (GimpProjection       *proj);
 
 TileManager    * gimp_projection_get_tiles_at_level
                                                   (GimpProjection       *proj,

Modified: branches/soc-2008-tagging/app/core/gimpsamplepointundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpsamplepointundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpsamplepointundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpselection.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpselection.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpselection.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 
@@ -587,7 +587,7 @@
   /*  saved selections are not visible by default  */
   gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
 
-  gimp_image_add_channel (image, new_channel, -1);
+  gimp_image_add_channel (image, new_channel, -1, TRUE);
 
   return new_channel;
 }
@@ -766,7 +766,8 @@
               if (gimp_layer_is_floating_sel (GIMP_LAYER (pickable)))
                 floating_sel_remove (GIMP_LAYER (pickable));
               else
-                gimp_image_remove_layer (image, GIMP_LAYER (pickable));
+                gimp_image_remove_layer (image, GIMP_LAYER (pickable),
+                                         TRUE, NULL);
             }
           else if (GIMP_IS_LAYER_MASK (pickable))
             {
@@ -775,7 +776,8 @@
             }
           else if (GIMP_IS_CHANNEL (pickable))
             {
-              gimp_image_remove_channel (image, GIMP_CHANNEL (pickable));
+              gimp_image_remove_channel (image, GIMP_CHANNEL (pickable),
+                                         TRUE, NULL);
             }
         }
     }

Modified: branches/soc-2008-tagging/app/core/gimptemplate.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimptemplate.c	(original)
+++ branches/soc-2008-tagging/app/core/gimptemplate.c	Sun Oct 12 15:38:02 2008
@@ -23,7 +23,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpconfig/gimpconfig.h"
@@ -112,12 +112,14 @@
                                        "xresolution",
                                        N_("The horizontal image resolution."),
                                        DEFAULT_RESOLUTION,
-                                       GIMP_PARAM_STATIC_STRINGS);
+                                       GIMP_PARAM_STATIC_STRINGS |
+                                       GIMP_TEMPLATE_PARAM_COPY_FIRST);
   GIMP_CONFIG_INSTALL_PROP_RESOLUTION (object_class, PROP_YRESOLUTION,
                                        "yresolution",
                                        N_("The vertical image resolution."),
                                        DEFAULT_RESOLUTION,
-                                       GIMP_PARAM_STATIC_STRINGS);
+                                       GIMP_PARAM_STATIC_STRINGS |
+                                       GIMP_TEMPLATE_PARAM_COPY_FIRST);
   GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_RESOLUTION_UNIT,
                                  "resolution-unit",
                                  NULL,
@@ -406,7 +408,7 @@
   gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
                               context, template->fill_type);
 
-  gimp_image_add_layer (image, layer, 0);
+  gimp_image_add_layer (image, layer, 0, FALSE);
 
   gimp_image_undo_enable (image);
   gimp_image_clean_all (image);

Modified: branches/soc-2008-tagging/app/core/gimptemplate.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimptemplate.h	(original)
+++ branches/soc-2008-tagging/app/core/gimptemplate.h	Sun Oct 12 15:38:02 2008
@@ -26,6 +26,8 @@
 #include "gimpviewable.h"
 
 
+#define GIMP_TEMPLATE_PARAM_COPY_FIRST (1 << (8 + G_PARAM_USER_SHIFT))
+
 /*  The default image aspect ratio is the golden mean. We use
  *  two adjacent fibonacci numbers for the unstable series and
  *  some less odd values for the stable version.

Modified: branches/soc-2008-tagging/app/core/gimpundo.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpundo.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpundo.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <time.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/core/gimpundo.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpundo.h	(original)
+++ branches/soc-2008-tagging/app/core/gimpundo.h	Sun Oct 12 15:38:02 2008
@@ -26,12 +26,19 @@
 struct _GimpUndoAccumulator
 {
   gboolean mode_changed;
+
   gboolean size_changed;
-  gdouble  previous_origin_x;
-  gdouble  previous_origin_y;
+  gint     previous_origin_x;
+  gint     previous_origin_y;
+  gint     previous_width;
+  gint     previous_height;
+
   gboolean resolution_changed;
+
   gboolean unit_changed;
+
   gboolean quick_mask_changed;
+
   gboolean alpha_changed;
 };
 

Modified: branches/soc-2008-tagging/app/core/gimpundostack.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpundostack.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpundostack.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core-types.h"
 

Modified: branches/soc-2008-tagging/app/core/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/core/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/core/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -33,7 +33,7 @@
 OBJECTS = \
 	core-enums.obj \
 	gimp-contexts.obj \
-	gimp-documents.obj \
+#	gimp-documents.obj \
 	gimp-edit.obj \
 	gimp-gradients.obj \
 	gimp-gui.obj \
@@ -174,6 +174,18 @@
 	gimpundostack.obj \
 	gimpunit.obj \
 	gimpviewable.obj \
+	gimpcurve-map.obj \
+	gimpdrawable-brightness-contrast.obj \
+	gimpdrawable-color-balance.obj \
+	gimpdrawable-colorize.obj \
+	gimpdrawable-curves.obj \
+	gimpdrawable-hue-saturation.obj \
+	gimpdrawable-posterize.obj \
+	gimpdrawable-process.obj \
+	gimpdrawable-shadow.obj \
+	gimpdrawable-threshold.obj \
+	gimpimagemapconfig.obj \
+	gimptagged.obj \
 
 OTHER_FILES = \
 	\
@@ -197,8 +209,8 @@
 
 DEFINES = \
 	-DGIMP_COMPILATION \
-	-DGIMP_APP_VERSION=\"2.4\" \
-	-DG_LOG_DOMAIN=\"Gimp-Core\"
+	-DG_LOG_DOMAIN=\"Gimp-Core\" \
+	$(GIMP_VERSION_DEFINES)
 
 all : \
 	$(PRJ_TOP)\config.h \

Modified: branches/soc-2008-tagging/app/dialogs/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/dialogs/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -8,6 +8,7 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GTK_CFLAGS)		\
 	-I$(includedir)
 

Modified: branches/soc-2008-tagging/app/dialogs/about-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/about-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/about-dialog.c	Sun Oct 12 15:38:02 2008
@@ -46,21 +46,21 @@
 
 typedef struct
 {
-  GtkWidget    *dialog;
+  GtkWidget   *dialog;
 
-  GtkWidget    *anim_area;
-  PangoLayout  *layout;
+  GtkWidget   *anim_area;
+  PangoLayout *layout;
 
-  gint          n_authors;
-  gint          shuffle[G_N_ELEMENTS (authors) - 1];  /* NULL terminated */
+  gint         n_authors;
+  gint         shuffle[G_N_ELEMENTS (authors) - 1];  /* NULL terminated */
 
-  guint         timer;
+  guint        timer;
 
-  gint          index;
-  gint          animstep;
-  gint          textrange[2];
-  gint          state;
-  gboolean      visible;
+  gint         index;
+  gint         animstep;
+  gint         textrange[2];
+  gint         state;
+  gboolean     visible;
 } GimpAboutDialog;
 
 
@@ -124,9 +124,7 @@
                              "authors",            authors,
                              "artists",            artists,
                              "documenters",        documenters,
-                             /* Translators: insert your names here,
-                              * separated by newline
-                              */
+                             /* Translators: insert your names here, separated by newline */
                              "translator-credits", _("translator-credits"),
                              NULL);
 
@@ -219,7 +217,11 @@
   gchar     *filename;
 
   filename = g_build_filename (gimp_data_directory (), "images",
+#ifdef GIMP_UNSTABLE
+                               "gimp-devel-logo.png",
+#else
                                "gimp-logo.png",
+#endif
                                NULL);
 
   pixbuf = gdk_pixbuf_new_from_file (filename, NULL);

Modified: branches/soc-2008-tagging/app/dialogs/authors.xsl
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/authors.xsl	(original)
+++ branches/soc-2008-tagging/app/dialogs/authors.xsl	Sun Oct 12 15:38:02 2008
@@ -10,7 +10,7 @@
 
   <xsl:template name="recent-contributor">
     <xsl:param name="role" />
-    <xsl:apply-templates select="dc:contributor[contains(@role, $role) and number(@last-active) >= 2.4]" />
+    <xsl:apply-templates select="dc:contributor[contains(@role, $role) and number(@last-active) >= 2.6]" />
   </xsl:template>
 
   <xsl:template match="/dc:gimp-authors">

Modified: branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/dialogs/convert-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/convert-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/convert-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/dialogs-constructors.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/dialogs-constructors.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/dialogs-constructors.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/dialogs.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/dialogs.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/dialogs.c	Sun Oct 12 15:38:02 2008
@@ -168,7 +168,7 @@
             GIMP_HELP_TOOLS_DIALOG, GIMP_VIEW_SIZE_SMALL),
   LISTGRID (buffer, N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
             GIMP_HELP_BUFFER_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
-  LISTGRID (document, N_("History"), N_("Document History"), GTK_STOCK_OPEN,
+  LISTGRID (document, N_("History"), N_("Document History"), "document-open-recent",
             GIMP_HELP_DOCUMENT_DIALOG, GIMP_VIEW_SIZE_LARGE),
   LISTGRID (template, N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE,
             GIMP_HELP_TEMPLATE_DIALOG, GIMP_VIEW_SIZE_SMALL),
@@ -249,26 +249,30 @@
   global_dialog_factory = gimp_dialog_factory_new ("toplevel",
                                                    gimp_get_user_context (gimp),
                                                    menu_factory,
-                                                   NULL);
+                                                   NULL,
+                                                   TRUE);
 
   global_toolbox_factory = gimp_dialog_factory_new ("toolbox",
                                                     gimp_get_user_context (gimp),
                                                     menu_factory,
-                                                    dialogs_toolbox_get);
+                                                    dialogs_toolbox_get,
+                                                    TRUE);
   gimp_dialog_factory_set_constructor (global_toolbox_factory,
                                        dialogs_dockable_constructor);
 
   global_dock_factory = gimp_dialog_factory_new ("dock",
                                                  gimp_get_user_context (gimp),
                                                  menu_factory,
-                                                 dialogs_dock_new);
+                                                 dialogs_dock_new,
+                                                 TRUE);
   gimp_dialog_factory_set_constructor (global_dock_factory,
                                        dialogs_dockable_constructor);
 
   global_display_factory = gimp_dialog_factory_new ("display",
                                                     gimp_get_user_context (gimp),
                                                     menu_factory,
-                                                    NULL);
+                                                    NULL,
+                                                    FALSE);
 
   for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++)
     gimp_dialog_factory_register_entry (global_dialog_factory,

Modified: branches/soc-2008-tagging/app/dialogs/fade-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/fade-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/fade-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/dialogs/file-open-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/file-open-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/file-open-dialog.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -49,7 +50,7 @@
 static void       file_open_dialog_response    (GtkWidget           *open_dialog,
                                                 gint                 response_id,
                                                 Gimp                *gimp);
-static gboolean   file_open_dialog_open_image  (GtkWidget           *open_dialog,
+static GimpImage *file_open_dialog_open_image  (GtkWidget           *open_dialog,
                                                 Gimp                *gimp,
                                                 const gchar         *uri,
                                                 const gchar         *entered_filename,
@@ -138,13 +139,24 @@
             continue;
         }
 
-      if (dialog->image)
+      if (dialog->open_as_layers)
         {
-          if (file_open_dialog_open_layers (open_dialog,
-                                            dialog->image,
-                                            list->data,
-                                            list->data,
-                                            dialog->file_proc))
+          if (! dialog->image)
+            {
+              dialog->image = file_open_dialog_open_image (open_dialog,
+                                                           gimp,
+                                                           list->data,
+                                                           list->data,
+                                                           dialog->file_proc);
+
+              if (dialog->image)
+                success = TRUE;
+            }
+          else if (file_open_dialog_open_layers (open_dialog,
+                                                 dialog->image,
+                                                 list->data,
+                                                 list->data,
+                                                 dialog->file_proc))
             {
               success = TRUE;
             }
@@ -169,7 +181,7 @@
 
   if (success)
     {
-      if (dialog->image)
+      if (dialog->open_as_layers && dialog->image)
         gimp_image_flush (dialog->image);
 
       gtk_widget_destroy (open_dialog);
@@ -183,7 +195,7 @@
   g_slist_free (uris);
 }
 
-static gboolean
+static GimpImage *
 file_open_dialog_open_image (GtkWidget           *open_dialog,
                              Gimp                *gimp,
                              const gchar         *uri,
@@ -201,11 +213,7 @@
                                            load_proc,
                                            &status, &error);
 
-  if (image)
-    {
-      return TRUE;
-    }
-  else if (status != GIMP_PDB_CANCEL)
+  if (! image && status != GIMP_PDB_CANCEL)
     {
       gchar *filename = file_utils_uri_display_name (uri);
 
@@ -216,7 +224,7 @@
       g_free (filename);
     }
 
-  return FALSE;
+  return image;
 }
 
 static gboolean
@@ -247,8 +255,6 @@
 
       g_list_free (new_layers);
 
-      gimp_image_flush (image);
-
       return TRUE;
     }
   else if (status != GIMP_PDB_CANCEL)

Modified: branches/soc-2008-tagging/app/dialogs/file-save-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/file-save-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/file-save-dialog.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/grid-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/grid-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/grid-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/dialogs/image-merge-layers-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/image-merge-layers-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/image-merge-layers-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/image-new-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/image-new-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/image-new-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -245,6 +246,9 @@
   if (!template->comment || !strlen (template->comment))
     comment = g_strdup (dialog->template->comment);
 
+  /*  make sure the resolution values are copied first (see bug #546924)  */
+  gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
+                    GIMP_TEMPLATE_PARAM_COPY_FIRST);
   gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0);
 
   if (comment)

Modified: branches/soc-2008-tagging/app/dialogs/image-properties-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/image-properties-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/image-properties-dialog.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/image-scale-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/image-scale-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/image-scale-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -171,7 +172,7 @@
       break;
 
     case GIMP_IMAGE_SCALE_OK:
-      /* If all is well, return directly after scaling image. */
+      gtk_widget_hide (widget);
       dialog->callback (dialog->dialog,
                         GIMP_VIEWABLE (dialog->image),
                         dialog->width,
@@ -275,6 +276,7 @@
 
   if (response_id == GTK_RESPONSE_OK)
     {
+      gtk_widget_hide (dialog->dialog);
       dialog->callback (dialog->dialog,
                         GIMP_VIEWABLE (dialog->image),
                         dialog->width,

Modified: branches/soc-2008-tagging/app/dialogs/keyboard-shortcuts-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/keyboard-shortcuts-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/keyboard-shortcuts-dialog.c	Sun Oct 12 15:38:02 2008
@@ -26,7 +26,7 @@
 
 #include "core/gimp.h"
 
-#include "widgets/gimpactionview.h"
+#include "widgets/gimpactioneditor.h"
 #include "widgets/gimphelp-ids.h"
 #include "widgets/gimpuimanager.h"
 
@@ -40,8 +40,7 @@
 {
   GtkWidget *dialog;
   GtkWidget *vbox;
-  GtkWidget *scrolled_window;
-  GtkWidget *view;
+  GtkWidget *editor;
   GtkWidget *box;
   GtkWidget *button;
 
@@ -66,19 +65,10 @@
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
   gtk_widget_show (vbox);
 
-  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
-                                  GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
-                                       GTK_SHADOW_IN);
-  gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0);
-  gtk_widget_show (scrolled_window);
-
-  view = gimp_action_view_new (gimp_ui_managers_from_name ("<Image>")->data,
-                               NULL, TRUE);
-  gtk_widget_set_size_request (view, 300, 400);
-  gtk_container_add (GTK_CONTAINER (scrolled_window), view);
-  gtk_widget_show (view);
+  editor = gimp_action_editor_new (gimp_ui_managers_from_name ("<Image>")->data,
+                                   NULL, TRUE);
+  gtk_box_pack_start (GTK_BOX (vbox), editor, TRUE, TRUE, 0);
+  gtk_widget_show (editor);
 
   box = gimp_hint_box_new (_("To edit a shortcut key, click on the "
                              "corresponding row and type a new "
@@ -88,7 +78,7 @@
   gtk_widget_show (box);
 
   button = gimp_prop_check_button_new (G_OBJECT (gimp->config), "save-accels",
-                                       _("_Save keyboard shortcuts on exit"));
+                                       _("S_ave keyboard shortcuts on exit"));
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 

Modified: branches/soc-2008-tagging/app/dialogs/layer-add-mask-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/layer-add-mask-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/layer-add-mask-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -150,7 +151,7 @@
 
       /*  The size sizeentry  */
       spinbutton = gimp_spin_button_new (&adjustment,
-                                         1, 1, 1, 1, 10, 1,
+                                         1, 1, 1, 1, 10, 0,
                                          1, 2);
       gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
 

Modified: branches/soc-2008-tagging/app/dialogs/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/dialogs/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -27,7 +27,6 @@
 	about-dialog.obj \
 	channel-options-dialog.obj \
 	convert-dialog.obj \
-	desaturate-dialog.obj \
 	dialogs-constructors.obj \
 	dialogs.obj \
 	fade-dialog.obj \

Modified: branches/soc-2008-tagging/app/dialogs/offset-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/offset-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/offset-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -162,7 +163,7 @@
   gtk_widget_show (vbox);
 
   spinbutton = gimp_spin_button_new (&adjustment,
-                                     1, 1, 1, 1, 10, 1,
+                                     1, 1, 1, 1, 10, 0,
                                      1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
 

Modified: branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/dialogs/print-size-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/print-size-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/print-size-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/dialogs/resize-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/resize-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/resize-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -204,7 +205,7 @@
 
   /*  the offset sizeentry  */
   spinbutton = gimp_spin_button_new (&adjustment,
-                                     1, 1, 1, 1, 10, 1,
+                                     1, 1, 1, 1, 10, 0,
                                      1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH);
 

Modified: branches/soc-2008-tagging/app/dialogs/resolution-calibrate-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/resolution-calibrate-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/resolution-calibrate-dialog.c	Sun Oct 12 15:38:02 2008
@@ -105,14 +105,14 @@
       gtk_widget_show (image);
     }
 
-  ruler = gimp_hruler_new ();
+  ruler = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL);
   gtk_widget_set_size_request (ruler, ruler_width, 32);
   gimp_ruler_set_range (GIMP_RULER (ruler), 0, ruler_width, ruler_width);
   gtk_table_attach (GTK_TABLE (table), ruler, 1, 3, 0, 1,
                     GTK_SHRINK, GTK_SHRINK, 0, 0);
   gtk_widget_show (ruler);
 
-  ruler = gimp_vruler_new ();
+  ruler = gimp_ruler_new (GTK_ORIENTATION_VERTICAL);
   gtk_widget_set_size_request (ruler, 32, ruler_height);
   gimp_ruler_set_range (GIMP_RULER (ruler), 0, ruler_height, ruler_height);
   gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 3,

Modified: branches/soc-2008-tagging/app/dialogs/scale-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/scale-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/scale-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/stroke-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/stroke-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/stroke-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpconfig/gimpconfig.h"

Modified: branches/soc-2008-tagging/app/dialogs/tips-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/tips-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/tips-dialog.c	Sun Oct 12 15:38:02 2008
@@ -188,7 +188,7 @@
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
-  
+
   more_button = gtk_link_button_new_with_label ("http://docs.gimp.org/";,
   /*  a link to the related section in the user manual  */
                                                 _("Learn more"));

Modified: branches/soc-2008-tagging/app/dialogs/vectors-export-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/vectors-export-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/vectors-export-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/vectors-import-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/vectors-import-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/vectors-import-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/dialogs/vectors-options-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/vectors-options-dialog.c	(original)
+++ branches/soc-2008-tagging/app/dialogs/vectors-options-dialog.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/display/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/display/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/display/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Display\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GTK_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappdisplay.a
 
 libappdisplay_a_sources = \
@@ -74,18 +86,6 @@
 	$(libappdisplay_a_built_sources)	\
 	$(libappdisplay_a_sources)
 
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Display\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GTK_CFLAGS)		\
-	$(GEGL_CFLAGS)		\
-	-I$(includedir)
-
 EXTRA_DIST = makefile.msc
 
 #

Modified: branches/soc-2008-tagging/app/display/display-enums.c
==============================================================================
--- branches/soc-2008-tagging/app/display/display-enums.c	(original)
+++ branches/soc-2008-tagging/app/display/display-enums.c	Sun Oct 12 15:38:02 2008
@@ -39,6 +39,36 @@
 }
 
 GType
+gimp_cursor_precision_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_CURSOR_PRECISION_PIXEL_CENTER, "GIMP_CURSOR_PRECISION_PIXEL_CENTER", "pixel-center" },
+    { GIMP_CURSOR_PRECISION_PIXEL_BORDER, "GIMP_CURSOR_PRECISION_PIXEL_BORDER", "pixel-border" },
+    { GIMP_CURSOR_PRECISION_SUBPIXEL, "GIMP_CURSOR_PRECISION_SUBPIXEL", "subpixel" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_CURSOR_PRECISION_PIXEL_CENTER, "GIMP_CURSOR_PRECISION_PIXEL_CENTER", NULL },
+    { GIMP_CURSOR_PRECISION_PIXEL_BORDER, "GIMP_CURSOR_PRECISION_PIXEL_BORDER", NULL },
+    { GIMP_CURSOR_PRECISION_SUBPIXEL, "GIMP_CURSOR_PRECISION_SUBPIXEL", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpCursorPrecision", values);
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_canvas_padding_mode_get_type (void)
 {
   static const GEnumValue values[] =
@@ -128,6 +158,36 @@
   return type;
 }
 
+GType
+gimp_zoom_focus_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", "best-guess" },
+    { GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", "pointer" },
+    { GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", "image-center" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", NULL },
+    { GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", NULL },
+    { GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpZoomFocus", values);
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
 
 /* Generated data ends here */
 

Modified: branches/soc-2008-tagging/app/display/display-enums.h
==============================================================================
--- branches/soc-2008-tagging/app/display/display-enums.h	(original)
+++ branches/soc-2008-tagging/app/display/display-enums.h	Sun Oct 12 15:38:02 2008
@@ -32,6 +32,18 @@
 } GimpCursorMode;
 
 
+#define GIMP_TYPE_CURSOR_PRECISION (gimp_cursor_precision_get_type ())
+
+GType gimp_cursor_precision_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_CURSOR_PRECISION_PIXEL_CENTER,
+  GIMP_CURSOR_PRECISION_PIXEL_BORDER,
+  GIMP_CURSOR_PRECISION_SUBPIXEL
+} GimpCursorPrecision;
+
+
 #define GIMP_TYPE_CANVAS_PADDING_MODE (gimp_canvas_padding_mode_get_type ())
 
 GType gimp_canvas_padding_mode_get_type (void) G_GNUC_CONST;
@@ -69,4 +81,16 @@
 } GimpZoomQuality;
 
 
+#define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ())
+
+GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_ZOOM_FOCUS_BEST_GUESS,    /* Make a best guess                       */
+  GIMP_ZOOM_FOCUS_POINTER,       /* Use the mouse cursor (if within canvas) */
+  GIMP_ZOOM_FOCUS_IMAGE_CENTER   /* Use the image center                    */
+} GimpZoomFocus;
+
+
 #endif /* __DISPLAY_ENUMS_H__ */

Modified: branches/soc-2008-tagging/app/display/gimpcanvas.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpcanvas.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpcanvas.c	Sun Oct 12 15:38:02 2008
@@ -56,6 +56,8 @@
 
 static void    gimp_canvas_realize       (GtkWidget       *widget);
 static void    gimp_canvas_unrealize     (GtkWidget       *widget);
+static void    gimp_canvas_size_allocate (GtkWidget       *widget,
+                                          GtkAllocation   *allocation);
 static void    gimp_canvas_style_set     (GtkWidget       *widget,
                                           GtkStyle        *prev_style);
 
@@ -63,7 +65,7 @@
                                          GimpCanvasStyle  style);
 
 
-G_DEFINE_TYPE (GimpCanvas, gimp_canvas, GTK_TYPE_DRAWING_AREA)
+G_DEFINE_TYPE (GimpCanvas, gimp_canvas, GTK_TYPE_CONTAINER)
 
 #define parent_class gimp_canvas_parent_class
 
@@ -159,12 +161,13 @@
   GObjectClass   *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->set_property = gimp_canvas_set_property;
-  object_class->get_property = gimp_canvas_get_property;
+  object_class->set_property  = gimp_canvas_set_property;
+  object_class->get_property  = gimp_canvas_get_property;
 
-  widget_class->realize      = gimp_canvas_realize;
-  widget_class->unrealize    = gimp_canvas_unrealize;
-  widget_class->style_set    = gimp_canvas_style_set;
+  widget_class->realize       = gimp_canvas_realize;
+  widget_class->unrealize     = gimp_canvas_unrealize;
+  widget_class->size_allocate = gimp_canvas_size_allocate;
+  widget_class->style_set     = gimp_canvas_style_set;
 
   g_object_class_install_property (object_class, PROP_CONFIG,
                                    g_param_spec_object ("config", NULL, NULL,
@@ -176,7 +179,12 @@
 static void
 gimp_canvas_init (GimpCanvas *canvas)
 {
-  gint i;
+  GtkWidget *widget = GTK_WIDGET (canvas);
+  gint       i;
+
+  GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+
+  gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
 
   for (i = 0; i < GIMP_CANVAS_NUM_STYLES; i++)
     canvas->gc[i] = NULL;
@@ -226,9 +234,31 @@
 static void
 gimp_canvas_realize (GtkWidget *widget)
 {
-  GimpCanvas *canvas = GIMP_CANVAS (widget);
+  GimpCanvas    *canvas = GIMP_CANVAS (widget);
+  GdkWindowAttr  attributes;
+  gint           attributes_mask;
+
+  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+
+  attributes.x           = widget->allocation.x;
+  attributes.y           = widget->allocation.y;
+  attributes.width       = widget->allocation.width;
+  attributes.height      = widget->allocation.height;
+  attributes.window_type = GDK_WINDOW_CHILD;
+  attributes.wclass      = GDK_INPUT_OUTPUT;
+  attributes.visual      = gtk_widget_get_visual (widget);
+  attributes.colormap    = gtk_widget_get_colormap (widget);
+  attributes.event_mask  = (gtk_widget_get_events (widget) |
+                            GIMP_CANVAS_EVENT_MASK);
+
+  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+
+  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
+                                   &attributes, attributes_mask);
+  gdk_window_set_user_data (widget->window, widget);
 
-  GTK_WIDGET_CLASS (parent_class)->realize (widget);
+  widget->style = gtk_style_attach (widget->style, widget->window);
+  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
 
   canvas->stipple[0] =
     gdk_bitmap_create_from_data (widget->window,
@@ -269,6 +299,18 @@
 }
 
 static void
+gimp_canvas_size_allocate (GtkWidget     *widget,
+                           GtkAllocation *allocation)
+{
+  widget->allocation = *allocation;
+
+  if (GTK_WIDGET_REALIZED (widget))
+    gdk_window_move_resize (widget->window,
+                            allocation->x, allocation->y,
+                            allocation->width, allocation->height);
+}
+
+static void
 gimp_canvas_style_set (GtkWidget *widget,
                        GtkStyle  *prev_style)
 {
@@ -503,6 +545,32 @@
 }
 
 /**
+ * gimp_canvas_scroll:
+ * @canvas: the #GimpCanvas widget to scroll.
+ * @offset_x: the x scroll amount.
+ * @offset_y: the y scroll amount.
+ *
+ * Scrolls the canvas using gdk_window_scroll() and makes sure the result
+ * is displayed immediately by calling gdk_window_process_updates().
+ **/
+void
+gimp_canvas_scroll (GimpCanvas *canvas,
+                    gint        offset_x,
+                    gint        offset_y)
+{
+  GtkWidget *widget;
+
+  g_return_if_fail (GIMP_IS_CANVAS (canvas));
+
+  widget = GTK_WIDGET (canvas);
+
+  gdk_window_scroll (widget->window, offset_x, offset_y);
+
+  /*  Make sure expose events are processed before scrolling again  */
+  gdk_window_process_updates (widget->window, FALSE);
+}
+
+/**
  * gimp_canvas_draw_cursor:
  * @canvas: the #GimpCanvas widget to draw on.
  * @x: x coordinate

Modified: branches/soc-2008-tagging/app/display/gimpcanvas.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpcanvas.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpcanvas.h	Sun Oct 12 15:38:02 2008
@@ -42,6 +42,18 @@
 
 
 #define GIMP_CANVAS_NUM_STIPPLES  8
+#define GIMP_CANVAS_EVENT_MASK   (GDK_EXPOSURE_MASK            | \
+                                  GDK_POINTER_MOTION_MASK      |  \
+                                  GDK_POINTER_MOTION_HINT_MASK |  \
+                                  GDK_BUTTON_PRESS_MASK        |  \
+                                  GDK_BUTTON_RELEASE_MASK      |  \
+                                  GDK_STRUCTURE_MASK           |  \
+                                  GDK_ENTER_NOTIFY_MASK        |  \
+                                  GDK_LEAVE_NOTIFY_MASK        |  \
+                                  GDK_FOCUS_CHANGE_MASK        |  \
+                                  GDK_KEY_PRESS_MASK           |  \
+                                  GDK_KEY_RELEASE_MASK         |  \
+                                  GDK_PROXIMITY_OUT_MASK)
 
 
 #define GIMP_TYPE_CANVAS            (gimp_canvas_get_type ())
@@ -56,7 +68,7 @@
 
 struct _GimpCanvas
 {
-  GtkDrawingArea     parent_instance;
+  GtkContainer       parent_instance;
 
   GimpDisplayConfig *config;
 
@@ -67,7 +79,7 @@
 
 struct _GimpCanvasClass
 {
-  GtkDrawingAreaClass  parent_class;
+  GtkContainerClass  parent_class;
 };
 
 
@@ -75,6 +87,10 @@
 
 GtkWidget  * gimp_canvas_new               (GimpDisplayConfig *config);
 
+void         gimp_canvas_scroll            (GimpCanvas        *canvas,
+                                            gint               offset_x,
+                                            gint               offset_y);
+
 void         gimp_canvas_draw_cursor       (GimpCanvas        *canvas,
                                             gint               x,
                                             gint               y);

Modified: branches/soc-2008-tagging/app/display/gimpdisplay-foreach.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplay-foreach.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplay-foreach.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "display-types.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplay-handlers.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplay-handlers.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplay-handlers.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "display-types.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplay.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplay.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplay.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c	Sun Oct 12 15:38:02 2008
@@ -130,14 +130,22 @@
 
   if (dx || dy)
     {
-      GimpDisplay *display     = shell->display;
-      GimpTool    *active_tool = tool_manager_get_active (display->gimp);
+      GimpDisplay *display         = shell->display;
+      GimpTool    *active_tool     = tool_manager_get_active (display->gimp);
+      gint         scroll_amount_x = AUTOSCROLL_DX * dx;
+      gint         scroll_amount_y = AUTOSCROLL_DX * dy;
 
       info->time += AUTOSCROLL_DT;
 
+      gimp_display_shell_scroll_unoverscrollify (shell,
+                                                 scroll_amount_x,
+                                                 scroll_amount_y,
+                                                 &scroll_amount_x,
+                                                 &scroll_amount_y);
+
       gimp_display_shell_scroll (shell,
-                                 AUTOSCROLL_DX * (gdouble) dx,
-                                 AUTOSCROLL_DX * (gdouble) dy);
+                                 scroll_amount_x,
+                                 scroll_amount_y);
 
       gimp_display_shell_untransform_coordinate (shell,
                                                  &device_coords,

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c	Sun Oct 12 15:38:02 2008
@@ -333,17 +333,17 @@
            */
           target_offset_x = shell->offset_x;
           target_offset_y = shell->offset_y;
- 
+
           if (! center_horizontally)
             {
               target_offset_x = MAX (shell->offset_x, 0);
             }
- 
+
           if (! center_vertically)
             {
               target_offset_y = MAX (shell->offset_y, 0);
             }
- 
+
           gimp_display_shell_scroll_set_offset (shell,
                                                 target_offset_x,
                                                 target_offset_y);
@@ -539,6 +539,46 @@
                                      shell->display);
 }
 
+static gboolean
+gimp_display_shell_canvas_no_image_events (GtkWidget        *canvas,
+                                           GdkEvent         *event,
+                                           GimpDisplayShell *shell)
+{
+  switch (event->type)
+    {
+    case GDK_BUTTON_PRESS:
+      {
+        GdkEventButton *bevent = (GdkEventButton *) event;
+
+        if (bevent->button == 3)
+          {
+            gimp_ui_manager_ui_popup (shell->popup_manager,
+                                      "/dummy-menubar/image-popup",
+                                      GTK_WIDGET (shell),
+                                      NULL, NULL, NULL, NULL);
+          }
+      }
+      break;
+
+    case GDK_KEY_PRESS:
+      {
+        GdkEventKey *kevent = (GdkEventKey *) event;
+
+        if (kevent->keyval == GDK_Tab ||
+            kevent->keyval == GDK_ISO_Left_Tab)
+          {
+            gimp_dialog_factories_toggle ();
+          }
+      }
+      break;
+
+    default:
+      break;
+    }
+
+  return TRUE;
+}
+
 gboolean
 gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
                                        GdkEvent         *event,
@@ -573,16 +613,7 @@
 
   if (! image)
     {
-      if (event->type == GDK_BUTTON_PRESS &&
-          ((GdkEventButton *) event)->button == 3)
-        {
-          gimp_ui_manager_ui_popup (shell->popup_manager,
-                                    "/dummy-menubar/image-popup",
-                                    GTK_WIDGET (shell),
-                                    NULL, NULL, NULL, NULL);
-        }
-
-      return TRUE;
+      return gimp_display_shell_canvas_no_image_events (canvas, event, shell);
     }
 
   gdk_display = gtk_widget_get_display (canvas);
@@ -1009,11 +1040,17 @@
             switch (direction)
               {
               case GDK_SCROLL_UP:
-                gimp_display_shell_scale (shell, GIMP_ZOOM_IN, 0.0);
+                gimp_display_shell_scale (shell,
+                                          GIMP_ZOOM_IN,
+                                          0.0,
+                                          GIMP_ZOOM_FOCUS_BEST_GUESS);
                 break;
 
               case GDK_SCROLL_DOWN:
-                gimp_display_shell_scale (shell, GIMP_ZOOM_OUT, 0.0);
+                gimp_display_shell_scale (shell,
+                                          GIMP_ZOOM_OUT,
+                                          0.0,
+                                          GIMP_ZOOM_FOCUS_BEST_GUESS);
                 break;
 
               default:
@@ -1137,15 +1174,8 @@
               }
           }
 
-        /* Ask for the pointer position, but ignore it except for cursor
-         * handling, so motion events sync with the button press/release events
-         */
-        if (mevent->is_hint)
-          {
-            gimp_display_shell_get_device_coords (shell,
-                                                  mevent->device,
-                                                  &display_coords);
-          }
+        /* Ask for more motion events in case the event was a hint */
+        gdk_event_request_motions (mevent);
 
         update_sw_cursor = TRUE;
 
@@ -1529,11 +1559,21 @@
     }
 
   if (update_sw_cursor)
-    gimp_display_shell_update_cursor (shell,
-                                      (gint) display_coords.x,
-                                      (gint) display_coords.y,
-                                      (gint) image_coords.x,
-                                      (gint) image_coords.y);
+    {
+      GimpCursorPrecision precision = GIMP_CURSOR_PRECISION_PIXEL_CENTER;
+
+      active_tool = tool_manager_get_active (gimp);
+
+      if (active_tool)
+        precision = gimp_tool_control_get_precision (active_tool->control);
+
+      gimp_display_shell_update_cursor (shell,
+                                        precision,
+                                        (gint) display_coords.x,
+                                        (gint) display_coords.y,
+                                        image_coords.x,
+                                        image_coords.y);
+    }
 
   return return_val;
 }

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.h	Sun Oct 12 15:38:02 2008
@@ -20,20 +20,6 @@
 #define __GIMP_DISPLAY_SHELL_CALLBACKS_H__
 
 
-#define GIMP_DISPLAY_SHELL_CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK            | \
-                                              GDK_POINTER_MOTION_MASK      | \
-                                              GDK_POINTER_MOTION_HINT_MASK | \
-                                              GDK_BUTTON_PRESS_MASK        | \
-                                              GDK_BUTTON_RELEASE_MASK      | \
-                                              GDK_STRUCTURE_MASK           | \
-                                              GDK_ENTER_NOTIFY_MASK        | \
-                                              GDK_LEAVE_NOTIFY_MASK        | \
-                                              GDK_FOCUS_CHANGE_MASK        | \
-                                              GDK_KEY_PRESS_MASK           | \
-                                              GDK_KEY_RELEASE_MASK         | \
-                                              GDK_PROXIMITY_OUT_MASK)
-
-
 gboolean   gimp_display_shell_events                  (GtkWidget        *widget,
                                                        GdkEvent         *event,
                                                        GimpDisplayShell *shell);

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <time.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "display-types.h"
@@ -117,11 +118,12 @@
 }
 
 void
-gimp_display_shell_update_cursor (GimpDisplayShell *shell,
-                                  gint              display_x,
-                                  gint              display_y,
-                                  gint              image_x,
-                                  gint              image_y)
+gimp_display_shell_update_cursor (GimpDisplayShell    *shell,
+                                  GimpCursorPrecision  precision,
+                                  gint                 display_x,
+                                  gint                 display_y,
+                                  gdouble              image_x,
+                                  gdouble              image_y)
 {
   GimpDialogFactory *factory;
   GimpSessionInfo   *session_info;
@@ -159,7 +161,7 @@
    *  possibly snapped...
    */
   gimp_statusbar_update_cursor (GIMP_STATUSBAR (shell->statusbar),
-                                image_x, image_y);
+                                precision, image_x, image_y);
 
   factory = gimp_dialog_factory_from_name ("dock");
   session_info = gimp_dialog_factory_find_session_info (factory,

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-cursor.h	Sun Oct 12 15:38:02 2008
@@ -20,21 +20,22 @@
 #define __GIMP_DISPLAY_SHELL_CURSOR_H__
 
 
-void   gimp_display_shell_set_cursor            (GimpDisplayShell   *shell,
-                                                 GimpCursorType      cursor_type,
-                                                 GimpToolCursorType  tool_cursor,
-                                                 GimpCursorModifier  modifier);
-void   gimp_display_shell_unset_cursor          (GimpDisplayShell   *shell);
-void   gimp_display_shell_set_override_cursor   (GimpDisplayShell   *shell,
-                                                 GimpCursorType      cursor_type);
-void   gimp_display_shell_unset_override_cursor (GimpDisplayShell   *shell);
+void   gimp_display_shell_set_cursor            (GimpDisplayShell    *shell,
+                                                 GimpCursorType       cursor_type,
+                                                 GimpToolCursorType   tool_cursor,
+                                                 GimpCursorModifier   modifier);
+void   gimp_display_shell_unset_cursor          (GimpDisplayShell    *shell);
+void   gimp_display_shell_set_override_cursor   (GimpDisplayShell    *shell,
+                                                 GimpCursorType       cursor_type);
+void   gimp_display_shell_unset_override_cursor (GimpDisplayShell    *shell);
 
-void   gimp_display_shell_update_cursor         (GimpDisplayShell   *shell,
-                                                 gint                display_x,
-                                                 gint                display_y,
-                                                 gint                image_x,
-                                                 gint                image_y);
-void   gimp_display_shell_clear_cursor          (GimpDisplayShell   *shell);
+void   gimp_display_shell_update_cursor         (GimpDisplayShell    *shell,
+                                                 GimpCursorPrecision  precision,
+                                                 gint                 display_x,
+                                                 gint                 display_y,
+                                                 gdouble              image_x,
+                                                 gdouble              image_y);
+void   gimp_display_shell_clear_cursor          (GimpDisplayShell    *shell);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_CURSOR_H__ */

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-dnd.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-dnd.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-dnd.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -33,6 +34,7 @@
 #include "core/gimpcontext.h"
 #include "core/gimpdrawable-bucket-fill.h"
 #include "core/gimpimage.h"
+#include "core/gimpimage-colormap.h"
 #include "core/gimpimage-merge.h"
 #include "core/gimpimage-undo.h"
 #include "core/gimplayer.h"
@@ -156,6 +158,26 @@
 
 /*  private functions  */
 
+/*
+ * Position the dropped item in the middle of the viewport.
+ */
+static void
+gimp_display_shell_dnd_position_item (GimpDisplayShell *shell,
+                                      GimpItem         *item)
+{
+  gint x, y;
+  gint width, height;
+  gint off_x, off_y;
+
+  gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
+
+  gimp_item_offsets (item, &off_x, &off_y);
+
+  off_x = x + (width  - gimp_item_width  (item)) / 2 - off_x;
+  off_y = y + (height - gimp_item_height (item)) / 2 - off_y;
+
+  gimp_item_translate (item, off_x, off_y, FALSE);
+}
 
 static void
 gimp_display_shell_dnd_flush (GimpDisplayShell *shell,
@@ -176,10 +198,11 @@
                                   GimpViewable *viewable,
                                   gpointer      data)
 {
-  GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
-  GimpImage        *image = shell->display->image;
+  GimpDisplayShell *shell     = GIMP_DISPLAY_SHELL (data);
+  GimpImage        *image     = shell->display->image;
   GType             new_type;
   GimpItem         *new_item;
+  gboolean          new_image = FALSE;
 
   GIMP_LOG (DND, NULL);
 
@@ -187,7 +210,36 @@
     return;
 
   if (! image)
-    return;
+    {
+      GimpImage         *src_image = gimp_item_get_image (GIMP_ITEM (viewable));
+      GimpDrawable      *drawable  = GIMP_DRAWABLE (viewable);
+      GimpImageBaseType  type;
+      gdouble            xres;
+      gdouble            yres;
+
+      type = GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable));
+
+      image = gimp_create_image (shell->display->gimp,
+                                 gimp_item_width (GIMP_ITEM (viewable)),
+                                 gimp_item_height (GIMP_ITEM (viewable)),
+                                 type, TRUE);
+      gimp_image_undo_disable (image);
+
+      if (type == GIMP_INDEXED)
+        gimp_image_set_colormap (image,
+                                 gimp_image_get_colormap (src_image),
+                                 gimp_image_get_colormap_size (src_image),
+                                 FALSE);
+
+      gimp_image_get_resolution (src_image, &xres, &yres);
+      gimp_image_set_resolution (image, xres, yres);
+      gimp_image_set_unit (image, gimp_image_get_unit (src_image));
+
+      gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0);
+      g_object_unref (image);
+
+      new_image = TRUE;
+    }
 
   if (GIMP_IS_LAYER (viewable))
     new_type = G_TYPE_FROM_INSTANCE (viewable);
@@ -198,32 +250,26 @@
 
   if (new_item)
     {
-      GimpLayer *new_layer;
-      gint       x, y, width, height;
-      gint       off_x, off_y;
-
-      new_layer = GIMP_LAYER (new_item);
+      GimpLayer *new_layer = GIMP_LAYER (new_item);
 
       gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
                                    _("Drop New Layer"));
 
-      gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
-
-      gimp_item_offsets (new_item, &off_x, &off_y);
+      if (! new_image)
+        gimp_display_shell_dnd_position_item (shell, new_item);
 
-      off_x = x + (width  - gimp_item_width  (new_item)) / 2 - off_x;
-      off_y = y + (height - gimp_item_height (new_item)) / 2 - off_y;
-
-      gimp_item_translate (new_item, off_x, off_y, FALSE);
       gimp_item_set_visible (new_item, TRUE, FALSE);
       gimp_item_set_linked (new_item, FALSE, FALSE);
 
-      gimp_image_add_layer (image, new_layer, -1);
+      gimp_image_add_layer (image, new_layer, -1, TRUE);
 
       gimp_image_undo_group_end (image);
 
       gimp_display_shell_dnd_flush (shell, image);
     }
+
+  if (new_image)
+    gimp_image_undo_enable (image);
 }
 
 static void
@@ -255,7 +301,7 @@
       gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
                                    _("Drop New Path"));
 
-      gimp_image_add_vectors (image, new_vectors, -1);
+      gimp_image_add_vectors (image, new_vectors, -1, TRUE);
 
       gimp_image_undo_group_end (image);
 
@@ -515,8 +561,6 @@
   if (new_item)
     {
       GimpLayer *new_layer = GIMP_LAYER (new_item);
-      gint       x, y, width, height;
-      gint       off_x, off_y;
 
       gimp_enum_get_value (GIMP_TYPE_CHANNEL_TYPE, component,
                            NULL, NULL, &desc, NULL);
@@ -526,16 +570,9 @@
       gimp_image_undo_group_start (dest_image, GIMP_UNDO_GROUP_EDIT_PASTE,
                                    _("Drop New Layer"));
 
-      gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
+      gimp_display_shell_dnd_position_item (shell, new_item);
 
-      gimp_item_offsets (new_item, &off_x, &off_y);
-
-      off_x = x + (width  - gimp_item_width  (new_item)) / 2 - off_x;
-      off_y = y + (height - gimp_item_height (new_item)) / 2 - off_y;
-
-      gimp_item_translate (new_item, off_x, off_y, FALSE);
-
-      gimp_image_add_layer (dest_image, new_layer, -1);
+      gimp_image_add_layer (dest_image, new_layer, -1, TRUE);
 
       gimp_image_undo_group_end (dest_image);
 
@@ -550,48 +587,70 @@
                                 GdkPixbuf *pixbuf,
                                 gpointer   data)
 {
-  GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
-  GimpImage        *image = shell->display->image;
+  GimpDisplayShell *shell     = GIMP_DISPLAY_SHELL (data);
+  GimpImage        *image     = shell->display->image;
   GimpLayer        *new_layer;
+  GimpImageType     image_type;
+  gboolean          new_image = FALSE;
 
   GIMP_LOG (DND, NULL);
 
   if (shell->display->gimp->busy)
     return;
 
+  switch (gdk_pixbuf_get_n_channels (pixbuf))
+    {
+    case 1: image_type = GIMP_GRAY_IMAGE;  break;
+    case 2: image_type = GIMP_GRAYA_IMAGE; break;
+    case 3: image_type = GIMP_RGB_IMAGE;   break;
+    case 4: image_type = GIMP_RGBA_IMAGE;  break;
+      break;
+
+    default:
+      g_return_if_reached ();
+      break;
+    }
+
   if (! image)
-    return;
+    {
+      image = gimp_create_image (shell->display->gimp,
+                                 gdk_pixbuf_get_width (pixbuf),
+                                 gdk_pixbuf_get_height (pixbuf),
+                                 GIMP_IMAGE_TYPE_BASE_TYPE (image_type),
+                                 FALSE);
+
+      gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0);
+      g_object_unref (image);
+
+      gimp_image_undo_disable (image);
+
+      new_image = TRUE;
+    }
 
   new_layer =
-    gimp_layer_new_from_pixbuf (pixbuf, image,
-                                gimp_image_base_type_with_alpha (image),
+    gimp_layer_new_from_pixbuf (pixbuf, image, image_type,
                                 _("Dropped Buffer"),
                                 GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
 
   if (new_layer)
     {
-      GimpItem *new_item;
-      gint      x, y, width, height;
-      gint      off_x, off_y;
+      GimpItem *new_item = GIMP_ITEM (new_layer);
 
       new_item = GIMP_ITEM (new_layer);
 
       gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
                                    _("Drop New Layer"));
 
-      gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
+      if (! new_image)
+        gimp_display_shell_dnd_position_item (shell, new_item);
 
-      gimp_item_offsets (new_item, &off_x, &off_y);
-
-      off_x = x + (width  - gimp_item_width  (new_item)) / 2 - off_x;
-      off_y = y + (height - gimp_item_height (new_item)) / 2 - off_y;
-
-      gimp_item_translate (new_item, off_x, off_y, FALSE);
-
-      gimp_image_add_layer (image, new_layer, -1);
+      gimp_image_add_layer (image, new_layer, -1, TRUE);
 
       gimp_image_undo_group_end (image);
 
       gimp_display_shell_dnd_flush (shell, image);
     }
+
+  if (new_image)
+    gimp_image_undo_enable (image);
 }

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-filter-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-filter-dialog.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-filter-dialog.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-handlers.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-handlers.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-handlers.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"
@@ -70,6 +71,8 @@
                                                             (GimpImage        *image,
                                                              gint              previous_origin_x,
                                                              gint              previous_origin_y,
+                                                             gint              previous_width,
+                                                             gint              previous_height,
                                                              GimpDisplayShell *shell);
 static void   gimp_display_shell_resolution_changed_handler (GimpImage        *image,
                                                              GimpDisplayShell *shell);
@@ -485,9 +488,26 @@
 }
 
 static void
+gimp_display_shell_image_size_starts_to_fit (GimpDisplayShell *shell,
+                                             gint              previous_width,
+                                             gint              previous_height,
+                                             gint              new_width,
+                                             gint              new_height,
+                                             gboolean         *horizontally,
+                                             gboolean         *vertically)
+{
+  *horizontally = SCALEX (shell, previous_width)  >  shell->disp_width  &&
+                  SCALEX (shell, new_width)       <= shell->disp_width;
+  *vertically   = SCALEY (shell, previous_height) >  shell->disp_height &&
+                  SCALEY (shell, new_height)      <= shell->disp_height;
+}
+
+static void
 gimp_display_shell_size_changed_detailed_handler (GimpImage        *image,
                                                   gint              previous_origin_x,
                                                   gint              previous_origin_y,
+                                                  gint              previous_width,
+                                                  gint              previous_height,
                                                   GimpDisplayShell *shell)
 {
   if (shell->display->config->resize_windows_on_resize)
@@ -499,12 +519,26 @@
     }
   else
     {
-      gint scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
-      gint scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
+      GimpImage *image;
+      gboolean   horizontally, vertically;
+      gint       scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
+      gint       scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
+
+      image = GIMP_IMAGE (shell->display->image);
+
+      gimp_display_shell_image_size_starts_to_fit (shell,
+                                                   previous_width,
+                                                   previous_height,
+                                                   gimp_image_get_width (image),
+                                                   gimp_image_get_height (image),
+                                                   &horizontally,
+                                                   &vertically);
 
       gimp_display_shell_scroll_set_offset (shell,
                                             shell->offset_x + scaled_previous_origin_x,
                                             shell->offset_y + scaled_previous_origin_y);
+
+      gimp_display_shell_scroll_center_image (shell, horizontally, vertically);
     }
 }
 

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-icon.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-icon.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-icon.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "display-types.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-layer-select.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-layer-select.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-layer-select.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -211,8 +212,7 @@
   else if (index >= gimp_container_num_children (layer_select->image->layers))
     index = 0;
 
-  next_layer = (GimpLayer *)
-    gimp_container_get_child_by_index (layer_select->image->layers, index);
+  next_layer = gimp_image_get_layer_by_index (layer_select->image, index);
 
   if (next_layer && next_layer != current_layer)
     {

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-preview.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-preview.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-preview.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -959,8 +960,6 @@
       src[8] = src[5];  /* reusing existing pixel data */
     }
 
-
-
   if (tile[0])
     {
       src[0] = tile_data_pointer (tile[0], info->src_x - 1, info->src_y - 1);

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale-dialog.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale-dialog.c	Sun Oct 12 15:38:02 2008
@@ -163,7 +163,7 @@
 
   spin = gimp_spin_button_new (&data->num_adj,
                                num, 1, 256,
-                               1, 8, 1, 1, 0);
+                               1, 8, 0, 1, 0);
   gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
   gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
   gtk_widget_show (spin);
@@ -174,7 +174,7 @@
 
   spin = gimp_spin_button_new (&data->denom_adj,
                                denom, 1, 256,
-                               1, 8, 1, 1, 0);
+                               1, 8, 0, 1, 0);
   gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
   gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
   gtk_widget_show (spin);
@@ -217,7 +217,10 @@
 
       scale = gtk_adjustment_get_value (GTK_ADJUSTMENT (dialog->scale_adj));
 
-      gimp_display_shell_scale (dialog->shell, GIMP_ZOOM_TO, scale / 100.0);
+      gimp_display_shell_scale (dialog->shell,
+                                GIMP_ZOOM_TO,
+                                scale / 100.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
     }
   else
     {

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -70,7 +71,8 @@
                                                           gdouble           new_scale,
                                                           gdouble           current_scale,
                                                           gint             *x,
-                                                          gint             *y);
+                                                          gint             *y,
+                                                          GimpZoomFocus     zoom_focus);
 
 static gdouble   img2real                                (GimpDisplayShell *shell,
                                                           gboolean          xdir,
@@ -89,9 +91,6 @@
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  if (! shell->display)
-    return;
-
   gimp_display_shell_scale_update_scrollbars (shell);
   gimp_display_shell_scale_update_rulers (shell);
 }
@@ -108,6 +107,9 @@
   gint       image_width;
   gint       image_height;
 
+  if (! shell->display)
+    return;
+
   image = shell->display->image;
 
   if (image)
@@ -164,6 +166,9 @@
   gint       scaled_viewport_offset_x;
   gint       scaled_viewport_offset_y;
 
+  if (! shell->display)
+    return;
+
   image = shell->display->image;
 
   if (image)
@@ -334,7 +339,8 @@
 void
 gimp_display_shell_scale (GimpDisplayShell *shell,
                           GimpZoomType      zoom_type,
-                          gdouble           new_scale)
+                          gdouble           new_scale,
+                          GimpZoomFocus     zoom_focus)
 {
   gint    x, y;
   gdouble current_scale;
@@ -375,7 +381,8 @@
                                                    real_new_scale,
                                                    current_scale,
                                                    &x,
-                                                   &y);
+                                                   &y,
+                                                   zoom_focus);
 
           gimp_display_shell_scale_to (shell, real_new_scale, x, y);
 
@@ -438,7 +445,11 @@
   zoom_factor = MIN ((gdouble) shell->disp_width  / (gdouble) image_width,
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
-  gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
+  gimp_display_shell_scale (shell,
+                            GIMP_ZOOM_TO,
+                            zoom_factor,
+                            GIMP_ZOOM_FOCUS_BEST_GUESS);
+  
   gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
 }
 
@@ -510,7 +521,11 @@
   zoom_factor = MAX ((gdouble) shell->disp_width  / (gdouble) image_width,
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
-  gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
+  gimp_display_shell_scale (shell,
+                            GIMP_ZOOM_TO,
+                            zoom_factor,
+                            GIMP_ZOOM_FOCUS_BEST_GUESS);
+
   gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
 }
 
@@ -672,7 +687,6 @@
   gint       shell_height;
   gint       screen_width;
   gint       screen_height;
-  gdouble    new_scale;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -684,16 +698,18 @@
   screen_width  = gdk_screen_get_width (screen)  * 0.75;
   screen_height = gdk_screen_get_height (screen) * 0.75;
 
+  /* We need to zoom before we use SCALE[XY] */
+  gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, scale);
+
   shell_width  = SCALEX (shell, image_width);
   shell_height = SCALEY (shell, image_height);
 
-  gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, scale);
-
   if (shell->display->config->initial_zoom_to_fit)
     {
       /*  Limit to the size of the screen...  */
       if (shell_width > screen_width || shell_height > screen_height)
         {
+          gdouble new_scale;
           gdouble current = gimp_zoom_model_get_factor (shell->zoom);
 
           new_scale = current * MIN (((gdouble) screen_height) / shell_height,
@@ -751,6 +767,7 @@
                              gint              viewport_x,
                              gint              viewport_y)
 {
+  gdouble scale_x, scale_y;
   gdouble image_focus_x, image_focus_y;
   gint    target_offset_x, target_offset_y;
 
@@ -766,8 +783,10 @@
                                        &image_focus_y,
                                        FALSE);
 
-  target_offset_x = scale * image_focus_x - viewport_x;
-  target_offset_y = scale * image_focus_y - viewport_y;
+  gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
+
+  target_offset_x = scale_x * image_focus_x - viewport_x;
+  target_offset_y = scale_y * image_focus_y - viewport_y;
 
   /* Note that we never come here if we need to
    * resize_windows_on_zoom
@@ -879,7 +898,8 @@
                                          gdouble           new_scale,
                                          gdouble           current_scale,
                                          gint             *x,
-                                         gint             *y)
+                                         gint             *y,
+                                         GimpZoomFocus     zoom_focus)
 {
   gint image_center_x, image_center_y;
   gint other_x, other_y;
@@ -945,23 +965,39 @@
   }
 
   /* Decide which one to use for each axis */
-  {
-    gboolean within_horizontally, within_vertically;
-    gboolean stops_horizontally, stops_vertically;
+  switch (zoom_focus)
+    {
+    case GIMP_ZOOM_FOCUS_POINTER:
+      *x = other_x;
+      *y = other_y;
+      break;
+
+    case GIMP_ZOOM_FOCUS_IMAGE_CENTER:
+      *x = image_center_x;
+      *y = image_center_y;
+      break;
 
-    gimp_display_shell_scale_image_is_within_viewport (shell,
-                                                       &within_horizontally,
-                                                       &within_vertically);
-
-    gimp_display_shell_scale_image_stops_to_fit (shell,
-                                                 new_scale,
-                                                 current_scale,
-                                                 &stops_horizontally,
-                                                 &stops_vertically);
+    case GIMP_ZOOM_FOCUS_BEST_GUESS:
+    default:
+      {
+        gboolean within_horizontally, within_vertically;
+        gboolean stops_horizontally, stops_vertically;
 
-    *x = within_horizontally && ! stops_horizontally ? image_center_x : other_x;
-    *y = within_vertically   && ! stops_vertically   ? image_center_y : other_y;
-  }
+        gimp_display_shell_scale_image_is_within_viewport (shell,
+                                                           &within_horizontally,
+                                                           &within_vertically);
+
+        gimp_display_shell_scale_image_stops_to_fit (shell,
+                                                     new_scale,
+                                                     current_scale,
+                                                     &stops_horizontally,
+                                                     &stops_vertically);
+
+        *x = within_horizontally && ! stops_horizontally ? image_center_x : other_x;
+        *y = within_vertically   && ! stops_vertically   ? image_center_y : other_y;
+      }
+      break;
+    }
 }
 
 /* scale image coord to realworld units (cm, inches, pixels)

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h	Sun Oct 12 15:38:02 2008
@@ -32,7 +32,8 @@
 
 void     gimp_display_shell_scale                          (GimpDisplayShell       *shell,
                                                             GimpZoomType            zoom_type,
-                                                            gdouble                 scale);
+                                                            gdouble                 scale,
+                                                            GimpZoomFocus           zoom_focus);
 void     gimp_display_shell_scale_fit_in                   (GimpDisplayShell       *shell);
 gboolean gimp_display_shell_scale_image_is_within_viewport (GimpDisplayShell       *shell,
                                                             gboolean               *horizontally,

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -33,6 +34,7 @@
 #include "core/gimpimage.h"
 #include "core/gimpprojection.h"
 
+#include "gimpcanvas.h"
 #include "gimpdisplay.h"
 #include "gimpdisplay-foreach.h"
 #include "gimpdisplayshell.h"
@@ -41,7 +43,8 @@
 #include "gimpdisplayshell-scroll.h"
 
 
-#define OVERPAN_FACTOR 0.5
+#define OVERPAN_FACTOR      0.5
+#define MINIMUM_STEP_AMOUNT 1.0
 
 
 typedef struct
@@ -92,6 +95,9 @@
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
+  if (x_offset == 0 && y_offset == 0)
+    return;
+
   old_x = shell->offset_x;
   old_y = shell->offset_y;
 
@@ -116,10 +122,7 @@
       shell->offset_x += x_offset;
       shell->offset_y += y_offset;
 
-      gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset);
-
-      /*  Make sure expose events are processed before scrolling again  */
-      gdk_window_process_updates (shell->canvas->window, FALSE);
+      gimp_canvas_scroll (GIMP_CANVAS (shell->canvas), -x_offset, -y_offset);
 
       /*  Update scrollbars and rulers  */
       gimp_display_shell_update_scrollbars_and_rulers (shell);
@@ -256,6 +259,66 @@
 }
 
 /**
+ * gimp_display_shell_scroll_unoverscrollify:
+ * @shell:
+ * @in_offset_x:
+ * @in_offset_y:
+ * @out_offset_x:
+ * @out_offset_y:
+ *
+ * Takes a scroll offset and returns the offset that will not result
+ * in a scroll beyond the image border. If the image is already
+ * overscrolled, the return value is 0 for that given axis.
+ *
+ **/
+void
+gimp_display_shell_scroll_unoverscrollify (GimpDisplayShell *shell,
+                                           gint              in_offset_x,
+                                           gint              in_offset_y,
+                                           gint             *out_offset_x,
+                                           gint             *out_offset_y)
+{
+  gint sw, sh;
+  gint out_offset_x_dummy, out_offset_y_dummy;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (! out_offset_x) out_offset_x = &out_offset_x_dummy;
+  if (! out_offset_y) out_offset_y = &out_offset_y_dummy;
+
+  *out_offset_x = in_offset_x;
+  *out_offset_y = in_offset_y;
+
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+  if (in_offset_x < 0)
+    {
+      *out_offset_x = MAX (in_offset_x,
+                           MIN (0, 0 - shell->offset_x));
+    }
+  else if (in_offset_x > 0)
+    {
+      gint min_offset = sw - shell->disp_width;
+
+      *out_offset_x = MIN (in_offset_x,
+                           MAX (0, min_offset - shell->offset_x));
+    }
+
+  if (in_offset_y < 0)
+    {
+      *out_offset_y = MAX (in_offset_y,
+                           MIN (0, 0 - shell->offset_y));
+    }
+  else if (in_offset_y > 0)
+    {
+      gint min_offset = sh - shell->disp_height;
+
+      *out_offset_y = MIN (in_offset_y,
+                           MAX (0, min_offset - shell->offset_y));
+    }
+}
+
+/**
  * gimp_display_shell_scroll_center_image:
  * @shell:
  * @horizontally:
@@ -343,7 +406,7 @@
       data->shell        = shell;
       data->horizontally = horizontally;
       data->vertically   = vertically;
-      
+
       g_signal_connect (shell->canvas, "size-allocate",
                         G_CALLBACK (gimp_display_shell_scroll_center_image_callback),
                         data);
@@ -532,7 +595,7 @@
                                    sw + (shell->disp_width - sw) / 2);
     }
 
-  shell->hsbdata->step_increment = MAX (shell->scale_x, 1.0);
+  shell->hsbdata->step_increment = MAX (shell->scale_x, MINIMUM_STEP_AMOUNT);
 }
 
 /**
@@ -574,5 +637,5 @@
                                    sh + (shell->disp_height - sh) / 2);
     }
 
-  shell->vsbdata->step_increment = MAX (shell->scale_y, 1.0);
+  shell->vsbdata->step_increment = MAX (shell->scale_y, MINIMUM_STEP_AMOUNT);
 }

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h	Sun Oct 12 15:38:02 2008
@@ -31,6 +31,11 @@
                                                              gint                    offset_y);
 void   gimp_display_shell_scroll_clamp_offsets              (GimpDisplayShell       *shell);
 void   gimp_display_shell_scroll_clamp_and_update           (GimpDisplayShell       *shell);
+void   gimp_display_shell_scroll_unoverscrollify            (GimpDisplayShell       *shell,
+                                                             gint                    in_offset_x,
+                                                             gint                    in_offset_y,
+                                                             gint                   *out_offset_x,
+                                                             gint                   *out_offset_y);
 void   gimp_display_shell_scroll_center_image               (GimpDisplayShell       *shell,
                                                              gboolean                horizontally,
                                                              gboolean                vertically);

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-selection.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-selection.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-selection.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "display-types.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-title.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-title.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-title.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -173,9 +174,9 @@
 static void
 gimp_display_shell_class_init (GimpDisplayShellClass *klass)
 {
-  GObjectClass   *object_class      = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class  = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass *widget_class      = GTK_WIDGET_CLASS (klass);
+  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
+  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class     = GTK_WIDGET_CLASS (klass);
 
   display_shell_signals[SCALED] =
     g_signal_new ("scaled",
@@ -343,7 +344,7 @@
   shell->scroll_start_x         = 0;
   shell->scroll_start_y         = 0;
   shell->button_press_before_focus = FALSE;
-  
+
   shell->highlight              = NULL;
   shell->mask                   = NULL;
 
@@ -827,8 +828,13 @@
     {
       options = shell->no_image_options;
 
+      /*
+       * These values are arbitrary. The width is determined by the
+       * menubar and the height is chosen to give a window aspect
+       * ratio of roughly 3:1 (as requested by the UI team).
+       */
       image_width  = GIMP_DEFAULT_IMAGE_WIDTH;
-      image_height = GIMP_DEFAULT_IMAGE_HEIGHT;
+      image_height = GIMP_DEFAULT_IMAGE_HEIGHT / 3;
     }
 
   shell->dot_for_dot = display->config->default_dot_for_dot;
@@ -1020,12 +1026,13 @@
                            GIMP_HELP_IMAGE_WINDOW_ORIGIN);
 
   shell->canvas = gimp_canvas_new (display->config);
+  gtk_widget_set_size_request (shell->canvas, shell_width, shell_height);
 
   gimp_display_shell_dnd_init (shell);
   gimp_display_shell_selection_init (shell);
 
   /*  the horizontal ruler  */
-  shell->hrule = gimp_hruler_new ();
+  shell->hrule = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL);
   gtk_widget_set_events (GTK_WIDGET (shell->hrule),
                          GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
 
@@ -1039,7 +1046,7 @@
   gimp_help_set_help_data (shell->hrule, NULL, GIMP_HELP_IMAGE_WINDOW_RULER);
 
   /*  the vertical ruler  */
-  shell->vrule = gimp_vruler_new ();
+  shell->vrule = gimp_ruler_new (GTK_ORIENTATION_VERTICAL);
   gtk_widget_set_events (GTK_WIDGET (shell->vrule),
                          GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
 
@@ -1058,12 +1065,6 @@
   gtk_widget_set_extension_events (shell->hrule, GDK_EXTENSION_EVENTS_ALL);
   gtk_widget_set_extension_events (shell->vrule, GDK_EXTENSION_EVENTS_ALL);
 
-  /*  the canvas  */
-  gtk_widget_set_size_request (shell->canvas, shell_width, shell_height);
-  gtk_widget_set_events (shell->canvas, GIMP_DISPLAY_SHELL_CANVAS_EVENT_MASK);
-  gtk_widget_set_extension_events (shell->canvas, GDK_EXTENSION_EVENTS_ALL);
-  GTK_WIDGET_SET_FLAGS (shell->canvas, GTK_CAN_FOCUS);
-
   g_signal_connect (shell->canvas, "realize",
                     G_CALLBACK (gimp_display_shell_canvas_realize),
                     shell);

Modified: branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpnavigationeditor.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpnavigationeditor.c	Sun Oct 12 15:38:02 2008
@@ -24,6 +24,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -53,47 +54,44 @@
 #include "gimp-intl.h"
 
 
-#define BORDER_PEN_WIDTH  3
+static void        gimp_navigation_editor_docked_iface_init (GimpDockedInterface  *iface);
 
+static void        gimp_navigation_editor_destroy           (GtkObject            *object);
 
-static void   gimp_navigation_editor_docked_iface_init (GimpDockedInterface  *iface);
+static void        gimp_navigation_editor_set_context       (GimpDocked           *docked,
+                                                             GimpContext          *context);
 
-static void   gimp_navigation_editor_destroy           (GtkObject            *object);
-
-static void   gimp_navigation_editor_set_context       (GimpDocked           *docked,
-                                                        GimpContext          *context);
-
-static GtkWidget * gimp_navigation_editor_new_private  (GimpMenuFactory      *menu_factory,
-                                                        GimpDisplayShell     *shell);
-
-static void     gimp_navigation_editor_set_shell       (GimpNavigationEditor *view,
-                                                        GimpDisplayShell     *shell);
-static gboolean gimp_navigation_editor_button_release  (GtkWidget            *widget,
-                                                        GdkEventButton       *bevent,
-                                                        GimpDisplayShell     *shell);
-static void   gimp_navigation_editor_marker_changed    (GimpNavigationView   *view,
-                                                        gdouble               x,
-                                                        gdouble               y,
-                                                        gdouble               width,
-                                                        gdouble               height,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_zoom              (GimpNavigationView   *view,
-                                                        GimpZoomType          direction,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_scroll            (GimpNavigationView   *view,
-                                                        GdkScrollDirection    direction,
-                                                        GimpNavigationEditor  *editor);
-
-static void   gimp_navigation_editor_zoom_adj_changed  (GtkAdjustment        *adj,
-                                                        GimpNavigationEditor *editor);
-
-static void   gimp_navigation_editor_shell_scaled      (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_shell_scrolled    (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_shell_reconnect   (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_update_marker     (GimpNavigationEditor *editor);
+static GtkWidget * gimp_navigation_editor_new_private       (GimpMenuFactory      *menu_factory,
+                                                             GimpDisplayShell     *shell);
+
+static void        gimp_navigation_editor_set_shell         (GimpNavigationEditor *editor,
+                                                             GimpDisplayShell     *shell);
+static gboolean    gimp_navigation_editor_button_release    (GtkWidget            *widget,
+                                                             GdkEventButton       *bevent,
+                                                             GimpDisplayShell     *shell);
+static void        gimp_navigation_editor_marker_changed    (GimpNavigationView   *view,
+                                                             gdouble               x,
+                                                             gdouble               y,
+                                                             gdouble               width,
+                                                             gdouble               height,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_zoom              (GimpNavigationView   *view,
+                                                             GimpZoomType          direction,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_scroll            (GimpNavigationView   *view,
+                                                             GdkScrollDirection    direction,
+                                                             GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_zoom_adj_changed  (GtkAdjustment        *adj,
+                                                             GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_shell_scaled      (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_scrolled    (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_reconnect   (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_update_marker     (GimpNavigationEditor *editor);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpNavigationEditor, gimp_navigation_editor,
@@ -230,11 +228,8 @@
   GimpNavigationView   *view;
   GdkScreen            *screen;
   gint                  x, y;
-  gint                  x_org, y_org;
-  gint                  view_marker_x;
-  gint                  view_marker_y;
-  gint                  view_marker_width;
-  gint                  view_marker_height;
+  gint                  view_marker_x, view_marker_y;
+  gint                  view_marker_width, view_marker_height;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (GTK_IS_WIDGET (widget));
@@ -267,57 +262,72 @@
       editor = GIMP_NAVIGATION_EDITOR (gtk_bin_get_child (GTK_BIN (bin)));
     }
 
-  screen = gtk_widget_get_screen (widget);
-
-  gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
-
   view = GIMP_NAVIGATION_VIEW (editor->view);
 
-  /* decide where to put the popup */
-  gdk_window_get_origin (widget->window, &x_org, &y_org);
+  /* Set poup screen */
+  screen = gtk_widget_get_screen (widget);
+  gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
 
   gimp_navigation_view_get_local_marker (view,
                                          &view_marker_x,
                                          &view_marker_y,
                                          &view_marker_width,
                                          &view_marker_height);
+  /* Position the popup */
+  {
+    gint x_origin, y_origin;
+    gint popup_width, popup_height;
+    gint border_width, border_height;
+    gint screen_click_x, screen_click_y;
+
+    gdk_window_get_origin (widget->window, &x_origin, &y_origin);
+
+    screen_click_x = x_origin + click_x;
+    screen_click_y = y_origin + click_y;
+    border_width   = style->xthickness * 4;
+    border_height  = style->ythickness * 4;
+    popup_width    = GIMP_VIEW (view)->renderer->width  - border_width;
+    popup_height   = GIMP_VIEW (view)->renderer->height - border_height;
+
+    x = screen_click_x -
+        border_width -
+        view_marker_x -
+        view_marker_width / 2;
+
+    y = screen_click_y -
+        border_height -
+        view_marker_y -
+        view_marker_height / 2;
+
+    /* When the image is zoomed out and overscrolled, the above
+     * calculation risks positioning the popup far far away from the
+     * click coordinate. We don't want that, so perform some clamping.
+     */
+    x = CLAMP (x, screen_click_x - popup_width,  screen_click_x);
+    y = CLAMP (y, screen_click_y - popup_height, screen_click_y);
+
+    /* If the popup doesn't fit into the screen, we have a problem.
+     * We move the popup onscreen and risk that the pointer is not
+     * in the square representing the viewable area anymore. Moving
+     * the pointer will make the image scroll by a large amount,
+     * but then it works as usual. Probably better than a popup that
+     * is completely unusable in the lower right of the screen.
+     *
+     * Warping the pointer would be another solution ...
+     */
+    x = CLAMP (x, 0, gdk_screen_get_width (screen)  - popup_width);
+    y = CLAMP (y, 0, gdk_screen_get_height (screen) - popup_height);
 
-  x = (x_org + click_x -
-       view_marker_x -
-       0.5 * (view_marker_width  - BORDER_PEN_WIDTH) -
-       2   * style->xthickness);
-
-  y = (y_org + click_y -
-       view_marker_y -
-       0.5 * (view_marker_height - BORDER_PEN_WIDTH) -
-       2   * style->ythickness);
-
-  /* If the popup doesn't fit into the screen, we have a problem.
-   * We move the popup onscreen and risk that the pointer is not
-   * in the square representing the viewable area anymore. Moving
-   * the pointer will make the image scroll by a large amount,
-   * but then it works as usual. Probably better than a popup that
-   * is completely unusable in the lower right of the screen.
-   *
-   * Warping the pointer would be another solution ...
-   */
-
-  x = CLAMP (x, 0, (gdk_screen_get_width (screen)  -
-                    GIMP_VIEW (view)->renderer->width  -
-                    4 * style->xthickness));
-  y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
-                    GIMP_VIEW (view)->renderer->height -
-                    4 * style->ythickness));
+    gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
+  }
 
-  gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
   gtk_widget_show (shell->nav_popup);
-
   gdk_flush ();
 
   /* fill in then grab pointer */
   gimp_navigation_view_set_motion_offset (view,
-                                          0.5 * (view_marker_width  - BORDER_PEN_WIDTH),
-                                          0.5 * (view_marker_height - BORDER_PEN_WIDTH));
+                                          view_marker_width  / 2,
+                                          view_marker_height / 2);
   gimp_navigation_view_grab_pointer (view);
 }
 
@@ -525,7 +535,10 @@
 
   if (editor->shell)
     {
-      gimp_display_shell_scale (editor->shell, direction, 0.0);
+      gimp_display_shell_scale (editor->shell,
+                                direction,
+                                0.0,
+                                GIMP_ZOOM_FOCUS_BEST_GUESS);
     }
 }
 
@@ -579,8 +592,10 @@
 gimp_navigation_editor_zoom_adj_changed (GtkAdjustment        *adj,
                                          GimpNavigationEditor *editor)
 {
-  gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO,
-                            pow (2.0, gtk_adjustment_get_value (adj)));
+  gimp_display_shell_scale (editor->shell,
+                            GIMP_ZOOM_TO,
+                            pow (2.0, gtk_adjustment_get_value (adj)),
+                            GIMP_ZOOM_FOCUS_BEST_GUESS);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/display/gimpstatusbar.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpstatusbar.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpstatusbar.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -164,8 +165,9 @@
   statusbar->temp_context_id =
     gimp_statusbar_get_context_id (statusbar, "gimp-statusbar-temp");
 
-  statusbar->cursor_format_str[0] = '\0';
-  statusbar->length_format_str[0] = '\0';
+  statusbar->cursor_format_str[0]   = '\0';
+  statusbar->cursor_format_str_f[0] = '\0';
+  statusbar->length_format_str[0]   = '\0';
 
   statusbar->progress_active      = FALSE;
   statusbar->progress_shown       = FALSE;
@@ -290,7 +292,7 @@
 {
   GtkRequisition  child_requisition;
   gint            width   = 0;
-  gint            padding = 2 * widget->style->ythickness;
+  gint            padding = 2 * gtk_widget_get_style (widget)->ythickness;
 
   /*  also consider the children which can be invisible  */
 
@@ -792,14 +794,15 @@
 }
 
 void
-gimp_statusbar_push_coords (GimpStatusbar *statusbar,
-                            const gchar   *context,
-                            const gchar   *stock_id,
-                            const gchar   *title,
-                            gdouble        x,
-                            const gchar   *separator,
-                            gdouble        y,
-                            const gchar   *help)
+gimp_statusbar_push_coords (GimpStatusbar       *statusbar,
+                            const gchar         *context,
+                            const gchar         *stock_id,
+                            GimpCursorPrecision  precision,
+                            const gchar         *title,
+                            gdouble              x,
+                            const gchar         *separator,
+                            gdouble              y,
+                            const gchar         *help)
 {
   GimpDisplayShell *shell;
 
@@ -812,16 +815,46 @@
 
   shell = statusbar->shell;
 
+  switch (precision)
+    {
+    case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
+      x = RINT (x + 0.5);
+      y = RINT (y + 0.5);
+      break;
+
+    case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
+      x = RINT (x);
+      y = RINT (y);
+      break;
+
+    case GIMP_CURSOR_PRECISION_SUBPIXEL:
+      break;
+    }
+
   if (shell->unit == GIMP_UNIT_PIXEL)
     {
-      gimp_statusbar_push (statusbar, context,
-                           stock_id,
-                           statusbar->cursor_format_str,
-                           title,
-                           (gint) RINT (x),
-                           separator,
-                           (gint) RINT (y),
-                           help);
+      if (precision == GIMP_CURSOR_PRECISION_SUBPIXEL)
+        {
+          gimp_statusbar_push (statusbar, context,
+                               stock_id,
+                               statusbar->cursor_format_str_f,
+                               title,
+                               x,
+                               separator,
+                               y,
+                               help);
+        }
+      else
+        {
+          gimp_statusbar_push (statusbar, context,
+                               stock_id,
+                               statusbar->cursor_format_str,
+                               title,
+                               (gint) RINT (x),
+                               separator,
+                               (gint) RINT (y),
+                               help);
+        }
     }
   else /* show real world units */
     {
@@ -1132,13 +1165,12 @@
 }
 
 void
-gimp_statusbar_update_cursor (GimpStatusbar *statusbar,
-                              gdouble        x,
-                              gdouble        y)
+gimp_statusbar_update_cursor (GimpStatusbar       *statusbar,
+                              GimpCursorPrecision  precision,
+                              gdouble              x,
+                              gdouble              y)
 {
   GimpDisplayShell *shell;
-  GtkTreeModel     *model;
-  GimpUnitStore    *store;
   gchar             buffer[CURSOR_LEN];
 
   g_return_if_fail (GIMP_IS_STATUSBAR (statusbar));
@@ -1158,19 +1190,46 @@
       gtk_widget_set_sensitive (statusbar->cursor_label, TRUE);
     }
 
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
-  store = GIMP_UNIT_STORE (model);
+  switch (precision)
+    {
+    case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
+      x = RINT (x + 0.5);
+      y = RINT (y + 0.5);
+      break;
+
+    case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
+      x = RINT (x);
+      y = RINT (y);
+      break;
 
-  gimp_unit_store_set_pixel_values (store, x, y);
+    case GIMP_CURSOR_PRECISION_SUBPIXEL:
+      break;
+    }
 
   if (shell->unit == GIMP_UNIT_PIXEL)
     {
-      g_snprintf (buffer, sizeof (buffer),
-                  statusbar->cursor_format_str,
-                  "", (gint) RINT (x), ", ", (gint) RINT (y), "");
+      if (precision == GIMP_CURSOR_PRECISION_SUBPIXEL)
+        {
+          g_snprintf (buffer, sizeof (buffer),
+                      statusbar->cursor_format_str_f,
+                      "", x, ", ", y, "");
+        }
+      else
+        {
+          g_snprintf (buffer, sizeof (buffer),
+                      statusbar->cursor_format_str,
+                      "", (gint) RINT (x), ", ", (gint) RINT (y), "");
+        }
     }
   else /* show real world units */
     {
+      GtkTreeModel  *model;
+      GimpUnitStore *store;
+
+      model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
+      store = GIMP_UNIT_STORE (model);
+
+      gimp_unit_store_set_pixel_values (store, x, y);
       gimp_unit_store_get_values (store, shell->unit, &x, &y);
 
       g_snprintf (buffer, sizeof (buffer),
@@ -1211,7 +1270,7 @@
                                     PANGO_PIXELS (rect.width) : 0);
       y += PANGO_PIXELS (rect.y);
 
-      gdk_draw_pixbuf (widget->window, widget->style->black_gc,
+      gdk_draw_pixbuf (widget->window, gtk_widget_get_style (widget)->black_gc,
                        statusbar->icon,
                        0, 0,
                        x, y,
@@ -1275,6 +1334,9 @@
       g_snprintf (statusbar->cursor_format_str,
                   sizeof (statusbar->cursor_format_str),
                   "%%s%%d%%s%%d%%s");
+      g_snprintf (statusbar->cursor_format_str_f,
+                  sizeof (statusbar->cursor_format_str_f),
+                  "%%s%%.1f%%s%%.1f%%s");
       g_snprintf (statusbar->length_format_str,
                   sizeof (statusbar->length_format_str),
                   "%%s%%d%%s");
@@ -1286,13 +1348,15 @@
                   "%%s%%.%df%%s%%.%df%%s",
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit),
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit));
+      strcpy (statusbar->cursor_format_str_f, statusbar->cursor_format_str);
       g_snprintf (statusbar->length_format_str,
                   sizeof (statusbar->length_format_str),
                   "%%s%%.%df%%s",
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit));
     }
 
-  gimp_statusbar_update_cursor (statusbar, image_width, image_height);
+  gimp_statusbar_update_cursor (statusbar, GIMP_CURSOR_PRECISION_SUBPIXEL,
+                                image_width, image_height);
 
   text = gtk_label_get_text (GTK_LABEL (statusbar->cursor_label));
 
@@ -1323,7 +1387,8 @@
 {
   gimp_display_shell_scale (statusbar->shell,
                             GIMP_ZOOM_TO,
-                            gimp_scale_combo_box_get_scale (combo));
+                            gimp_scale_combo_box_get_scale (combo),
+                            GIMP_ZOOM_FOCUS_BEST_GUESS);
 }
 
 static guint

Modified: branches/soc-2008-tagging/app/display/gimpstatusbar.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpstatusbar.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpstatusbar.h	Sun Oct 12 15:38:02 2008
@@ -52,6 +52,7 @@
   GimpMessageSeverity  temp_severity;
 
   gchar                cursor_format_str[CURSOR_FORMAT_LENGTH];
+  gchar                cursor_format_str_f[CURSOR_FORMAT_LENGTH];
   gchar                length_format_str[CURSOR_FORMAT_LENGTH];
 
   GtkWidget           *cursor_label;
@@ -93,6 +94,7 @@
 void        gimp_statusbar_push_coords      (GimpStatusbar       *statusbar,
                                              const gchar         *context,
                                              const gchar         *stock_id,
+                                             GimpCursorPrecision  precision,
                                              const gchar         *title,
                                              gdouble              x,
                                              const gchar         *separator,
@@ -133,6 +135,7 @@
 void        gimp_statusbar_pop_temp         (GimpStatusbar       *statusbar);
 
 void        gimp_statusbar_update_cursor    (GimpStatusbar       *statusbar,
+                                             GimpCursorPrecision  precision,
                                              gdouble              x,
                                              gdouble              y);
 void        gimp_statusbar_clear_cursor     (GimpStatusbar       *statusbar);

Modified: branches/soc-2008-tagging/app/display/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/display/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/display/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -13,7 +13,8 @@
 	-FImsvc_recommended_pragmas.h \
 	-I$(PRJ_TOP) \
 	-I$(PRJ_TOP)/app \
-	$(GTK2_CFLAGS)
+	$(GTK2_CFLAGS) \
+	$(GEGL_CFLAGS)
 
 DEFINES = \
 	-DG_LOG_DOMAIN=\"Gimp-Display\"
@@ -52,6 +53,8 @@
 	gimpnavigationeditor.obj \
 	gimpscalecombobox.obj \
 	gimpstatusbar.obj \
+	gimpdisplayshell-icon.obj \
+	gimpdisplayshell-scale-dialog.obj \
 #	display-enums.obj \
 
 all : \

Modified: branches/soc-2008-tagging/app/file/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/file/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/file/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-noinst_LIBRARIES = libappfile.a
-
 AM_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\"Gimp-File\"
 
@@ -10,10 +8,12 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GDK_PIXBUF_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
 	-I$(includedir)
 
+noinst_LIBRARIES = libappfile.a
+
 libappfile_a_SOURCES = \
 	file-open.c		\
 	file-open.h		\

Modified: branches/soc-2008-tagging/app/file/file-open.c
==============================================================================
--- branches/soc-2008-tagging/app/file/file-open.c	(original)
+++ branches/soc-2008-tagging/app/file/file-open.c	Sun Oct 12 15:38:02 2008
@@ -33,7 +33,7 @@
 #include <unistd.h>
 #endif
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #ifdef G_OS_WIN32

Modified: branches/soc-2008-tagging/app/file/file-save.c
==============================================================================
--- branches/soc-2008-tagging/app/file/file-save.c	(original)
+++ branches/soc-2008-tagging/app/file/file-save.c	Sun Oct 12 15:38:02 2008
@@ -33,7 +33,7 @@
 #include <unistd.h>
 #endif
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #ifdef G_OS_WIN32
@@ -194,6 +194,8 @@
         }
     }
 
+  gimp_image_flush (image);
+
   g_object_unref (image);
 
  out:

Modified: branches/soc-2008-tagging/app/file/file-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/file/file-utils.c	(original)
+++ branches/soc-2008-tagging/app/file/file-utils.c	Sun Oct 12 15:38:02 2008
@@ -23,8 +23,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
-
+#include <gegl.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/gegl/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/gegl/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/gegl/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-GEGL\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappgegl.a
 
 libappgegl_a_SOURCES = \
@@ -28,6 +40,13 @@
 	gimpthresholdconfig.c		\
 	gimpthresholdconfig.h		\
 	\
+	gimpoperationtilesink.c		\
+	gimpoperationtilesink.h		\
+	gimpoperationtilesource.c	\
+	gimpoperationtilesource.h	\
+	\
+	gimpoperationpointfilter.c	\
+	gimpoperationpointfilter.h	\
 	gimpoperationcolorbalance.c	\
 	gimpoperationcolorbalance.h	\
 	gimpoperationcolorize.c		\
@@ -40,23 +59,60 @@
 	gimpoperationhuesaturation.h	\
 	gimpoperationlevels.c		\
 	gimpoperationlevels.h		\
-	gimpoperationpointfilter.c	\
-	gimpoperationpointfilter.h	\
 	gimpoperationposterize.c	\
 	gimpoperationposterize.h	\
 	gimpoperationthreshold.c	\
 	gimpoperationthreshold.h	\
-	gimpoperationtilesink.c		\
-	gimpoperationtilesink.h		\
-	gimpoperationtilesource.c	\
-	gimpoperationtilesource.h
-
-INCLUDES = \
-	-I.			\
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GEGL_CFLAGS)		\
-	$(GDK_PIXBUF_CFLAGS)	\
-	-I$(includedir)
+	\
+	gimpoperationpointcomposer.c	\
+	gimpoperationpointcomposer.h	\
+	gimpoperationdissolvemode.c	\
+	gimpoperationdissolvemode.h	\
+	gimpoperationbehindmode.c	\
+	gimpoperationbehindmode.h	\
+	gimpoperationmultiplymode.c	\
+	gimpoperationmultiplymode.h	\
+	gimpoperationscreenmode.c	\
+	gimpoperationscreenmode.h	\
+	gimpoperationoverlaymode.c	\
+	gimpoperationoverlaymode.h	\
+	gimpoperationdifferencemode.c	\
+	gimpoperationdifferencemode.h	\
+	gimpoperationadditionmode.c	\
+	gimpoperationadditionmode.h	\
+	gimpoperationsubtractmode.c	\
+	gimpoperationsubtractmode.h	\
+	gimpoperationdarkenonlymode.c	\
+	gimpoperationdarkenonlymode.h	\
+	gimpoperationlightenonlymode.c	\
+	gimpoperationlightenonlymode.h	\
+	gimpoperationhuemode.c		\
+	gimpoperationhuemode.h		\
+	gimpoperationsaturationmode.c	\
+	gimpoperationsaturationmode.h	\
+	gimpoperationcolormode.c	\
+	gimpoperationcolormode.h	\
+	gimpoperationvaluemode.c	\
+	gimpoperationvaluemode.h	\
+	gimpoperationdividemode.c	\
+	gimpoperationdividemode.h	\
+	gimpoperationdodgemode.c	\
+	gimpoperationdodgemode.h	\
+	gimpoperationburnmode.c		\
+	gimpoperationburnmode.h		\
+	gimpoperationhardlightmode.c	\
+	gimpoperationhardlightmode.h	\
+	gimpoperationsoftlightmode.c	\
+	gimpoperationsoftlightmode.h	\
+	gimpoperationgrainextractmode.c	\
+	gimpoperationgrainextractmode.h	\
+	gimpoperationgrainmergemode.c	\
+	gimpoperationgrainmergemode.h	\
+	gimpoperationcolorerasemode.c	\
+	gimpoperationcolorerasemode.h	\
+	gimpoperationerasemode.c	\
+	gimpoperationerasemode.h	\
+	gimpoperationreplacemode.c	\
+	gimpoperationreplacemode.h	\
+	gimpoperationantierasemode.c	\
+	gimpoperationantierasemode.h

Modified: branches/soc-2008-tagging/app/gegl/gegl-types.h
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gegl-types.h	(original)
+++ branches/soc-2008-tagging/app/gegl/gegl-types.h	Sun Oct 12 15:38:02 2008
@@ -23,35 +23,62 @@
 
 
 #include "core/core-types.h"
-#include "gegl/gegl-types.h"
 
 
 /*  operations  */
 
-typedef struct _GimpOperationColorBalance    GimpOperationColorBalance;
-typedef struct _GimpOperationColorize        GimpOperationColorize;
-typedef struct _GimpOperationCurves          GimpOperationCurves;
-typedef struct _GimpOperationDesaturate      GimpOperationDesaturate;
-typedef struct _GimpOperationHueSaturation   GimpOperationHueSaturation;
-typedef struct _GimpOperationLevels          GimpOperationLevels;
-typedef struct _GimpOperationPointFilter     GimpOperationPointFilter;
-typedef struct _GimpOperationPosterize       GimpOperationPosterize;
-typedef struct _GimpOperationThreshold       GimpOperationThreshold;
-typedef struct _GimpOperationTileSink        GimpOperationTileSink;
-typedef struct _GimpOperationTileSource      GimpOperationTileSource;
+typedef struct _GimpOperationTileSink         GimpOperationTileSink;
+typedef struct _GimpOperationTileSource       GimpOperationTileSource;
+
+typedef struct _GimpOperationPointFilter      GimpOperationPointFilter;
+typedef struct _GimpOperationColorBalance     GimpOperationColorBalance;
+typedef struct _GimpOperationColorize         GimpOperationColorize;
+typedef struct _GimpOperationCurves           GimpOperationCurves;
+typedef struct _GimpOperationDesaturate       GimpOperationDesaturate;
+typedef struct _GimpOperationHueSaturation    GimpOperationHueSaturation;
+typedef struct _GimpOperationLevels           GimpOperationLevels;
+typedef struct _GimpOperationPosterize        GimpOperationPosterize;
+typedef struct _GimpOperationThreshold        GimpOperationThreshold;
+
+typedef struct _GimpOperationPointComposer    GimpOperationPointComposer;
+typedef struct _GimpOperationDissolveMode     GimpOperationDissolveMode;
+typedef struct _GimpOperationBehindMode       GimpOperationBehindMode;
+typedef struct _GimpOperationMultiplyMode     GimpOperationMultiplyMode;
+typedef struct _GimpOperationScreenMode       GimpOperationScreenMode;
+typedef struct _GimpOperationOverlayMode      GimpOperationOverlayMode;
+typedef struct _GimpOperationDifferenceMode   GimpOperationDifferenceMode;
+typedef struct _GimpOperationAdditionMode     GimpOperationAdditionMode;
+typedef struct _GimpOperationSubtractMode     GimpOperationSubtractMode;
+typedef struct _GimpOperationDarkenOnlyMode   GimpOperationDarkenOnlyMode;
+typedef struct _GimpOperationLightenOnlyMode  GimpOperationLightenOnlyMode;
+typedef struct _GimpOperationHueMode          GimpOperationHueMode;
+typedef struct _GimpOperationSaturationMode   GimpOperationSaturationMode;
+typedef struct _GimpOperationColorMode        GimpOperationColorMode;
+typedef struct _GimpOperationValueMode        GimpOperationValueMode;
+typedef struct _GimpOperationDivideMode       GimpOperationDivideMode;
+typedef struct _GimpOperationDodgeMode        GimpOperationDodgeMode;
+typedef struct _GimpOperationBurnMode         GimpOperationBurnMode;
+typedef struct _GimpOperationHardlightMode    GimpOperationHardlightMode;
+typedef struct _GimpOperationSoftlightMode    GimpOperationSoftlightMode;
+typedef struct _GimpOperationGrainExtractMode GimpOperationGrainExtractMode;
+typedef struct _GimpOperationGrainMergeMode   GimpOperationGrainMergeMode;
+typedef struct _GimpOperationColorEraseMode   GimpOperationColorEraseMode;
+typedef struct _GimpOperationEraseMode        GimpOperationEraseMode;
+typedef struct _GimpOperationReplaceMode      GimpOperationReplaceMode;
+typedef struct _GimpOperationAntiEraseMode    GimpOperationAntiEraseMode;
 
 
 /*  operation config objects  */
 
-typedef struct _GimpBrightnessContrastConfig GimpBrightnessContrastConfig;
-typedef struct _GimpColorBalanceConfig       GimpColorBalanceConfig;
-typedef struct _GimpColorizeConfig           GimpColorizeConfig;
-typedef struct _GimpCurvesConfig             GimpCurvesConfig;
-typedef struct _GimpDesaturateConfig         GimpDesaturateConfig;
-typedef struct _GimpHueSaturationConfig      GimpHueSaturationConfig;
-typedef struct _GimpLevelsConfig             GimpLevelsConfig;
-typedef struct _GimpPosterizeConfig          GimpPosterizeConfig;
-typedef struct _GimpThresholdConfig          GimpThresholdConfig;
+typedef struct _GimpBrightnessContrastConfig  GimpBrightnessContrastConfig;
+typedef struct _GimpColorBalanceConfig        GimpColorBalanceConfig;
+typedef struct _GimpColorizeConfig            GimpColorizeConfig;
+typedef struct _GimpCurvesConfig              GimpCurvesConfig;
+typedef struct _GimpDesaturateConfig          GimpDesaturateConfig;
+typedef struct _GimpHueSaturationConfig       GimpHueSaturationConfig;
+typedef struct _GimpLevelsConfig              GimpLevelsConfig;
+typedef struct _GimpPosterizeConfig           GimpPosterizeConfig;
+typedef struct _GimpThresholdConfig           GimpThresholdConfig;
 
 
 #endif /* __GEGL_TYPES_H__ */

Modified: branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.c	Sun Oct 12 15:38:02 2008
@@ -85,3 +85,42 @@
 
   return NULL;
 }
+
+const gchar *
+gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode)
+{
+#ifdef __GNUC__
+#warning FIXME: add all layer modes as GEGL operations
+#endif
+
+  switch (mode)
+    {
+    case GIMP_NORMAL_MODE:        return "normal";
+    case GIMP_DISSOLVE_MODE:      return "gimp-dissolve-mode";
+    case GIMP_BEHIND_MODE:        return "gimp-behind-mode";
+    case GIMP_MULTIPLY_MODE:      return "gimp-multiply-mode";
+    case GIMP_SCREEN_MODE:        return "gimp-screen-mode";
+    case GIMP_OVERLAY_MODE:       return "gimp-overlay-mode";
+    case GIMP_DIFFERENCE_MODE:    return "gimp-difference-mode";
+    case GIMP_ADDITION_MODE:      return "gimp-addition-mode";
+    case GIMP_SUBTRACT_MODE:      return "gimp-subtract-mode";
+    case GIMP_DARKEN_ONLY_MODE:   return "gimp-darken-mode";
+    case GIMP_LIGHTEN_ONLY_MODE:  return "gimp-lighten-mode";
+    case GIMP_HUE_MODE:           return "gimp-hue-mode";
+    case GIMP_SATURATION_MODE:    return "gimp-saturation-mode";
+    case GIMP_COLOR_MODE:         return "gimp-color-mode";
+    case GIMP_VALUE_MODE:         return "gimp-value-mode";
+    case GIMP_DIVIDE_MODE:        return "gimp-divide-mode";
+    case GIMP_DODGE_MODE:         return "gimp-dodge-mode";
+    case GIMP_BURN_MODE:          return "gimp-burn-mode";
+    case GIMP_HARDLIGHT_MODE:     return "gimp-hardlight-mode";
+    case GIMP_SOFTLIGHT_MODE:     return "gimp-softlight-mode";
+    case GIMP_GRAIN_EXTRACT_MODE: return "gimp-grain-extract-mode";
+    case GIMP_GRAIN_MERGE_MODE:   return "gimp-grain-merge-mode";
+    case GIMP_COLOR_ERASE_MODE:   return "gimp-color-erase-mode";
+    default:
+      break;
+    }
+
+  return "normal";
+}

Modified: branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.h
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.h	(original)
+++ branches/soc-2008-tagging/app/gegl/gimp-gegl-utils.h	Sun Oct 12 15:38:02 2008
@@ -23,9 +23,10 @@
 #define __GIMP_GEGL_UTILS_H__
 
 
-const Babl * gimp_bpp_to_babl_format        (guint bpp) G_GNUC_CONST;
-const Babl * gimp_bpp_to_babl_format_linear (guint bpp) G_GNUC_CONST;
+const Babl  * gimp_bpp_to_babl_format           (guint                bpp) G_GNUC_CONST;
+const Babl  * gimp_bpp_to_babl_format_linear    (guint                bpp) G_GNUC_CONST;
 
+const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode) G_GNUC_CONST;
 
 
 #endif /* __GIMP_GEGL_UTILS_H__ */

Modified: branches/soc-2008-tagging/app/gegl/gimp-gegl.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimp-gegl.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimp-gegl.c	Sun Oct 12 15:38:02 2008
@@ -39,6 +39,32 @@
 #include "gimpoperationtilesink.h"
 #include "gimpoperationtilesource.h"
 
+#include "gimpoperationdissolvemode.h"
+#include "gimpoperationbehindmode.h"
+#include "gimpoperationmultiplymode.h"
+#include "gimpoperationscreenmode.h"
+#include "gimpoperationoverlaymode.h"
+#include "gimpoperationdifferencemode.h"
+#include "gimpoperationadditionmode.h"
+#include "gimpoperationsubtractmode.h"
+#include "gimpoperationdarkenonlymode.h"
+#include "gimpoperationlightenonlymode.h"
+#include "gimpoperationhuemode.h"
+#include "gimpoperationsaturationmode.h"
+#include "gimpoperationcolormode.h"
+#include "gimpoperationvaluemode.h"
+#include "gimpoperationdividemode.h"
+#include "gimpoperationdodgemode.h"
+#include "gimpoperationburnmode.h"
+#include "gimpoperationhardlightmode.h"
+#include "gimpoperationsoftlightmode.h"
+#include "gimpoperationgrainextractmode.h"
+#include "gimpoperationgrainmergemode.h"
+#include "gimpoperationcolorerasemode.h"
+#include "gimpoperationerasemode.h"
+#include "gimpoperationreplacemode.h"
+#include "gimpoperationantierasemode.h"
+
 
 void
 gimp_gegl_init (void)
@@ -48,6 +74,9 @@
                 "tile-height", TILE_HEIGHT,
                 NULL);
 
+  g_type_class_ref (GIMP_TYPE_OPERATION_TILE_SINK);
+  g_type_class_ref (GIMP_TYPE_OPERATION_TILE_SOURCE);
+
   g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_BALANCE);
   g_type_class_ref (GIMP_TYPE_OPERATION_COLORIZE);
   g_type_class_ref (GIMP_TYPE_OPERATION_CURVES);
@@ -56,6 +85,30 @@
   g_type_class_ref (GIMP_TYPE_OPERATION_LEVELS);
   g_type_class_ref (GIMP_TYPE_OPERATION_POSTERIZE);
   g_type_class_ref (GIMP_TYPE_OPERATION_THRESHOLD);
-  g_type_class_ref (GIMP_TYPE_OPERATION_TILE_SINK);
-  g_type_class_ref (GIMP_TYPE_OPERATION_TILE_SOURCE);
+
+  g_type_class_ref (GIMP_TYPE_OPERATION_DISSOLVE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_BEHIND_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_MULTIPLY_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SCREEN_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_OVERLAY_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DIFFERENCE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DARKEN_ONLY_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_LIGHTEN_ONLY_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_HUE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SATURATION_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_VALUE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DIVIDE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_DODGE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_BURN_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_HARDLIGHT_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SOFTLIGHT_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_EXTRACT_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_MERGE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_ERASE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_ERASE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_REPLACE_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_ANTI_ERASE_MODE);
 }

Modified: branches/soc-2008-tagging/app/gegl/gimpbrightnesscontrastconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpbrightnesscontrastconfig.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimpbrightnesscontrastconfig.c	Sun Oct 12 15:38:02 2008
@@ -162,7 +162,7 @@
 {
   GimpLevelsConfig *levels;
   gdouble           brightness;
-  gdouble           contrast;
+  gdouble           slant;
   gdouble           value;
 
   g_return_val_if_fail (GIMP_IS_BRIGHTNESS_CONTRAST_CONFIG (config), NULL);
@@ -170,33 +170,63 @@
   levels = g_object_new (GIMP_TYPE_LEVELS_CONFIG, NULL);
 
   brightness = config->brightness / 2.0;
-  contrast   = (config->contrast < 0 ?
-                (config->contrast + 1.0) :
-                config->contrast * 4.0 + 1.0);
+  slant = tan ((config->contrast + 1) * G_PI_4);
 
-  value = -0.5 * contrast + brightness + 0.5;
-
-  if (value < 0.0)
+  if (config->brightness >= 0)
     {
-      value = 0.0;
+      value = -0.5 * slant + brightness * slant + 0.5;
 
-      levels->low_input[GIMP_HISTOGRAM_VALUE] =
-        (-0.5 - brightness) / contrast + 0.5;
-    }
+      if (value < 0.0)
+        {
+          value = 0.0;
 
-  levels->low_output[GIMP_HISTOGRAM_VALUE] = value;
+          /* this slightly convoluted math follows by inverting the
+           * calculation of the brightness/contrast LUT in base/lut-funcs.h */
 
-  value = 0.5 * contrast + brightness + 0.5;
+          levels->low_input[GIMP_HISTOGRAM_VALUE] =
+            (- brightness * slant + 0.5 * slant - 0.5) / (slant - brightness * slant);
+        }
 
-  if (value > 1.0)
-    {
-      value = 1.0;
+      levels->low_output[GIMP_HISTOGRAM_VALUE] = value;
+
+      value = 0.5 * slant + 0.5;
 
-      levels->high_input[GIMP_HISTOGRAM_VALUE] =
-        (0.5 - brightness) / contrast + 0.5;
+      if (value > 1.0)
+        {
+          value = 1.0;
+
+          levels->high_input[GIMP_HISTOGRAM_VALUE] =
+            (- brightness * slant + 0.5 * slant + 0.5) / (slant - brightness * slant);
+        }
+
+      levels->high_output[GIMP_HISTOGRAM_VALUE] = value;
     }
+  else
+    {
+      value = 0.5 - 0.5 * slant;
 
-  levels->high_output[GIMP_HISTOGRAM_VALUE] = value;
+      if (value < 0.0)
+        {
+          value = 0.0;
+
+          levels->low_input[GIMP_HISTOGRAM_VALUE] =
+            (0.5 * slant - 0.5) / (slant + brightness * slant);
+        }
+
+      levels->low_output[GIMP_HISTOGRAM_VALUE] = value;
+
+      value = slant * brightness + slant * 0.5 + 0.5;
+
+      if (value > 1.0)
+        {
+          value = 1.0;
+
+          levels->high_input[GIMP_HISTOGRAM_VALUE] =
+            (0.5 * slant + 0.5) / (slant + brightness * slant);
+        }
+
+      levels->high_output[GIMP_HISTOGRAM_VALUE] = value;
+    }
 
   return levels;
 }

Modified: branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c	Sun Oct 12 15:38:02 2008
@@ -207,14 +207,8 @@
 
         if (src_curve && dest_curve)
           {
-            gimp_config_sync (G_OBJECT (src_curve), G_OBJECT (dest_curve), 0);
-
-            memcpy (dest_curve->points, src_curve->points,
-                    sizeof (GimpVector2) * src_curve->n_points);
-            memcpy (dest_curve->samples, src_curve->samples,
-                    sizeof (gdouble) * src_curve->n_samples);
-
-            dest_curve->identity = src_curve->identity;
+            gimp_config_copy (GIMP_CONFIG (src_curve),
+                              GIMP_CONFIG (dest_curve), 0);
           }
       }
       break;
@@ -340,8 +334,6 @@
                         flags);
     }
 
-  g_object_notify (G_OBJECT (dest), "curve");
-
   dest_config->channel = src_config->channel;
 
   g_object_notify (G_OBJECT (dest), "channel");
@@ -419,10 +411,12 @@
 
       gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
 
+      gimp_curve_reset (curve, FALSE);
+
       for (j = 0; j < GIMP_CURVE_N_CRUFT_POINTS; j++)
         {
           if (index[i][j] < 0 || value[i][j] < 0)
-            gimp_curve_set_point (curve, j, -1, -1);
+            gimp_curve_set_point (curve, j, -1.0, -1.0);
           else
             gimp_curve_set_point (curve, j,
                                   (gdouble) index[i][j] / 255.0,
@@ -484,9 +478,11 @@
 
       for (j = 0; j < curve->n_points; j++)
         {
-          gdouble x, y;
-
-          gimp_curve_get_point (curve, j, &x, &y);
+          /* don't use gimp_curve_get_point() becaue that doesn't
+           * work when the curve type is GIMP_CURVE_FREE
+           */
+          gdouble x = curve->points[j].x;
+          gdouble y = curve->points[j].y;
 
           if (x < 0.0 || y < 0.0)
             {

Modified: branches/soc-2008-tagging/app/gegl/gimplevelsconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimplevelsconfig.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimplevelsconfig.c	Sun Oct 12 15:38:02 2008
@@ -596,39 +596,42 @@
        channel <= GIMP_HISTOGRAM_ALPHA;
        channel++)
     {
-      GimpCurve *curve = curves->curve[channel];
-      gint       border_point;
-      gint       point;
+      GimpCurve  *curve    = curves->curve[channel];
+      const gint  n_points = gimp_curve_get_n_points (curve);
+      gdouble     gamma    = config->gamma[channel];
+      gdouble     delta_in;
+      gdouble     delta_out;
+      gdouble     x, y;
+
+      /* clear the points set by default */
+      gimp_curve_set_point (curve, 0, -1, -1);
+      gimp_curve_set_point (curve, n_points - 1, -1, -1);
+
+      delta_in  = config->high_input[channel] - config->low_input[channel];
+      delta_out = config->high_output[channel] - config->low_output[channel];
 
-      if (config->low_input[channel]  > 0.0 ||
-          config->low_output[channel] > 0.0)
-        {
-          border_point = gimp_curve_get_closest_point (curve, 0.0);
-          point = gimp_curve_get_closest_point (curve,
-                                                config->low_input[channel]);
-
-          gimp_curve_set_point (curve, point,
-                                config->low_input[channel],
-                                config->low_output[channel]);
+      x = config->low_input[channel];
+      y = config->low_output[channel];
 
-          if (point != border_point)
-            gimp_curve_set_point (curve, border_point, -1, -1);
-        }
+      gimp_curve_set_point (curve,
+                            CLAMP (n_points * x, 0, n_points - 1), x, y);
 
-      if (config->high_input[channel]  < 1.0 ||
-          config->high_output[channel] < 1.0)
+      if (delta_out != 0 && gamma != 1.0)
         {
-          border_point = gimp_curve_get_closest_point (curve, 1.0);
-          point = gimp_curve_get_closest_point (curve,
-                                                config->high_input[channel]);
-
-          gimp_curve_set_point (curve, point,
-                                config->high_input[channel],
-                                config->high_output[channel]);
+          x = (config->low_input[channel] +
+               pow (gamma, gamma / (1 - gamma)) * delta_in);
+          y = (config->low_output[channel] +
+               pow (gamma, 1.0 / (1 - gamma)) * delta_out);
 
-          if (point != border_point)
-            gimp_curve_set_point (curve, border_point, -1, -1);
+          gimp_curve_set_point (curve,
+                                CLAMP (n_points * x, 0, n_points - 1), x, y);
         }
+
+      x = config->high_input[channel];
+      y = config->high_output[channel];
+
+      gimp_curve_set_point (curve,
+                            CLAMP (n_points * x, 0, n_points - 1), x, y);
     }
 
   return curves;

Modified: branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationhuesaturation.c	Sun Oct 12 15:38:02 2008
@@ -207,14 +207,34 @@
 
       if (use_secondary_hue)
         {
-          hsl.h = (map_hue        (config, hue,           hsl.h) * primary_intensity +
-                   map_hue        (config, secondary_hue, hsl.h) * secondary_intensity);
+          gdouble mapped_primary_hue;
+          gdouble mapped_secondary_hue;
+          gdouble diff;
+
+          mapped_primary_hue   = map_hue (config, hue,           hsl.h);
+          mapped_secondary_hue = map_hue (config, secondary_hue, hsl.h);
+
+          /* Find nearest hue on the circle between primary and
+           * secondary hue
+           */
+          diff = mapped_primary_hue - mapped_secondary_hue;
+          if (diff < -0.5)
+            {
+              mapped_secondary_hue -= 1.0;
+            }
+          else if (diff >= 0.5)
+            {
+              mapped_secondary_hue += 1.0;
+            }
+
+          hsl.h = (mapped_primary_hue   * primary_intensity +
+                   mapped_secondary_hue * secondary_intensity);
 
           hsl.s = (map_saturation (config, hue,           hsl.s) * primary_intensity +
                    map_saturation (config, secondary_hue, hsl.s) * secondary_intensity);
 
-          hsl.l = (map_lightness  (config, hue,           hsl.l) * primary_intensity +
-                   map_lightness  (config, secondary_hue, hsl.l) * secondary_intensity);
+          hsl.l = (map_lightness (config, hue,           hsl.l) * primary_intensity +
+                   map_lightness (config, secondary_hue, hsl.l) * secondary_intensity);
         }
       else
         {

Modified: branches/soc-2008-tagging/app/gegl/gimpoperationpointfilter.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpoperationpointfilter.c	(original)
+++ branches/soc-2008-tagging/app/gegl/gimpoperationpointfilter.c	Sun Oct 12 15:38:02 2008
@@ -31,8 +31,8 @@
 static void   gimp_operation_point_filter_finalize (GObject *object);
 
 
-G_DEFINE_TYPE (GimpOperationPointFilter, gimp_operation_point_filter,
-               GEGL_TYPE_OPERATION_POINT_FILTER)
+G_DEFINE_ABSTRACT_TYPE (GimpOperationPointFilter, gimp_operation_point_filter,
+                        GEGL_TYPE_OPERATION_POINT_FILTER)
 
 #define parent_class gimp_operation_point_filter_parent_class
 

Modified: branches/soc-2008-tagging/app/gegl/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/gegl/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/gegl/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -27,7 +27,21 @@
 	gimpoperationposterize.obj \
 	gimpoperationthreshold.obj \
 	gimpoperationtilesink.obj \
-	gimpoperationtilesource.obj
+	gimpoperationtilesource.obj \
+	gimpbrightnesscontrastconfig.obj \
+	gimpcolorbalanceconfig.obj \
+	gimpcolorizeconfig.obj \
+	gimpcurvesconfig.obj \
+	gimpdesaturateconfig.obj \
+	gimphuesaturationconfig.obj \
+	gimplevelsconfig.obj \
+	gimpoperationcolorbalance.obj \
+	gimpoperationcurves.obj \
+	gimpoperationhuesaturation.obj \
+	gimpoperationlevels.obj \
+	gimpoperationpointfilter.obj \
+	gimpposterizeconfig.obj \
+	gimpthresholdconfig.obj \
 
 INCLUDES = \
 	-FImsvc_recommended_pragmas.h \
@@ -38,8 +52,8 @@
 
 DEFINES = \
 	-DGIMP_COMPILATION \
-	-DGIMP_APP_VERSION=\"2.4\" \
-	-DG_LOG_DOMAIN=\"Gimp-Gegl\"
+	-DG_LOG_DOMAIN=\"Gimp-Gegl\" \
+	$(GIMP_VERSION_DEFINES)
 
 all : \
 	$(PRJ_TOP)\config.h \

Modified: branches/soc-2008-tagging/app/gimp-log.c
==============================================================================
--- branches/soc-2008-tagging/app/gimp-log.c	(original)
+++ branches/soc-2008-tagging/app/gimp-log.c	Sun Oct 12 15:38:02 2008
@@ -43,7 +43,8 @@
         { "menus",          GIMP_LOG_MENUS          },
         { "save-dialog",    GIMP_LOG_SAVE_DIALOG    },
         { "image-scale",    GIMP_LOG_IMAGE_SCALE    },
-        { "shadow-tiles",   GIMP_LOG_SHADOW_TILES   }
+        { "shadow-tiles",   GIMP_LOG_SHADOW_TILES   },
+        { "scale",          GIMP_LOG_SCALE          }
       };
 
       gimp_log_flags = g_parse_debug_string (env_log_val,

Modified: branches/soc-2008-tagging/app/gimp-log.h
==============================================================================
--- branches/soc-2008-tagging/app/gimp-log.h	(original)
+++ branches/soc-2008-tagging/app/gimp-log.h	Sun Oct 12 15:38:02 2008
@@ -30,7 +30,8 @@
   GIMP_LOG_MENUS          = 1 << 5,
   GIMP_LOG_SAVE_DIALOG    = 1 << 6,
   GIMP_LOG_IMAGE_SCALE    = 1 << 7,
-  GIMP_LOG_SHADOW_TILES   = 1 << 8
+  GIMP_LOG_SHADOW_TILES   = 1 << 8,
+  GIMP_LOG_SCALE          = 1 << 9
 } GimpLogFlags;
 
 
@@ -80,6 +81,7 @@
 #define SAVE_DIALOG    GIMP_LOG_SAVE_DIALOG
 #define IMAGE_SCALE    GIMP_LOG_IMAGE_SCALE
 #define SHADOW_TILES   GIMP_LOG_SHADOW_TILES
+#define SCALE          GIMP_LOG_SCALE
 
 #if 0 /* last resort */
 #  define GIMP_LOG /* nothing => no varargs, no log */

Modified: branches/soc-2008-tagging/app/gimpcore.def
==============================================================================
--- branches/soc-2008-tagging/app/gimpcore.def	(original)
+++ branches/soc-2008-tagging/app/gimpcore.def	Sun Oct 12 15:38:02 2008
@@ -19,7 +19,6 @@
 	color_balance
 	color_balance_create_lookup_tables
 	color_balance_init
-	color_balance_range_reset
 	colorize
 	colorize_calculate
 	colorize_init
@@ -257,7 +256,6 @@
 	gimp_help
 	gimp_histogram_calculate
 	gimp_histogram_channel_get_type
-	gimp_histogram_free
 	gimp_histogram_get_count
 	gimp_histogram_get_maximum
 	gimp_histogram_get_mean
@@ -520,7 +518,6 @@
 	gimp_rectangle_intersect
 	gimp_repeat_mode_get_type
 	gimp_restore
-	gimp_scan_convert_add_points
 	gimp_scan_convert_free
 	gimp_scan_convert_new
 	gimp_scan_convert_render
@@ -616,10 +613,6 @@
 	hue_saturation
 	hue_saturation_calculate_transfers
 	hue_saturation_init
-	hue_saturation_partition_reset
-	levels_adjust_by_colors
-	levels_calculate_transfers
-	levels_channel_reset
 	levels_init
 	levels_lut_func
 	pixel_region_init
@@ -685,7 +678,6 @@
 gimp_progress_start
 gimp_stroke_desc_new
 gimp_view_size_get_type
-levels_stretch
 gimp_templates_migrate
 file_utils_filename_from_uri
 gimp_drawable_get_sub_preview
@@ -710,13 +702,11 @@
 gimp_layer_new_from_pixbuf
 gimp_viewable_get_new_pixbuf
 gimp_viewable_get_size
-gimp_documents_save
 gimp_container_clear
 gimp_dash_pattern_free
 gimp_dash_pattern_new_from_preset
 gimp_dash_pattern_copy
 gimp_dash_pattern_new_from_segments
-gimp_stroke_options_set_dash_pattern
 boundary_find
 boundary_sort
 gimp_contexts_clear
@@ -930,3 +920,65 @@
 gimp_image_get_guides
 gimp_image_get_sample_points
 gimp_plug_in_manager_get_menu_branches
+desaturate_region
+file_utils_filename_is_uri
+get_pid
+gimp_brightness_contrast_config_get_type
+gimp_brightness_contrast_config_set_node
+gimp_brightness_contrast_config_to_levels_config
+gimp_buffer_get_tiles
+gimp_color_balance_config_get_type
+gimp_color_balance_config_reset_range
+gimp_color_balance_config_to_cruft
+gimp_colorize_config_get_type
+gimp_colorize_config_to_cruft
+gimp_container_get_first_child
+gimp_context_display_changed
+gimp_curve_get_curve_type
+gimp_curve_get_n_points
+gimp_curve_get_n_samples
+gimp_curve_get_point
+gimp_curve_map_value
+gimp_curves_config_get_type
+gimp_curves_config_load_cruft
+gimp_curves_config_save_cruft
+gimp_curves_config_to_cruft
+gimp_desaturate_config_get_type
+gimp_display_options_no_image_get_type
+gimp_histogram_duplicate
+gimp_histogram_ref
+gimp_histogram_unref
+gimp_hue_saturation_config_get_type
+gimp_hue_saturation_config_reset_range
+gimp_hue_saturation_config_to_cruft
+gimp_image_get_projection
+gimp_image_map_config_compare
+gimp_image_map_config_get_type
+gimp_imagefile_set_mime_type
+gimp_is_restored
+gimp_item_is_attached
+gimp_layer_new_from_tiles
+gimp_levels_config_adjust_by_colors
+gimp_levels_config_get_type
+gimp_levels_config_load_cruft
+gimp_levels_config_reset_channel
+gimp_levels_config_save_cruft
+gimp_levels_config_stretch
+gimp_levels_config_to_cruft
+gimp_levels_config_to_curves_config
+gimp_list_set_sort_func
+gimp_marshal_BOOLEAN__STRING
+gimp_marshal_VOID__DOUBLE
+gimp_marshal_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE
+gimp_operation_hue_saturation_map
+gimp_operation_levels_map_input
+gimp_perspective_clone_set_transform
+gimp_posterize_config_get_type
+gimp_recent_list_load
+gimp_scan_convert_compose_value
+gimp_stroke_options_take_dash_pattern
+gimp_threshold_config_get_type
+gimp_threshold_config_to_cruft
+gimp_tool_info_build_options_filename
+gimp_use_gegl
+gimp_vectors_make_bezier

Modified: branches/soc-2008-tagging/app/gui/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/gui/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/gui/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -9,6 +9,7 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GTK_CFLAGS)		\
 	$(DBUS_GLIB_CFLAGS)	\
 	-I$(includedir)

Modified: branches/soc-2008-tagging/app/gui/gimpdbusservice.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gimpdbusservice.c	(original)
+++ branches/soc-2008-tagging/app/gui/gimpdbusservice.c	Sun Oct 12 15:38:02 2008
@@ -171,9 +171,16 @@
 
   g_return_val_if_fail (GIMP_IS_DBUS_SERVICE (service), FALSE);
 
+  /*  We want to be called again later in case that GIMP is not fully
+   *  started yet.
+   */
+  if (! gimp_is_restored (service->gimp))
+    return TRUE;
+
   display = gimp_container_get_first_child (service->gimp->displays);
 
-  gtk_window_present (GTK_WINDOW (GIMP_DISPLAY (display)->shell));
+  if (display)
+    gtk_window_present (GTK_WINDOW (GIMP_DISPLAY (display)->shell));
 
   return TRUE;
 }
@@ -194,6 +201,7 @@
     {
       service->source = g_idle_source_new ();
 
+      g_source_set_priority (service->source, G_PRIORITY_LOW);
       g_source_set_callback (service->source,
                              (GSourceFunc) gimp_dbus_service_open_idle, service,
                              NULL);
@@ -215,7 +223,12 @@
 static gboolean
 gimp_dbus_service_open_idle (GimpDBusService *service)
 {
-  OpenData *data = g_queue_pop_tail (service->queue);
+  OpenData *data;
+
+  if (! service->gimp->restored)
+    return TRUE;
+
+  data = g_queue_pop_tail (service->queue);
 
   if (data)
     {

Modified: branches/soc-2008-tagging/app/gui/gui-unique.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui-unique.c	(original)
+++ branches/soc-2008-tagging/app/gui/gui-unique.c	Sun Oct 12 15:38:02 2008
@@ -49,10 +49,13 @@
 #endif
 
 #ifdef G_OS_WIN32
+#include "file/file-open.h"
+
 static void gui_unique_win32_init  (Gimp *gimp);
 static void gui_unique_win32_exit  (void);
 
 static Gimp            *unique_gimp      = NULL;
+static HWND             proxy_window     = NULL;
 #endif
 
 
@@ -69,10 +72,10 @@
 void
 gui_unique_exit (void)
 {
-#if HAVE_DBUS_GLIB
-  gui_dbus_service_exit ();
-#elif HAVE_DBUS_GLIB
+#ifdef G_OS_WIN32
   gui_unique_win32_exit ();
+#elif HAVE_DBUS_GLIB
+  gui_dbus_service_exit ();
 #endif
 }
 
@@ -131,7 +134,7 @@
 static IdleOpenData *
 idle_open_data_new (const gchar *name,
                     gint         len,
-		    gboolean     as_new)
+                    gboolean     as_new)
 {
   IdleOpenData *data = g_slice_new0 (IdleOpenData);
 
@@ -154,6 +157,12 @@
 static gboolean
 gui_unique_win32_idle_open (IdleOpenData *data)
 {
+  /*  We want to be called again later in case that GIMP is not fully
+   *  started yet.
+   */
+  if (! gimp_is_restored (unique_gimp))
+    return TRUE;
+
   if (data->name)
     {
       file_open_from_command_line (unique_gimp, data->name, data->as_new);
@@ -172,11 +181,11 @@
 }
 
 
-LRESULT CALLBACK
+static LRESULT CALLBACK
 gui_unique_win32_message_handler (HWND   hWnd,
-				  UINT   uMsg,
-				  WPARAM wParam,
-				  LPARAM lParam)
+                                  UINT   uMsg,
+                                  WPARAM wParam,
+                                  LPARAM lParam)
 {
   switch (uMsg)
     {
@@ -199,6 +208,7 @@
           g_object_watch_closure (unique_gimp, closure);
 
           source = g_idle_source_new ();
+          g_source_set_priority (source, G_PRIORITY_LOW);
           g_source_set_closure (source, closure);
           g_source_attach (source, NULL);
           g_source_unref (source);
@@ -229,10 +239,10 @@
 
   RegisterClassW (&wc);
 
-  CreateWindowExW (0,
-		   GIMP_UNIQUE_WIN32_WINDOW_CLASS,
-		   GIMP_UNIQUE_WIN32_WINDOW_NAME,
-		   WS_POPUP, 0, 0, 1, 1, NULL, NULL, wc.hInstance, NULL);
+  proxy_window = CreateWindowExW (0,
+                                  GIMP_UNIQUE_WIN32_WINDOW_CLASS,
+                                  GIMP_UNIQUE_WIN32_WINDOW_NAME,
+                                  WS_POPUP, 0, 0, 1, 1, NULL, NULL, wc.hInstance, NULL);
 }
 
 static void
@@ -241,6 +251,8 @@
   g_return_if_fail (GIMP_IS_GIMP (unique_gimp));
 
   unique_gimp = NULL;
+
+  DestroyWindow (proxy_window);
 }
 
 

Modified: branches/soc-2008-tagging/app/gui/gui-vtable.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui-vtable.c	(original)
+++ branches/soc-2008-tagging/app/gui/gui-vtable.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #ifdef GDK_WINDOWING_X11

Modified: branches/soc-2008-tagging/app/gui/gui.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui.c	(original)
+++ branches/soc-2008-tagging/app/gui/gui.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -192,6 +193,10 @@
   if (abort_message)
     gui_abort (abort_message);
 
+  the_gui_gimp = gimp;
+
+  gui_unique_init (gimp);
+
   gimp_widgets_init (gui_help_func,
                      gui_get_foreground_func,
                      gui_get_background_func,
@@ -199,8 +204,6 @@
 
   g_type_class_ref (GIMP_TYPE_COLOR_SELECT);
 
-  the_gui_gimp = gimp;
-
   /*  disable automatic startup notification  */
   gtk_window_set_auto_startup_notification (FALSE);
 
@@ -512,8 +515,6 @@
   display = GIMP_DISPLAY (gimp_create_display (gimp,
                                                NULL, GIMP_UNIT_PIXEL, 1.0));
 
-  gui_unique_init (gimp);
-
   if (gui_config->restore_session)
     session_restore (gimp);
 

Modified: branches/soc-2008-tagging/app/gui/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/gui/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/gui/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -35,6 +35,8 @@
 	session.obj \
 	splash.obj \
 	themes.obj \
+	gimpdbusservice.obj \
+	gui-unique.obj \
 
 INCLUDES = \
 	-FImsvc_recommended_pragmas.h \

Modified: branches/soc-2008-tagging/app/gui/splash.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/splash.c	(original)
+++ branches/soc-2008-tagging/app/gui/splash.c	Sun Oct 12 15:38:02 2008
@@ -159,8 +159,7 @@
   /*  create the pango layouts  */
   splash->upper = gtk_widget_create_pango_layout (splash->area, "");
   splash->lower = gtk_widget_create_pango_layout (splash->area, "");
-
-  gimp_pango_layout_set_weight (splash->upper, PANGO_WEIGHT_BOLD);
+  gimp_pango_layout_set_scale (splash->lower, PANGO_SCALE_SMALL);
 
   /*  this sets the initial layout positions  */
   splash_position_layouts (splash, "", "", NULL);
@@ -252,7 +251,7 @@
   gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (splash->progress),
                                  percentage);
 
-  while (gtk_events_pending ())
+  if (gtk_events_pending ())
     gtk_main_iteration ();
 }
 

Modified: branches/soc-2008-tagging/app/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -16,7 +16,7 @@
 
 SUBDIRS = composite paint-funcs base config xcf core file text \
 	dialogs display paint vectors pdb plug-in tools widgets gui \
-	actions menus
+	actions menus gegl
 
 sub-all: 
 	for %d in ($(SUBDIRS)) do nmake -nologo -f makefile.msc sub-one THIS=%d
@@ -101,7 +101,9 @@
 	batch.obj \
 	errors.obj \
 	sanity.obj \
+	unique.obj \
 	units.obj \
+	version.obj \
 	\
 	actions/appactions.lib \
 	menus/appmenus.lib \

Modified: branches/soc-2008-tagging/app/menus/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/menus/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/menus/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Menus\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GTK_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappmenus.a
 
 libappmenus_a_SOURCES = \
@@ -21,17 +33,4 @@
 	windows-menu.c		\
 	windows-menu.h
 
-
-EXTRA_DIST = \
-	makefile.msc
-
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Menus\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GTK_CFLAGS)		\
-	-I$(includedir)
+EXTRA_DIST = makefile.msc

Modified: branches/soc-2008-tagging/app/menus/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/menus/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/menus/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -29,9 +29,10 @@
 	image-menu.obj \
 	menus.obj \
 	plug-in-menus.obj \
-	toolbox-menu.obj \
+#	toolbox-menu.obj \
 	tool-options-menu.obj \
 	window-menu.obj \
+	windows-menu.obj \
 
 $(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
 	copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h

Modified: branches/soc-2008-tagging/app/menus/menus.c
==============================================================================
--- branches/soc-2008-tagging/app/menus/menus.c	(original)
+++ branches/soc-2008-tagging/app/menus/menus.c	Sun Oct 12 15:38:02 2008
@@ -94,6 +94,7 @@
 
   gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
                                       "file",
+                                      "config",
                                       "context",
                                       "debug",
                                       "help",
@@ -121,6 +122,7 @@
 
   gimp_menu_factory_manager_register (global_menu_factory, "<Toolbox>",
                                       "file",
+                                      "config",
                                       "context",
                                       "help",
                                       "edit",
@@ -140,6 +142,7 @@
 
   gimp_menu_factory_manager_register (global_menu_factory, "<Dock>",
                                       "file",
+                                      "config",
                                       "context",
                                       "edit",
                                       "select",

Modified: branches/soc-2008-tagging/app/menus/windows-menu.c
==============================================================================
--- branches/soc-2008-tagging/app/menus/windows-menu.c	(original)
+++ branches/soc-2008-tagging/app/menus/windows-menu.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpthumb/gimpthumb.h"
@@ -27,6 +28,7 @@
 #include "config/gimpguiconfig.h"
 
 #include "core/gimp.h"
+#include "core/gimpimage.h"
 #include "core/gimplist.h"
 #include "core/gimpviewable.h"
 
@@ -66,6 +68,13 @@
                                            GimpSessionInfo   *info,
                                            GimpUIManager     *manager);
 
+static gboolean  windows_menu_display_query_tooltip (GtkWidget  *widget,
+                                                     gint        x,
+                                                     gint        y,
+                                                     gboolean    keyboard_mode,
+                                                     GtkTooltip *tooltip,
+                                                     GimpAction *action);
+
 
 void
 windows_menu_setup (GimpUIManager *manager,
@@ -181,11 +190,14 @@
 
       if (! merge_id)
         {
+          GtkWidget   *widget;
           const gchar *ui_path;
           gchar       *action_name;
           gchar       *action_path;
+          gchar       *full_path;
 
-          ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");
+          ui_path = g_object_get_data (G_OBJECT (manager),
+                                       "image-menu-ui-path");
 
           action_name = g_strdup_printf ("windows-display-%04d",
                                          gimp_display_get_ID (display));
@@ -201,8 +213,26 @@
                                  GTK_UI_MANAGER_MENUITEM,
                                  FALSE);
 
-          g_free (action_path);
+          full_path = g_strconcat (action_path, "/", action_name, NULL);
+
+          widget = gtk_ui_manager_get_widget (GTK_UI_MANAGER (manager),
+                                              full_path);
+
+          if (widget)
+            {
+              GtkAction *action;
+
+              action = gimp_ui_manager_find_action (manager,
+                                                    "windows", action_name);
+
+              g_signal_connect_object (widget, "query-tooltip",
+                                       G_CALLBACK (windows_menu_display_query_tooltip),
+                                       action, 0);
+            }
+
           g_free (action_name);
+          g_free (action_path);
+          g_free (full_path);
         }
 
       g_free (merge_key);
@@ -324,3 +354,38 @@
 
   g_free (merge_key);
 }
+
+static gboolean
+windows_menu_display_query_tooltip (GtkWidget  *widget,
+                                    gint        x,
+                                    gint        y,
+                                    gboolean    keyboard_mode,
+                                    GtkTooltip *tooltip,
+                                    GimpAction *action)
+{
+  GimpImage *image = GIMP_IMAGE (action->viewable);
+  gchar     *text;
+  gdouble    xres;
+  gdouble    yres;
+  gint       width;
+  gint       height;
+
+  text = gtk_widget_get_tooltip_text (widget);
+  gtk_tooltip_set_text (tooltip, text);
+  g_free (text);
+
+  gimp_image_get_resolution (image, &xres, &yres);
+
+  gimp_viewable_calc_preview_size (gimp_image_get_width  (image),
+                                   gimp_image_get_height (image),
+                                   GIMP_VIEW_SIZE_HUGE, GIMP_VIEW_SIZE_HUGE,
+                                   FALSE, xres, yres,
+                                   &width, &height, NULL);
+
+  gtk_tooltip_set_icon (tooltip,
+                        gimp_viewable_get_pixbuf (action->viewable,
+                                                  action->context,
+                                                  width, height));
+
+  return TRUE;
+}

Modified: branches/soc-2008-tagging/app/paint-funcs/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/paint-funcs/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/paint-funcs/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,21 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Paint-Funcs\"
+
+AM_CCASFLAGS = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir) 	\
+	-I$(top_srcdir)/app
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GLIB_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libapppaint-funcs.a
 
 libapppaint_funcs_a_SOURCES = \
@@ -14,20 +30,4 @@
 	subsample-region.c	\
 	subsample-region.h
 
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GLIB_CFLAGS)		\
-	-I$(includedir)
-
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Paint-Funcs\"
-
-AM_CCASFLAGS = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir) 	\
-	-I$(top_srcdir)/app
-
 EXTRA_DIST = makefile.msc

Modified: branches/soc-2008-tagging/app/paint-funcs/paint-funcs.c
==============================================================================
--- branches/soc-2008-tagging/app/paint-funcs/paint-funcs.c	(original)
+++ branches/soc-2008-tagging/app/paint-funcs/paint-funcs.c	Sun Oct 12 15:38:02 2008
@@ -1886,6 +1886,35 @@
 /**************************************************/
 
 void
+clear_region (PixelRegion *dest)
+{
+  gpointer pr;
+
+  for (pr = pixel_regions_register (1, dest);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
+    {
+      if (dest->w * dest->bytes == dest->rowstride)
+        {
+          memset (dest->data, 0, dest->w * dest->h * dest->bytes);
+        }
+      else
+        {
+          guchar *d = dest->data;
+          gint    h = dest->h;
+
+          while (h--)
+            {
+              memset (d, 0, dest->w * dest->bytes);
+
+              d += dest->rowstride;
+            }
+        }
+    }
+}
+
+
+void
 color_region (PixelRegion  *dest,
               const guchar *col)
 {

Modified: branches/soc-2008-tagging/app/paint-funcs/paint-funcs.h
==============================================================================
--- branches/soc-2008-tagging/app/paint-funcs/paint-funcs.h	(original)
+++ branches/soc-2008-tagging/app/paint-funcs/paint-funcs.h	Sun Oct 12 15:38:02 2008
@@ -339,6 +339,9 @@
 
 
 /*  Region functions  */
+
+void  clear_region                        (PixelRegion  *dest);
+
 void  color_region                        (PixelRegion  *dest,
                                            const guchar *color);
 void  color_region_mask                   (PixelRegion  *dest,

Modified: branches/soc-2008-tagging/app/paint-funcs/scale-region.c
==============================================================================
--- branches/soc-2008-tagging/app/paint-funcs/scale-region.c	(original)
+++ branches/soc-2008-tagging/app/paint-funcs/scale-region.c	Sun Oct 12 15:38:02 2008
@@ -29,323 +29,286 @@
 #include "base/tile.h"
 #include "base/tile-manager.h"
 #include "base/pixel-region.h"
+#include "base/pixel-surround.h"
 
 #include "paint-funcs.h"
 #include "scale-region.h"
 
+#include "gimp-log.h"
 
-static void           scale_region_buffer     (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data);
-static void           scale_region_tile       (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data);
-static void           scale                   (TileManager           *srcTM,
-                                               TileManager           *dstTM,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data,
-                                               gint                  *progress,
-                                               gint                   max_progress);
-static void           scale_pr                (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation);
-static void           interpolate_bilinear    (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               const gdouble  xfrac,
-                                               const gdouble  yfrac,
-                                               guchar        *pixel);
-static void           interpolate_nearest     (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               const gdouble  xfrac,
-                                               const gdouble  yfrac,
-                                               guchar        *pixel);
-static void           interpolate_cubic       (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gdouble  xfrac,
-                                               const gdouble  yfrac,
-                                               guchar        *pixel);
-static void           decimate_gauss          (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               guchar        *pixel);
-static void           decimate_average        (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               guchar        *pixel);
-static gfloat *       create_lanczos3_lookup  (void);
-static void           interpolate_lanczos3    (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               const gdouble  xfrac,
-                                               const gdouble  yfrac,
-                                               guchar        *pixel,
-                                               const gfloat  *kernel_lookup);
-static void           decimate_average_pr     (PixelRegion   *srcPR,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               guchar        *pixel);
-static void           interpolate_bilinear_pr (PixelRegion   *srcPR,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               const gint     x1,
-                                               const gint     y1,
-                                               const gdouble  xfrac,
-                                               const gdouble  yfrac,
-                                               guchar        *pixel);
-static void           determine_scale         (PixelRegion   *srcPR,
-                                               PixelRegion   *dstPR,
-                                               gint          *levelx,
-                                               gint          *levely,
-                                               gint          *max_progress);
-static inline void    gaussan_lanczos2        (const guchar  *pixels,
-                                               const gint     bytes,
-                                               guchar        *pixel);
-static inline void    decimate_lanczos2       (TileManager   *srcTM,
-                                               const gint     x0,
-                                               const gint     y0,
-                                               guchar        *pixel);
-static inline void    pixel_average           (const guchar  *p1,
-                                               const guchar  *p2,
-                                               const guchar  *p3,
-                                               const guchar  *p4,
-                                               guchar        *pixel,
-                                               const gint     bytes);
-static inline void    gaussan_decimate        (const guchar  *pixels,
-                                               const gint     bytes,
-                                               guchar        *pixel);
-static inline gdouble cubic_spline_fit        (const gdouble  dx,
-                                               const gint     pt0,
-                                               const gint     pt1,
-                                               const gint     pt2,
-                                               const gint     pt3);
-static inline gdouble weighted_sum            (const gdouble  dx,
-                                               const gdouble  dy,
-                                               const gint     s00,
-                                               const gint     s10,
-                                               const gint     s01,
-                                               const gint     s11);
-static inline gdouble sinc                    (const gdouble  x);
-static inline gdouble lanczos3_mul_alpha      (const guchar  *pixels,
-                                               const gdouble *x_kernel,
-                                               const gdouble *y_kernel,
-                                               const gint     bytes,
-                                               const gint     byte);
-static inline gdouble lanczos3_mul            (const guchar  *pixels,
-                                               const gdouble *x_kernel,
-                                               const gdouble *y_kernel,
-                                               const gint     bytes,
-                                               const gint     byte);
 
+#define NUM_TILES(w,h) ((((w) + (TILE_WIDTH - 1)) / TILE_WIDTH) *  \
+                        (((h) + (TILE_HEIGHT - 1)) / TILE_HEIGHT))
+
+
+static void           scale_determine_levels   (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                gint                  *levelx,
+                                                gint                  *levely);
+static gint           scale_determine_progress (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                gint                   levelx,
+                                                gint                   levely);
+
+static void           scale_region_buffer      (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR);
+static void           scale_region_tile        (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data);
+static void           scale                    (TileManager           *srcTM,
+                                                TileManager           *dstTM,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data,
+                                                gint                  *progress,
+                                                gint                   max_progress);
+static void           decimate_xy              (TileManager           *srcTM,
+                                                TileManager           *dstTM,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data,
+                                                gint                  *progress,
+                                                gint                   max_progress);
+static void           decimate_x               (TileManager           *srcTM,
+                                                TileManager           *dstTM,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data,
+                                                gint                  *progress,
+                                                gint                   max_progress);
+static void           decimate_y               (TileManager           *srcTM,
+                                                TileManager           *dstTM,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data,
+                                                gint                  *progress,
+                                                gint                   max_progress);
+static void           decimate_average_xy      (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           decimate_average_y       (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           decimate_average_x       (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           interpolate_nearest      (TileManager   *srcTM,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                guchar        *pixel);
+static void           interpolate_bilinear     (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           interpolate_cubic        (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static gfloat *       create_lanczos3_lookup   (void);
+static void           interpolate_lanczos3     (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel,
+                                                const gfloat  *kernel_lookup);
+static void           interpolate_bilinear_pr  (PixelRegion   *srcPR,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     x1,
+                                                const gint     y1,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                guchar        *pixel);
+static inline gdouble cubic_spline_fit         (const gdouble  dx,
+                                                const gdouble  x1,
+                                                const gdouble  y1,
+                                                const gdouble  x2,
+                                                const gdouble  y2);
+static inline gdouble weighted_sum             (const gdouble  dx,
+                                                const gdouble  dy,
+                                                const gint     s00,
+                                                const gint     s10,
+                                                const gint     s01,
+                                                const gint     s11);
+static inline gdouble sinc                     (const gdouble  x);
+static inline gdouble lanczos3_mul_alpha       (const guchar  *pixels,
+                                                const gdouble *x_kernel,
+                                                const gdouble *y_kernel,
+                                                const gint     stride,
+                                                const gint     bytes,
+                                                const gint     byte);
+static inline gdouble lanczos3_mul             (const guchar  *pixels,
+                                                const gdouble *x_kernel,
+                                                const gdouble *y_kernel,
+                                                const gint     stride,
+                                                const gint     bytes,
+                                                const gint     byte);
+
+
+
+void
+scale_region (PixelRegion           *srcPR,
+              PixelRegion           *dstPR,
+              GimpInterpolationType  interpolation,
+              GimpProgressFunc       progress_callback,
+              gpointer               progress_data)
+{
+  /* Copy and return if scale = 1.0 */
+  if (srcPR->h == dstPR->h && srcPR->w == dstPR->w)
+    {
+      copy_region (srcPR, dstPR);
+      return;
+    }
+
+  if (srcPR->tiles == NULL && srcPR->data != NULL)
+    {
+      g_return_if_fail (interpolation == GIMP_INTERPOLATION_LINEAR);
+      g_return_if_fail (progress_callback == NULL);
+
+      scale_region_buffer (srcPR, dstPR);
+      return;
+    }
+
+  if (srcPR->tiles != NULL && srcPR->data == NULL)
+    {
+      scale_region_tile (srcPR, dstPR, interpolation,
+                         progress_callback, progress_data);
+      return;
+    }
+
+  g_assert_not_reached ();
+}
 
 static void
-determine_scale (PixelRegion *srcPR,
-                 PixelRegion *dstPR,
-                 gint        *levelx,
-                 gint        *levely,
-                 gint        *max_progress)
+scale_determine_levels (PixelRegion *srcPR,
+                        PixelRegion *dstPR,
+                        gint        *levelx,
+                        gint        *levely)
 {
   gdouble scalex = (gdouble) dstPR->w / (gdouble) srcPR->w;
   gdouble scaley = (gdouble) dstPR->h / (gdouble) srcPR->h;
   gint    width  = srcPR->w;
   gint    height = srcPR->h;
 
-  *max_progress = ((height % TILE_HEIGHT) + 1) * ((width % TILE_WIDTH) + 1);
-
   /* determine scaling levels */
-  while (scalex >= 2)
+  while (scalex > 2)
     {
       scalex  /= 2;
-      width   *=2;
+      width   *= 2;
       *levelx -= 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scaley >= 2)
+  while (scaley > 2)
     {
       scaley  /= 2;
       height  *= 2;
       *levely -= 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scalex <= 0.5)
+  while (scalex < 0.5 && width > 1)
     {
       scalex  *= 2;
       width   /= 2;
       *levelx += 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scaley <= 0.5)
+  while (scaley < 0.5 && height > 1)
     {
       scaley  *= 2;
       height  *= 2;
       *levely += 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 }
 
-static void
-scale_region_buffer (PixelRegion           *srcPR,
-                     PixelRegion           *dstPR,
-                     GimpInterpolationType  interpolation,
-                     GimpProgressFunc       progress_callback,
-                     gpointer               progress_data)
-{
-  PixelRegion  tmpPR0;
-  PixelRegion  tmpPR1;
-  gint         width        = srcPR->w;
-  gint         height       = srcPR->h;
-  gint         bytes        = srcPR->bytes;
-  gint         max_progress = 0;
-  gint         levelx       = 0;
-  gint         levely       = 0;
-
-  /* determine scaling levels */
-  determine_scale (srcPR, dstPR, &levelx, &levely, &max_progress);
+/* This function calculates the number of tiles that are written in
+ * one scale operation. This number is used as the max_progress
+ * parameter in calls to GimpProgressFunc.
+ */
+static gint
+scale_determine_progress (PixelRegion *srcPR,
+                          PixelRegion *dstPR,
+                          gint         levelx,
+                          gint         levely)
+{
+  gint width  = srcPR->w;
+  gint height = srcPR->h;
+  gint tiles  = 0;
 
-  pixel_region_init_data (&tmpPR0,
-                          g_memdup (srcPR->data, width * height * bytes),
-                          bytes, width * bytes, 0, 0, width, height);
+  /*  The logic here should be kept in sync with scale_region_tile().  */
 
   while (levelx < 0 && levely < 0)
     {
       width  <<= 1;
       height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx++;
       levely++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx < 0)
     {
       width <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levely < 0)
     {
       height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
       levely++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx > 0 && levely > 0)
     {
       width  >>= 1;
       height >>= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx--;
       levely--;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx > 0)
     {
-      width <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
+      width >>= 1;
       levelx--;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levely > 0)
     {
-      height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
+      height >>= 1;
       levely--;
-    }
 
-  scale_pr (&tmpPR0, dstPR, interpolation);
+      tiles += NUM_TILES (width, height);
+    }
 
-  g_free (tmpPR0.data);
+  tiles += NUM_TILES (dstPR->w, dstPR->h);
 
-  return;
+  return tiles;
 }
 
 static void
@@ -361,20 +324,23 @@
   gint         width        = srcPR->w;
   gint         height       = srcPR->h;
   gint         bytes        = srcPR->bytes;
-  gint         max_progress = (((height % TILE_HEIGHT) + 1) *
-                               ((width % TILE_WIDTH) + 1));
+  gint         max_progress = 0;
   gint         progress     = 0;
   gint         levelx       = 0;
   gint         levely       = 0;
 
   /* determine scaling levels */
-  determine_scale (srcPR, dstPR, &levelx, &levely, &max_progress);
+  if (interpolation != GIMP_INTERPOLATION_NONE)
+    {
+      scale_determine_levels (srcPR, dstPR, &levelx, &levely);
+    }
+
+  max_progress = scale_determine_progress (srcPR, dstPR, levelx, levely);
 
   if (levelx == 0 && levely == 0)
     {
-       scale (srcTM, dstTM, interpolation,
-              progress_callback,
-              progress_data, &progress, max_progress);
+      scale (srcTM, dstTM, interpolation,
+             progress_callback, progress_data, &progress, max_progress);
     }
 
   while (levelx < 0 && levely < 0)
@@ -430,8 +396,8 @@
       height >>= 1;
 
       tmpTM = tile_manager_new (width, height, bytes);
-      scale (srcTM, tmpTM, interpolation,
-             progress_callback, progress_data, &progress, max_progress);
+      decimate_xy (srcTM, tmpTM, interpolation,
+                   progress_callback, progress_data, &progress, max_progress);
 
       if (srcTM != srcPR->tiles)
         tile_manager_unref (srcTM);
@@ -443,11 +409,11 @@
 
   while (levelx > 0)
     {
-      width <<= 1;
+      width >>= 1;
 
       tmpTM = tile_manager_new (width, height, bytes);
-      scale (srcTM, tmpTM, interpolation,
-             progress_callback, progress_data, &progress, max_progress);
+      decimate_x (srcTM, tmpTM, interpolation,
+                  progress_callback, progress_data, &progress, max_progress);
 
       if (srcTM != srcPR->tiles)
         tile_manager_unref (srcTM);
@@ -458,11 +424,11 @@
 
   while (levely > 0)
     {
-      height <<= 1;
+      height >>= 1;
 
       tmpTM = tile_manager_new (width, height, bytes);
-      scale (srcTM, tmpTM, interpolation,
-             progress_callback, progress_data, &progress, max_progress);
+      decimate_y (srcTM, tmpTM, interpolation,
+                  progress_callback, progress_data, &progress, max_progress);
 
       if (srcTM != srcPR->tiles)
         tile_manager_unref (srcTM);
@@ -474,8 +440,7 @@
   if (tmpTM != NULL)
     {
       scale (tmpTM, dstTM, interpolation,
-             progress_callback,
-             progress_data, &progress, max_progress);
+             progress_callback, progress_data, &progress, max_progress);
       tile_manager_unref (tmpTM);
     }
 
@@ -494,15 +459,20 @@
        gint                  *progress,
        gint                   max_progress)
 {
-  guint              src_width    = tile_manager_width  (srcTM);
-  guint              src_height   = tile_manager_height (srcTM);
-  guint              dst_width    = tile_manager_width  (dstTM);
-  guint              dst_height   = tile_manager_height (dstTM);
-  guint              dst_tilerows = tile_manager_tiles_per_row(dstTM);    /*  the number of tiles in each row      */
-  guint              dst_tilecols = tile_manager_tiles_per_col(dstTM);    /*  the number of tiles in each columns  */
-  gint               col, row;
-  guchar             pixel[4];
-  gfloat            *kernel_lookup = NULL;
+  PixelRegion     region;
+  PixelSurround  *surround   = NULL;
+  const guint     src_width  = tile_manager_width  (srcTM);
+  const guint     src_height = tile_manager_height (srcTM);
+  const guint     bytes      = tile_manager_bpp    (dstTM);
+  const guint     dst_width  = tile_manager_width  (dstTM);
+  const guint     dst_height = tile_manager_height (dstTM);
+  const gdouble   scaley     = (gdouble) dst_height / (gdouble) src_height;
+  const gdouble   scalex     = (gdouble) dst_width  / (gdouble) src_width;
+  gpointer        pr;
+  gfloat         *kernel_lookup = NULL;
+
+  GIMP_LOG (SCALE, "scale: %dx%d -> %dx%d",
+            src_width, src_height, dst_width, dst_height);
 
   /* fall back if not enough pixels available */
   if (interpolation != GIMP_INTERPOLATION_NONE)
@@ -519,557 +489,475 @@
         }
     }
 
-  /* if scale is 2^n */
-  if (src_width == dst_width && src_height == dst_height)
+  switch (interpolation)
     {
-      for (row = 0; row < dst_tilerows; row++)
-        {
-          for (col = 0; col < dst_tilecols; col++)
-            {
-              Tile   *dst_tile    = tile_manager_get_at (dstTM,
-                                                         col, row, TRUE, TRUE);
-              guchar *dst_data    = tile_data_pointer (dst_tile, 0, 0);
-              guint   dst_bpp     = tile_bpp (dst_tile);
-              guint   dst_ewidth  = tile_ewidth (dst_tile);
-              guint   dst_eheight = tile_eheight (dst_tile);
-              guint   dst_stride  = dst_ewidth * dst_bpp;
-              gint    x0          = col * TILE_WIDTH;
-              gint    y0          = row * TILE_HEIGHT;
-              gint    x1          = x0 + dst_ewidth - 1;
-              gint    y1          = y0 + dst_eheight - 1;
-
-              read_pixel_data (srcTM, x0, y0, x1, y1, dst_data, dst_stride);
-
-              tile_release (dst_tile, TRUE);
-
-              if (progress_callback)
-                progress_callback (0, max_progress, ((*progress)++),
-                                   progress_data);
-            }
-        }
+    case GIMP_INTERPOLATION_NONE:
+      break;
 
-      return;
+    case GIMP_INTERPOLATION_LINEAR:
+      surround = pixel_surround_new (srcTM, 2, 2, PIXEL_SURROUND_SMEAR);
+      break;
+
+    case GIMP_INTERPOLATION_CUBIC:
+      surround = pixel_surround_new (srcTM, 4, 4, PIXEL_SURROUND_SMEAR);
+      break;
+
+    case GIMP_INTERPOLATION_LANCZOS:
+      surround = pixel_surround_new (srcTM, 6, 6, PIXEL_SURROUND_SMEAR);
+      kernel_lookup = create_lanczos3_lookup ();
+      break;
     }
 
-  if (interpolation == GIMP_INTERPOLATION_LANCZOS )
-    kernel_lookup = create_lanczos3_lookup();
+  pixel_region_init (&region, dstTM, 0, 0, dst_width, dst_height, TRUE);
 
-  for (row = 0; row < dst_tilerows; row++)
+  for (pr = pixel_regions_register (1, &region);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
     {
-      for (col = 0; col < dst_tilecols; col++)
+      const gint  x1  = region.x + region.w;
+      const gint  y1  = region.y + region.h;
+      guchar     *row = region.data;
+      gint        y;
+
+      for (y = region.y; y < y1; y++)
         {
-          Tile  *dst_tile    = tile_manager_get_at (dstTM,
-                                                    col, row, FALSE, FALSE);
-          guint  dst_ewidth  = tile_ewidth (dst_tile);
-          guint  dst_eheight = tile_eheight (dst_tile);
-          gint   x0          = col * TILE_WIDTH;
-          gint   y0          = row * TILE_HEIGHT;
-          gint   x1          = x0 + dst_ewidth  - 1;
-          gint   y1          = y0 + dst_eheight - 1;
-          gint   x, y;
+          guchar  *pixel = row;
+          gdouble  yfrac = y / scaley;
+          gint     sy0   = (gint) yfrac;
+          gint     x;
+
+          yfrac = yfrac - sy0;
 
-          for (y = y0; y <= y1; y++)
+          for (x = region.x; x < x1; x++)
             {
-              gdouble scaley = (gdouble) dst_height / (gdouble) src_height;
-              gdouble yfrac  = y / scaley;
-              gint    sy0    = (gint) yfrac;
-              gint    sy1    = sy0 + 1;
-
-              sy0 = (sy0 > 0) ? sy0 : 0;
-              sy1 = (sy1 > 0) ? sy1 : 0;
-              sy0 = (sy0 < src_height - 1) ? sy0 : src_height - 1;
-              sy1 = (sy1 < src_height - 1) ? sy1 : src_height - 1;
+              gdouble xfrac = x / scalex;
+              gint    sx0   = (gint) xfrac;
 
-              yfrac = yfrac - sy0;
+              xfrac = xfrac - sx0;
 
-              for (x = x0; x <= x1; x++)
+              switch (interpolation)
                 {
-                  gdouble scalex  = (gdouble) dst_width / (gdouble) src_width;
-                  gdouble xfrac   = x / scalex;
-                  gint sx0        = (gint) xfrac;
-                  gint sx1        = sx0 + 1;
-
-                  sx0 = (sx0 > 0) ? sx0 : 0;
-                  sx1 = (sx1 > 0) ? sx1 : 0;
-                  sx0 = (sx0 < src_width - 1) ? sx0 : src_width - 1;
-                  sx1 = (sx1 < src_width - 1) ? sx1 : src_width - 1;
-
-                  xfrac = xfrac - sx0;
-
-                  switch (interpolation)
-                    {
-                    case GIMP_INTERPOLATION_NONE:
-                      interpolate_nearest (srcTM, sx0, sy0, sx1, sy1,
-                                           xfrac, yfrac, pixel);
-                      break;
-
-                    case GIMP_INTERPOLATION_LINEAR:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_average (srcTM, sx0, sy0, sx1, sy1,
-                                          pixel);
-                      else
-                        interpolate_bilinear (srcTM, sx0, sy0, sx1, sy1,
-                                              xfrac, yfrac, pixel);
-                      break;
-
-                    case GIMP_INTERPOLATION_CUBIC:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_gauss (srcTM, sx0, sy0, pixel);
-                      else
-                        interpolate_cubic (srcTM, sx0, sy0,
-                                           xfrac, yfrac, pixel);
-                      break;
-
-                    case GIMP_INTERPOLATION_LANCZOS:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_lanczos2 (srcTM, sx0, sy0, pixel);
-                      else
-                        interpolate_lanczos3 (srcTM, sx0, sy0, sx1, sy1,
-                                              xfrac, yfrac, pixel,
-                                              kernel_lookup);
-                      break;
-                    }
-
-                  write_pixel_data_1 (dstTM, x, y, pixel);
+                case GIMP_INTERPOLATION_NONE:
+                  interpolate_nearest (srcTM, sx0, sy0, xfrac, yfrac, pixel);
+                  break;
+
+                case GIMP_INTERPOLATION_LINEAR:
+                  interpolate_bilinear (surround,
+                                        sx0, sy0, xfrac, yfrac, bytes, pixel);
+                  break;
+
+                case GIMP_INTERPOLATION_CUBIC:
+                  interpolate_cubic (surround,
+                                     sx0, sy0, xfrac, yfrac, bytes, pixel);
+                  break;
+
+                case GIMP_INTERPOLATION_LANCZOS:
+                  interpolate_lanczos3 (surround,
+                                        sx0, sy0, xfrac, yfrac, bytes, pixel,
+                                        kernel_lookup);
+                  break;
                 }
+
+              pixel += region.bytes;
             }
 
-          if (progress_callback)
-            progress_callback (0, max_progress, ((*progress)++), progress_data);
+          row += region.rowstride;
+        }
+
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 8 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
         }
     }
 
-  if (interpolation == GIMP_INTERPOLATION_LANCZOS)
+  if (kernel_lookup)
     g_free (kernel_lookup);
-}
 
-static void inline
-pixel_average (const guchar *p1,
-               const guchar *p2,
-               const guchar *p3,
-               const guchar *p4,
-               guchar       *p,
-               const gint    bytes)
-{
-  gdouble sum, alphasum;
-  gdouble alpha;
-  gint    b;
+  if (surround)
+    pixel_surround_destroy (surround);
+}
 
-  for (b = 0; b < bytes; b++)
-    p[b]=0;
+static void
+decimate_xy (TileManager           *srcTM,
+             TileManager           *dstTM,
+             GimpInterpolationType  interpolation,
+             GimpProgressFunc       progress_callback,
+             gpointer               progress_data,
+             gint                  *progress,
+             gint                   max_progress)
+{
+  PixelRegion     region;
+  PixelSurround  *surround   = NULL;
+  const guint     bytes      = tile_manager_bpp    (dstTM);
+  const guint     dst_width  = tile_manager_width  (dstTM);
+  const guint     dst_height = tile_manager_height (dstTM);
+  gpointer        pr;
+
+  GIMP_LOG (SCALE, "decimate_xy: %dx%d -> %dx%d\n",
+            tile_manager_width (srcTM), tile_manager_height (srcTM),
+            dst_width, dst_height);
+
+  surround = pixel_surround_new (srcTM, 2, 2, PIXEL_SURROUND_SMEAR);
+
+  pixel_region_init (&region, dstTM, 0, 0, dst_width, dst_height, TRUE);
+
+  for (pr = pixel_regions_register (1, &region);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
+    {
+      const gint  x1  = region.x + region.w;
+      const gint  y1  = region.y + region.h;
+      guchar     *row = region.data;
+      gint        y;
+
+      for (y = region.y; y < y1; y++)
+        {
+          const gint  sy    = y * 2;
+          guchar     *pixel = row;
+          gint        x;
 
-  switch (bytes)
-    {
-    case 1:
-      sum = ((p1[0] + p2[0] + p3[0] + p4[0]) / 4);
+          for (x = region.x; x < x1; x++)
+            {
+              decimate_average_xy (surround, x * 2, sy, bytes, pixel);
 
-      p[0] = (guchar) CLAMP (sum, 0, 255);
-      break;
+              pixel += region.bytes;
+            }
 
-    case 2:
-      alphasum = p1[1] +  p2[1] +  p3[1] +  p4[1];
+          row += region.rowstride;
+        }
 
-      if (alphasum > 0)
+      if (progress_callback)
         {
-          sum = p1[0] * p1[1] + p2[0] * p2[1] + p3[0] * p3[1] + p4[0] * p4[1];
-          sum /= alphasum;
+          (*progress)++;
 
-          alpha = alphasum / 4;
-
-          p[0] = (guchar) CLAMP (sum, 0, 255);
-          p[1] = (guchar) CLAMP (alpha, 0, 255);
+          if (*progress % 16 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
         }
-      break;
+    }
 
-    case 3:
-      for (b = 0; b<3; b++)
-        {
-          sum = ((p1[b] + p2[b] + p3[b] + p4[b]) / 4);
-          p[b] = (guchar) CLAMP (sum, 0, 255);
-        }
-      break;
+  pixel_surround_destroy (surround);
+}
 
-    case 4:
-      alphasum = p1[3] +  p2[3] +  p3[3] +  p4[3];
+static void
+decimate_x (TileManager           *srcTM,
+            TileManager           *dstTM,
+            GimpInterpolationType  interpolation,
+            GimpProgressFunc       progress_callback,
+            gpointer               progress_data,
+            gint                  *progress,
+            gint                   max_progress)
+{
+  PixelRegion     region;
+  PixelSurround  *surround   = NULL;
+  const guint     bytes      = tile_manager_bpp    (dstTM);
+  const guint     dst_width  = tile_manager_width  (dstTM);
+  const guint     dst_height = tile_manager_height (dstTM);
+  gpointer        pr;
+
+  GIMP_LOG (SCALE, "decimate_x: %dx%d -> %dx%d\n",
+            tile_manager_width (srcTM), tile_manager_height (srcTM),
+            dst_width, dst_height);
+
+  surround = pixel_surround_new (srcTM, 2, 1, PIXEL_SURROUND_SMEAR);
+
+  pixel_region_init (&region, dstTM, 0, 0, dst_width, dst_height, TRUE);
+
+  for (pr = pixel_regions_register (1, &region);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
+    {
+      const gint  x1  = region.x + region.w;
+      const gint  y1  = region.y + region.h;
+      guchar     *row = region.data;
+      gint        y;
 
-      if (alphasum > 0)
+      for (y = region.y; y < y1; y++)
         {
-          for (b = 0; b<3; b++)
+          guchar *pixel = row;
+          gint    x;
+
+          for (x = region.x; x < x1; x++)
             {
-              sum = p1[b] * p1[3] + p2[b] * p2[3] + p3[b] * p3[3] + p4[b] * p4[3];
-              sum /= alphasum;
+              decimate_average_x (surround, x * 2, y, bytes, pixel);
 
-              p[b] = (guchar) CLAMP (sum, 0, 255);
+              pixel += region.bytes;
             }
 
-          alpha = alphasum / 4;
+          row += region.rowstride;
+        }
 
-          p[3] = (guchar) CLAMP (alpha, 0, 255);
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 32 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
         }
-      break;
     }
+
+  pixel_surround_destroy (surround);
 }
 
-void
-scale_region (PixelRegion           *srcPR,
-              PixelRegion           *dstPR,
-              GimpInterpolationType  interpolation,
-              GimpProgressFunc       progress_callback,
-              gpointer               progress_data)
-{
+static void
+decimate_y (TileManager           *srcTM,
+            TileManager           *dstTM,
+            GimpInterpolationType  interpolation,
+            GimpProgressFunc       progress_callback,
+            gpointer               progress_data,
+            gint                  *progress,
+            gint                   max_progress)
+{
+  PixelRegion     region;
+  PixelSurround  *surround   = NULL;
+  const guint     bytes      = tile_manager_bpp    (dstTM);
+  const guint     dst_width  = tile_manager_width  (dstTM);
+  const guint     dst_height = tile_manager_height (dstTM);
+  gpointer        pr;
+
+  GIMP_LOG (SCALE, "decimate_y: %dx%d -> %dx%d\n",
+            tile_manager_width (srcTM), tile_manager_height (srcTM),
+            dst_width, dst_height);
+
+  surround = pixel_surround_new (srcTM, 1, 2, PIXEL_SURROUND_SMEAR);
+
+  pixel_region_init (&region, dstTM, 0, 0, dst_width, dst_height, TRUE);
+
+  for (pr = pixel_regions_register (1, &region);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
+    {
+      const gint  x1  = region.x + region.w;
+      const gint  y1  = region.y + region.h;
+      guchar     *row = region.data;
+      gint        y;
+
+      for (y = region.y; y < y1; y++)
+        {
+          const gint  sy    = y * 2;
+          guchar     *pixel = row;
+          gint        x;
 
-  /* Copy and return if scale = 1.0 */
-  if (srcPR->h == dstPR->h && srcPR->w == dstPR->w)
-    {
-      copy_region (srcPR, dstPR);
-      return;
-    }
+          for (x = region.x; x < x1; x++)
+            {
+              decimate_average_y (surround, x, sy, bytes, pixel);
 
-  if (srcPR->tiles == NULL && srcPR->data != NULL)
-    {
-      scale_region_buffer (srcPR, dstPR, interpolation,
-                           progress_callback, progress_data);
-      return;
-    }
+              pixel += region.bytes;
+            }
 
-  if (srcPR->tiles != NULL && srcPR->data == NULL)
-    {
-      scale_region_tile (srcPR, dstPR, interpolation,
-                         progress_callback, progress_data);
-      return;
-    }
+          row += region.rowstride;
+        }
 
-  g_assert_not_reached ();
-}
+      if (progress_callback)
+        {
+          (*progress)++;
 
-static void
-decimate_gauss (TileManager  *srcTM,
-                const gint    x0,
-                const gint    y0,
-                guchar       *pixel)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[4];
-  guchar  pixel2[4];
-  guchar  pixel3[4];
-  guchar  pixel4[4];
-  guchar  pixels[16 * 4];
-  gint    x, y, i;
-  guchar *p;
-
-  for (y = y0 - 1, i = 0; y <= y0 + 2; y++)
-    {
-      for (x = x0 - 1; x <= x0 + 2; x++, i++)
-        {
-          gint u, v;
-          u = (x > 0) ? x : 0;
-          u = (u < src_width - 1) ? u : src_width - 1;
-          v = (y > 0) ? y : 0;
-          v = (v < src_height - 1) ? v : src_height - 1;
-          read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
+          if (*progress % 32 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
         }
     }
 
-  p = pixels + (0 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel1);
-  p = pixels + (1 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel2);
-  p = pixels + (4 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel3);
-  p = pixels + (5 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
-
+  pixel_surround_destroy (surround);
 }
 
-static inline void
-gaussan_decimate (const guchar *pixels,
-                  const gint    bytes,
-                  guchar       *pixel)
+static void inline
+pixel_average4 (const guchar *p1,
+                const guchar *p2,
+                const guchar *p3,
+                const guchar *p4,
+                guchar       *p,
+                const gint    bytes)
 {
-  const guchar *p;
-  gdouble       sum;
-  gdouble       alphasum;
-  gdouble       alpha;
-  gint          b;
-
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
-
-  p = pixels;
-
   switch (bytes)
     {
     case 1:
-      sum  = p[0]     + p[1] * 2 + p[2];
-      sum += p[4] * 2 + p[5] * 4 + p[6] * 2;
-      sum += p[8]     + p[9] * 2 + p[10];
-      sum /= 16;
-
-      pixel[0] = (guchar) CLAMP (sum, 0, 255);
+      p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
       break;
 
     case 2:
-      alphasum  = p[1]     + p[3]  * 2 + p[5];
-      alphasum += p[9] * 2 + p[11] * 4 + p[13] * 2;
-      alphasum += p[17]    + p[19] * 2 + p[21];
-
-      if (alphasum > 0)
-        {
-          sum  = p[0]  * p[1]     + p[2]  * p[3]  * 2 + p[4]  * p[5];
-          sum += p[8]  * p[9] * 2 + p[10] * p[11] * 4 + p[12] * p[13] * 2;
-          sum += p[16] * p[17]    + p[18] * p[19] * 2 + p[20] * p[21];
-          sum /= alphasum;
-
-          alpha = alphasum / 16;
+      {
+        guint a = p1[1] + p2[1] + p3[1] + p4[1];
 
-          pixel[0] = (guchar) CLAMP (sum,   0, 255);
-          pixel[1] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = 0;
+            break;
+
+          case 1020: /* all opaque */
+            p[0] = (p1[0]  + p2[0] + p3[0] + p4[0] + 2) >> 2;
+            p[1] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[1] +
+                     p2[0] * p2[1] +
+                     p3[0] * p3[1] +
+                     p4[0] * p4[1] + (a >> 1)) / a);
+            p[1] = (a + 2) >> 2;
+            break;
+          }
+      }
       break;
 
     case 3:
-      for (b = 0; b < 3; b++ )
-        {
-          sum  = p[b   ]     + p[3 + b] * 2 + p[6 + b];
-          sum += p[12 + b] * 2 + p[15 + b] * 4 + p[18 + b] * 2;
-          sum += p[24 + b]     + p[27 + b] * 2 + p[30 + b];
-          sum /= 16;
-
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
-        }
+      p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
+      p[1] = (p1[1] + p2[1] + p3[1] + p4[1] + 2) >> 2;
+      p[2] = (p1[2] + p2[2] + p3[2] + p4[2] + 2) >> 2;
       break;
 
     case 4:
-      alphasum  = p[3]      + p[7]  * 2  + p[11];
-      alphasum += p[19] * 2 + p[23] * 4  + p[27] * 2;
-      alphasum += p[35]     + p[39] * 2  + p[43];
-
-      if (alphasum > 0)
-        {
-          for (b = 0; b < 3; b++)
-            {
-              sum = p[   b] * p[3]      + p[4 + b] * p[7]  * 2 + p[8 + b] * p[11];
-              sum += p[16 + b] * p[19] * 2 + p[20 + b] * p[23] * 4 + p[24 + b] * p[27] * 2;
-              sum += p[32 + b] * p[35]     + p[36 + b] * p[39] * 2 + p[40 + b] * p[43];
-              sum /= alphasum;
-
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
-            }
-
-          alpha = alphasum / 16;
+      {
+        guint a = p1[3] + p2[3] + p3[3] + p4[3];
 
-          pixel[3] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = p[2] = p[3] = 0;
+            break;
+
+          case 1020: /* all opaque */
+            p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
+            p[1] = (p1[1] + p2[1] + p3[1] + p4[1] + 2) >> 2;
+            p[2] = (p1[2] + p2[2] + p3[2] + p4[2] + 2) >> 2;
+            p[3] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[3] +
+                     p2[0] * p2[3] +
+                     p3[0] * p3[3] +
+                     p4[0] * p4[3] + (a >> 1)) / a);
+            p[1] = ((p1[1] * p1[3] +
+                     p2[1] * p2[3] +
+                     p3[1] * p3[3] +
+                     p4[1] * p4[3] + (a >> 1)) / a);
+            p[2] = ((p1[2] * p1[3] +
+                     p2[2] * p2[3] +
+                     p3[2] * p3[3] +
+                     p4[2] * p4[3] + (a >> 1)) / a);
+            p[3] = (a + 2) >> 2;
+            break;
+          }
+      }
       break;
     }
 }
 
-static inline void
-decimate_lanczos2 (TileManager  *srcTM,
-                   const gint    x0,
-                   const gint    y0,
-                   guchar       *pixel)
+static void inline
+pixel_average2 (const guchar *p1,
+                const guchar *p2,
+                guchar       *p,
+                const gint    bytes)
 {
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[4];
-  guchar  pixel2[4];
-  guchar  pixel3[4];
-  guchar  pixel4[4];
-  guchar  pixels[36 * 4];
-  gint    x, y, i;
-  guchar *p;
-
-  for (y = y0 - 2, i = 0; y <= y0 + 3; y++)
-    for (x = x0 - 2; x <= x0 + 3; x++, i++)
-      {
-        gint u, v;
-        u = (x > 0) ? x : 0;
-        u = (u < src_width - 1) ? u : src_width - 1;
-        v = (y > 0) ? y : 0;
-        v = (v < src_height - 1) ? v : src_height - 1;
-        read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
-      }
-
-  p = pixels + (0 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel1);
-  p = pixels + (1 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel2);
-  p = pixels + (6 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel3);
-  p = pixels + (7 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
-
-}
-
-static inline void
-gaussan_lanczos2 (const guchar *pixels,
-                  const gint    bytes,
-                  guchar       *pixel)
-{
-  /*
-   *   Filter source taken from document:
-   *   www.worldserver.com/turk/computergraphics/ResamplingFilters.pdf
-   *
-   *   Filters for Common Resampling Tasks
-   *
-   *   Ken Turkowski, Apple computer
-   *
-   */
-  const guchar *p;
-  gdouble      sum;
-  gdouble      alphasum;
-  gdouble      alpha;
-  gint         b;
-
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
-
-  p = pixels;
-
   switch (bytes)
     {
     case 1:
-      sum  = p[0] + p[1] * -9 + p[2] * -16 + p[3] * -9 + p[4];
-      sum += p[6] * -9 + p[7] * 81 + p[8] * 144 + p[9] * 81 + p[10] * -9;
-      sum += p[12] * -16 +
-             p[13] * 144 + p[14] * 256 + p[15] * 144 + p[16] * -16;
-      sum += p[18] * -9 + p[19] * 81 + p[20] * 144 + p[21] * 81 + p[22] * -9;
-      sum += p[24] + p[25] * -9 + p[26] * -16 + p[27] * -9 + p[28];
-      sum /= 1024;
-
-      pixel[0] = (guchar) CLAMP (sum, 0, 255);
+      p[0] = (p1[0] + p2[0] + 1) >> 1;
       break;
 
     case 2:
-      alphasum =  p[1] + p[3] * -9 + p[5] * -16 + p[7] * -9 + p[9];
-      alphasum += p[13] * -9 +
-                  p[15] * 81 + p[17] * 144 + p[19] * 81 + p[21] * -9;
-      alphasum += p[25] * -16 +
-                  p[27] * 144 + p[29] * 256 + p[31] * 144 + p[33] * -16;
-      alphasum += p[37] * -9 +
-                  p[39] * 81 + p[41] * 144 + p[43] * 81 + p[45] * -9;
-      alphasum += p[49] + p[51] * -9 + p[53] * -16 + p[55] * -9 + p[57];
-
-      if (alphasum > 0)
-        {
-          sum =  p[0] * p[1] +
-                 p[2] * p[3] * -9 +
-                 p[4] * p[5] * -16 + p[6] * p[7] * -9 + p[8] * p[9];
-          sum += p[12] * p[13] * -9 +
-                 p[14] * p[15] * 81 +
-                 p[16] * p[17] * 144 + p[18] * p[19] * 81 + p[20] * p[21] * -9;
-          sum += p[24] * p[25] * -16 +
-                 p[26] * p[27] * 144 +
-                 p[28] * p[29] * 256 + p[30] * p[31] * 144 + p[32] * p[33] * -16;
-          sum += p[36] * p[37] * -9 +
-                 p[38] * p[39] * 81 +
-                 p[40] * p[41] * 144 + p[42] * p[43] * 81 + p[44] * p[45] * -9;
-          sum += p[48] * p[49] +
-                 p[50] * p[51] * -9 +
-                 p[52] * p[53] * -16 + p[54] * p[55] * -9 + p[56] * p[57];
-          sum /= alphasum;
-
-          alpha = alphasum / 1024;
+      {
+        guint a = p1[1] + p2[1];
 
-          pixel[0] = (guchar) CLAMP (sum, 0, 255);
-          pixel[1] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = 0;
+            break;
+
+          case 510: /* all opaque */
+            p[0] = (p1[0]  + p2[0] + 1) >> 2;
+            p[1] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[1] +
+                     p2[0] * p2[1] + (a >> 1)) / a);
+            p[1] = (a + 1) >> 1;
+            break;
+          }
+      }
       break;
 
     case 3:
-      for (b = 0; b < 3; b++)
-        {
-          sum =  p[b] +
-                 p[3 + b] * -9 + p[6 + b] * -16 + p[9 + b] * -9 + p[12 + b];
-          sum += p[18 + b] * -9 +
-                 p[21 + b] * 81 +
-                 p[24 + b] * 144 + p[27 + b] * 81 + p[30 + b] * -9;
-          sum += p[36 + b] * -16 +
-                 p[39 + b] * 144 +
-                 p[42 + b] * 256 + p[45 + b] * 144 + p[48 + b] * -16;
-          sum += p[54 + b] * -9 +
-                 p[57 + b] * 81 +
-                 p[60 + b] * 144 + p[63 + b] * 81 + p[66 + b] * -9;
-          sum += p[72 + b] +
-                 p[75 + b] * -9 + p[78 + b] * -16 + p[81 + b] * -9 + p[84 + b];
-          sum /= 1024;
-
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
-        }
+      p[0] = (p1[0] + p2[0] + 1) >> 1;
+      p[1] = (p1[1] + p2[1] + 1) >> 1;
+      p[2] = (p1[2] + p2[2] + 1) >> 1;
       break;
 
     case 4:
-      alphasum =  p[3] + p[7] * -9 + p[11] * -16 + p[15] * -9 + p[19];
-      alphasum += p[27] * -9 +
-                  p[31] * 81 + p[35] * 144 + p[39] * 81 + p[43] * -9;
-      alphasum += p[51] * -16 +
-                  p[55] * 144 + p[59] * 256 + p[63] * 144 + p[67] * -16;
-      alphasum += p[75] * -9 +
-                  p[79] * 81 + p[83] * 144 + p[87] * 81 + p[91] * -9;
-      alphasum += p[99] + p[103] * -9 + p[107] * -16 + p[111] * -9 + p[115];
-
-      if (alphasum > 0)
-        {
-          for (b = 0; b < 3; b++)
-            {
-              sum =  p[0 + b] * p[3] +
-                     p[4 + b] * p[7] * -9 +
-                     p[8 + b] * p[11] * -16 +
-                     p[12 + b] * p[15] * -9 + p[16 + b] * p[19];
-              sum += p[24 + b] * p[27] * -9 +
-                     p[28 + b] * p[31] * 81 +
-                     p[32 + b] * p[35] * 144 +
-                     p[36 + b] * p[39] * 81 + p[40 + b] * p[43] * -9;
-              sum += p[48 + b] * p[51] * -16 +
-                     p[52 + b] * p[55] * 144 +
-                     p[56 + b] * p[59] * 256 +
-                     p[60 + b] * p[63] * 144 + p[64 + b] * p[67] * -16;
-              sum += p[72 + b] * p[75] * -9 +
-                     p[76 + b] * p[79] * 81 +
-                     p[80 + b] * p[83] * 144 +
-                     p[84 + b] * p[87] * 81 + p[88 + b] * p[91] * -9;
-              sum += p[96 + b] * p[99] +
-                     p[100 + b] * p[103] * -9 +
-                    p[104 + b] * p[107] * -16 +
-                    p[108 + b] * p[111] * -9 + p[112 + b] * p[115];
-              sum /= alphasum;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
-            }
+      {
+        guint a = p1[3] + p2[3];
 
-          alpha = (gint) alphasum / 1024;
-          pixel[3] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = p[2] = p[3] = 0;
+            break;
+
+          case 510: /* all opaque */
+            p[0] = (p1[0] + p2[0] + 1) >> 1;
+            p[1] = (p1[1] + p2[1] + 1) >> 1;
+            p[2] = (p1[2] + p2[2] + 1) >> 1;
+            p[3] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[3] +
+                     p2[0] * p2[3] + (a >> 1)) / a);
+            p[1] = ((p1[1] * p1[3] +
+                     p2[1] * p2[3] + (a >> 1)) / a);
+            p[2] = ((p1[2] * p1[3] +
+                     p2[2] * p2[3] + (a >> 1)) / a);
+            p[3] = (a + 1) >> 1;
+            break;
+          }
+      }
       break;
     }
 }
 
 static void
-decimate_average (TileManager  *srcTM,
-                  const gint    x0,
-                  const gint    y0,
-                  const gint    x1,
-                  const gint    y1,
-                  guchar       *pixel)
-{
-  guchar pixel1[4];
-  guchar pixel2[4];
-  guchar pixel3[4];
-  guchar pixel4[4];
-
-  read_pixel_data_1 (srcTM, x0, y0, pixel1);
-  read_pixel_data_1 (srcTM, x1, y0, pixel2);
-  read_pixel_data_1 (srcTM, x0, y1, pixel3);
-  read_pixel_data_1 (srcTM, x1, y1, pixel4);
+decimate_average_xy (PixelSurround *surround,
+                     const gint     x0,
+                     const gint     y0,
+                     const gint     bytes,
+                     guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
+
+  pixel_average4 (src, src + bytes, src + stride, src + stride + bytes,
+                  pixel, bytes);
+}
+
+static void
+decimate_average_x (PixelSurround *surround,
+                    const gint     x0,
+                    const gint     y0,
+                    const gint     bytes,
+                    guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
+
+  pixel_average2 (src, src + bytes, pixel, bytes);
+}
+
+static void
+decimate_average_y (PixelSurround *surround,
+                    const gint     x0,
+                    const gint     y0,
+                    const gint     bytes,
+                    guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
 
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, tile_manager_bpp (srcTM));
+  pixel_average2 (src, src + stride, pixel, bytes);
 }
 
 static inline gdouble
@@ -1085,7 +973,8 @@
 
 /*
  * allocate and fill lookup table of Lanczos windowed sinc function
- * use gfloat since errors due to granularity of array far exceed data precision
+ * use gfloat since errors due to granularity of array far exceed
+ * data precision
  */
 gfloat *
 create_lanczos_lookup (void)
@@ -1129,16 +1018,16 @@
 interpolate_nearest (TileManager   *srcTM,
                      const gint     x0,
                      const gint     y0,
-                     const gint     x1,
-                     const gint     y1,
                      const gdouble  xfrac,
                      const gdouble  yfrac,
                      guchar        *pixel)
 {
-  gint x = (xfrac <= 0.5) ? x0 : x1;
-  gint y = (yfrac <= 0.5) ? y0 : y1;
+  const gint w = tile_manager_width (srcTM) - 1;
+  const gint h = tile_manager_height (srcTM) - 1;
+  const gint x = (xfrac <= 0.5) ? x0 : x0 + 1;
+  const gint y = (yfrac <= 0.5) ? y0 : y0 + 1;
 
-  read_pixel_data_1 (srcTM, x, y, pixel);
+  read_pixel_data_1 (srcTM, CLAMP (x, 0, w), CLAMP (y, 0, h), pixel);
 }
 
 static inline gdouble
@@ -1154,49 +1043,47 @@
 }
 
 static void
-interpolate_bilinear (TileManager   *srcTM,
+interpolate_bilinear (PixelSurround *surround,
                       const gint     x0,
                       const gint     y0,
-                      const gint     x1,
-                      const gint     y1,
                       const gdouble  xfrac,
                       const gdouble  yfrac,
+                      const gint     bytes,
                       guchar        *pixel)
 {
-  gint   src_bpp = tile_manager_bpp  (srcTM);
-  guchar p1[4];
-  guchar p2[4];
-  guchar p3[4];
-  guchar p4[4];
-
-  gint   b;
-  gdouble sum, alphasum;
-
-  for (b=0; b < src_bpp; b++)
-    pixel[b]=0;
-
-  read_pixel_data_1 (srcTM, x0, y0, p1);
-  read_pixel_data_1 (srcTM, x1, y0, p2);
-  read_pixel_data_1 (srcTM, x0, y1, p3);
-  read_pixel_data_1 (srcTM, x1, y1, p4);
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
+  const guchar *p1  = src;
+  const guchar *p2  = p1 + bytes;
+  const guchar *p3  = src + stride;
+  const guchar *p4  = p3 + bytes;
+  gdouble       sum;
+  gdouble       alphasum;
+  gint          b;
 
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
       sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      pixel[0] = (guchar) CLAMP (sum, 0, 255);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
       alphasum = weighted_sum (xfrac, yfrac, p1[1], p2[1], p3[1], p4[1]);
       if (alphasum > 0)
         {
-          sum = weighted_sum (xfrac, yfrac, p1[0] * p1[1], p2[0] * p2[1],
+          sum = weighted_sum (xfrac, yfrac,
+                              p1[0] * p1[1], p2[0] * p2[1],
                               p3[0] * p3[1], p4[0] * p4[1]);
           sum /= alphasum;
 
-          pixel[0] = (guchar) CLAMP (sum, 0, 255);
-          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
@@ -1204,7 +1091,8 @@
       for (b = 0; b < 3; b++)
         {
           sum = weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]);
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1212,15 +1100,21 @@
       alphasum = weighted_sum (xfrac, yfrac, p1[3], p2[3], p3[3], p4[3]);
       if (alphasum > 0)
         {
-          for (b = 0; b<3; b++)
+          for (b = 0; b < 3; b++)
             {
-              sum = weighted_sum (xfrac, yfrac, p1[b] * p1[3], p2[b] * p2[3],
+              sum = weighted_sum (xfrac, yfrac,
+                                  p1[b] * p1[3], p2[b] * p2[3],
                                   p3[b] * p3[3], p4[b] * p4[3]);
               sum /= alphasum;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
@@ -1233,109 +1127,103 @@
   */
 
 static inline gdouble
-cubic_spline_fit (const gdouble dx,
-                  const gint    pt0,
-                  const gint    pt1,
-                  const gint    pt2,
-                  const gint    pt3)
+cubic_spline_fit (const gdouble  dx,
+                  const gdouble  pt0,
+                  const gdouble  pt1,
+                  const gdouble  pt2,
+                  const gdouble  pt3)
 {
-
   return (gdouble) ((( ( -pt0 + 3 * pt1 - 3 * pt2 + pt3 ) *   dx +
                        ( 2 * pt0 - 5 * pt1 + 4 * pt2 - pt3 ) ) * dx +
                      ( -pt0 + pt2 ) ) * dx + (pt1 + pt1) ) / 2.0;
 }
 
 static void
-interpolate_cubic (TileManager  *srcTM,
-                   const gint    x0,
-                   const gint    y0,
-                   const gdouble xfrac,
-                   const gdouble yfrac,
-                   guchar       *pixel)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  gint    b, i;
-  gint    x, y;
-
-  guchar  ps[16 * 4];
-  gdouble p0, p1, p2, p3;
-
-  gdouble sum, alphasum;
-
-  for (b = 0; b < src_bpp; b++)
-    pixel[b] = 0;
-
-  for (y = y0 - 1, i = 0; y <= y0 + 2; y++)
-    for (x = x0 - 1; x <= x0 + 2; x++, i++)
-      {
-        gint u,v;
-        u = (x > 0) ? x : 0;
-        u = (u < src_width - 1) ? u : src_width - 1;
-        v = (y > 0) ? y : 0;
-        v = (v < src_height - 1) ? v : src_height - 1;
-        read_pixel_data_1 (srcTM, u, v, ps + (i * src_bpp));
-      }
+interpolate_cubic (PixelSurround *surround,
+                   const gint     x0,
+                   const gint     y0,
+                   const gdouble  xfrac,
+                   const gdouble  yfrac,
+                   const gint     bytes,
+                   guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0 - 1, y0 - 1, &stride);
+  const guchar *s0  = src;
+  const guchar *s1  = s0 + stride;
+  const guchar *s2  = s1 + stride;
+  const guchar *s3  = s2 + stride;
+  gint          b;
+  gdouble       p0, p1, p2, p3;
+  gdouble       sum, alphasum;
 
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
-      p0 = cubic_spline_fit (xfrac, ps[0 ], ps[1 ], ps[2 ], ps[3 ]);
-      p1 = cubic_spline_fit (xfrac, ps[4 ], ps[5 ], ps[6 ], ps[7 ]);
-      p2 = cubic_spline_fit (xfrac, ps[8 ], ps[9 ], ps[10], ps[11]);
-      p3 = cubic_spline_fit (xfrac, ps[12], ps[13], ps[14], ps[15]);
+      p0 = cubic_spline_fit (xfrac, s0[0], s0[1], s0[2], s0[3]);
+      p1 = cubic_spline_fit (xfrac, s1[0], s1[1], s1[2], s1[3]);
+      p2 = cubic_spline_fit (xfrac, s2[0], s2[1], s2[2], s2[3]);
+      p3 = cubic_spline_fit (xfrac, s3[0], s3[1], s3[2], s3[3]);
 
       sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-      pixel[0]= (guchar) CLAMP (sum, 0, 255);
+      pixel[0]= CLAMP (sum, 0, 255);
       break;
 
     case 2:
-      p0 = cubic_spline_fit (xfrac, ps[1 ], ps[3 ], ps[5 ], ps[7 ]);
-      p1 = cubic_spline_fit (xfrac, ps[9 ], ps[11], ps[13], ps[15]);
-      p2 = cubic_spline_fit (xfrac, ps[17], ps[19], ps[21], ps[23]);
-      p3 = cubic_spline_fit (xfrac, ps[25], ps[27], ps[29], ps[31]);
+      p0 = cubic_spline_fit (xfrac, s0[1], s0[3], s0[5], s0[7]);
+      p1 = cubic_spline_fit (xfrac, s1[1], s1[3], s1[5], s1[7]);
+      p2 = cubic_spline_fit (xfrac, s2[1], s2[3], s2[5], s2[7]);
+      p3 = cubic_spline_fit (xfrac, s3[1], s3[3], s3[5], s3[7]);
 
       alphasum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
       if (alphasum > 0)
         {
-          p0 = cubic_spline_fit (xfrac, ps[0 ] * ps[1 ], ps[2 ] * ps[3 ],
-                                 ps[4 ] * ps[5 ], ps[6 ] * ps[7 ]);
-          p1 = cubic_spline_fit (xfrac, ps[8 ] * ps[9 ], ps[10] * ps[11],
-                                 ps[12] * ps[13], ps[14] * ps[15]);
-          p2 = cubic_spline_fit (xfrac, ps[16] * ps[17], ps[18] * ps[19],
-                                 ps[20] * ps[21], ps[22] * ps[23]);
-          p3 = cubic_spline_fit (xfrac, ps[24] * ps[25], ps[26] * ps[27],
-                                 ps[28] * ps[29], ps[30] * ps[31]);
+          p0 = cubic_spline_fit (xfrac,
+                                 s0[0] * s0[1], s0[2] * s0[3],
+                                 s0[4] * s0[5], s0[6] * s0[7]);
+          p1 = cubic_spline_fit (xfrac,
+                                 s1[0] * s1[1], s1[2] * s1[3],
+                                 s1[4] * s1[5], s1[6] * s1[7]);
+          p2 = cubic_spline_fit (xfrac,
+                                 s2[0] * s2[1], s2[2] * s2[3],
+                                 s2[4] * s2[5], s2[6] * s2[7]);
+          p3 = cubic_spline_fit (xfrac,
+                                 s3[0] * s3[1], s3[2] * s3[3],
+                                 s3[4] * s3[5], s3[6] * s3[7]);
 
           sum  = cubic_spline_fit (yfrac, p0, p1, p2, p3);
           sum /= alphasum;
 
-          pixel[0] = (guchar) CLAMP (sum, 0, 255);
-          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
+
     case 3:
       for (b = 0; b < 3; b++)
         {
-          p0 = cubic_spline_fit (xfrac, ps[   b], ps[3 + b], ps[6 + b], ps[9 + b]);
-          p1 = cubic_spline_fit (xfrac, ps[12 + b], ps[15 + b], ps[18 + b], ps[21 + b]);
-          p2 = cubic_spline_fit (xfrac, ps[24 + b], ps[27 + b], ps[30 + b], ps[33 + b]);
-          p3 = cubic_spline_fit (xfrac, ps[36 + b], ps[39 + b], ps[42 + b], ps[45 + b]);
+          p0 = cubic_spline_fit (xfrac, s0[b], s0[3 + b], s0[6 + b], s0[9 + b]);
+          p1 = cubic_spline_fit (xfrac, s1[b], s1[3 + b], s1[6 + b], s1[9 + b]);
+          p2 = cubic_spline_fit (xfrac, s2[b], s2[3 + b], s2[6 + b], s2[9 + b]);
+          p3 = cubic_spline_fit (xfrac, s3[b], s3[3 + b], s3[6 + b], s3[9 + b]);
 
           sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
     case 4:
-      p0 = cubic_spline_fit (xfrac, ps[3],  ps[7],  ps[11], ps[15]);
-      p1 = cubic_spline_fit (xfrac, ps[19], ps[23], ps[27], ps[31]);
-      p2 = cubic_spline_fit (xfrac, ps[35], ps[39], ps[43], ps[47]);
-      p3 = cubic_spline_fit (xfrac, ps[51], ps[55], ps[59], ps[63]);
+      p0 = cubic_spline_fit (xfrac, s0[3], s0[7], s0[11], s0[15]);
+      p1 = cubic_spline_fit (xfrac, s1[3], s1[7], s1[11], s1[15]);
+      p2 = cubic_spline_fit (xfrac, s2[3], s2[7], s2[11], s2[15]);
+      p3 = cubic_spline_fit (xfrac, s3[3], s3[7], s3[11], s3[15]);
 
       alphasum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
@@ -1343,22 +1231,30 @@
         {
           for (b = 0; b < 3; b++)
             {
-              p0 = cubic_spline_fit (xfrac, ps[0 + b] * ps[3],  ps[4 + b] * ps[7],
-                                     ps[8 + b] * ps[11], ps[12 + b] * ps[15]);
-              p1 = cubic_spline_fit (xfrac, ps[16 + b] * ps[19], ps[20 + b] * ps[23],
-                                     ps[24 + b] * ps[27], ps[28 + b] * ps[31]);
-              p2 = cubic_spline_fit (xfrac, ps[32 + b] * ps[35], ps[36 + b] * ps[39],
-                                     ps[40 + b] * ps[43], ps[44 + b] * ps[47]);
-              p3 = cubic_spline_fit (xfrac, ps[48 + b] * ps[51], ps[52 + b] * ps[55],
-                                     ps[56 + b] * ps[59], ps[60 + b] * ps[63]);
+              p0 = cubic_spline_fit (xfrac,
+                                     s0[0 + b] * s0[ 3], s0[ 4 + b] * s0[7],
+                                     s0[8 + b] * s0[11], s0[12 + b] * s0[15]);
+              p1 = cubic_spline_fit (xfrac,
+                                     s1[0 + b] * s1[ 3], s1[ 4 + b] * s1[7],
+                                     s1[8 + b] * s1[11], s1[12 + b] * s1[15]);
+              p2 = cubic_spline_fit (xfrac,
+                                     s2[0 + b] * s2[ 3], s2[ 4 + b] * s2[7],
+                                     s2[8 + b] * s2[11], s2[12 + b] * s2[15]);
+              p3 = cubic_spline_fit (xfrac,
+                                     s3[0 + b] * s3[ 3], s3[ 4 + b] * s3[7],
+                                     s3[8 + b] * s3[11], s3[12 + b] * s3[15]);
 
               sum  = cubic_spline_fit (yfrac, p0, p1, p2, p3);
               sum /= alphasum;
 
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
@@ -1368,17 +1264,19 @@
 lanczos3_mul_alpha (const guchar  *pixels,
                     const gdouble *x_kernel,
                     const gdouble *y_kernel,
+                    const gint     stride,
                     const gint     bytes,
                     const gint     byte)
 {
-  const guchar *p     = pixels;
+  const guchar *row   = pixels;
   const guchar  alpha = bytes - 1;
   gdouble       sum   = 0.0;
   gint          x, y;
 
-  for (y = 0; y < 6; y++)
+  for (y = 0; y < 6; y++, row += stride)
     {
-      gdouble tmpsum = 0.0;
+      const guchar *p      = row;
+      gdouble       tmpsum = 0.0;
 
       for (x = 0; x < 6; x++, p += bytes)
         {
@@ -1396,16 +1294,18 @@
 lanczos3_mul (const guchar  *pixels,
               const gdouble *x_kernel,
               const gdouble *y_kernel,
+              const gint     stride,
               const gint     bytes,
               const gint     byte)
 {
-  const guchar *p   = pixels;
+  const guchar *row = pixels;
   gdouble       sum = 0.0;
   gint          x, y;
 
-  for (y = 0; y < 6; y++)
+  for (y = 0; y < 6; y++, row += stride)
     {
-      gdouble tmpsum = 0.0;
+      const guchar *p = row;
+      gdouble       tmpsum = 0.0;
 
       for (x = 0; x < 6; x++, p += bytes)
         {
@@ -1420,50 +1320,31 @@
 }
 
 static void
-interpolate_lanczos3 (TileManager        *srcTM,
-                      const gint          x0,
-                      const gint          y0,
-                      const gint          x1,
-                      const gint          y1,
-                      const gdouble       xfrac,
-                      const gdouble       yfrac,
-                      guchar              *pixel,
-                      const gfloat *kernel_lookup)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  gint    b, i;
-  gint    x, y;
-  gint    x_shift, y_shift;
-  gdouble kx_sum, ky_sum;
-  gdouble x_kernel[6], y_kernel[6];
-  guchar  pixels[36 * 4];
-  gdouble sum, alphasum;
-
-  for (b = 0; b < src_bpp; b++)
-    pixel[b] = 0;
-
-  for (y = y0 - 2, i = 0; y <= y0 + 3; y++)
-    {
-      for (x = x0 - 2; x <= x0 + 3; x++, i++)
-        {
-          gint u, v;
-          u = (x > 0) ? x : 0;
-          u = (u < src_width - 1) ? u : src_width - 1;
-          v = (y > 0) ? y : 0;
-          v = (v < src_height - 1) ? v : src_height - 1;
-          read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
-        }
-    }
+interpolate_lanczos3 (PixelSurround *surround,
+                      const gint     x0,
+                      const gint     y0,
+                      const gdouble  xfrac,
+                      const gdouble  yfrac,
+                      const gint     bytes,
+                      guchar        *pixel,
+                      const gfloat  *kernel_lookup)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0 - 2, y0 - 2, &stride);
+  const gint    x_shift    = (gint) (xfrac * LANCZOS_SPP + 0.5);
+  const gint    y_shift    = (gint) (yfrac * LANCZOS_SPP + 0.5);
+  gint          b, i;
+  gdouble       kx_sum, ky_sum;
+  gdouble       x_kernel[6];
+  gdouble       y_kernel[6];
+  gdouble       sum, alphasum;
 
-  x_shift = (gint) (xfrac * LANCZOS_SPP + 0.5);
-  y_shift = (gint) (yfrac * LANCZOS_SPP + 0.5);
   kx_sum  = ky_sum = 0.0;
 
   for (i = 3; i >= -2; i--)
     {
       gint pos = i * LANCZOS_SPP;
+
       kx_sum += x_kernel[2 + i] = kernel_lookup[ABS (x_shift - pos)];
       ky_sum += y_kernel[2 + i] = kernel_lookup[ABS (y_shift - pos)];
     }
@@ -1475,127 +1356,99 @@
       y_kernel[2 + i] /= ky_sum;
     }
 
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
-      sum      = lanczos3_mul (pixels, x_kernel, y_kernel, 1, 0);
-      pixel[0] = (guchar) CLAMP ((gint) sum, 0, 255);
+      sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 1, 0);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
-      alphasum  = lanczos3_mul (pixels, x_kernel, y_kernel, 2, 1);
+      alphasum  = lanczos3_mul (src, x_kernel, y_kernel, stride, 2, 1);
       if (alphasum > 0)
         {
-          sum       = lanczos3_mul_alpha (pixels, x_kernel, y_kernel, 2, 0);
-          sum      /= alphasum;
-          pixel[0]  = (guchar) CLAMP (sum, 0, 255);
-          pixel[1]  = (guchar) CLAMP (alphasum, 0, 255);
+          sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 2, 0);
+          sum /= alphasum;
+
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
     case 3:
       for (b = 0; b < 3; b++)
         {
-          sum      = lanczos3_mul (pixels, x_kernel, y_kernel, 3, b);
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
+          sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 3, b);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
     case 4:
-      alphasum = lanczos3_mul (pixels, x_kernel, y_kernel, 4, 3);
+      alphasum = lanczos3_mul (src, x_kernel, y_kernel, stride, 4, 3);
       if (alphasum > 0)
         {
           for (b = 0; b < 3; b++)
             {
-              sum      = lanczos3_mul_alpha (pixels, x_kernel, y_kernel, 4, b);
-              sum     /= alphasum;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+              sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 4, b);
+              sum /= alphasum;
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
 }
 
 static void
-scale_pr (PixelRegion           *srcPR,
-          PixelRegion           *dstPR,
-          GimpInterpolationType  interpolation)
-{
-  gdouble scalex     = (gdouble) dstPR->w / (gdouble) srcPR->w;
-  gdouble scaley     = (gdouble) dstPR->h / (gdouble) srcPR->h;
-  gint    src_width  = srcPR->w;
-  gint    src_height = srcPR->h;
-  gint    bytes      = srcPR->bytes;
-  guchar *dstPtr     = dstPR->data;
-  gdouble xfrac, yfrac;
-  gint    b, x, sx0, sx1, y, sy0, sy1;
-  guchar  pixel[bytes];
+scale_region_buffer (PixelRegion *srcPR,
+                     PixelRegion *dstPR)
+{
+  const gdouble   scalex     = (gdouble) dstPR->w / (gdouble) srcPR->w;
+  const gdouble   scaley     = (gdouble) dstPR->h / (gdouble) srcPR->h;
+  const gint      src_width  = srcPR->w;
+  const gint      src_height = srcPR->h;
+  const gint      bytes      = srcPR->bytes;
+  const gint      dst_width  = dstPR->w;
+  const gint      dst_height = dstPR->h;
+  guchar         *pixel      = dstPR->data;
+  gint            x, y;
 
-  for (y = 0; y < dstPR->h; y++)
+  for (y = 0; y < dst_height; y++)
    {
-      yfrac = (y / scaley);
-      sy0   = (gint) yfrac;
-      sy1 = sy0 + 1;
-      sy1   = (sy1 < src_height - 1) ? sy1 : src_height - 1;
-
-      yfrac =  yfrac - sy0;
-
-      for (x = 0; x < dstPR->w; x++)
-        {
-          xfrac = (x / scalex);
-          sx0   = (gint) xfrac;
-          sx1   = sx0 + 1;
+     gdouble yfrac = (y / scaley);
+     gint    sy0   = (gint) yfrac;
+     gint    sy1   = sy0 + 1;
+
+     sy1   = (sy1 < src_height - 1) ? sy1 : src_height - 1;
+     yfrac =  yfrac - sy0;
+
+      for (x = 0; x < dst_width; x++)
+        {
+          gdouble xfrac = (x / scalex);
+          gint    sx0   = (gint) xfrac;
+          gint    sx1   = sx0 + 1;
+
           sx1   = (sx1 < src_width - 1) ? sx1 : src_width - 1;
           xfrac =  xfrac - sx0;
 
-          switch (interpolation)
-            {
-            case GIMP_INTERPOLATION_NONE:
-            case GIMP_INTERPOLATION_LINEAR:
-            case GIMP_INTERPOLATION_CUBIC:
-            case GIMP_INTERPOLATION_LANCZOS:
-              if (scalex == 0.5 || scaley == 0.5)
-                {
-                  decimate_average_pr (srcPR,
-                                       sx0, sy0,
-                                       sx1, sy1,
-                                       pixel);
-                }
-              else
-                {
-                  interpolate_bilinear_pr (srcPR,
-                                           sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel);
-                }
-              break;
-            }
-
-          for (b = 0; b < bytes; b++, dstPtr++)
-            *dstPtr = pixel[b];
+          interpolate_bilinear_pr (srcPR,
+                                   sx0, sy0, sx1, sy1, xfrac, yfrac,
+                                   pixel);
+          pixel += bytes;
         }
-    }
-}
-
-static void
-decimate_average_pr (PixelRegion *srcPR,
-                     const gint   x0,
-                     const gint   y0,
-                     const gint   x1,
-                     const gint   y1,
-                     guchar      *pixel)
-{
-  gint    bytes = srcPR->bytes;
-  gint    width = srcPR->w;
-  guchar *p1    = srcPR->data + (y0 * width + x0) * bytes;
-  guchar *p2    = srcPR->data + (y0 * width + x1) * bytes;
-  guchar *p3    = srcPR->data + (y1 * width + x0) * bytes;
-  guchar *p4    = srcPR->data + (y1 * width + x1) * bytes;
-
-  pixel_average (p1, p2, p3, p4, pixel, bytes);
+   }
 }
 
 static void
@@ -1608,35 +1461,38 @@
                          const gdouble   yfrac,
                          guchar         *pixel)
 {
-  gint    bytes = srcPR->bytes;
-  gint    width = srcPR->w;
-  guchar *p1    = srcPR->data + (y0 * width + x0) * bytes;
-  guchar *p2    = srcPR->data + (y0 * width + x1) * bytes;
-  guchar *p3    = srcPR->data + (y1 * width + x0) * bytes;
-  guchar *p4    = srcPR->data + (y1 * width + x1) * bytes;
-
-  gint    b;
-  gdouble sum, alphasum;
-
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
+  const gint  bytes = srcPR->bytes;
+  const gint  width = srcPR->w;
+  guchar     *p1    = srcPR->data + (y0 * width + x0) * bytes;
+  guchar     *p2    = srcPR->data + (y0 * width + x1) * bytes;
+  guchar     *p3    = srcPR->data + (y1 * width + x0) * bytes;
+  guchar     *p4    = srcPR->data + (y1 * width + x1) * bytes;
+  gint        b;
+  gdouble     sum, alphasum;
 
   switch (bytes)
     {
     case 1:
-      sum      = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      pixel[0]     = (guchar) CLAMP (sum, 0, 255);
+      sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
       alphasum = weighted_sum (xfrac, yfrac, p1[1], p2[1], p3[1], p4[1]);
       if (alphasum > 0)
         {
-          sum  = weighted_sum (xfrac, yfrac, p1[0] * p1[1], p2[0] * p2[1],
+          sum  = weighted_sum (xfrac, yfrac,
+                               p1[0] * p1[1], p2[0] * p2[1],
                                p3[0] * p3[1], p4[0] * p4[1]);
           sum /= alphasum;
-          pixel[0] = (guchar) CLAMP (sum, 0, 255);
-          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
+
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
@@ -1644,7 +1500,8 @@
       for (b = 0; b < 3; b++)
         {
           sum  = weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]);
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1654,13 +1511,19 @@
         {
           for (b = 0; b < 3; b++)
             {
-              sum  = weighted_sum (xfrac, yfrac, p1[b] * p1[3], p2[b] * p2[3],
+              sum  = weighted_sum (xfrac, yfrac,
+                                   p1[b] * p1[3], p2[b] * p2[3],
                                    p3[b] * p3[3], p4[b] * p4[3]);
               sum /= alphasum;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }

Modified: branches/soc-2008-tagging/app/paint/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/paint/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/paint/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -8,8 +8,8 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GDK_PIXBUF_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
 	-I$(includedir)
 
 noinst_LIBRARIES = libapppaint.a

Modified: branches/soc-2008-tagging/app/paint/gimpairbrush.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpairbrush.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpairbrush.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpbrushcore.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpbrushcore.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpbrushcore.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 
@@ -46,7 +46,6 @@
 
 #define EPSILON  0.00001
 
-
 enum
 {
   SET_BRUSH,
@@ -56,70 +55,72 @@
 
 /*  local function prototypes  */
 
-static void     gimp_brush_core_finalize          (GObject          *object);
+static void     gimp_brush_core_finalize           (GObject          *object);
 
-static gboolean gimp_brush_core_start             (GimpPaintCore    *core,
-                                                   GimpDrawable     *drawable,
-                                                   GimpPaintOptions *paint_options,
-                                                   GimpCoords       *coords,
-                                                   GError          **error);
-static gboolean gimp_brush_core_pre_paint         (GimpPaintCore    *core,
-                                                   GimpDrawable     *drawable,
-                                                   GimpPaintOptions *paint_options,
-                                                   GimpPaintState    paint_state,
-                                                   guint32           time);
-static void     gimp_brush_core_post_paint        (GimpPaintCore    *core,
-                                                   GimpDrawable     *drawable,
-                                                   GimpPaintOptions *paint_options,
-                                                   GimpPaintState    paint_state,
-                                                   guint32           time);
-static void     gimp_brush_core_interpolate       (GimpPaintCore    *core,
-                                                   GimpDrawable     *drawable,
-                                                   GimpPaintOptions *paint_options,
-                                                   guint32           time);
-
-static TempBuf *gimp_brush_core_get_paint_area    (GimpPaintCore    *paint_core,
-                                                   GimpDrawable     *drawable,
-                                                   GimpPaintOptions *paint_options);
-
-static void     gimp_brush_core_real_set_brush    (GimpBrushCore    *core,
-                                                   GimpBrush        *brush);
-
-static inline void rotate_pointers                (gulong          **p,
-                                                   guint32           n);
-static TempBuf * gimp_brush_core_subsample_mask   (GimpBrushCore    *core,
-                                                   TempBuf          *mask,
-                                                   gdouble           x,
-                                                   gdouble           y);
-static TempBuf * gimp_brush_core_pressurize_mask  (GimpBrushCore    *core,
-                                                   TempBuf          *brush_mask,
-                                                   gdouble           x,
-                                                   gdouble           y,
-                                                   gdouble           pressure);
-static TempBuf * gimp_brush_core_solidify_mask    (GimpBrushCore    *core,
-                                                   TempBuf          *brush_mask,
-                                                   gdouble           x,
-                                                   gdouble           y);
-static TempBuf * gimp_brush_core_scale_mask       (GimpBrushCore    *core,
-                                                   GimpBrush        *brush);
-static TempBuf * gimp_brush_core_scale_pixmap     (GimpBrushCore    *core,
-                                                   GimpBrush        *brush);
+static gboolean gimp_brush_core_start              (GimpPaintCore    *core,
+                                                    GimpDrawable     *drawable,
+                                                    GimpPaintOptions *paint_options,
+                                                    GimpCoords       *coords,
+                                                    GError          **error);
+static gboolean gimp_brush_core_pre_paint          (GimpPaintCore    *core,
+                                                    GimpDrawable     *drawable,
+                                                    GimpPaintOptions *paint_options,
+                                                    GimpPaintState    paint_state,
+                                                    guint32           time);
+static void     gimp_brush_core_post_paint         (GimpPaintCore    *core,
+                                                    GimpDrawable     *drawable,
+                                                    GimpPaintOptions *paint_options,
+                                                    GimpPaintState    paint_state,
+                                                    guint32           time);
+static void     gimp_brush_core_interpolate        (GimpPaintCore    *core,
+                                                    GimpDrawable     *drawable,
+                                                    GimpPaintOptions *paint_options,
+                                                    guint32           time);
+
+static TempBuf *gimp_brush_core_get_paint_area     (GimpPaintCore    *paint_core,
+                                                    GimpDrawable     *drawable,
+                                                    GimpPaintOptions *paint_options);
+
+static void     gimp_brush_core_real_set_brush     (GimpBrushCore    *core,
+                                                    GimpBrush        *brush);
+
+static inline void rotate_pointers                 (gulong          **p,
+                                                    guint32           n);
+static TempBuf * gimp_brush_core_subsample_mask    (GimpBrushCore    *core,
+                                                    TempBuf          *mask,
+                                                    gdouble           x,
+                                                    gdouble           y);
+static TempBuf * gimp_brush_core_pressurize_mask   (GimpBrushCore    *core,
+                                                    TempBuf          *brush_mask,
+                                                    gdouble           x,
+                                                    gdouble           y,
+                                                    gdouble           pressure);
+static TempBuf * gimp_brush_core_solidify_mask     (GimpBrushCore    *core,
+                                                    TempBuf          *brush_mask,
+                                                    gdouble           x,
+                                                    gdouble           y);
+static gdouble   gimp_brush_core_clamp_brush_scale (GimpBrushCore    *core,
+                                                    gdouble           scale);
+static TempBuf * gimp_brush_core_scale_mask        (GimpBrushCore    *core,
+                                                    GimpBrush        *brush);
+static TempBuf * gimp_brush_core_scale_pixmap      (GimpBrushCore    *core,
+                                                    GimpBrush        *brush);
 
-static void      gimp_brush_core_invalidate_cache (GimpBrush        *brush,
-                                                   GimpBrushCore    *core);
+static void      gimp_brush_core_invalidate_cache  (GimpBrush        *brush,
+                                                    GimpBrushCore    *core);
 
 
 /*  brush pipe utility functions  */
-static void      paint_line_pixmap_mask           (GimpImage        *dest,
-                                                   GimpDrawable     *drawable,
-                                                   TempBuf          *pixmap_mask,
-                                                   TempBuf          *brush_mask,
-                                                   guchar           *d,
-                                                   gint              x,
-                                                   gint              y,
-                                                   gint              bytes,
-                                                   gint              width,
-                                                   GimpBrushApplicationMode  mode);
+static void      paint_line_pixmap_mask            (GimpImage        *dest,
+                                                    GimpDrawable     *drawable,
+                                                    TempBuf          *pixmap_mask,
+                                                    TempBuf          *brush_mask,
+                                                    guchar           *d,
+                                                    gint              x,
+                                                    gint              y,
+                                                    gint              bytes,
+                                                    gint              width,
+                                                    GimpBrushApplicationMode  mode);
 
 
 G_DEFINE_TYPE (GimpBrushCore, gimp_brush_core, GIMP_TYPE_PAINT_CORE)
@@ -691,10 +692,9 @@
                                                        &paint_core->cur_coords,
                                                        TRUE);
 
-  /* else use scale from start(), we don't support on-the-fly scaling */
+  core->scale = gimp_brush_core_clamp_brush_scale (core, core->scale);
 
-  gimp_brush_scale_size (core->brush, core->scale,
-                         &brush_width, &brush_height);
+  gimp_brush_scale_size (core->brush, core->scale, &brush_width, &brush_height);
 
   /*  adjust the x and y coordinates to the upper left corner of the brush  */
   x = (gint) floor (paint_core->cur_coords.x) - (brush_width  / 2);
@@ -782,7 +782,11 @@
   scale = paint_options->brush_scale;
 
   if (scale > 0.0)
-    mask = gimp_brush_scale_mask (core->main_brush, scale);
+    {
+      scale = gimp_brush_core_clamp_brush_scale (core, scale);
+
+      mask = gimp_brush_scale_mask (core->main_brush, scale);
+    }
 
   if (mask)
     {
@@ -1263,6 +1267,16 @@
   return dest;
 }
 
+static gdouble
+gimp_brush_core_clamp_brush_scale (GimpBrushCore *core,
+                                   gdouble        scale)
+{
+  TempBuf *mask = core->main_brush->mask;
+
+  /* ensure that the final brush mask remains >= 0.5 pixel along both axes */
+  return MAX (0.5 / (gfloat) MIN (mask->width, mask->height), scale);
+}
+
 static TempBuf *
 gimp_brush_core_scale_mask (GimpBrushCore *core,
                             GimpBrush     *brush)
@@ -1271,7 +1285,7 @@
   gint height;
 
   if (core->scale <= 0.0)
-    return NULL;
+    return NULL; /* Should never happen now, with scale clamping. */
 
   if (core->scale == 1.0)
     return brush->mask;

Modified: branches/soc-2008-tagging/app/paint/gimpclone.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpclone.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpclone.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpconvolve.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpconvolve.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpconvolve.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "paint-types.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpdodgeburn.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpdodgeburn.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpdodgeburn.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimperaser.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimperaser.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimperaser.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpheal.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpheal.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpheal.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/paint/gimpink.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpink.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpink.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpinkoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpinkoptions.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpinkoptions.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpconfig/gimpconfig.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimppaintbrush.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintbrush.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintbrush.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/paint/gimppaintcore-stroke.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintcore-stroke.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintcore-stroke.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "paint-types.h"
 
@@ -338,7 +338,7 @@
         {
           coords[i].pressure =  i * slope;
         }
-                
+
       /* Calculate pressure end ramp */
       for (i = length - ramp_length; i < length; i++)
         {

Modified: branches/soc-2008-tagging/app/paint/gimppaintcore.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintcore.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintcore.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "paint-types.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimppaintoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintoptions.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintoptions.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/paint/gimpperspectiveclone.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpperspectiveclone.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpperspectiveclone.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
@@ -76,6 +76,9 @@
                                                    gint             *paint_area_height,
                                                    PixelRegion      *srcPR);
 
+static void     gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
+                                                   GimpMatrix3          *matrix);
+
 
 G_DEFINE_TYPE (GimpPerspectiveClone, gimp_perspective_clone,
                GIMP_TYPE_CLONE)
@@ -408,6 +411,35 @@
   return TRUE;
 }
 
+
+/*  public functions  */
+
+void
+gimp_perspective_clone_set_transform (GimpPerspectiveClone *clone,
+                                      GimpMatrix3          *transform)
+{
+  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
+  g_return_if_fail (transform != NULL);
+
+  clone->transform = *transform;
+
+  clone->transform_inv = clone->transform;
+  gimp_matrix3_invert (&clone->transform_inv);
+
+#if 0
+  g_printerr ("%f\t%f\t%f\n%f\t%f\t%f\n%f\t%f\t%f\n\n",
+              clone->transform.coeff[0][0],
+              clone->transform.coeff[0][1],
+              clone->transform.coeff[0][2],
+              clone->transform.coeff[1][0],
+              clone->transform.coeff[1][1],
+              clone->transform.coeff[1][2],
+              clone->transform.coeff[2][0],
+              clone->transform.coeff[2][1],
+              clone->transform.coeff[2][2]);
+#endif
+}
+
 void
 gimp_perspective_clone_get_source_point (GimpPerspectiveClone *clone,
                                          gdouble               x,
@@ -417,6 +449,10 @@
 {
   gdouble temp_x, temp_y;
 
+  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
+  g_return_if_fail (newx != NULL);
+  g_return_if_fail (newy != NULL);
+
   gimp_matrix3_transform_point (&clone->transform_inv,
                                 x, y, &temp_x, &temp_y);
 
@@ -440,7 +476,10 @@
                                 temp_x, temp_y, newx, newy);
 }
 
-void
+
+/*  private functions  */
+
+static void
 gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
                                    GimpMatrix3          *matrix)
 {

Modified: branches/soc-2008-tagging/app/paint/gimpperspectiveclone.h
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpperspectiveclone.h	(original)
+++ branches/soc-2008-tagging/app/paint/gimpperspectiveclone.h	Sun Oct 12 15:38:02 2008
@@ -56,18 +56,18 @@
 };
 
 
-void    gimp_perspective_clone_register   (Gimp                      *gimp,
-                                           GimpPaintRegisterCallback  callback);
+void    gimp_perspective_clone_register      (Gimp                      *gimp,
+                                              GimpPaintRegisterCallback  callback);
 
 GType   gimp_perspective_clone_get_type         (void) G_GNUC_CONST;
 
+void    gimp_perspective_clone_set_transform    (GimpPerspectiveClone   *clone,
+                                                 GimpMatrix3            *transform);
 void    gimp_perspective_clone_get_source_point (GimpPerspectiveClone   *clone,
                                                  gdouble                 x,
                                                  gdouble                 y,
-                                                 gdouble                 *newx,
-                                                 gdouble                 *newy);
-void    gimp_perspective_clone_get_matrix       (GimpPerspectiveClone    *clone,
-                                                 GimpMatrix3             *matrix);
+                                                 gdouble                *newx,
+                                                 gdouble                *newy);
 
 
 #endif  /*  __GIMP_PERSPECTIVE_CLONE_H__  */

Modified: branches/soc-2008-tagging/app/paint/gimpsmudge.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpsmudge.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpsmudge.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/paint/gimpsourcecore.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpsourcecore.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpsourcecore.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/pdb/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/pdb/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-PDB\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
+	-I$(includedir)
+
 noinst_LIBRARIES = libapppdb.a libappinternal-procs.a
 
 libapppdb_a_SOURCES = \
@@ -69,17 +81,4 @@
 	unit-cmds.c			\
 	vectors-cmds.c
 
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-PDB\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
-	$(GEGL_CFLAGS)		\
-	$(GLIB_CFLAGS)		\
-	-I$(includedir)
-
 EXTRA_DIST = makefile.msc

Modified: branches/soc-2008-tagging/app/pdb/brush-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/brush-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/brush-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/brush-select-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/brush-select-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/brush-select-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/brushes-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/brushes-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/brushes-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/buffer-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/buffer-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/buffer-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/channel-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/channel-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/channel-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/pdb/color-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/color-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/color-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/context-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/context-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/context-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/pdb/convert-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/convert-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/convert-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/display-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/display-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/display-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/drawable-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/drawable-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/drawable-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 
@@ -799,7 +799,10 @@
 
   if (success)
     {
-      non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
+        non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
+      else
+        success = FALSE;
     }
 
   return_vals = gimp_procedure_get_return_values (procedure, success,
@@ -838,7 +841,11 @@
 
   if (success)
     {
-      non_empty = gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
+        non_empty = gimp_drawable_mask_intersect (drawable,
+                                                  &x, &y, &width, &height);
+      else
+        success = FALSE;
     }
 
   return_vals = gimp_procedure_get_return_values (procedure, success,

Modified: branches/soc-2008-tagging/app/pdb/drawable-transform-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/drawable-transform-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/drawable-transform-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/pdb/edit-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/edit-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/edit-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/fileops-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/fileops-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/fileops-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpconfig/gimpconfig.h"

Modified: branches/soc-2008-tagging/app/pdb/floating-sel-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/floating-sel-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/floating-sel-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/font-select-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/font-select-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/font-select-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/fonts-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/fonts-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/fonts-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/gimppdb-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimppdb-utils.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gimppdb-utils.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 
@@ -299,34 +299,46 @@
   g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  if (gimp_item_is_attached (item))
-    return TRUE;
-
-  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
-               _("Item '%s' (%d) can not be used because it has not "
-                 "been added to an image"),
-               gimp_object_get_name (GIMP_OBJECT (item)),
-               gimp_item_get_ID (item));
+  if (! gimp_item_is_attached (item))
+    {
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                   _("Item '%s' (%d) can not be used because it has not "
+                     "been added to an image"),
+                   gimp_object_get_name (GIMP_OBJECT (item)),
+                   gimp_item_get_ID (item));
+      return FALSE;
+    }
 
-  return FALSE;
+  return TRUE;
 }
 
 gboolean
 gimp_pdb_item_is_floating (GimpItem  *item,
+                           GimpImage *dest_image,
                            GError   **error)
 {
   g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
+  g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  if (g_object_is_floating (item))
-    return TRUE;
-
-  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
-               _("Item '%s' (%d) has already been added to an image"),
-               gimp_object_get_name (GIMP_OBJECT (item)),
-               gimp_item_get_ID (item));
+  if (! g_object_is_floating (item))
+    {
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                   _("Item '%s' (%d) has already been added to an image"),
+                   gimp_object_get_name (GIMP_OBJECT (item)),
+                   gimp_item_get_ID (item));
+      return FALSE;
+    }
+  else if (gimp_item_get_image (item) != dest_image)
+    {
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                   _("Trying to add item '%s' (%d) to wrong image"),
+                   gimp_object_get_name (GIMP_OBJECT (item)),
+                   gimp_item_get_ID (item));
+      return FALSE;
+    }
 
-  return FALSE;
+  return TRUE;
 }
 
 gboolean

Modified: branches/soc-2008-tagging/app/pdb/gimppdb-utils.h
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimppdb-utils.h	(original)
+++ branches/soc-2008-tagging/app/pdb/gimppdb-utils.h	Sun Oct 12 15:38:02 2008
@@ -52,6 +52,7 @@
 gboolean        gimp_pdb_item_is_attached       (GimpItem           *item,
                                                  GError            **error);
 gboolean        gimp_pdb_item_is_floating       (GimpItem           *item,
+                                                 GimpImage          *dest_image,
                                                  GError            **error);
 gboolean        gimp_pdb_layer_is_text_layer    (GimpLayer          *layer,
                                                  GError            **error);

Modified: branches/soc-2008-tagging/app/pdb/gimpprocedure.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimpprocedure.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gimpprocedure.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <stdarg.h>
 #include <sys/types.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -247,25 +247,25 @@
 
 void
 gimp_procedure_set_static_strings (GimpProcedure *procedure,
-                                   gchar         *original_name,
-                                   gchar         *blurb,
-                                   gchar         *help,
-                                   gchar         *author,
-                                   gchar         *copyright,
-                                   gchar         *date,
-                                   gchar         *deprecated)
+                                   const gchar   *original_name,
+                                   const gchar   *blurb,
+                                   const gchar   *help,
+                                   const gchar   *author,
+                                   const gchar   *copyright,
+                                   const gchar   *date,
+                                   const gchar   *deprecated)
 {
   g_return_if_fail (GIMP_IS_PROCEDURE (procedure));
 
   gimp_procedure_free_strings (procedure);
 
-  procedure->original_name = original_name;
-  procedure->blurb         = blurb;
-  procedure->help          = help;
-  procedure->author        = author;
-  procedure->copyright     = copyright;
-  procedure->date          = date;
-  procedure->deprecated    = deprecated;
+  procedure->original_name = (gchar *) original_name;
+  procedure->blurb         = (gchar *) blurb;
+  procedure->help          = (gchar *) help;
+  procedure->author        = (gchar *) author;
+  procedure->copyright     = (gchar *) copyright;
+  procedure->date          = (gchar *) date;
+  procedure->deprecated    = (gchar *) deprecated;
 
   procedure->static_strings = TRUE;
 }

Modified: branches/soc-2008-tagging/app/pdb/gimpprocedure.h
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimpprocedure.h	(original)
+++ branches/soc-2008-tagging/app/pdb/gimpprocedure.h	Sun Oct 12 15:38:02 2008
@@ -98,13 +98,13 @@
                                                    const gchar      *date,
                                                    const gchar      *deprecated);
 void            gimp_procedure_set_static_strings (GimpProcedure    *procedure,
-                                                   gchar            *original_name,
-                                                   gchar            *blurb,
-                                                   gchar            *help,
-                                                   gchar            *author,
-                                                   gchar            *copyright,
-                                                   gchar            *date,
-                                                   gchar            *deprecated);
+                                                   const gchar      *original_name,
+                                                   const gchar      *blurb,
+                                                   const gchar      *help,
+                                                   const gchar      *author,
+                                                   const gchar      *copyright,
+                                                   const gchar      *date,
+                                                   const gchar      *deprecated);
 void            gimp_procedure_take_strings       (GimpProcedure    *procedure,
                                                    gchar            *original_name,
                                                    gchar            *blurb,

Modified: branches/soc-2008-tagging/app/pdb/gimprc-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimprc-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gimprc-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpconfig/gimpconfig.h"

Modified: branches/soc-2008-tagging/app/pdb/gradient-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gradient-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gradient-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
@@ -1304,6 +1304,9 @@
 
       if (start_seg)
         {
+          if (!end_seg)
+            end_seg = gimp_gradient_segment_get_last (start_seg);
+
           gimp_gradient_segment_range_blend (gradient,
                                              start_seg, end_seg,
                                              &start_seg->left_color,
@@ -1346,6 +1349,9 @@
 
       if (start_seg)
         {
+          if (!end_seg)
+            end_seg = gimp_gradient_segment_get_last (start_seg);
+
           gimp_gradient_segment_range_blend (gradient,
                                              start_seg, end_seg,
                                              &start_seg->left_color,

Modified: branches/soc-2008-tagging/app/pdb/gradient-select-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gradient-select-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gradient-select-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/gradients-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gradients-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gradients-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/grid-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/grid-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/grid-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbaseenums.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/pdb/guides-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/guides-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/guides-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/help-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/help-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/help-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/image-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/image-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/image-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -48,6 +48,7 @@
 #include "core/gimplist.h"
 #include "core/gimpparamspecs.h"
 #include "core/gimppickable.h"
+#include "core/gimpprogress.h"
 #include "core/gimpselection.h"
 #include "core/gimpunit.h"
 #include "vectors/gimpvectors.h"
@@ -400,9 +401,49 @@
 
   if (success)
     {
+      if (progress)
+        gimp_progress_start (progress, _("Scaling"), FALSE);
+
       gimp_image_scale (image, new_width, new_height,
                         gimp->config->interpolation_type,
-                        NULL);
+                        progress);
+
+      if (progress)
+        gimp_progress_end (progress);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+image_scale_full_invoker (GimpProcedure      *procedure,
+                          Gimp               *gimp,
+                          GimpContext        *context,
+                          GimpProgress       *progress,
+                          const GValueArray  *args,
+                          GError            **error)
+{
+  gboolean success = TRUE;
+  GimpImage *image;
+  gint32 new_width;
+  gint32 new_height;
+  gint32 interpolation;
+
+  image = gimp_value_get_image (&args->values[0], gimp);
+  new_width = g_value_get_int (&args->values[1]);
+  new_height = g_value_get_int (&args->values[2]);
+  interpolation = g_value_get_enum (&args->values[3]);
+
+  if (success)
+    {
+      if (progress)
+        gimp_progress_start (progress, _("Scaling"), FALSE);
+
+      gimp_image_scale (image, new_width, new_height, interpolation, progress);
+
+      if (progress)
+        gimp_progress_end (progress);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -488,7 +529,13 @@
 
   if (success)
     {
-      gimp_image_rotate (image, context, rotate_type, NULL);
+      if (progress)
+        gimp_progress_start (progress, _("Rotating"), FALSE);
+
+      gimp_image_rotate (image, context, rotate_type, progress);
+
+      if (progress)
+        gimp_progress_end (progress);  
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -863,12 +910,12 @@
 
   if (success)
     {
-      if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), error) &&
+      if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), image, error) &&
           gimp_pdb_image_is_base_type (image,
                                        GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (GIMP_DRAWABLE (layer))),
                                        error))
         {
-          success = gimp_image_add_layer (image, layer, MAX (position, -1));
+          success = gimp_image_add_layer (image, layer, MAX (position, -1), TRUE);
         }
       else
         {
@@ -897,7 +944,10 @@
 
   if (success)
     {
-      gimp_image_remove_layer (image, layer);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+        gimp_image_remove_layer (image, layer, TRUE, NULL);
+      else
+        success = FALSE;
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -955,7 +1005,7 @@
 
   if (success)
     {
-      success = gimp_image_raise_layer (image, layer);
+      success = gimp_image_raise_layer (image, layer, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -979,7 +1029,7 @@
 
   if (success)
     {
-      success = gimp_image_lower_layer (image, layer);
+      success = gimp_image_lower_layer (image, layer, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1053,9 +1103,9 @@
 
   if (success)
     {
-      if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), error))
+      if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), image, error))
         {
-          success = gimp_image_add_channel (image, channel, MAX (position, -1));
+          success = gimp_image_add_channel (image, channel, MAX (position, -1), TRUE);
         }
       else
         {
@@ -1084,7 +1134,10 @@
 
   if (success)
     {
-      gimp_image_remove_channel (image, channel);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), error))
+        gimp_image_remove_channel (image, channel, TRUE, NULL);
+      else
+        success = FALSE;
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1142,7 +1195,7 @@
 
   if (success)
     {
-      success = gimp_image_raise_channel (image, channel);
+      success = gimp_image_raise_channel (image, channel, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1166,7 +1219,7 @@
 
   if (success)
     {
-      success = gimp_image_lower_channel (image, channel);
+      success = gimp_image_lower_channel (image, channel, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1192,9 +1245,9 @@
 
   if (success)
     {
-      if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), error))
+      if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), image, error))
         {
-          success = gimp_image_add_vectors (image, vectors, MAX (position, -1));
+          success = gimp_image_add_vectors (image, vectors, MAX (position, -1), TRUE);
         }
       else
         {
@@ -1223,7 +1276,10 @@
 
   if (success)
     {
-      gimp_image_remove_vectors (image, vectors);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
+        gimp_image_remove_vectors (image, vectors, TRUE, NULL);
+      else
+        success = FALSE;
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1281,7 +1337,7 @@
 
   if (success)
     {
-      success = gimp_image_raise_vectors (image, vectors);
+      success = gimp_image_raise_vectors (image, vectors, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1305,7 +1361,7 @@
 
   if (success)
     {
-      success = gimp_image_lower_vectors (image, vectors);
+      success = gimp_image_lower_vectors (image, vectors, error);
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1481,7 +1537,9 @@
 
   if (success)
     {
-      if (! gimp_layer_add_mask (layer, mask, TRUE))
+      if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), image, error))
+        success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
+      else
         success = FALSE;
     }
 
@@ -1508,7 +1566,11 @@
 
   if (success)
     {
-      gimp_layer_apply_mask (layer, mode, TRUE);
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
+          gimp_layer_get_mask (layer))
+        gimp_layer_apply_mask (layer, mode, TRUE);
+      else
+        success = FALSE;
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -2692,7 +2754,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-resize",
                                      "Resize the image to the specified extents.",
-                                     "This procedure resizes the image so that it's new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous image's content. No bounds checking is currently provided, so don't supply parameters that are out of bounds. All channels within the image are resized according to the specified parameters; this includes the image selection mask. All layers within the image are repositioned according to the specified offsets.",
+                                     "This procedure resizes the image so that it's new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous image's content. All channels within the image are resized according to the specified parameters; this includes the image selection mask. All layers within the image are repositioned according to the specified offsets.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -2761,8 +2823,8 @@
                                "gimp-image-scale");
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-scale",
-                                     "Scale the image to the specified extents.",
-                                     "This procedure scales the image so that its new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous image's content. No bounds checking is currently provided, so don't supply parameters that are out of bounds. All channels within the image are scaled according to the specified parameters; this includes the image selection mask. All layers within the image are repositioned according to the specified offsets.",
+                                     "Scale the image using the default interpolation method.",
+                                     "This procedure scales the image so that its new width and height are equal to the supplied parameters. All layers and channels within the image are scaled according to the specified parameters; this includes the image selection mask. The default interpolation method is used.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -2789,6 +2851,48 @@
   g_object_unref (procedure);
 
   /*
+   * gimp-image-scale-full
+   */
+  procedure = gimp_procedure_new (image_scale_full_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-image-scale-full");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-image-scale-full",
+                                     "Scale the image using a specific interpolation method.",
+                                     "This procedure scales the image so that its new width and height are equal to the supplied parameters. All layers and channels within the image are scaled according to the specified parameters; this includes the image selection mask. This procedure allows you to specify the interpolation method explicitly.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_image_id ("image",
+                                                         "image",
+                                                         "The image",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("new-width",
+                                                      "new width",
+                                                      "New image width",
+                                                      1, GIMP_MAX_IMAGE_SIZE, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("new-height",
+                                                      "new height",
+                                                      "New image height",
+                                                      1, GIMP_MAX_IMAGE_SIZE, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("interpolation",
+                                                  "interpolation",
+                                                  "Type of interpolation",
+                                                  GIMP_TYPE_INTERPOLATION_TYPE,
+                                                  GIMP_INTERPOLATION_NONE,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
    * gimp-image-crop
    */
   procedure = gimp_procedure_new (image_crop_invoker);
@@ -2823,13 +2927,13 @@
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_int32 ("offx",
                                                       "offx",
-                                                      "x offset: (0 <= offx <= (width - new_width))",
+                                                      "X offset: (0 <= offx <= (width - new_width))",
                                                       0, G_MAXINT32, 0,
                                                       GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_int32 ("offy",
                                                       "offy",
-                                                      "y offset: (0 <= offy <= (height - new_height))",
+                                                      "Y offset: (0 <= offy <= (height - new_height))",
                                                       0, G_MAXINT32, 0,
                                                       GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -3289,7 +3393,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-get-layer-position",
                                      "Returns the position of the layer in the layer stack.",
-                                     "This procedure determines the positioin of the specified layer in the images layer stack. If the layer doesn't exist in the image, an error is returned.",
+                                     "This procedure determines the position of the specified layer in the images layer stack. If the layer doesn't exist in the image, an error is returned.",
                                      "Simon Budig",
                                      "Simon Budig",
                                      "2006",
@@ -3324,7 +3428,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-raise-layer",
                                      "Raise the specified layer in the image's layer stack",
-                                     "This procedure raises the specified layer one step in the existing layer stack. It will not move the layer if there is no layer above it.",
+                                     "This procedure raises the specified layer one step in the existing layer stack. The procecure call will fail if there is no layer above it.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -3353,7 +3457,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-lower-layer",
                                      "Lower the specified layer in the image's layer stack",
-                                     "This procedure lowers the specified layer one step in the existing layer stack. It will not move the layer if there is no layer below it.",
+                                     "This procedure lowers the specified layer one step in the existing layer stack. The procecure call will fail if there is no layer below it.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -3504,7 +3608,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-get-channel-position",
                                      "Returns the position of the channel in the channel stack.",
-                                     "This procedure determines the positioin of the specified channel in the images channel stack. If the channel doesn't exist in the image, an error is returned.",
+                                     "This procedure determines the position of the specified channel in the images channel stack. If the channel doesn't exist in the image, an error is returned.",
                                      "Simon Budig",
                                      "Simon Budig",
                                      "2006",
@@ -3539,7 +3643,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-raise-channel",
                                      "Raise the specified channel in the image's channel stack",
-                                     "This procedure raises the specified channel one step in the existing channel stack. It will not move the channel if there is no channel above it.",
+                                     "This procedure raises the specified channel one step in the existing channel stack. The procecure call will fail if there is no channel above it.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -3568,7 +3672,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-lower-channel",
                                      "Lower the specified channel in the image's channel stack",
-                                     "This procedure lowers the specified channel one step in the existing channel stack. It will not move the channel if there is no channel below it.",
+                                     "This procedure lowers the specified channel one step in the existing channel stack. The procecure call will fail if there is no channel below it.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -3661,7 +3765,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-get-vectors-position",
                                      "Returns the position of the vectors object in the vectors objects stack.",
-                                     "This procedure determines the positioin of the specified vectors object in the images vectors object stack. If the vectors object doesn't exist in the image, an error is returned.",
+                                     "This procedure determines the position of the specified vectors object in the images vectors object stack. If the vectors object doesn't exist in the image, an error is returned.",
                                      "Simon Budig",
                                      "Simon Budig",
                                      "2006",
@@ -3696,7 +3800,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-raise-vectors",
                                      "Raise the specified vectors in the image's vectors stack",
-                                     "This procedure raises the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors above it.",
+                                     "This procedure raises the specified vectors one step in the existing vectors stack. The procecure call will fail if there is no vectors above it.",
                                      "Simon Budig",
                                      "Simon Budig",
                                      "2005",
@@ -3725,7 +3829,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-lower-vectors",
                                      "Lower the specified vectors in the image's vectors stack",
-                                     "This procedure lowers the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors below it.",
+                                     "This procedure lowers the specified vectors one step in the existing vectors stack. The procecure call will fail if there is no vectors below it.",
                                      "Simon Budig",
                                      "Simon Budig",
                                      "2005",

Modified: branches/soc-2008-tagging/app/pdb/internal-procs.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/internal-procs.c	(original)
+++ branches/soc-2008-tagging/app/pdb/internal-procs.c	Sun Oct 12 15:38:02 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 589 procedures registered total */
+/* 593 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)

Modified: branches/soc-2008-tagging/app/pdb/layer-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/layer-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/layer-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 
@@ -35,6 +35,7 @@
 #include "core/gimplayer.h"
 #include "core/gimplayermask.h"
 #include "core/gimpparamspecs.h"
+#include "core/gimpprogress.h"
 #include "core/gimpprojection.h"
 
 #include "gimppdb.h"
@@ -283,11 +284,66 @@
   if (success)
     {
       if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
-        gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
-                                   gimp->config->interpolation_type, NULL,
-                                   local_origin);
+        {
+          if (progress)
+            gimp_progress_start (progress, _("Scaling"), FALSE);
+
+          gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
+                                     gimp->config->interpolation_type, progress,
+                                     local_origin);
+
+          if (progress)
+            gimp_progress_end (progress);
+        }
       else
-        success = FALSE;
+        {
+          success = FALSE;
+        }
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+layer_scale_full_invoker (GimpProcedure      *procedure,
+                          Gimp               *gimp,
+                          GimpContext        *context,
+                          GimpProgress       *progress,
+                          const GValueArray  *args,
+                          GError            **error)
+{
+  gboolean success = TRUE;
+  GimpLayer *layer;
+  gint32 new_width;
+  gint32 new_height;
+  gboolean local_origin;
+  gint32 interpolation;
+
+  layer = gimp_value_get_layer (&args->values[0], gimp);
+  new_width = g_value_get_int (&args->values[1]);
+  new_height = g_value_get_int (&args->values[2]);
+  local_origin = g_value_get_boolean (&args->values[3]);
+  interpolation = g_value_get_enum (&args->values[4]);
+
+  if (success)
+    {
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+        {
+          if (progress)
+            gimp_progress_start (progress, _("Scaling"), FALSE);
+
+          gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
+                                     interpolation, progress,
+                                     local_origin);
+
+          if (progress)
+            gimp_progress_end (progress);
+        }
+      else
+        {
+          success = FALSE;
+        }
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -550,8 +606,10 @@
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
-        gimp_layer_add_mask (layer, mask, TRUE);
+      if (gimp_pdb_item_is_floating (GIMP_ITEM (mask),
+                                     gimp_item_get_image (GIMP_ITEM (layer)),
+                                     error))
+        success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
       else
         success = FALSE;
     }
@@ -577,7 +635,8 @@
 
   if (success)
     {
-      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
+          gimp_layer_get_mask (layer))
         gimp_layer_apply_mask (layer, mode, TRUE);
       else
         success = FALSE;
@@ -1191,8 +1250,8 @@
                                "gimp-layer-scale");
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-layer-scale",
-                                     "Scale the layer to the specified extents.",
-                                     "This procedure scales the layer so that its new width and height are equal to the supplied parameters. The 'local-origin' parameter specifies whether to scale from the center of the layer, or from the image origin. This operation only works if the layer has been added to an image.",
+                                     "Scale the layer using the default interpolation method.",
+                                     "This procedure scales the layer so that its new width and height are equal to the supplied parameters. The 'local-origin' parameter specifies whether to scale from the center of the layer, or from the image origin. This operation only works if the layer has been added to an image. The default interpolation method is used for scaling.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -1225,6 +1284,54 @@
   g_object_unref (procedure);
 
   /*
+   * gimp-layer-scale-full
+   */
+  procedure = gimp_procedure_new (layer_scale_full_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-layer-scale-full");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-layer-scale-full",
+                                     "Scale the layer using a specific interpolation method.",
+                                     "This procedure scales the layer so that its new width and height are equal to the supplied parameters. The 'local-origin' parameter specifies whether to scale from the center of the layer, or from the image origin. This operation only works if the layer has been added to an image. This procedure allows you to specify the interpolation method explicitly.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_layer_id ("layer",
+                                                         "layer",
+                                                         "The layer",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("new-width",
+                                                      "new width",
+                                                      "New layer width",
+                                                      1, GIMP_MAX_IMAGE_SIZE, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("new-height",
+                                                      "new height",
+                                                      "New layer height",
+                                                      1, GIMP_MAX_IMAGE_SIZE, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("local-origin",
+                                                     "local origin",
+                                                     "Use a local origin (as opposed to the image origin)",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("interpolation",
+                                                  "interpolation",
+                                                  "Type of interpolation",
+                                                  GIMP_TYPE_INTERPOLATION_TYPE,
+                                                  GIMP_INTERPOLATION_NONE,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
    * gimp-layer-resize
    */
   procedure = gimp_procedure_new (layer_resize_invoker);

Modified: branches/soc-2008-tagging/app/pdb/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/pdb/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/pdb/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -28,56 +28,57 @@
 	
 
 OBJECTS_UI = \
-	brush_select_cmds.obj \
-	gradient_select_cmds.obj \
-	palette_select_cmds.obj \
-	pattern_select_cmds.obj \
+	brush-select-cmds.obj \
+	gradient-select-cmds.obj \
+	palette-select-cmds.obj \
+	pattern-select-cmds.obj \
 
 OBJECTS = \
 	$(OBJECTS_UI) \
-	internal_procs.obj \
-	brush_cmds.obj \
-	brushes_cmds.obj \
-	buffer_cmds.obj \
-	channel_cmds.obj \
-	color_cmds.obj \
-	context_cmds.obj \
-	convert_cmds.obj \
-	display_cmds.obj \
-	drawable_cmds.obj \
-	drawable_transform_cmds.obj \
-	edit_cmds.obj \
-	fileops_cmds.obj \
-	floating_sel_cmds.obj \
-	fonts_cmds.obj \
-	font_select_cmds.obj \
-	gimprc_cmds.obj \
-	gradient_cmds.obj \
-	gradients_cmds.obj \
-	grid_cmds.obj \
-	guides_cmds.obj \
-	help_cmds.obj \
-	image_cmds.obj \
-	layer_cmds.obj \
-	message_cmds.obj \
-	misc_cmds.obj \
-	paint_tools_cmds.obj \
-	palette_cmds.obj \
-	palettes_cmds.obj \
-	parasite_cmds.obj \
-	paths_cmds.obj \
-	pattern_cmds.obj \
-	patterns_cmds.obj \
-	plug_in_cmds.obj \
-	procedural_db_cmds.obj \
-	progress_cmds.obj \
-	selection_cmds.obj \
-	selection_tools_cmds.obj \
-	text_tool_cmds.obj \
-	transform_tools_cmds.obj \
-	undo_cmds.obj \
-	unit_cmds.obj \
-	vectors_cmds.obj \
+	internal-procs.obj \
+	brush-cmds.obj \
+	brushes-cmds.obj \
+	buffer-cmds.obj \
+	channel-cmds.obj \
+	color-cmds.obj \
+	context-cmds.obj \
+	convert-cmds.obj \
+	display-cmds.obj \
+	drawable-cmds.obj \
+	drawable-transform-cmds.obj \
+	edit-cmds.obj \
+	fileops-cmds.obj \
+	floating-sel-cmds.obj \
+	fonts-cmds.obj \
+	font-select-cmds.obj \
+	gimprc-cmds.obj \
+	gradient-cmds.obj \
+	gradients-cmds.obj \
+	grid-cmds.obj \
+	guides-cmds.obj \
+	help-cmds.obj \
+	image-cmds.obj \
+	layer-cmds.obj \
+	message-cmds.obj \
+	misc-cmds.obj \
+	paint-tools-cmds.obj \
+	palette-cmds.obj \
+	palettes-cmds.obj \
+	parasite-cmds.obj \
+	paths-cmds.obj \
+	pattern-cmds.obj \
+	patterns-cmds.obj \
+	plug-in-cmds.obj \
+	procedural-db-cmds.obj \
+	progress-cmds.obj \
+	selection-cmds.obj \
+	selection-tools-cmds.obj \
+	text-layer-cmds.obj \
+	text-tool-cmds.obj \
+	transform-tools-cmds.obj \
+	undo-cmds.obj \
+	unit-cmds.obj \
+	vectors-cmds.obj \
 	\
 	gimppdb.obj \
 	gimppdb-utils.obj \

Modified: branches/soc-2008-tagging/app/pdb/message-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/message-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/message-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/misc-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/misc-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/misc-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/paint-tools-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/paint-tools-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/paint-tools-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/pdb/palette-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/palette-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/palette-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/pdb/palette-select-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/palette-select-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/palette-select-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/palettes-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/palettes-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/palettes-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 

Modified: branches/soc-2008-tagging/app/pdb/parasite-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/parasite-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/parasite-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/paths-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/paths-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/paths-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 
@@ -162,7 +162,7 @@
       GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
 
       if (vectors)
-        gimp_image_remove_vectors (image, vectors);
+        gimp_image_remove_vectors (image, vectors, TRUE, NULL);
       else
         success = FALSE;
     }
@@ -303,7 +303,7 @@
           g_free (points);
 
           if (vectors)
-            gimp_image_add_vectors (image, vectors, 0);
+            success = gimp_image_add_vectors (image, vectors, 0, TRUE);
           else
             success = FALSE;
         }

Modified: branches/soc-2008-tagging/app/pdb/pattern-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/pattern-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/pattern-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/pattern-select-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/pattern-select-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/pattern-select-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/patterns-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/patterns-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/patterns-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/plug-in-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/plug-in-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/plug-in-cmds.c	Sun Oct 12 15:38:02 2008
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 
@@ -278,6 +278,69 @@
                                            error ? *error : NULL);
 }
 
+static GValueArray *
+plugin_set_pdb_error_handler_invoker (GimpProcedure      *procedure,
+                                      Gimp               *gimp,
+                                      GimpContext        *context,
+                                      GimpProgress       *progress,
+                                      const GValueArray  *args,
+                                      GError            **error)
+{
+  gboolean success = TRUE;
+  gint32 handler;
+
+  handler = g_value_get_enum (&args->values[0]);
+
+  if (success)
+    {
+      GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+      if (plug_in)
+        {
+          gimp_plug_in_set_error_handler (plug_in, handler);
+        }
+      else
+        {
+          success = FALSE;
+        }
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+plugin_get_pdb_error_handler_invoker (GimpProcedure      *procedure,
+                                      Gimp               *gimp,
+                                      GimpContext        *context,
+                                      GimpProgress       *progress,
+                                      const GValueArray  *args,
+                                      GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gint32 handler = 0;
+
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      handler = gimp_plug_in_get_error_handler (plug_in);
+    }
+  else
+    {
+      success = FALSE;
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_enum (&return_vals->values[1], handler);
+
+  return return_vals;
+}
+
 void
 register_plug_in_procs (GimpPDB *pdb)
 {
@@ -538,4 +601,52 @@
                                                            GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
+
+  /*
+   * gimp-plugin-set-pdb-error-handler
+   */
+  procedure = gimp_procedure_new (plugin_set_pdb_error_handler_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-plugin-set-pdb-error-handler");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-plugin-set-pdb-error-handler",
+                                     "Sets an error handler for procedure calls.",
+                                     "This procedure changes the way that errors in procedure calls are handled. By default GIMP will raise an error dialog if a procedure call made by a plug-in fails. Using this procedure the plug-in can change this behavior. If the error handler is set to %GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for calling 'gimp-get-pdb-error' and handling the error whenever one if its procedure calls fails. It can do this by displaying the error message or by forwarding it in its own return values.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("handler",
+                                                  "handler",
+                                                  "Who is responsible for handling procedure call errors",
+                                                  GIMP_TYPE_PDB_ERROR_HANDLER,
+                                                  GIMP_PDB_ERROR_HANDLER_INTERNAL,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-plugin-get-pdb-error-handler
+   */
+  procedure = gimp_procedure_new (plugin_get_pdb_error_handler_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-plugin-get-pdb-error-handler");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-plugin-get-pdb-error-handler",
+                                     "Retrieves the active error handler for procedure calls.",
+                                     "This procedure retrieves the currently active error handler for procedure calls made by the calling plug-in. See 'gimp-plugin-set-pdb-error-handler' for details.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_enum ("handler",
+                                                      "handler",
+                                                      "Who is responsible for handling procedure call errors",
+                                                      GIMP_TYPE_PDB_ERROR_HANDLER,
+                                                      GIMP_PDB_ERROR_HANDLER_INTERNAL,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
 }

Modified: branches/soc-2008-tagging/app/pdb/procedural-db-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/procedural-db-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/procedural-db-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/progress-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/progress-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/progress-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/selection-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/selection-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/selection-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 
@@ -950,7 +950,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-selection-layer-alpha",
                                      "Transfer the specified layer's alpha channel to the selection mask.",
-                                     "This procedure requires a layer with an alpha channel. The alpha channel information is used to create a selection mask such that for any pixel in the image defined in the specified layer, that layer pixel's alpha value is transferred to the selection mask. If the layer is undefined at a particular image pixel, the associated selection mask value is set to 0.",
+                                     "The alpha channel information is used to create a selection mask such that for any pixel in the image defined in the specified layer, that layer pixel's alpha value is transferred to the selection mask. If the layer is undefined at a particular image pixel, the associated selection mask value is set to 0. A layer without an alpha channel is considered opaque.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",

Modified: branches/soc-2008-tagging/app/pdb/selection-tools-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/selection-tools-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/selection-tools-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/pdb/text-layer-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/text-layer-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/text-layer-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/pdb/text-tool-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/text-tool-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/text-tool-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/transform-tools-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/transform-tools-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/transform-tools-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
 

Modified: branches/soc-2008-tagging/app/pdb/undo-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/undo-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/undo-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/pdb/unit-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/unit-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/unit-cmds.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 

Modified: branches/soc-2008-tagging/app/pdb/vectors-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/vectors-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/vectors-cmds.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "pdb-types.h"
 

Modified: branches/soc-2008-tagging/app/plug-in/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/plug-in/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -8,8 +8,8 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GDK_PIXBUF_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
 	-I$(includedir)
 
 noinst_LIBRARIES = libappplug-in.a

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin-cleanup.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin-cleanup.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin-cleanup.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#include "glib-object.h"
+#include <gegl.h>
 
 #include "plug-in-types.h"
 

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpbase/gimpprotocol.h"
@@ -407,6 +407,41 @@
 }
 
 static void
+gimp_plug_in_handle_proc_error (GimpPlugIn          *plug_in,
+                                GimpPlugInProcFrame *proc_frame,
+                                const gchar         *name,
+                                const GError        *error)
+{
+  switch (proc_frame->error_handler)
+    {
+    case GIMP_PDB_ERROR_HANDLER_INTERNAL:
+      if (error->domain == GIMP_PDB_ERROR)
+        {
+          gimp_message (plug_in->manager->gimp,
+                        G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Calling error for procedure '%s':\n"
+                          "%s"),
+                        name, error->message);
+        }
+      else
+        {
+          gimp_message (plug_in->manager->gimp,
+                        G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Execution error for procedure '%s':\n"
+                          "%s"),
+                        name, error->message);
+        }
+      break;
+
+    case GIMP_PDB_ERROR_HANDLER_PLUGIN:
+      /*  the plug-in is responsible for handling this error  */
+      break;
+    }
+}
+
+static void
 gimp_plug_in_handle_proc_run (GimpPlugIn *plug_in,
                               GPProcRun  *proc_run)
 {
@@ -503,23 +538,8 @@
 
   if (error)
     {
-      if (error->domain == GIMP_PDB_ERROR)
-        {
-          gimp_message (plug_in->manager->gimp, G_OBJECT (proc_frame->progress),
-                        GIMP_MESSAGE_ERROR,
-                        _("Calling error for procedure '%s':\n"
-                          "%s"),
-                        canonical, error->message);
-        }
-      else
-        {
-          gimp_message (plug_in->manager->gimp, G_OBJECT (proc_frame->progress),
-                        GIMP_MESSAGE_ERROR,
-                        _("Execution error for procedure '%s':\n"
-                          "%s"),
-                        canonical, error->message);
-        }
-
+      gimp_plug_in_handle_proc_error (plug_in, proc_frame,
+                                      canonical, error);
       g_error_free (error);
     }
 

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,9 @@
 
 #include "config.h"
 
+#ifndef _WIN32
 #define _GNU_SOURCE
+#endif
 
 #include <errno.h>
 #include <signal.h>
@@ -220,18 +222,20 @@
                    GimpPlugInCallMode  call_mode,
                    gboolean            synchronous)
 {
-  gint       my_read[2];
-  gint       my_write[2];
-  gchar    **envp;
-  gchar     *args[9], **argv;
-  gint       argc;
-  gchar     *interp, *interp_arg;
-  gchar     *read_fd, *write_fd;
-  gchar     *mode, *stm;
-  GError    *error = NULL;
-  gboolean   debug;
-  guint      debug_flag;
-  guint      spawn_flags;
+  gint          my_read[2];
+  gint          my_write[2];
+  gchar       **envp;
+  const gchar  *args[9];
+  gchar       **argv;
+  gint          argc;
+  gchar        *interp, *interp_arg;
+  gchar        *read_fd, *write_fd;
+  const gchar  *mode;
+  gchar        *stm;
+  GError       *error = NULL;
+  gboolean      debug;
+  guint         debug_flag;
+  guint         spawn_flags;
 
   g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
   g_return_val_if_fail (plug_in->call_mode == GIMP_PLUG_IN_CALL_NONE, FALSE);
@@ -331,7 +335,7 @@
   args[argc++] = stm;
   args[argc++] = NULL;
 
-  argv = args;
+  argv = (gchar **) args;
   envp = gimp_environ_table_get_envp (plug_in->manager->environ_table);
   spawn_flags = (G_SPAWN_LEAVE_DESCRIPTORS_OPEN |
                  G_SPAWN_DO_NOT_REAP_CHILD      |
@@ -939,6 +943,36 @@
 }
 
 void
+gimp_plug_in_set_error_handler (GimpPlugIn          *plug_in,
+                                GimpPDBErrorHandler  handler)
+{
+  GimpPlugInProcFrame *proc_frame;
+
+  g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
+
+  proc_frame = gimp_plug_in_get_proc_frame (plug_in);
+
+  if (proc_frame)
+    proc_frame->error_handler = handler;
+}
+
+GimpPDBErrorHandler
+gimp_plug_in_get_error_handler (GimpPlugIn *plug_in)
+{
+  GimpPlugInProcFrame *proc_frame;
+
+  g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in),
+                        GIMP_PDB_ERROR_HANDLER_INTERNAL);
+
+  proc_frame = gimp_plug_in_get_proc_frame (plug_in);
+
+  if (proc_frame)
+    return proc_frame->error_handler;
+
+  return GIMP_PDB_ERROR_HANDLER_INTERNAL;
+}
+
+void
 gimp_plug_in_add_temp_proc (GimpPlugIn             *plug_in,
                             GimpTemporaryProcedure *proc)
 {

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin.h
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin.h	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin.h	Sun Oct 12 15:38:02 2008
@@ -77,43 +77,48 @@
 };
 
 
-GType         gimp_plug_in_get_type         (void) G_GNUC_CONST;
+GType         gimp_plug_in_get_type          (void) G_GNUC_CONST;
 
-GimpPlugIn  * gimp_plug_in_new              (GimpPlugInManager      *manager,
-                                             GimpContext            *context,
-                                             GimpProgress           *progress,
-                                             GimpPlugInProcedure    *procedure,
-                                             const gchar            *prog);
-
-gboolean      gimp_plug_in_open             (GimpPlugIn             *plug_in,
-                                             GimpPlugInCallMode      call_mode,
-                                             gboolean                synchronous);
-void          gimp_plug_in_close            (GimpPlugIn             *plug_in,
-                                             gboolean                kill_it);
+GimpPlugIn  * gimp_plug_in_new               (GimpPlugInManager      *manager,
+                                              GimpContext            *context,
+                                              GimpProgress           *progress,
+                                              GimpPlugInProcedure    *procedure,
+                                              const gchar            *prog);
+
+gboolean      gimp_plug_in_open              (GimpPlugIn             *plug_in,
+                                              GimpPlugInCallMode      call_mode,
+                                              gboolean                synchronous);
+void          gimp_plug_in_close             (GimpPlugIn             *plug_in,
+                                              gboolean                kill_it);
 
 GimpPlugInProcFrame *
-              gimp_plug_in_get_proc_frame   (GimpPlugIn             *plug_in);
+              gimp_plug_in_get_proc_frame    (GimpPlugIn             *plug_in);
 
 GimpPlugInProcFrame *
-              gimp_plug_in_proc_frame_push  (GimpPlugIn             *plug_in,
-                                             GimpContext            *context,
-                                             GimpProgress           *progress,
-                                             GimpTemporaryProcedure *procedure);
-void          gimp_plug_in_proc_frame_pop   (GimpPlugIn             *plug_in);
-
-void          gimp_plug_in_main_loop        (GimpPlugIn             *plug_in);
-void          gimp_plug_in_main_loop_quit   (GimpPlugIn             *plug_in);
-
-const gchar * gimp_plug_in_get_undo_desc    (GimpPlugIn             *plug_in);
-
-gboolean      gimp_plug_in_menu_register    (GimpPlugIn             *plug_in,
-                                             const gchar            *proc_name,
-                                             const gchar            *menu_path);
-
-void          gimp_plug_in_add_temp_proc    (GimpPlugIn             *plug_in,
-                                             GimpTemporaryProcedure *procedure);
-void          gimp_plug_in_remove_temp_proc (GimpPlugIn             *plug_in,
-                                             GimpTemporaryProcedure *procedure);
+              gimp_plug_in_proc_frame_push   (GimpPlugIn             *plug_in,
+                                              GimpContext            *context,
+                                              GimpProgress           *progress,
+                                              GimpTemporaryProcedure *procedure);
+void          gimp_plug_in_proc_frame_pop    (GimpPlugIn             *plug_in);
+
+void          gimp_plug_in_main_loop         (GimpPlugIn             *plug_in);
+void          gimp_plug_in_main_loop_quit    (GimpPlugIn             *plug_in);
+
+const gchar * gimp_plug_in_get_undo_desc     (GimpPlugIn             *plug_in);
+
+gboolean      gimp_plug_in_menu_register     (GimpPlugIn             *plug_in,
+                                              const gchar            *proc_name,
+                                              const gchar            *menu_path);
+
+void          gimp_plug_in_add_temp_proc     (GimpPlugIn             *plug_in,
+                                              GimpTemporaryProcedure *procedure);
+void          gimp_plug_in_remove_temp_proc  (GimpPlugIn             *plug_in,
+                                              GimpTemporaryProcedure *procedure);
+
+void          gimp_plug_in_set_error_handler (GimpPlugIn             *plug_in,
+                                              GimpPDBErrorHandler     handler);
+GimpPDBErrorHandler
+              gimp_plug_in_get_error_handler (GimpPlugIn             *plug_in);
 
 
 #endif /* __GIMP_PLUG_IN_H__ */

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugindebug.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugindebug.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugindebug.c	Sun Oct 12 15:38:02 2008
@@ -109,7 +109,7 @@
 gimp_plug_in_debug_argv (GimpPlugInDebug    *debug,
                          const gchar        *name,
                          GimpDebugWrapFlag   flag,
-                         gchar             **args)
+                         const gchar       **args)
 {
   GPtrArray  *argv;
   gchar     **arg;
@@ -134,7 +134,7 @@
   for (arg = debug->args; *arg != NULL; arg++)
     g_ptr_array_add (argv, *arg);
 
-  for (arg = args; *arg != NULL; arg++)
+  for (arg = (gchar **) args; *arg != NULL; arg++)
     g_ptr_array_add (argv, *arg);
 
   g_ptr_array_add (argv, NULL);

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugindebug.h
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugindebug.h	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugindebug.h	Sun Oct 12 15:38:02 2008
@@ -38,7 +38,7 @@
 gchar           ** gimp_plug_in_debug_argv (GimpPlugInDebug    *debug,
                                             const gchar        *name,
                                             GimpDebugWrapFlag   flag,
-                                            gchar             **args);
+                                            const gchar       **args);
 
 
 #endif /* __GIMP_PLUG_IN_DEBUG_H__ */

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginmanager-call.c	Sun Oct 12 15:38:02 2008
@@ -289,7 +289,8 @@
                                     GimpTemporaryProcedure *procedure,
                                     GValueArray            *args)
 {
-  GimpPlugIn *plug_in;
+  GValueArray *return_vals = NULL;
+  GimpPlugIn  *plug_in;
 
   g_return_val_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager), NULL);
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@@ -302,7 +303,6 @@
   if (plug_in)
     {
       GimpPlugInProcFrame *proc_frame;
-      GValueArray         *return_vals;
       GPProcRun            proc_run;
 
       proc_frame = gimp_plug_in_proc_frame_push (plug_in, context, progress,
@@ -346,13 +346,7 @@
 
       gimp_plug_in_proc_frame_unref (proc_frame, plug_in);
       g_object_unref (plug_in);
-
-      return return_vals;
-    }
-  else
-    {
-      /*  can we actually ever get here?  */
-      return gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure),
-                                               FALSE, NULL);
     }
+
+  return return_vals;
 }

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.c	Sun Oct 12 15:38:02 2008
@@ -67,7 +67,7 @@
                                                          GValueArray    *args,
                                                          GimpObject     *display);
 
-const gchar * gimp_plug_in_procedure_real_get_progname (const GimpPlugInProcedure *procedure);
+const gchar  * gimp_plug_in_procedure_real_get_progname (const GimpPlugInProcedure *procedure);
 
 
 G_DEFINE_TYPE (GimpPlugInProcedure, gimp_plug_in_procedure,
@@ -169,7 +169,7 @@
     {
     case GIMP_ICON_TYPE_STOCK_ID:
     case GIMP_ICON_TYPE_IMAGE_FILE:
-      memsize += gimp_string_get_memsize ((gchar *) proc->icon_data);
+      memsize += gimp_string_get_memsize ((const gchar *) proc->icon_data);
       break;
 
     case GIMP_ICON_TYPE_INLINE_PIXBUF:
@@ -231,11 +231,13 @@
                                                plug_in_procedure,
                                                args, FALSE, display);
 
-  /*  In case of errors, gimp_plug_in_manager_call_run() may return
-   *  return_vals, even if run asynchronously.
-   */
   if (return_vals)
-    g_value_array_free (return_vals);
+    {
+      gimp_plug_in_procedure_handle_return_values (plug_in_procedure,
+                                                   gimp, progress,
+                                                   return_vals);
+      g_value_array_free (return_vals);
+    }
 }
 
 const gchar *
@@ -958,3 +960,49 @@
 
   proc->thumb_loader = g_strdup (thumb_loader);
 }
+
+void
+gimp_plug_in_procedure_handle_return_values (GimpPlugInProcedure *proc,
+                                             Gimp                *gimp,
+                                             GimpProgress        *progress,
+                                             GValueArray         *return_vals)
+{
+  g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
+  g_return_if_fail (return_vals != NULL);
+
+  if (! return_vals->n_values > 0 ||
+      G_VALUE_TYPE (&return_vals->values[0]) != GIMP_TYPE_PDB_STATUS_TYPE)
+    {
+      return;
+    }
+
+  switch (g_value_get_enum (&return_vals->values[0]))
+    {
+    case GIMP_PDB_SUCCESS:
+      break;
+
+    case GIMP_PDB_CALLING_ERROR:
+      if (return_vals->n_values > 1 &&
+          G_VALUE_HOLDS_STRING (&return_vals->values[1]))
+        {
+          gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
+                        _("Calling error for '%s':\n"
+                          "%s"),
+                        gimp_plug_in_procedure_get_label (proc),
+                        g_value_get_string (&return_vals->values[1]));
+        }
+      break;
+
+    case GIMP_PDB_EXECUTION_ERROR:
+      if (return_vals->n_values > 1 &&
+          G_VALUE_HOLDS_STRING (&return_vals->values[1]))
+        {
+          gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
+                        _("Execution error for '%s':\n"
+                          "%s"),
+                        gimp_plug_in_procedure_get_label (proc),
+                        g_value_get_string (&return_vals->values[1]));
+        }
+      break;
+    }
+}

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.h
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.h	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginprocedure.h	Sun Oct 12 15:38:02 2008
@@ -130,5 +130,11 @@
 void          gimp_plug_in_procedure_set_thumb_loader(GimpPlugInProcedure       *proc,
                                                       const gchar               *thumbnailer);
 
+void     gimp_plug_in_procedure_handle_return_values (GimpPlugInProcedure       *proc,
+                                                      Gimp                      *gimp,
+                                                      GimpProgress              *progress,
+
+                                                      GValueArray               *return_vals);
+
 
 #endif /* __GIMP_PLUG_IN_PROCEDURE_H__ */

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.c	Sun Oct 12 15:38:02 2008
@@ -75,12 +75,13 @@
 
   proc_frame->main_context       = g_object_ref (context);
   proc_frame->context_stack      = NULL;
-  proc_frame->procedure          = GIMP_PROCEDURE (procedure);
+  proc_frame->procedure          = procedure ? g_object_ref (procedure) : NULL;
   proc_frame->main_loop          = NULL;
   proc_frame->return_vals        = NULL;
   proc_frame->progress           = progress ? g_object_ref (progress) : NULL;
   proc_frame->progress_created   = FALSE;
   proc_frame->progress_cancel_id = 0;
+  proc_frame->error_handler      = GIMP_PDB_ERROR_HANDLER_INTERNAL;
 
   if (progress)
     gimp_plug_in_progress_attach (progress);
@@ -117,6 +118,12 @@
       proc_frame->main_context = NULL;
     }
 
+  if (proc_frame->procedure)
+    {
+      g_object_unref (proc_frame->procedure);
+      proc_frame->procedure = NULL;
+    }
+
   if (proc_frame->return_vals)
     {
       g_value_array_free (proc_frame->return_vals);

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.h
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.h	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginprocframe.h	Sun Oct 12 15:38:02 2008
@@ -24,23 +24,25 @@
 
 struct _GimpPlugInProcFrame
 {
-  gint           ref_count;
+  gint                 ref_count;
 
-  GimpContext   *main_context;
-  GList         *context_stack;
+  GimpContext         *main_context;
+  GList               *context_stack;
 
-  GimpProcedure *procedure;
-  GMainLoop     *main_loop;
+  GimpProcedure       *procedure;
+  GMainLoop           *main_loop;
 
-  GValueArray   *return_vals;
+  GValueArray         *return_vals;
 
-  GimpProgress  *progress;
-  gboolean       progress_created;
-  gulong         progress_cancel_id;
+  GimpProgress        *progress;
+  gboolean             progress_created;
+  gulong               progress_cancel_id;
+
+  GimpPDBErrorHandler  error_handler;
 
   /*  lists of things to clean up on dispose  */
-  GList         *image_cleanups;
-  GList         *item_cleanups;
+  GList               *image_cleanups;
+  GList               *item_cleanups;
 };
 
 

Modified: branches/soc-2008-tagging/app/plug-in/gimppluginshm.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimppluginshm.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimppluginshm.c	Sun Oct 12 15:38:02 2008
@@ -142,7 +142,7 @@
     g_snprintf (fileMapName, sizeof (fileMapName), "GIMP%d.SHM", pid);
 
     /* Create the file mapping into paging space */
-    shm->shm_handle = CreateFileMapping ((HANDLE) 0xFFFFFFFF, NULL,
+    shm->shm_handle = CreateFileMapping (INVALID_HANDLE_VALUE, NULL,
                                          PAGE_READWRITE, 0,
                                          TILE_MAP_SIZE,
                                          fileMapName);

Modified: branches/soc-2008-tagging/app/plug-in/gimptemporaryprocedure.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimptemporaryprocedure.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimptemporaryprocedure.c	Sun Oct 12 15:38:02 2008
@@ -109,14 +109,23 @@
                                         GValueArray   *args,
                                         GimpObject    *display)
 {
-  GValueArray *return_vals;
+  GimpTemporaryProcedure *temp_procedure = GIMP_TEMPORARY_PROCEDURE (procedure);
+  GValueArray            *return_vals;
 
   return_vals = gimp_plug_in_manager_call_run_temp (gimp->plug_in_manager,
                                                     context, progress,
-                                                    GIMP_TEMPORARY_PROCEDURE (procedure),
+                                                    temp_procedure,
                                                     args);
 
-  g_value_array_free (return_vals);
+  if (return_vals)
+    {
+      GimpPlugInProcedure *proc = GIMP_PLUG_IN_PROCEDURE (procedure);
+
+      gimp_plug_in_procedure_handle_return_values (proc,
+                                                   gimp, progress,
+                                                   return_vals);
+      g_value_array_free (return_vals);
+    }
 }
 
 const gchar *

Modified: branches/soc-2008-tagging/app/plug-in/plug-in-icc-profile.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/plug-in-icc-profile.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/plug-in-icc-profile.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "core/core-types.h"
 

Modified: branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/plug-in-menu-path.c	Sun Oct 12 15:38:02 2008
@@ -43,27 +43,29 @@
 
 static const MenuPathMapping menu_path_mappings[] =
 {
-  { "<Toolbox>/Xtns/Languages",       NULL, "<Image>/Filters/Languages"        },
-  { "<Toolbox>/Xtns/Extensions",      NULL, "<Image>/Filters/Extensions"       },
+  { "<Toolbox>/Xtns/Languages",       NULL, "<Image>/Filters/Languages"           },
+  { "<Toolbox>/Xtns/Extensions",      NULL, "<Image>/Filters/Extensions"          },
 
-  { "<Toolbox>/Xtns/Buttons",         NULL, "<Image>/File/New/Buttons"         },
-  { "<Toolbox>/Xtns/Logos",           NULL, "<Image>/File/New/Logos"           },
-  { "<Toolbox>/Xtns/Misc",            NULL, "<Image>/File/New/Misc"            },
-  { "<Toolbox>/Xtns/Patterns",        NULL, "<Image>/File/New/Patterns"        },
-  { "<Toolbox>/Xtns/Web Page Themes", NULL, "<Image>/File/New/Web Page Themes" },
-
-  { "<Toolbox>/Xtns", "Buttons",            "<Image>/File/New"                 },
-  { "<Toolbox>/Xtns", "Logos",              "<Image>/File/New"                 },
-  { "<Toolbox>/Xtns", "Misc",               "<Image>/File/New"                 },
-  { "<Toolbox>/Xtns", "Patterns",           "<Image>/File/New"                 },
-  { "<Toolbox>/Xtns", "Web Page Themes",    "<Image>/File/New"                 },
-
-  { "<Toolbox>/Xtns",                 NULL, "<Image>/Filters/Extensions"       },
-  { "<Toolbox>/Help",                 NULL, "<Image>/Help"                     },
-
-  { "<Toolbox>/File/Acquire",         NULL, "<Image>/File/New/Acquire"         },
-  { "<Image>/File/Acquire",           NULL, "<Image>/File/New/Acquire"         },
-  { NULL, NULL, NULL                                                           }
+  { "<Toolbox>/Xtns/Buttons",         NULL, "<Image>/File/Create/Buttons"         },
+  { "<Toolbox>/Xtns/Logos",           NULL, "<Image>/File/Create/Logos"           },
+  { "<Toolbox>/Xtns/Misc",            NULL, "<Image>/File/Create/Misc"            },
+  { "<Toolbox>/Xtns/Patterns",        NULL, "<Image>/File/Create/Patterns"        },
+  { "<Toolbox>/Xtns/Web Page Themes", NULL, "<Image>/File/Create/Web Page Themes" },
+
+  { "<Toolbox>/Xtns", "Buttons",            "<Image>/File/Create"                 },
+  { "<Toolbox>/Xtns", "Logos",              "<Image>/File/Create"                 },
+  { "<Toolbox>/Xtns", "Misc",               "<Image>/File/Create"                 },
+  { "<Toolbox>/Xtns", "Patterns",           "<Image>/File/Create"                 },
+  { "<Toolbox>/Xtns", "Web Page Themes",    "<Image>/File/Create"                 },
+
+  { "<Toolbox>/Xtns",                 NULL, "<Image>/Filters/Extensions"          },
+  { "<Toolbox>/Help",                 NULL, "<Image>/Help"                        },
+
+  { "<Toolbox>/File/Acquire",         NULL, "<Image>/File/Create/Acquire"         },
+  { "<Toolbox>",                      NULL, "<Image>"                             },
+  { "<Image>/File/Acquire",           NULL, "<Image>/File/Create/Acquire"         },
+  { "<Image>/File/New",               NULL, "<Image>/File/Create"                 },
+  { NULL, NULL, NULL                                                              }
 };
 
 

Modified: branches/soc-2008-tagging/app/text/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/text/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/text/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -8,9 +8,9 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
+	$(GEGL_CFLAGS)		\
 	$(PANGOFT2_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
 	-I$(includedir)
 
 noinst_LIBRARIES = libapptext.a

Modified: branches/soc-2008-tagging/app/text/gimptext-compat.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptext-compat.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptext-compat.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <pango/pangoft2.h>
 
 #include "libgimpcolor/gimpcolor.h"
@@ -118,12 +118,16 @@
   if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
     gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
 
-  /*  If the drawable is NULL, create a new layer  */
   if (drawable == NULL)
-    gimp_image_add_layer (image, layer, -1);
-  /*  Otherwise, instantiate the text as the new floating selection */
+    {
+      /*  If the drawable is NULL, create a new layer  */
+      gimp_image_add_layer (image, layer, -1, TRUE);
+    }
   else
-    floating_sel_attach (layer, drawable);
+    {
+      /*  Otherwise, instantiate the text as the new floating selection */
+      floating_sel_attach (layer, drawable);
+    }
 
   /*  end the group undo  */
   gimp_image_undo_group_end (image);

Modified: branches/soc-2008-tagging/app/text/gimptext-vectors.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptext-vectors.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptext-vectors.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #define PANGO_ENABLE_ENGINE
 #include <pango/pangoft2.h>

Modified: branches/soc-2008-tagging/app/text/gimptextlayer-transform.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextlayer-transform.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextlayer-transform.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "text-types.h"
 

Modified: branches/soc-2008-tagging/app/text/gimptextlayer-xcf.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextlayer-xcf.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextlayer-xcf.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "text-types.h"
 

Modified: branches/soc-2008-tagging/app/text/gimptextlayer.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextlayer.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextlayer.c	Sun Oct 12 15:38:02 2008
@@ -23,7 +23,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <pango/pangoft2.h>
 
 #include "libgimpconfig/gimpconfig.h"

Modified: branches/soc-2008-tagging/app/text/gimptextlayout-render.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextlayout-render.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextlayout-render.c	Sun Oct 12 15:38:02 2008
@@ -92,9 +92,13 @@
   if (pango_layout_get_width (layout->layout) > 0)
     switch (pango_layout_get_alignment (layout->layout))
       {
+      case PANGO_ALIGN_LEFT:
+        break;
+
       case PANGO_ALIGN_RIGHT:
         x += pango_layout_get_width (layout->layout) - rect.width;
         break;
+
       case PANGO_ALIGN_CENTER:
         x += (pango_layout_get_width (layout->layout) - rect.width) / 2;
         break;

Modified: branches/soc-2008-tagging/app/text/gimptextlayout.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextlayout.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextlayout.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <pango/pangoft2.h>
 
 #include "text-types.h"

Modified: branches/soc-2008-tagging/app/text/gimptextundo.c
==============================================================================
--- branches/soc-2008-tagging/app/text/gimptextundo.c	(original)
+++ branches/soc-2008-tagging/app/text/gimptextundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpconfig/gimpconfig.h"
 

Modified: branches/soc-2008-tagging/app/tools/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/tools/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/tools/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-Tools\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GTK_CFLAGS)		\
+	-I$(includedir)
+
 noinst_LIBRARIES = libapptools.a
 
 libapptools_a_sources = \
@@ -183,19 +195,6 @@
 
 libapptools_a_SOURCES = $(libapptools_a_built_sources) $(libapptools_a_sources)
 
-
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-Tools\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GTK_CFLAGS)		\
-	$(GEGL_CFLAGS)		\
-	-I$(includedir)
-
 EXTRA_DIST = makefile.msc
 
 #

Modified: branches/soc-2008-tagging/app/tools/gimpaligntool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpaligntool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpaligntool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -176,6 +177,8 @@
   align_tool->vert_offset = 0;
 
   gimp_tool_control_set_snap_to     (tool->control, FALSE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_MOVE);
 
 }
@@ -882,9 +885,9 @@
 
   spinbutton = gimp_spin_button_new (&align_tool->horz_offset_adjustment,
                                      0,
-                                     -100000.,
-                                     100000.,
-                                     1., 20., 20., 1., 0);
+                                     -100000,
+                                     100000,
+                                     1, 20, 0, 1, 0);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   g_signal_connect (align_tool->horz_offset_adjustment, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),

Modified: branches/soc-2008-tagging/app/tools/gimpblendtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpblendtool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpblendtool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -390,7 +391,8 @@
                              GdkModifierType  state,
                              GimpDisplay     *display)
 {
-  gchar *status_help;
+  GimpTool *tool = GIMP_TOOL (blend_tool);
+  gchar    *status_help;
 
   status_help = gimp_suggest_modifiers ("",
                                         ((GDK_CONTROL_MASK | GDK_MOD1_MASK)
@@ -398,11 +400,14 @@
                                         NULL,
                                         _("%s for constrained angles"),
                                         _("%s to move the whole line"));
-  gimp_tool_push_status_coords (GIMP_TOOL (blend_tool), display,
+
+  gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Blend: "),
                                 blend_tool->end_x - blend_tool->start_x,
                                 ", ",
                                 blend_tool->end_y - blend_tool->start_y,
                                 status_help);
+
   g_free (status_help);
 }

Modified: branches/soc-2008-tagging/app/tools/gimpbrushtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpbrushtool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpbrushtool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/tools/gimpbucketfilltool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpbucketfilltool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpbucketfilltool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/tools/gimpbycolorselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpbycolorselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpbycolorselecttool.c	Sun Oct 12 15:38:02 2008
@@ -22,6 +22,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c	Sun Oct 12 15:38:02 2008
@@ -349,14 +349,24 @@
   GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
   GimpTransferMode      range   = cb_tool->config->range;
 
-  g_object_freeze_notify (G_OBJECT (cb_tool->config));
+  g_object_freeze_notify (im_tool->config);
+
+  if (im_tool->default_config)
+    {
+      gimp_config_copy (GIMP_CONFIG (im_tool->default_config),
+                        GIMP_CONFIG (im_tool->config),
+                        0);
+    }
+  else
+    {
+      gimp_config_reset (GIMP_CONFIG (im_tool->config));
+    }
 
-  gimp_config_reset (GIMP_CONFIG (cb_tool->config));
   g_object_set (cb_tool->config,
                 "range", range,
                 NULL);
 
-  g_object_thaw_notify (G_OBJECT (cb_tool->config));
+  g_object_thaw_notify (im_tool->config);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/tools/gimpcolorpickertool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolorpickertool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcolorpickertool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/tools/gimpcolortool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolortool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcolortool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -254,6 +255,7 @@
       gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
 
       gimp_tool_push_status_coords (tool, display,
+                                    gimp_tool_control_get_precision (tool->control),
                                     _("Move Sample Point: "),
                                     color_tool->sample_point_x,
                                     ", ",
@@ -431,6 +433,7 @@
       else
         {
           gimp_tool_push_status_coords (tool, display,
+                                        gimp_tool_control_get_precision (tool->control),
                                         color_tool->sample_point ?
                                         _("Move Sample Point: ") :
                                         _("Add Sample Point: "),

Modified: branches/soc-2008-tagging/app/tools/gimpcroptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcroptool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcroptool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -172,6 +173,8 @@
   gimp_rectangle_tool_init (GIMP_RECTANGLE_TOOL (crop_tool));
 
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
 
   crop_tool->current_image = NULL;
@@ -336,7 +339,7 @@
  * gimp_crop_tool_rectangle_change_complete:
  * @rectangle:
  *
- * Returns: 
+ * Returns:
  **/
 static gboolean
 gimp_crop_tool_rectangle_change_complete (GimpRectangleTool *rectangle)

Modified: branches/soc-2008-tagging/app/tools/gimpcurvestool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcurvestool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcurvestool.c	Sun Oct 12 15:38:02 2008
@@ -101,6 +101,10 @@
                                                    const gchar          *filename,
                                                    GError              **error);
 
+static void       gimp_curves_tool_export_setup   (GimpSettingsBox      *settings_box,
+                                                   GtkFileChooserDialog *dialog,
+                                                   gboolean              export,
+                                                   GimpCurvesTool       *tool);
 static void       gimp_curves_tool_config_notify  (GObject              *object,
                                                    GParamSpec           *pspec,
                                                    GimpCurvesTool       *tool);
@@ -422,6 +426,10 @@
   GtkWidget        *bar;
   GtkWidget        *combo;
 
+  g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
+                    G_CALLBACK (gimp_curves_tool_export_setup),
+                    image_map_tool);
+
   main_vbox   = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
   label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
 
@@ -566,13 +574,35 @@
 gimp_curves_tool_reset (GimpImageMapTool *image_map_tool)
 {
   GimpCurvesTool       *tool = GIMP_CURVES_TOOL (image_map_tool);
+  GimpCurvesConfig     *default_config;
   GimpHistogramChannel  channel;
 
+  default_config = GIMP_CURVES_CONFIG (image_map_tool->default_config);
+
   for (channel = GIMP_HISTOGRAM_VALUE;
        channel <= GIMP_HISTOGRAM_ALPHA;
        channel++)
     {
-      gimp_curve_reset (tool->config->curve[channel], FALSE);
+      if (default_config)
+        {
+          GimpCurveType curve_type = tool->config->curve[channel]->curve_type;
+
+          g_object_freeze_notify (G_OBJECT (tool->config->curve[channel]));
+
+          gimp_config_copy (GIMP_CONFIG (default_config->curve[channel]),
+                            GIMP_CONFIG (tool->config->curve[channel]),
+                            0);
+
+          g_object_set (tool->config->curve[channel],
+                        "curve-type", curve_type,
+                        NULL);
+
+          g_object_thaw_notify (G_OBJECT (tool->config->curve[channel]));
+        }
+      else
+        {
+          gimp_curve_reset (tool->config->curve[channel], FALSE);
+        }
     }
 }
 
@@ -583,7 +613,6 @@
 {
   GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
   FILE           *file;
-  gboolean        success;
   gchar           header[64];
 
   file = g_fopen (filename, "rt");
@@ -609,6 +638,8 @@
 
   if (g_str_has_prefix (header, "# GIMP Curves File\n"))
     {
+      gboolean success;
+
       rewind (file);
 
       success = gimp_curves_config_load_cruft (tool->config, file, error);
@@ -631,25 +662,55 @@
                                   GError           **error)
 {
   GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
-  FILE           *file;
-  gboolean        success;
 
-  file = g_fopen (filename, "wt");
-
-  if (! file)
+  if (tool->export_old_format)
     {
-      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
-                   _("Could not open '%s' for writing: %s"),
-                   gimp_filename_to_utf8 (filename),
-                   g_strerror (errno));
-      return FALSE;
+      FILE     *file;
+      gboolean  success;
+
+      file = g_fopen (filename, "wt");
+
+      if (! file)
+        {
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for writing: %s"),
+                       gimp_filename_to_utf8 (filename),
+                       g_strerror (errno));
+          return FALSE;
+        }
+
+      success = gimp_curves_config_save_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
     }
 
-  success = gimp_curves_config_save_cruft (tool->config, file, error);
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
+                                                                    filename,
+                                                                    error);
+}
 
-  fclose (file);
+static void
+gimp_curves_tool_export_setup (GimpSettingsBox      *settings_box,
+                               GtkFileChooserDialog *dialog,
+                               gboolean              export,
+                               GimpCurvesTool       *tool)
+{
+  GtkWidget *button;
+
+  if (! export)
+    return;
+
+  button = gtk_check_button_new_with_mnemonic (_("Use _old curves file format"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+                                tool->export_old_format);
+  gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
+  gtk_widget_show (button);
 
-  return success;
+  g_signal_connect (button, "toggled",
+                    G_CALLBACK (gimp_toggle_button_update),
+                    &tool->export_old_format);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/tools/gimpcurvestool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcurvestool.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcurvestool.h	Sun Oct 12 15:38:02 2008
@@ -48,6 +48,9 @@
   GtkWidget            *yrange;
   GtkWidget            *graph;
   GtkWidget            *curve_type;
+
+  /* export dialog */
+  gboolean              export_old_format;
 };
 
 struct _GimpCurvesToolClass

Modified: branches/soc-2008-tagging/app/tools/gimpdrawtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpdrawtool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpdrawtool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -186,6 +187,7 @@
                                 gboolean           propagate_release)
 {
   GimpEditSelectionTool *edit_select;
+  GimpTool              *tool;
   GimpDisplayShell      *shell;
   GimpItem              *active_item;
   GimpChannel           *channel;
@@ -201,6 +203,8 @@
 
   edit_select->propagate_release = propagate_release;
 
+  tool = GIMP_TOOL (edit_select);
+
   shell = GIMP_DISPLAY_SHELL (display->shell);
 
   /*  Make a check to see if it should be a floating selection translation  */
@@ -429,7 +433,7 @@
         break;
       }
 
-    gimp_tool_control_set_snap_offsets (GIMP_TOOL (edit_select)->control,
+    gimp_tool_control_set_snap_offsets (tool->control,
                                         x1 - coords->x,
                                         y1 - coords->y,
                                         x2 - x1,
@@ -440,16 +444,17 @@
     edit_select->center_y = (y1 + y2) / 2.0;
   }
 
-  gimp_tool_control_activate (GIMP_TOOL (edit_select)->control);
-  GIMP_TOOL (edit_select)->display = display;
+  gimp_tool_control_activate (tool->control);
+  tool->display = display;
 
-  tool_manager_push_tool (display->image->gimp, GIMP_TOOL (edit_select));
+  tool_manager_push_tool (display->image->gimp, tool);
 
   /*  pause the current selection  */
   gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
 
   /* initialize the statusbar display */
-  gimp_tool_push_status_coords (GIMP_TOOL (edit_select), display,
+  gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Move: "), 0, ", ", 0, NULL);
 
   gimp_draw_tool_start (GIMP_DRAW_TOOL (edit_select), display);
@@ -579,8 +584,8 @@
                                         gdouble                new_y,
                                         GimpDisplay           *display)
 {
-  GimpDrawTool *draw_tool          = GIMP_DRAW_TOOL (edit_select);
-  GimpTool     *tool               = GIMP_TOOL (edit_select);
+  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (edit_select);
+  GimpTool     *tool      = GIMP_TOOL (edit_select);
   GimpItem     *active_item;
   gint          off_x, off_y;
   gdouble       motion_x, motion_y;
@@ -718,6 +723,7 @@
 
   gimp_tool_pop_status (tool, display);
   gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Move: "),
                                 edit_select->cumlx,
                                 ", ",
@@ -772,7 +778,7 @@
 gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (draw_tool);
-  GimpDisplay           *display       = GIMP_TOOL (draw_tool)->display;
+  GimpDisplay           *display     = GIMP_TOOL (draw_tool)->display;
   GimpItem              *active_item;
 
   active_item = gimp_edit_selection_tool_get_active_item (edit_select,

Modified: branches/soc-2008-tagging/app/tools/gimpellipseselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpellipseselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpellipseselecttool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/tools/gimpfliptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpfliptool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpfliptool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -104,6 +105,8 @@
   GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (flip_tool);
 
   gimp_tool_control_set_snap_to            (tool->control, FALSE);
+  gimp_tool_control_set_precision          (tool->control,
+                                            GIMP_CURSOR_PRECISION_PIXEL_CENTER);
   gimp_tool_control_set_cursor             (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_toggle_cursor      (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_tool_cursor        (tool->control,

Modified: branches/soc-2008-tagging/app/tools/gimpforegroundselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpforegroundselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpforegroundselecttool.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -185,6 +186,8 @@
   gimp_tool_control_set_scroll_lock (tool->control, FALSE);
   gimp_tool_control_set_preserve    (tool->control, FALSE);
   gimp_tool_control_set_dirty_mask  (tool->control, GIMP_DIRTY_IMAGE_SIZE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_CENTER);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_FREE_SELECT);
 

Modified: branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -236,6 +237,8 @@
 
   gimp_tool_control_set_scroll_lock (tool->control, FALSE);
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_SUBPIXEL);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_FREE_SELECT);
 

Modified: branches/soc-2008-tagging/app/tools/gimpfuzzyselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpfuzzyselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpfuzzyselecttool.c	Sun Oct 12 15:38:02 2008
@@ -22,6 +22,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/tools/gimpgegltool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpgegltool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpgegltool.c	Sun Oct 12 15:38:02 2008
@@ -221,29 +221,50 @@
   g_free (pspecs);
 }
 
-/* Builds a GList of the class structures of all subtypes
- * of type.
+static gboolean
+gimp_gegl_tool_operation_blacklisted (const gchar *name)
+{
+  static const gchar * const blacklist[] =
+  {
+    "convert-format", "gimp-", "introspect", "stress", "text"
+  };
+  gint i;
+
+  for (i = 0; i < G_N_ELEMENTS (blacklist); i++)
+    {
+      if (g_str_has_prefix (name, blacklist[i]))
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
+
+/* Builds a GList of the class structures of all subtypes of type.
  */
 static GList *
 gimp_get_subtype_classes (GType  type,
                           GList *classes)
 {
-  GObjectClass *klass;
-  GType        *ops;
-  guint         n_ops;
-  gint          i;
+  GeglOperationClass *klass;
+  GType              *ops;
+  guint               n_ops;
+  gint                i;
 
-  if (!type)
+  if (! type)
     return classes;
 
-  klass = g_type_class_ref (type);
+  klass = GEGL_OPERATION_CLASS (g_type_class_ref (type));
   ops = g_type_children (type, &n_ops);
 
   /* only add classes which have a name, this avoids
    * the abstract base classes
    */
-  if (GEGL_OPERATION_CLASS (klass)->name)
-    classes = g_list_prepend (classes, klass);
+  if (klass->name)
+    {
+      if (! gimp_gegl_tool_operation_blacklisted (klass->name))
+        classes = g_list_prepend (classes, klass);
+    }
 
   for (i = 0; i < n_ops; i++)
     classes = gimp_get_subtype_classes (ops[i], classes);
@@ -318,10 +339,11 @@
           strstr (opclass->categories, "blur")    ||
           strstr (opclass->categories, "edge")    ||
           strstr (opclass->categories, "render"))
-
-        gtk_list_store_insert_with_values (store, NULL, -1,
-                                           0, opclass->name,
-                                           -1);
+        {
+          gtk_list_store_insert_with_values (store, NULL, -1,
+                                             0, opclass->name,
+                                             -1);
+        }
     }
 
   g_list_free (opclasses);
@@ -627,8 +649,6 @@
 
           if (copy)
             {
-              g_print ("installing property: %s\n", copy->name);
-
               g_object_class_install_property (klass, i + 1, copy);
             }
         }

Modified: branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c	Sun Oct 12 15:38:02 2008
@@ -464,14 +464,24 @@
   GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
   GimpHueRange           range   = hs_tool->config->range;
 
-  g_object_freeze_notify (G_OBJECT (hs_tool->config));
+  g_object_freeze_notify (image_map_tool->config);
+
+  if (image_map_tool->default_config)
+    {
+      gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
+                        GIMP_CONFIG (image_map_tool->config),
+                        0);
+    }
+  else
+    {
+      gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
+    }
 
-  gimp_config_reset (GIMP_CONFIG (hs_tool->config));
   g_object_set (hs_tool->config,
                 "range", range,
                 NULL);
 
-  g_object_thaw_notify (G_OBJECT (hs_tool->config));
+  g_object_thaw_notify (image_map_tool->config);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.c	Sun Oct 12 15:38:02 2008
@@ -190,15 +190,16 @@
                                      GIMP_DIRTY_DRAWABLE        |
                                      GIMP_DIRTY_SELECTION);
 
-  image_map_tool->drawable     = NULL;
-  image_map_tool->operation    = NULL;
-  image_map_tool->config       = NULL;
-  image_map_tool->image_map    = NULL;
-
-  image_map_tool->shell        = NULL;
-  image_map_tool->main_vbox    = NULL;
-  image_map_tool->settings_box = NULL;
-  image_map_tool->label_group  = NULL;
+  image_map_tool->drawable       = NULL;
+  image_map_tool->operation      = NULL;
+  image_map_tool->config         = NULL;
+  image_map_tool->default_config = NULL;
+  image_map_tool->image_map      = NULL;
+
+  image_map_tool->shell          = NULL;
+  image_map_tool->main_vbox      = NULL;
+  image_map_tool->settings_box   = NULL;
+  image_map_tool->label_group    = NULL;
 }
 
 static GObject *
@@ -239,6 +240,12 @@
       image_map_tool->config = NULL;
     }
 
+  if (image_map_tool->default_config)
+    {
+      g_object_unref (image_map_tool->default_config);
+      image_map_tool->default_config = NULL;
+    }
+
   if (image_map_tool->shell)
     {
       gtk_widget_destroy (image_map_tool->shell);
@@ -467,7 +474,16 @@
     }
   else if (tool->config)
     {
-      gimp_config_reset (GIMP_CONFIG (tool->config));
+      if (tool->default_config)
+        {
+          gimp_config_copy (GIMP_CONFIG (tool->default_config),
+                            GIMP_CONFIG (tool->config),
+                            0);
+        }
+      else
+        {
+          gimp_config_reset (GIMP_CONFIG (tool->config));
+        }
     }
 }
 
@@ -674,9 +690,9 @@
 
   new_tool = tool_manager_get_active (display->gimp);
 
-  gimp_config_copy (config,
-                    GIMP_CONFIG (GIMP_IMAGE_MAP_TOOL (new_tool)->config),
-                    0);
+  GIMP_IMAGE_MAP_TOOL (new_tool)->default_config = g_object_ref (config);
+
+  gimp_image_map_tool_reset (GIMP_IMAGE_MAP_TOOL (new_tool));
 }
 
 GtkWidget *

Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.h	Sun Oct 12 15:38:02 2008
@@ -43,6 +43,7 @@
 
   GeglNode              *operation;
   GObject               *config;
+  GObject               *default_config;
   GimpImageMapApplyFunc  apply_func;
   gpointer               apply_data;
 

Modified: branches/soc-2008-tagging/app/tools/gimpiscissorstool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpiscissorstool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpiscissorstool.c	Sun Oct 12 15:38:02 2008
@@ -48,6 +48,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 

Modified: branches/soc-2008-tagging/app/tools/gimplevelstool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimplevelstool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimplevelstool.c	Sun Oct 12 15:38:02 2008
@@ -94,6 +94,10 @@
                                                    const gchar       *filename,
                                                    GError           **error);
 
+static void       gimp_levels_tool_export_setup   (GimpSettingsBox      *settings_box,
+                                                   GtkFileChooserDialog *dialog,
+                                                   gboolean              export,
+                                                   GimpLevelsTool       *tool);
 static void       gimp_levels_tool_config_notify  (GObject           *object,
                                                    GParamSpec        *pspec,
                                                    GimpLevelsTool    *tool);
@@ -361,6 +365,10 @@
   GtkObject        *data;
   gint              border;
 
+  g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
+                    G_CALLBACK (gimp_levels_tool_export_setup),
+                    image_map_tool);
+
   main_vbox   = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
   label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
 
@@ -494,7 +502,7 @@
 
   spinbutton = gimp_spin_button_new (&data,
                                      config->low_input[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -509,7 +517,7 @@
   /*  input gamma spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->gamma[config->channel],
-                                     0.1, 10, 0.01, 0.1, 1, 0.5, 2);
+                                     0.1, 10, 0.01, 0.1, 0, 0.5, 2);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, TRUE, FALSE, 0);
   gimp_help_set_help_data (spinbutton, _("Gamma"), NULL);
   gtk_widget_show (spinbutton);
@@ -540,7 +548,7 @@
 
   spinbutton = gimp_spin_button_new (&data,
                                      config->high_input[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -601,7 +609,7 @@
   /*  low output spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->low_output[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -616,7 +624,7 @@
   /*  high output spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->high_output[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_end (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -698,14 +706,24 @@
   GimpLevelsTool       *tool    = GIMP_LEVELS_TOOL (image_map_tool);
   GimpHistogramChannel  channel = tool->config->channel;
 
-  g_object_freeze_notify (G_OBJECT (tool->config));
+  g_object_freeze_notify (image_map_tool->config);
+
+  if (image_map_tool->default_config)
+    {
+      gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
+                        GIMP_CONFIG (image_map_tool->config),
+                        0);
+    }
+  else
+    {
+      gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
+    }
 
-  gimp_config_reset (GIMP_CONFIG (tool->config));
   g_object_set (tool->config,
                 "channel", channel,
                 NULL);
 
-  g_object_thaw_notify (G_OBJECT (tool->config));
+  g_object_thaw_notify (image_map_tool->config);
 }
 
 static gboolean
@@ -715,7 +733,7 @@
 {
   GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
   FILE           *file;
-  gboolean        success;
+  gchar           header[64];
 
   file = g_fopen (filename, "rt");
 
@@ -728,11 +746,34 @@
       return FALSE;
     }
 
-  success = gimp_levels_config_load_cruft (tool->config, file, error);
+  if (! fgets (header, sizeof (header), file))
+    {
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not read header from '%s': %s"),
+                   gimp_filename_to_utf8 (filename),
+                   g_strerror (errno));
+      fclose (file);
+      return FALSE;
+    }
+
+  if (g_str_has_prefix (header, "# GIMP Levels File\n"))
+    {
+      gboolean success;
+
+      rewind (file);
+
+      success = gimp_levels_config_load_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
+    }
 
   fclose (file);
 
-  return success;
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_import (image_map_tool,
+                                                                    filename,
+                                                                    error);
 }
 
 static gboolean
@@ -741,25 +782,55 @@
                                   GError           **error)
 {
   GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
-  FILE           *file;
-  gboolean        success;
-
-  file = g_fopen (filename, "wt");
 
-  if (! file)
+  if (tool->export_old_format)
     {
-      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
-                   _("Could not open '%s' for writing: %s"),
-                   gimp_filename_to_utf8 (filename),
-                   g_strerror (errno));
-      return FALSE;
+      FILE     *file;
+      gboolean  success;
+
+      file = g_fopen (filename, "wt");
+
+      if (! file)
+        {
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for writing: %s"),
+                       gimp_filename_to_utf8 (filename),
+                       g_strerror (errno));
+          return FALSE;
+        }
+
+      success = gimp_levels_config_save_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
     }
 
-  success = gimp_levels_config_save_cruft (tool->config, file, error);
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
+                                                                    filename,
+                                                                    error);
+}
 
-  fclose (file);
+static void
+gimp_levels_tool_export_setup (GimpSettingsBox      *settings_box,
+                               GtkFileChooserDialog *dialog,
+                               gboolean              export,
+                               GimpLevelsTool       *tool)
+{
+  GtkWidget *button;
 
-  return success;
+  if (! export)
+    return;
+
+  button = gtk_check_button_new_with_mnemonic (_("Use _old levels file format"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+                                tool->export_old_format);
+  gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
+  gtk_widget_show (button);
+
+  g_signal_connect (button, "toggled",
+                    G_CALLBACK (gimp_toggle_button_update),
+                    &tool->export_old_format);
 }
 
 static void

Modified: branches/soc-2008-tagging/app/tools/gimplevelstool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimplevelstool.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimplevelstool.h	Sun Oct 12 15:38:02 2008
@@ -61,6 +61,9 @@
   GtkAdjustment        *high_output;
 
   GtkWidget            *active_picker;
+
+  /* export dialog */
+  gboolean              export_old_format;
 };
 
 struct _GimpLevelsToolClass

Modified: branches/soc-2008-tagging/app/tools/gimpmagnifytool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpmagnifytool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpmagnifytool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/tools/gimpmeasuretool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpmeasuretool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpmeasuretool.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 

Modified: branches/soc-2008-tagging/app/tools/gimpmovetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpmovetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpmovetool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -262,6 +263,9 @@
               move->guide_orientation = gimp_guide_get_orientation (guide);
 
               gimp_tool_control_set_scroll_lock (tool->control, TRUE);
+              gimp_tool_control_set_precision   (tool->control,
+                                                 GIMP_CURSOR_PRECISION_PIXEL_BORDER);
+
               gimp_tool_control_activate (tool->control);
 
               gimp_display_shell_selection_control (shell,
@@ -366,6 +370,9 @@
       gimp_tool_pop_status (tool, display);
 
       gimp_tool_control_set_scroll_lock (tool->control, FALSE);
+      gimp_tool_control_set_precision   (tool->control,
+                                         GIMP_CURSOR_PRECISION_PIXEL_CENTER);
+
       gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
 
       if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
@@ -447,6 +454,8 @@
     }
   else
     {
+      gboolean flush = FALSE;
+
       if (! config->move_tool_changes_active ||
           (release_type == GIMP_BUTTON_RELEASE_CANCEL))
         {
@@ -455,6 +464,8 @@
               gimp_image_set_active_layer (display->image,
                                            move->old_active_layer);
               move->old_active_layer = NULL;
+
+              flush = TRUE;
             }
 
           if (move->old_active_vectors)
@@ -462,6 +473,8 @@
               gimp_image_set_active_vectors (display->image,
                                              move->old_active_vectors);
               move->old_active_vectors = NULL;
+
+              flush = TRUE;
             }
         }
 
@@ -470,9 +483,13 @@
           if (move->floating_layer)
             {
               floating_sel_anchor (move->floating_layer);
-              gimp_image_flush (display->image);
+
+              flush = TRUE;
             }
         }
+
+      if (flush)
+        gimp_image_flush (display->image);
     }
 }
 

Modified: branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c	Sun Oct 12 15:38:02 2008
@@ -228,7 +228,7 @@
        * label positions in RTL mode.
        */
       fixed = gtk_fixed_new ();
-      gtk_table_attach (GTK_TABLE (table), fixed, 0, 6, 0, 1,
+      gtk_table_attach (GTK_TABLE (table), fixed, 0, n_dynamics + 2, 0, 1,
                         GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
       gtk_widget_show (fixed);
 

Modified: branches/soc-2008-tagging/app/tools/gimppainttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimppainttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimppainttool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -90,6 +91,10 @@
 
 static void   gimp_paint_tool_draw           (GimpDrawTool          *draw_tool);
 
+static void   gimp_paint_tool_hard_notify    (GimpPaintOptions      *options,
+                                              const GParamSpec      *pspec,
+                                              GimpTool              *tool);
+
 
 G_DEFINE_TYPE (GimpPaintTool, gimp_paint_tool, GIMP_TYPE_COLOR_TOOL)
 
@@ -121,8 +126,8 @@
 {
   GimpTool *tool = GIMP_TOOL (paint_tool);
 
-  gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
-  gimp_tool_control_set_scroll_lock (tool->control, TRUE);
+  gimp_tool_control_set_motion_mode    (tool->control, GIMP_MOTION_MODE_EXACT);
+  gimp_tool_control_set_scroll_lock    (tool->control, TRUE);
   gimp_tool_control_set_action_value_1 (tool->control,
                                         "context/context-opacity-set");
 
@@ -144,15 +149,17 @@
                              guint                  n_params,
                              GObjectConstructParam *params)
 {
-  GObject       *object;
-  GimpTool      *tool;
-  GimpPaintInfo *paint_info;
-  GimpPaintTool *paint_tool;
+  GObject          *object;
+  GimpTool         *tool;
+  GimpPaintInfo    *paint_info;
+  GimpPaintTool    *paint_tool;
+  GimpPaintOptions *options;
 
   object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
 
   tool       = GIMP_TOOL (object);
   paint_tool = GIMP_PAINT_TOOL (object);
+  options    = GIMP_PAINT_TOOL_GET_OPTIONS (tool);
 
   g_assert (GIMP_IS_TOOL_INFO (tool->tool_info));
   g_assert (GIMP_IS_PAINT_INFO (tool->tool_info->paint_info));
@@ -165,6 +172,12 @@
                                    "undo-desc", paint_info->blurb,
                                    NULL);
 
+  g_signal_connect_object (options, "notify::hard",
+                           G_CALLBACK (gimp_paint_tool_hard_notify),
+                           tool, 0);
+
+  gimp_paint_tool_hard_notify (options, NULL, tool);
+
   return object;
 }
 
@@ -706,3 +719,14 @@
 
   GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
 }
+
+static void
+gimp_paint_tool_hard_notify (GimpPaintOptions *options,
+                             const GParamSpec *pspec,
+                             GimpTool         *tool)
+{
+  gimp_tool_control_set_precision (tool->control,
+                                   options->hard ?
+                                   GIMP_CURSOR_PRECISION_PIXEL_CENTER :
+                                   GIMP_CURSOR_PRECISION_SUBPIXEL);
+}

Modified: branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -46,7 +47,6 @@
 
 
 #define HANDLE_SIZE  25
-
 #define TARGET_SIZE  15
 
 
@@ -92,7 +92,7 @@
                                                                 gboolean         proximity,
                                                                 GimpDisplay     *display);
 
-static void          gimp_perspective_clone_tool_mode_notify   (GObject          *config,
+static void          gimp_perspective_clone_tool_mode_notify   (GimpPerspectiveCloneOptions *options,
                                                                 GParamSpec       *pspec,
                                                                 GimpPerspectiveCloneTool *clone_tool);
 
@@ -197,20 +197,14 @@
 
   tool       = GIMP_TOOL (object);
   clone_tool = GIMP_PERSPECTIVE_CLONE_TOOL (object);
-
-  options = GIMP_PERSPECTIVE_CLONE_TOOL_GET_OPTIONS (tool);
+  options    = GIMP_PERSPECTIVE_CLONE_TOOL_GET_OPTIONS (tool);
 
   g_signal_connect_object (options,
                            "notify::clone-mode",
                            G_CALLBACK (gimp_perspective_clone_tool_mode_notify),
                            clone_tool, 0);
 
-  if (options->clone_mode == GIMP_PERSPECTIVE_CLONE_MODE_ADJUST)
-    gimp_tool_control_set_tool_cursor (tool->control,
-                                       GIMP_TOOL_CURSOR_PERSPECTIVE);
-  else
-    gimp_tool_control_set_tool_cursor (tool->control,
-                                       GIMP_TOOL_CURSOR_CLONE);
+  gimp_perspective_clone_tool_mode_notify (options, NULL, clone_tool);
 
   return object;
 }
@@ -251,7 +245,6 @@
   return TRUE;
 }
 
-
 static gboolean
 gimp_perspective_clone_tool_has_display (GimpTool    *tool,
                                          GimpDisplay *display)
@@ -536,7 +529,6 @@
     }
 }
 
-
 static void
 gimp_perspective_clone_tool_cursor_update (GimpTool        *tool,
                                            GimpCoords      *coords,
@@ -881,43 +873,29 @@
 }
 
 static void
-gimp_perspective_clone_tool_mode_notify (GObject                  *config,
-                                         GParamSpec               *pspec,
-                                         GimpPerspectiveCloneTool *clone_tool)
+gimp_perspective_clone_tool_mode_notify (GimpPerspectiveCloneOptions *options,
+                                         GParamSpec                  *pspec,
+                                         GimpPerspectiveCloneTool    *clone_tool)
 {
-  GimpPerspectiveClone        *clone;
-  GimpPerspectiveCloneOptions *options;
+  GimpTool             *tool = GIMP_TOOL (clone_tool);
+  GimpPerspectiveClone *clone;
 
   clone = GIMP_PERSPECTIVE_CLONE (GIMP_PAINT_TOOL (clone_tool)->core);
-  options = GIMP_PERSPECTIVE_CLONE_OPTIONS (config);
 
   if (options->clone_mode == GIMP_PERSPECTIVE_CLONE_MODE_PAINT)
     {
-      gimp_tool_control_set_tool_cursor (GIMP_TOOL (clone_tool)->control,
-                                         GIMP_TOOL_CURSOR_CLONE);
-
-      clone->transform = clone_tool->transform;
+      /* GimpPaintTool's notify callback will set the right precision */
+      g_object_notify (G_OBJECT (options), "hard");
 
-      clone->transform_inv = clone_tool->transform;
-      gimp_matrix3_invert (&clone->transform_inv);
-
-#if 0
-      /* print the matrix */
+      gimp_tool_control_set_tool_cursor (tool->control,
+                                         GIMP_TOOL_CURSOR_CLONE);
 
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[0][0]);
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[0][1]);
-      g_printerr ("%f\n",   (clone_tool->transform).coeff[0][2]);
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[1][0]);
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[1][1]);
-      g_printerr ("%f\n",   (clone_tool->transform).coeff[1][2]);
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[2][0]);
-      g_printerr ("%f\t",   (clone_tool->transform).coeff[2][1]);
-      g_printerr ("%f\n\n", (clone_tool->transform).coeff[2][2]);
-#endif
+      gimp_perspective_clone_set_transform (clone, &clone_tool->transform);
     }
   else
     {
-      GimpTool *tool = GIMP_TOOL (clone_tool);
+      gimp_tool_control_set_precision (tool->control,
+                                       GIMP_CURSOR_PRECISION_SUBPIXEL);
 
       gimp_tool_control_set_tool_cursor (tool->control,
                                          GIMP_TOOL_CURSOR_PERSPECTIVE);

Modified: branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimpperspectiveclonetool.h	Sun Oct 12 15:38:02 2008
@@ -95,10 +95,10 @@
 };
 
 
-void    gimp_perspective_clone_tool_register      (GimpToolRegisterCallback  callback,
-                                                   gpointer                  data);
+void    gimp_perspective_clone_tool_register (GimpToolRegisterCallback  callback,
+                                              gpointer                  data);
 
-GType   gimp_perspective_clone_tool_get_type      (void) G_GNUC_CONST;
+GType   gimp_perspective_clone_tool_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_PERSPECTIVE_CLONE_TOOL_H__  */

Modified: branches/soc-2008-tagging/app/tools/gimpperspectivetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpperspectivetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpperspectivetool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/tools/gimprectangleselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprectangleselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimprectangleselecttool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -135,6 +136,8 @@
                                                            gint                   y,
                                                            gint                   w,
                                                            gint                   h);
+static GimpChannelOps
+                gimp_rectangle_select_tool_get_operation  (GimpRectangleSelectTool    *rect_sel_tool);
 static void     gimp_rectangle_select_tool_update_option_defaults
                                                           (GimpRectangleSelectTool    *rect_sel_tool,
                                                            gboolean                    ignore_pending);
@@ -222,6 +225,8 @@
   priv = GIMP_RECTANGLE_SELECT_TOOL_GET_PRIVATE (rect_sel_tool);
 
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_RECT_SELECT);
   gimp_tool_control_set_dirty_mask  (tool->control,
@@ -424,15 +429,9 @@
     }
   else
     {
-      GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (tool);
-      GimpImage            *image   = tool->display->image;
-      GimpUndo             *undo;
-      GimpChannelOps        operation;
-
-      if (priv->use_saved_op)
-        operation = priv->operation;
-      else
-        operation = options->operation;
+      GimpImage      *image = tool->display->image;
+      GimpUndo       *undo;
+      GimpChannelOps  operation;
 
       undo = gimp_undo_stack_peek (image->undo_stack);
 
@@ -451,6 +450,8 @@
 
       /* if the operation is "Replace", turn off the marching ants,
          because they are confusing */
+      operation = gimp_rectangle_select_tool_get_operation (rect_sel_tool);
+
       if (operation == GIMP_CHANNEL_OP_REPLACE)
         gimp_display_shell_set_show_selection (shell, FALSE);
     }
@@ -580,18 +581,14 @@
                                    gint               w,
                                    gint               h)
 {
-  GimpTool                       *tool;
-  GimpRectangleSelectTool        *rect_sel_tool;
-  GimpSelectionOptions           *options;
-  GimpImage                      *image;
-  GimpRectangleSelectToolPrivate *priv;
-  gboolean                        rectangle_exists;
-  GimpChannelOps                  operation;
+  GimpTool                *tool;
+  GimpRectangleSelectTool *rect_sel_tool;
+  GimpImage               *image;
+  gboolean                 rectangle_exists;
+  GimpChannelOps           operation;
 
   tool          = GIMP_TOOL (rectangle);
   rect_sel_tool = GIMP_RECTANGLE_SELECT_TOOL (rectangle);
-  options       = GIMP_SELECTION_TOOL_GET_OPTIONS (tool);
-  priv          = GIMP_RECTANGLE_SELECT_TOOL_GET_PRIVATE (rect_sel_tool);
 
   image         = tool->display->image;
 
@@ -604,11 +601,9 @@
                       w > 0                              &&
                       h > 0);
 
-  if (priv->use_saved_op)
-    operation = priv->operation;
-  else
-    operation = options->operation;
 
+  operation = gimp_rectangle_select_tool_get_operation (rect_sel_tool);
+  
   /* if rectangle exists, turn it into a selection */
   if (rectangle_exists)
     GIMP_RECTANGLE_SELECT_TOOL_GET_CLASS (rect_sel_tool)->select (rect_sel_tool,
@@ -665,6 +660,21 @@
     }
 }
 
+static GimpChannelOps
+gimp_rectangle_select_tool_get_operation (GimpRectangleSelectTool *rect_sel_tool)
+{
+  GimpRectangleSelectToolPrivate *priv;
+  GimpSelectionOptions           *options;
+
+  priv    = GIMP_RECTANGLE_SELECT_TOOL_GET_PRIVATE (rect_sel_tool);
+  options = GIMP_SELECTION_TOOL_GET_OPTIONS (rect_sel_tool);
+
+  if (priv->use_saved_op)
+    return priv->operation;
+  else
+    return options->operation;
+}
+
 /**
  * gimp_rectangle_select_tool_update_option_defaults:
  * @crop_tool:
@@ -783,14 +793,31 @@
         }
       else
         {
-          GimpTool *tool = GIMP_TOOL (rectangle);
+          GimpTool       *tool = GIMP_TOOL (rectangle);
+          GimpChannelOps  operation;
 
           /* prevent this change from halting the tool */
           gimp_tool_control_set_preserve (tool->control, TRUE);
 
-          /* otherwise clear the selection */
-          gimp_channel_clear (selection, NULL, TRUE);
-          gimp_image_flush (image);
+          /* We can conceptually think of a click outside of the
+           * selection as adding a 0px selection. Behave intuitivly
+           * for the current selection mode
+           */
+          operation = gimp_rectangle_select_tool_get_operation (rect_sel_tool);
+          switch (operation)
+            {
+            case GIMP_CHANNEL_OP_REPLACE:
+            case GIMP_CHANNEL_OP_INTERSECT:
+              gimp_channel_clear (selection, NULL, TRUE);
+              gimp_image_flush (image);
+              break;
+
+            case GIMP_CHANNEL_OP_ADD:
+            case GIMP_CHANNEL_OP_SUBTRACT:
+            default:
+              /* Do nothing */
+              break;
+            }
 
           gimp_tool_control_set_preserve (tool->control, FALSE);
         }

Modified: branches/soc-2008-tagging/app/tools/gimprectangletool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprectangletool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimprectangletool.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -97,14 +98,15 @@
   (gimp_rectangle_tool_get_private (GIMP_RECTANGLE_TOOL (obj)))
 
 
-typedef struct
+typedef struct _GimpRectangleToolPrivate GimpRectangleToolPrivate;
+
+struct _GimpRectangleToolPrivate
 {
   /* The following members are "constants", that is, variables that are setup
    * during gimp_rectangle_tool_button_press and then only read.
    */
 
-  /*
-   * Wether or not the rectangle currently being rubber-banded was
+  /* Wether or not the rectangle currently being rubber-banded was
    * created from scatch.
    */
   gboolean                is_new;
@@ -125,7 +127,6 @@
   gboolean                rect_adjusting;
 
 
-
   /* The rest of the members are internal state variables, that is, variables
    * that might change during the manipulation session of the rectangle. Make
    * sure these variables are in consistent states.
@@ -200,7 +201,7 @@
 
   /* Synced with options->guide, only exists for drawing. */
   GimpRectangleGuide      guide;
-} GimpRectangleToolPrivate;
+};
 
 
 static void          gimp_rectangle_tool_iface_base_init      (GimpRectangleToolInterface *iface);
@@ -1064,7 +1065,7 @@
       private->function != GIMP_RECTANGLE_TOOL_EXECUTING)
     {
       gdouble pub_x1, pub_y1, pub_x2, pub_y2;
-      gint w, h;
+      gint    w, h;
 
       gimp_tool_pop_status (tool, display);
 
@@ -1080,6 +1081,7 @@
           aspect_text = g_strdup_printf ("  (%.2f:1)", w / (gdouble) h);
 
           gimp_tool_push_status_coords (tool, display,
+                                        GIMP_CURSOR_PRECISION_PIXEL_BORDER,
                                         _("Rectangle: "),
                                         w, " Ã ", h, aspect_text);
           g_free (aspect_text);
@@ -1089,8 +1091,8 @@
   if (private->function == GIMP_RECTANGLE_TOOL_CREATING)
     {
       GimpRectangleFunction function = GIMP_RECTANGLE_TOOL_CREATING;
-      gdouble               dx = snapped_x - private->lastx;
-      gdouble               dy = snapped_y - private->lasty;
+      gdouble               dx       = snapped_x - private->lastx;
+      gdouble               dy       = snapped_y - private->lasty;
 
       /* When the user starts to move the cursor, set the current
        * function to one of the corner-grabbed functions, depending on
@@ -1098,27 +1100,27 @@
        */
       if (dx < 0)
         {
-          function = dy < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT;
+          function = (dy < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT);
         }
       else if (dx > 0)
         {
-          function = dy < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT;
+          function = (dy < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT);
         }
       else if (dy < 0)
         {
-          function = dx < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT;
+          function = (dx < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT);
         }
       else if (dy > 0)
         {
-          function = dx < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT;
+          function = (dx < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT);
         }
 
       gimp_rectangle_tool_set_function (rect_tool, function);
@@ -1152,7 +1154,6 @@
   private->lasty = snapped_y;
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
-
 }
 
 void
@@ -1220,7 +1221,6 @@
 
   if (key == GDK_CONTROL_MASK)
     {
-
       g_object_set (options,
                     "fixed-center", ! options_private->fixed_center,
                     NULL);
@@ -1499,7 +1499,7 @@
 
   g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
 
-  private        = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
+  private   = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
   rect_tool = GIMP_RECTANGLE_TOOL (tool);
 
   if (tool->display != display)
@@ -1763,6 +1763,7 @@
 
   gimp_rectangle_tool_get_public_rect (GIMP_RECTANGLE_TOOL (draw_tool),
                                        &pub_x1, &pub_y1, &pub_x2, &pub_y2);
+
   switch (private->guide)
     {
     case GIMP_RECTANGLE_GUIDE_NONE:
@@ -1976,6 +1977,7 @@
 
   /* initialize the statusbar display */
   gimp_tool_push_status_coords (tool, tool->display,
+                                GIMP_CURSOR_PRECISION_PIXEL_BORDER,
                                 _("Rectangle: "), 0, " Ã ", 0, NULL);
 
   gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), tool->display);
@@ -2172,7 +2174,6 @@
   g_signal_handlers_unblock_by_func (options,
                                      gimp_rectangle_tool_options_notify,
                                      rect_tool);
-
 }
 
 static void

Modified: branches/soc-2008-tagging/app/tools/gimpregionselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpregionselecttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpregionselecttool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/tools/gimprotatetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprotatetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimprotatetool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -199,7 +200,7 @@
                     GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
   gtk_widget_show (scale);
 
-  button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 1, 1, 2);
+  button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 0, 1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Center _X:"),
                              0.0, 0.5, button, 1, TRUE);

Modified: branches/soc-2008-tagging/app/tools/gimpscaletool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpscaletool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpscaletool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/tools/gimpselectiontool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpselectiontool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpselectiontool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 

Modified: branches/soc-2008-tagging/app/tools/gimpsheartool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpsheartool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpsheartool.c	Sun Oct 12 15:38:02 2008
@@ -129,7 +129,7 @@
   gtk_widget_show (table);
 
   button = gimp_spin_button_new (&shear->x_adj,
-                                 0, -65536, 65536, 1, 15, 1, 1, 0);
+                                 0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Shear magnitude _X:"),
                              0.0, 0.5, button, 1, TRUE);
@@ -139,7 +139,7 @@
                     tr_tool);
 
   button = gimp_spin_button_new (&shear->y_adj,
-                                 0, -65536, 65536, 1, 15, 1, 1, 0);
+                                 0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Shear magnitude _Y:"),
                              0.0, 0.5, button, 1, TRUE);

Modified: branches/soc-2008-tagging/app/tools/gimpsourcetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpsourcetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpsourcetool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "tools-types.h"

Modified: branches/soc-2008-tagging/app/tools/gimptexttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptexttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimptexttool.c	Sun Oct 12 15:38:02 2008
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <errno.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpconfig/gimpconfig.h"
@@ -153,7 +154,9 @@
   (* callback) (GIMP_TYPE_TEXT_TOOL,
                 GIMP_TYPE_TEXT_OPTIONS,
                 gimp_text_options_gui,
-                GIMP_CONTEXT_FOREGROUND_MASK | GIMP_CONTEXT_FONT_MASK,
+                GIMP_CONTEXT_FOREGROUND_MASK |
+                GIMP_CONTEXT_FONT_MASK       |
+                GIMP_CONTEXT_PALETTE_MASK /* for the color popup's palette tab */,
                 "gimp-text-tool",
                 _("Text"),
                 _("Text Tool: Create or edit text layers"),
@@ -801,7 +804,7 @@
       gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
     }
 
-  gimp_image_add_vectors (text_tool->image, vectors, -1);
+  gimp_image_add_vectors (text_tool->image, vectors, -1, TRUE);
 
   gimp_image_flush (text_tool->image);
 }
@@ -827,7 +830,7 @@
 
   gimp_vectors_warp_vectors (vectors0, vectors, 0.5 * box_height);
 
-  gimp_image_add_vectors (text_tool->image, vectors, -1);
+  gimp_image_add_vectors (text_tool->image, vectors, -1, TRUE);
   gimp_image_set_active_vectors (text_tool->image, vectors);
   gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE);
 
@@ -890,7 +893,7 @@
   GIMP_ITEM (layer)->offset_x = text_tool->x1;
   GIMP_ITEM (layer)->offset_y = text_tool->y1;
 
-  gimp_image_add_layer (image, layer, -1);
+  gimp_image_add_layer (image, layer, -1, TRUE);
 
   if (text_tool->text_box_fixed)
     {

Modified: branches/soc-2008-tagging/app/tools/gimptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimptool.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -864,13 +865,14 @@
 }
 
 void
-gimp_tool_push_status_coords (GimpTool    *tool,
-                              GimpDisplay *display,
-                              const gchar *title,
-                              gdouble      x,
-                              const gchar *separator,
-                              gdouble      y,
-                              const gchar *help)
+gimp_tool_push_status_coords (GimpTool            *tool,
+                              GimpDisplay         *display,
+                              GimpCursorPrecision  precision,
+                              const gchar         *title,
+                              gdouble              x,
+                              const gchar         *separator,
+                              gdouble              y,
+                              const gchar         *help)
 {
   GimpDisplayShell *shell;
   const gchar      *stock_id;
@@ -884,7 +886,8 @@
 
   gimp_statusbar_push_coords (GIMP_STATUSBAR (shell->statusbar),
                               G_OBJECT_TYPE_NAME (tool), stock_id,
-                              title, x, separator, y, help);
+                              precision, title, x, separator, y,
+                              help);
 
   tool->status_displays = g_list_remove (tool->status_displays, display);
   tool->status_displays = g_list_prepend (tool->status_displays, display);

Modified: branches/soc-2008-tagging/app/tools/gimptool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptool.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimptool.h	Sun Oct 12 15:38:02 2008
@@ -191,6 +191,7 @@
                                              ...) G_GNUC_PRINTF(3,4);
 void          gimp_tool_push_status_coords  (GimpTool            *tool,
                                              GimpDisplay         *display,
+                                             GimpCursorPrecision  precision,
                                              const gchar         *title,
                                              gdouble              x,
                                              const gchar         *separator,

Modified: branches/soc-2008-tagging/app/tools/gimptoolcontrol.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptoolcontrol.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimptoolcontrol.c	Sun Oct 12 15:38:02 2008
@@ -60,6 +60,8 @@
   control->snap_width             = 0;
   control->snap_height            = 0;
 
+  control->precision              = GIMP_CURSOR_PRECISION_PIXEL_CENTER;
+
   control->toggled                = FALSE;
 
   control->cursor                 = GIMP_CURSOR_MOUSE;
@@ -301,6 +303,24 @@
 }
 
 void
+gimp_tool_control_set_precision (GimpToolControl     *control,
+                                 GimpCursorPrecision  precision)
+{
+  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
+
+  control->precision = precision;
+}
+
+GimpCursorPrecision
+gimp_tool_control_get_precision (GimpToolControl *control)
+{
+  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control),
+                        GIMP_CURSOR_PRECISION_PIXEL_CENTER);
+
+  return control->precision;
+}
+
+void
 gimp_tool_control_set_toggled (GimpToolControl *control,
                                gboolean         toggled)
 {

Modified: branches/soc-2008-tagging/app/tools/gimptoolcontrol.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptoolcontrol.h	(original)
+++ branches/soc-2008-tagging/app/tools/gimptoolcontrol.h	Sun Oct 12 15:38:02 2008
@@ -36,43 +36,45 @@
 
 struct _GimpToolControl
 {
-  GimpObject         parent_instance;
+  GimpObject           parent_instance;
 
-  gboolean           active;             /*  state of tool activity          */
-  gint               paused_count;       /*  paused control count            */
+  gboolean             active;             /*  state of tool activity          */
+  gint                 paused_count;       /*  paused control count            */
 
-  gboolean           preserve;           /*  Preserve this tool across       *
-                                          *  drawable changes                */
-  gboolean           scroll_lock;        /*  allow scrolling or not          */
-  gboolean           handle_empty_image; /*  invoke the tool on images       *
-                                          *  without active drawable         */
-  gboolean           wants_click;        /*  wants click detection           */
-  GimpDirtyMask      dirty_mask;         /*  if preserve is FALSE, cancel    *
-                                          *  the tool on these events        */
-  GimpMotionMode     motion_mode;        /*  how to process motion events    *
-                                          *  before they go to the tool      */
-  gboolean           auto_snap_to;       /*  snap to guides automatically    */
-  gint               snap_offset_x;
-  gint               snap_offset_y;
-  gint               snap_width;
-  gint               snap_height;
-
-  gboolean           toggled;
-
-  GimpCursorType     cursor;
-  GimpToolCursorType tool_cursor;
-  GimpCursorModifier cursor_modifier;
-
-  GimpCursorType     toggle_cursor;
-  GimpToolCursorType toggle_tool_cursor;
-  GimpCursorModifier toggle_cursor_modifier;
-
-  gchar             *action_value_1;
-  gchar             *action_value_2;
-  gchar             *action_value_3;
-  gchar             *action_value_4;
-  gchar             *action_object_1;
-  gchar             *action_object_2;
+  gboolean             preserve;           /*  Preserve this tool across       *
+                                            *  drawable changes                */
+  gboolean             scroll_lock;        /*  allow scrolling or not          */
+  gboolean             handle_empty_image; /*  invoke the tool on images       *
+                                            *  without active drawable         */
+  gboolean             wants_click;        /*  wants click detection           */
+  GimpDirtyMask        dirty_mask;         /*  if preserve is FALSE, cancel    *
+                                            *  the tool on these events        */
+  GimpMotionMode       motion_mode;        /*  how to process motion events    *
+                                            *  before they go to the tool      */
+  gboolean             auto_snap_to;       /*  snap to guides automatically    */
+  gint                 snap_offset_x;
+  gint                 snap_offset_y;
+  gint                 snap_width;
+  gint                 snap_height;
+
+  GimpCursorPrecision  precision;
+
+  gboolean             toggled;
+
+  GimpCursorType       cursor;
+  GimpToolCursorType   tool_cursor;
+  GimpCursorModifier   cursor_modifier;
+
+  GimpCursorType       toggle_cursor;
+  GimpToolCursorType   toggle_tool_cursor;
+  GimpCursorModifier   toggle_cursor_modifier;
+
+  gchar               *action_value_1;
+  gchar               *action_value_2;
+  gchar               *action_value_3;
+  gchar               *action_value_4;
+  gchar               *action_object_1;
+  gchar               *action_object_2;
 };
 
 struct _GimpToolControlClass
@@ -130,6 +132,11 @@
                                                    gint            *width,
                                                    gint            *height);
 
+void           gimp_tool_control_set_precision    (GimpToolControl     *control,
+                                                   GimpCursorPrecision  precision);
+GimpCursorPrecision
+               gimp_tool_control_get_precision    (GimpToolControl     *control);
+
 void           gimp_tool_control_set_toggled      (GimpToolControl *control,
                                                    gboolean         toggled);
 gboolean       gimp_tool_control_get_toggled      (GimpToolControl *control);

Modified: branches/soc-2008-tagging/app/tools/gimptransformtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimptransformtool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimptransformtool.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <stdlib.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -203,6 +204,8 @@
                                      GIMP_DIRTY_IMAGE_SIZE |
                                      GIMP_DIRTY_DRAWABLE   |
                                      GIMP_DIRTY_SELECTION);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_SUBPIXEL);
 
   tr_tool->function = TRANSFORM_CREATING;
   tr_tool->original = NULL;
@@ -359,6 +362,8 @@
       /*  start drawing the bounding box and handles...  */
       gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
 
+      gimp_transform_tool_expose_preview (tr_tool);
+
       tr_tool->function = TRANSFORM_CREATING;
 
       /*  Save the current transformation info  */
@@ -485,9 +490,9 @@
     {
       tr_tool_class->motion (tr_tool, display);
 
-      gimp_transform_tool_expose_preview (tr_tool);
-
       gimp_transform_tool_recalc (tr_tool, display);
+
+      gimp_transform_tool_expose_preview (tr_tool);
     }
 
   tr_tool->lastx = tr_tool->curx;
@@ -1179,15 +1184,9 @@
       return;
     }
 
-  mask_empty = gimp_channel_is_empty (gimp_image_get_mask (display->image));
-
-  if (gimp_display_shell_get_show_transform (shell))
-    {
-      gimp_display_shell_set_show_transform (shell, FALSE);
+  gimp_dialog_factory_hide_dialog (tr_tool->dialog);
 
-      /* get rid of preview artifacts left outside the drawable's area */
-      gtk_widget_queue_draw (shell->canvas);
-    }
+  mask_empty = gimp_channel_is_empty (gimp_image_get_mask (display->image));
 
   gimp_set_busy (display->image->gimp);
 
@@ -1294,6 +1293,14 @@
    */
   gimp_tool_control_set_preserve (tool->control, FALSE);
 
+  if (gimp_display_shell_get_show_transform (shell))
+    {
+      gimp_display_shell_set_show_transform (shell, FALSE);
+
+      /* get rid of preview artifacts left outside the drawable's area */
+      gtk_widget_queue_draw (shell->canvas);
+    }
+
   gimp_unset_busy (display->image->gimp);
 
   gimp_image_flush (display->image);
@@ -1352,7 +1359,9 @@
        options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
       options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
       options->direction    == GIMP_TRANSFORM_FORWARD)
-    gimp_transform_tool_force_expose_preview (tr_tool);
+    {
+      gimp_transform_tool_force_expose_preview (tr_tool);
+    }
 }
 
 static void
@@ -1692,16 +1701,16 @@
                              GimpDisplay       *display)
 {
   GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tr_tool);
+  gboolean              show_transform;
 
-  if ((options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
-       options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
-      options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
-      options->direction    == GIMP_TRANSFORM_FORWARD)
-    gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
-                                           TRUE);
-  else
-    gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
-                                           FALSE);
+  show_transform =
+    ((options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
+      options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
+     options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
+     options->direction    == GIMP_TRANSFORM_FORWARD);
+
+  gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
+                                         show_transform);
 
   if (tr_tool->dialog)
     {

Modified: branches/soc-2008-tagging/app/tools/gimpvectortool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpvectortool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpvectortool.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -192,6 +193,8 @@
   gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
   gimp_tool_control_set_motion_mode        (tool->control,
                                             GIMP_MOTION_MODE_COMPRESS);
+  gimp_tool_control_set_precision          (tool->control,
+                                            GIMP_CURSOR_PRECISION_SUBPIXEL);
   gimp_tool_control_set_cursor             (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_tool_cursor        (tool->control,
                                             GIMP_TOOL_CURSOR_PATHS);
@@ -301,7 +304,7 @@
 
       vector_tool->undo_motion = TRUE;
 
-      gimp_image_add_vectors (display->image, vectors, -1);
+      gimp_image_add_vectors (display->image, vectors, -1, TRUE);
       gimp_image_flush (display->image);
 
       gimp_vector_tool_set_vectors (vector_tool, vectors);

Modified: branches/soc-2008-tagging/app/tools/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/tools/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/tools/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -108,6 +108,11 @@
 	gimp-tools.obj \
 	tools-enums.obj \
 	tools-utils.obj \
+	gimpdesaturatetool.obj \
+	gimpgegltool.obj \
+	gimpimagemaptool-settings.obj \
+	gimpiscissorsoptions.obj \
+	gimpregionselectoptions.obj \
 
 INCLUDES = \
 	-FImsvc_recommended_pragmas.h \

Modified: branches/soc-2008-tagging/app/tools/tool_manager.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/tool_manager.c	(original)
+++ branches/soc-2008-tagging/app/tools/tool_manager.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/vectors/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/vectors/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/vectors/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -8,9 +8,9 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
 	$(CAIRO_CFLAGS)		\
-	$(GLIB_CFLAGS)		\
+	$(GEGL_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
 	-I$(includedir)
 
 noinst_LIBRARIES = libappvectors.a

Modified: branches/soc-2008-tagging/app/vectors/gimpanchor.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpanchor.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpanchor.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include "glib-object.h"
+#include <glib-object.h>
 
 #include "vectors-types.h"
 

Modified: branches/soc-2008-tagging/app/vectors/gimpvectors-compat.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors-compat.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors-compat.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "vectors-types.h"
 

Modified: branches/soc-2008-tagging/app/vectors/gimpvectors-export.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors-export.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors-export.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/vectors/gimpvectors-import.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors-import.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors-import.c	Sun Oct 12 15:38:02 2008
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpmath/gimpmath.h"
@@ -305,7 +305,7 @@
                   vectors = gimp_vectors_new (image,
                                               ((merge || !path->id) ?
                                                _("Imported Path") : path->id));
-                  gimp_image_add_vectors (image, vectors, position);
+                  gimp_image_add_vectors (image, vectors, position, TRUE);
                   gimp_vectors_freeze (vectors);
 
                   if (ret_vectors)

Modified: branches/soc-2008-tagging/app/vectors/gimpvectors-preview.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors-preview.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors-preview.c	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,7 @@
 
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "vectors-types.h"
 

Modified: branches/soc-2008-tagging/app/vectors/gimpvectors.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors.c	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <cairo.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/vectors/gimpvectorspropundo.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectorspropundo.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectorspropundo.c	Sun Oct 12 15:38:02 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "vectors-types.h"
 

Modified: branches/soc-2008-tagging/app/vectors/gimpvectorsundo.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectorsundo.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectorsundo.c	Sun Oct 12 15:38:02 2008
@@ -18,11 +18,10 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "vectors-types.h"
 
-#include "core/gimpcontainer.h"
 #include "core/gimpimage.h"
 
 #include "gimpvectors.h"
@@ -194,12 +193,8 @@
       vectors_undo->prev_position = gimp_image_get_vectors_index (undo->image,
                                                                   vectors);
 
-      gimp_container_remove (undo->image->vectors, GIMP_OBJECT (vectors));
-      gimp_item_removed (GIMP_ITEM (vectors));
-
-      if (vectors == gimp_image_get_active_vectors (undo->image))
-        gimp_image_set_active_vectors (undo->image,
-                                       vectors_undo->prev_vectors);
+      gimp_image_remove_vectors (undo->image, vectors, FALSE,
+                                 vectors_undo->prev_vectors);
     }
   else
     {
@@ -208,9 +203,8 @@
       /*  record the active vectors  */
       vectors_undo->prev_vectors = gimp_image_get_active_vectors (undo->image);
 
-      gimp_container_insert (undo->image->vectors, GIMP_OBJECT (vectors),
-                             vectors_undo->prev_position);
-      gimp_image_set_active_vectors (undo->image, vectors);
+      gimp_image_add_vectors (undo->image, vectors,
+                              vectors_undo->prev_position, FALSE);
 
       GIMP_ITEM (vectors)->removed = FALSE;
     }

Modified: branches/soc-2008-tagging/app/widgets/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/widgets/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/widgets/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -10,6 +10,7 @@
 	-I$(top_srcdir)		\
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
 	$(GTK_CFLAGS)		\
 	-I$(includedir)
 
@@ -20,6 +21,8 @@
 	widgets-types.h			\
 	gimpaction.c			\
 	gimpaction.h			\
+	gimpactioneditor.c		\
+	gimpactioneditor.h		\
 	gimpactionfactory.c		\
 	gimpactionfactory.h		\
 	gimpactiongroup.c		\

Modified: branches/soc-2008-tagging/app/widgets/gimpaction.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpaction.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpaction.c	Sun Oct 12 15:38:02 2008
@@ -278,12 +278,22 @@
                  const gchar *tooltip,
                  const gchar *stock_id)
 {
-  return g_object_new (GIMP_TYPE_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       NULL);
+  GimpAction *action;
+
+  action = g_object_new (GIMP_TYPE_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 gint

Modified: branches/soc-2008-tagging/app/widgets/gimpactionview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpactionview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpactionview.c	Sun Oct 12 15:38:02 2008
@@ -45,7 +45,10 @@
 /*  local function prototypes  */
 
 static void     gimp_action_view_dispose         (GObject         *object);
+static void     gimp_action_view_finalize        (GObject         *object);
 
+static void     gimp_action_view_select_path     (GimpActionView  *view,
+                                                  GtkTreePath     *path);
 static gboolean gimp_action_view_accel_find_func (GtkAccelKey     *key,
                                                   GClosure        *closure,
                                                   gpointer         data);
@@ -75,7 +78,8 @@
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->dispose = gimp_action_view_dispose;
+  object_class->dispose  = gimp_action_view_dispose;
+  object_class->finalize = gimp_action_view_finalize;
 }
 
 static void
@@ -108,12 +112,26 @@
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
+static void
+gimp_action_view_finalize (GObject *object)
+{
+  GimpActionView *view = GIMP_ACTION_VIEW (object);
+
+  if (view->filter)
+    {
+      g_free (view->filter);
+      view->filter = NULL;
+    }
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
 static gboolean
 idle_start_editing (GtkTreeView *tree_view)
 {
   GtkTreePath *path;
 
-  path = g_object_get_data (G_OBJECT (tree_view), "start_editing_path");
+  path = g_object_get_data (G_OBJECT (tree_view), "start-editing-path");
 
   if (path)
     {
@@ -123,7 +141,7 @@
                                 gtk_tree_view_get_column (tree_view, 1),
                                 TRUE);
 
-      g_object_set_data (G_OBJECT (tree_view), "start_editing_path", NULL);
+      g_object_set_data (G_OBJECT (tree_view), "start-editing-path", NULL);
     }
 
   return FALSE;
@@ -154,7 +172,7 @@
           return FALSE;
         }
 
-      g_object_set_data_full (G_OBJECT (tree_view), "start_editing_path",
+      g_object_set_data_full (G_OBJECT (tree_view), "start-editing-path",
                               path, (GDestroyNotify) gtk_tree_path_free);
 
       g_signal_stop_emission_by_name (tree_view, "button-press-event");
@@ -180,6 +198,7 @@
   GtkTreeViewColumn *column;
   GtkCellRenderer   *cell;
   GtkTreeStore      *store;
+  GtkTreeModel      *filter;
   GtkAccelGroup     *accel_group;
   GList             *list;
   GtkTreePath       *select_path = NULL;
@@ -187,13 +206,15 @@
   g_return_val_if_fail (GIMP_IS_UI_MANAGER (manager), NULL);
 
   store = gtk_tree_store_new (GIMP_ACTION_VIEW_NUM_COLUMNS,
-                              GTK_TYPE_ACTION,        /* COLUMN_ACTION        */
-                              G_TYPE_STRING,          /* COLUMN_STOCK_ID      */
-                              G_TYPE_STRING,          /* COLUMN_LABEL         */
-                              G_TYPE_STRING,          /* COLUMN_NAME          */
-                              G_TYPE_UINT,            /* COLUMN_ACCEL_KEY     */
-                              GDK_TYPE_MODIFIER_TYPE, /* COLUMN_ACCEL_MASK    */
-                              G_TYPE_CLOSURE);        /* COLUMN_ACCEL_CLOSURE */
+                              G_TYPE_BOOLEAN,         /* COLUMN_VISIBLE        */
+                              GTK_TYPE_ACTION,        /* COLUMN_ACTION         */
+                              G_TYPE_STRING,          /* COLUMN_STOCK_ID       */
+                              G_TYPE_STRING,          /* COLUMN_LABEL          */
+                              G_TYPE_STRING,          /* COLUMN_LABEL_CASEFOLD */
+                              G_TYPE_STRING,          /* COLUMN_NAME           */
+                              G_TYPE_UINT,            /* COLUMN_ACCEL_KEY      */
+                              GDK_TYPE_MODIFIER_TYPE, /* COLUMN_ACCEL_MASK     */
+                              G_TYPE_CLOSURE);        /* COLUMN_ACCEL_CLOSURE  */
 
   accel_group = gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (manager));
 
@@ -223,6 +244,7 @@
           const gchar     *name          = gtk_action_get_name (action);
           gchar           *stock_id;
           gchar           *label;
+          gchar           *label_casefold;
           gchar           *tmp;
           guint            accel_key     = 0;
           GdkModifierType  accel_mask    = 0;
@@ -248,6 +270,8 @@
               label = g_strdup (name);
             }
 
+          label_casefold = g_utf8_casefold (label, -1);
+
           if (show_shortcuts)
             {
               accel_closure = gtk_action_get_accel_closure (action);
@@ -273,17 +297,20 @@
           gtk_tree_store_append (store, &action_iter, &group_iter);
 
           gtk_tree_store_set (store, &action_iter,
-                              GIMP_ACTION_VIEW_COLUMN_ACTION,        action,
-                              GIMP_ACTION_VIEW_COLUMN_STOCK_ID,      stock_id,
-                              GIMP_ACTION_VIEW_COLUMN_LABEL,         label,
-                              GIMP_ACTION_VIEW_COLUMN_NAME,          name,
-                              GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY,     accel_key,
-                              GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK,    accel_mask,
-                              GIMP_ACTION_VIEW_COLUMN_ACCEL_CLOSURE, accel_closure,
+                              GIMP_ACTION_VIEW_COLUMN_VISIBLE,        TRUE,
+                              GIMP_ACTION_VIEW_COLUMN_ACTION,         action,
+                              GIMP_ACTION_VIEW_COLUMN_STOCK_ID,       stock_id,
+                              GIMP_ACTION_VIEW_COLUMN_LABEL,          label,
+                              GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD, label_casefold,
+                              GIMP_ACTION_VIEW_COLUMN_NAME,           name,
+                              GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY,      accel_key,
+                              GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK,     accel_mask,
+                              GIMP_ACTION_VIEW_COLUMN_ACCEL_CLOSURE,  accel_closure,
                               -1);
 
           g_free (stock_id);
           g_free (label);
+          g_free (label_casefold);
 
           if (select_action && ! strcmp (select_action, name))
             {
@@ -295,12 +322,19 @@
       g_list_free (actions);
     }
 
+  filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL);
+
+  g_object_unref (store);
+
   view = g_object_new (GIMP_TYPE_ACTION_VIEW,
-                       "model",      store,
+                       "model",      filter,
                        "rules-hint", TRUE,
                        NULL);
 
-  g_object_unref (store);
+  g_object_unref (filter);
+
+  gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER (filter),
+                                            GIMP_ACTION_VIEW_COLUMN_VISIBLE);
 
   GIMP_ACTION_VIEW (view)->manager        = g_object_ref (manager);
   GIMP_ACTION_VIEW (view)->show_shortcuts = show_shortcuts;
@@ -377,28 +411,132 @@
 
   if (select_path)
     {
-      GtkTreeSelection *sel = gtk_tree_view_get_selection (view);
-      GtkTreePath      *expand;
+      gimp_action_view_select_path (GIMP_ACTION_VIEW (view), select_path);
+      gtk_tree_path_free (select_path);
+    }
+
+  return GTK_WIDGET (view);
+}
 
-      expand = gtk_tree_path_copy (select_path);
-      gtk_tree_path_up (expand);
-      gtk_tree_view_expand_row (view, expand, FALSE);
+void
+gimp_action_view_set_filter (GimpActionView *view,
+                             const gchar    *filter)
+{
+  GtkTreeSelection    *sel;
+  GtkTreeModel        *filtered_model;
+  GtkTreeModel        *model;
+  GtkTreeIter          iter;
+  gboolean             iter_valid;
+  GtkTreeRowReference *selected_row = NULL;
 
-      gtk_tree_selection_select_path (sel, select_path);
+  g_return_if_fail (GIMP_IS_ACTION_VIEW (view));
 
-      gtk_tree_view_scroll_to_cell (view, select_path, NULL,
-                                    TRUE, 0.5, 0.0);
+  filtered_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
+  model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (filtered_model));
 
-      gtk_tree_path_free (select_path);
-      gtk_tree_path_free (expand);
+  if (filter && ! strlen (filter))
+    filter = NULL;
+
+  g_free (view->filter);
+  view->filter = NULL;
+
+  if (filter)
+    view->filter = g_utf8_casefold (filter, -1);
+
+  sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+
+  if (gtk_tree_selection_get_selected (sel, NULL, &iter))
+    {
+      GtkTreePath *path = gtk_tree_model_get_path (filtered_model, &iter);
+
+      selected_row = gtk_tree_row_reference_new (filtered_model, path);
     }
 
-  return GTK_WIDGET (view);
+  for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
+       iter_valid;
+       iter_valid = gtk_tree_model_iter_next (model, &iter))
+    {
+      GtkTreeIter child_iter;
+      gboolean    child_valid;
+      gint        n_children = 0;
+
+      for (child_valid = gtk_tree_model_iter_children (model, &child_iter,
+                                                       &iter);
+           child_valid;
+           child_valid = gtk_tree_model_iter_next (model, &child_iter))
+        {
+          gboolean visible = TRUE;
+
+          if (view->filter)
+            {
+              gchar *label;
+              gchar *name;
+
+              gtk_tree_model_get (model, &child_iter,
+                                  GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD, &label,
+                                  GIMP_ACTION_VIEW_COLUMN_NAME,           &name,
+                                  -1);
+
+              visible = label && name && (strstr (label, view->filter) != NULL ||
+                                          strstr (name,  view->filter) != NULL);
+
+              g_free (label);
+              g_free (name);
+            }
+
+          gtk_tree_store_set (GTK_TREE_STORE (model), &child_iter,
+                              GIMP_ACTION_VIEW_COLUMN_VISIBLE, visible,
+                              -1);
+
+          if (visible)
+            n_children++;
+        }
+
+      gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+                          GIMP_ACTION_VIEW_COLUMN_VISIBLE, n_children > 0,
+                          -1);
+    }
+
+  if (view->filter)
+    gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
+  else
+    gtk_tree_view_collapse_all (GTK_TREE_VIEW (view));
+
+  gtk_tree_view_columns_autosize (GTK_TREE_VIEW (view));
+
+  if (selected_row)
+    {
+      if (gtk_tree_row_reference_valid (selected_row))
+        {
+          GtkTreePath *path = gtk_tree_row_reference_get_path (selected_row);
+
+          gimp_action_view_select_path (view, path);
+          gtk_tree_path_free (path);
+        }
+
+      gtk_tree_row_reference_free (selected_row);
+    }
 }
 
 
 /*  private functions  */
 
+static void
+gimp_action_view_select_path (GimpActionView *view,
+                              GtkTreePath    *path)
+{
+  GtkTreeView *tv = GTK_TREE_VIEW (view);
+  GtkTreePath *expand;
+
+  expand = gtk_tree_path_copy (path);
+  gtk_tree_path_up (expand);
+  gtk_tree_view_expand_row (tv, expand, FALSE);
+  gtk_tree_path_free (expand);
+
+  gtk_tree_view_set_cursor (tv, path, NULL, FALSE);
+  gtk_tree_view_scroll_to_cell (tv, path, NULL, TRUE, 0.5, 0.0);
+}
+
 static gboolean
 gimp_action_view_accel_find_func (GtkAccelKey *key,
                                   GClosure    *closure,
@@ -422,6 +560,10 @@
   if (! model)
     return;
 
+  model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
+  if (! model)
+    return;
+
   for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
        iter_valid;
        iter_valid = gtk_tree_model_iter_next (model, &iter))
@@ -647,6 +789,7 @@
       gboolean      iter_valid;
 
       model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
+      model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
 
       for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
            iter_valid;

Modified: branches/soc-2008-tagging/app/widgets/gimpactionview.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpactionview.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpactionview.h	Sun Oct 12 15:38:02 2008
@@ -25,9 +25,11 @@
 
 enum
 {
+  GIMP_ACTION_VIEW_COLUMN_VISIBLE,
   GIMP_ACTION_VIEW_COLUMN_ACTION,
   GIMP_ACTION_VIEW_COLUMN_STOCK_ID,
   GIMP_ACTION_VIEW_COLUMN_LABEL,
+  GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD,
   GIMP_ACTION_VIEW_COLUMN_NAME,
   GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY,
   GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK,
@@ -52,6 +54,8 @@
 
   GimpUIManager *manager;
   gboolean       show_shortcuts;
+
+  gchar         *filter;
 };
 
 struct _GimpActionViewClass
@@ -60,11 +64,14 @@
 };
 
 
-GType       gimp_action_view_get_type (void) G_GNUC_CONST;
+GType       gimp_action_view_get_type   (void) G_GNUC_CONST;
+
+GtkWidget * gimp_action_view_new        (GimpUIManager  *manager,
+                                         const gchar    *select_action,
+                                         gboolean        show_shortcuts);
 
-GtkWidget * gimp_action_view_new      (GimpUIManager *manager,
-                                       const gchar   *select_action,
-                                       gboolean       show_shortcuts);
+void        gimp_action_view_set_filter (GimpActionView *view,
+                                         const gchar    *filter);
 
 
 #endif  /*  __GIMP_ACTION_VIEW_H__  */

Modified: branches/soc-2008-tagging/app/widgets/gimpbufferview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpbufferview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpbufferview.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpchanneltreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpchanneltreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpchanneltreeview.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -211,7 +212,7 @@
 
       gimp_item_set_linked (new_item, FALSE, FALSE);
 
-      item_view_class->add_item (item_view->image, new_item, index);
+      item_view_class->add_item (item_view->image, new_item, index, TRUE);
       gimp_image_flush (item_view->image);
       return;
     }
@@ -261,7 +262,8 @@
   if (src_image != item_view->image)
     GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, item_view->image);
 
-  gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index);
+  gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index,
+                          TRUE);
   gimp_image_flush (item_view->image);
 }
 
@@ -320,7 +322,7 @@
                                   gimp_image_get_height (image),
                                   _("Empty Channel"), &color);
 
-  gimp_image_add_channel (image, new_channel, -1);
+  gimp_image_add_channel (image, new_channel, -1, TRUE);
 
   gimp_image_undo_group_end (image);
 

Modified: branches/soc-2008-tagging/app/widgets/gimpcolorframe.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcolorframe.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcolorframe.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c	Sun Oct 12 15:38:02 2008
@@ -25,6 +25,7 @@
 #endif
 #undef GTK_DISABLE_DEPRECATED
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -219,7 +220,7 @@
   gtk_widget_show (table);
 
   editor->index_spinbutton = gimp_spin_button_new (&adj,
-                                                   0, 0, 0, 1, 10, 10, 1.0, 0);
+                                                   0, 0, 0, 1, 10, 0, 1.0, 0);
   editor->index_adjustment = GTK_ADJUSTMENT (adj);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("Color index:"), 0.0, 0.5,

Modified: branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c	Sun Oct 12 15:38:02 2008
@@ -513,6 +513,8 @@
     }
 
   parent_view_iface->set_container (view, container);
+
+  gtk_tree_view_columns_autosize (tree_view->view);
 }
 
 static void
@@ -574,6 +576,8 @@
     {
       gtk_list_store_remove (GTK_LIST_STORE (tree_view->model), iter);
 
+      gtk_tree_view_columns_autosize (tree_view->view);
+
       /*  If the store is empty after this remove, clear out renderers
        *  from all cells so they don't keep refing the viewables
        *  (see bug #149906).
@@ -673,12 +677,21 @@
   if (iter)
     {
       gchar *name = gimp_viewable_get_description (viewable, NULL);
+      gchar *old_name;
+
+      gtk_tree_model_get (tree_view->model, iter,
+                          COLUMN_NAME, &old_name,
+                          -1);
 
       gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
                           COLUMN_NAME, name,
                           -1);
 
+      if (name && old_name && strlen (name) < strlen (old_name))
+        gtk_tree_view_columns_autosize (tree_view->view);
+
       g_free (name);
+      g_free (old_name);
     }
 }
 

Modified: branches/soc-2008-tagging/app/widgets/gimpcontrollereditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontrollereditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontrollereditor.c	Sun Oct 12 15:38:02 2008
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
  *
  * gimpcontrollereditor.c
- * Copyright (C) 2004 Michael Natterer <mitch gimp org>
+ * Copyright (C) 2004-2008 Michael Natterer <mitch gimp org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@
 
 #include "core/gimpcontext.h"
 
+#include "gimpactioneditor.h"
 #include "gimpactionview.h"
 #include "gimpcontrollereditor.h"
 #include "gimpcontrollerinfo.h"
@@ -654,7 +655,6 @@
 
   if (event_name)
     {
-      GtkWidget *scrolled_window;
       GtkWidget *view;
       gchar     *title;
 
@@ -694,25 +694,18 @@
                         G_CALLBACK (gimp_controller_editor_edit_response),
                         editor);
 
-      scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-      gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
-                                           GTK_SHADOW_IN);
-      gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 12);
+      view = gimp_action_editor_new (gimp_ui_managers_from_name ("<Image>")->data,
+                                     action_name, FALSE);
+      gtk_container_set_border_width (GTK_CONTAINER (view), 12);
       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (editor->edit_dialog)->vbox),
-                         scrolled_window);
-      gtk_widget_show (scrolled_window);
-
-      view = gimp_action_view_new (gimp_ui_managers_from_name ("<Image>")->data,
-                                   action_name, FALSE);
-      gtk_widget_set_size_request (view, 300, 400);
-      gtk_container_add (GTK_CONTAINER (scrolled_window), view);
+                         view);
       gtk_widget_show (view);
 
-      g_signal_connect (view, "row-activated",
+      g_signal_connect (GIMP_ACTION_EDITOR (view)->view, "row-activated",
                         G_CALLBACK (gimp_controller_editor_edit_activated),
                         editor);
 
-      editor->edit_sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
+      editor->edit_sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (GIMP_ACTION_EDITOR (view)->view));
 
       g_object_add_weak_pointer (G_OBJECT (editor->edit_sel),
                                  (gpointer) &editor->edit_sel);
@@ -803,7 +796,7 @@
       g_free (stock_id);
       g_free (action_name);
 
-      gimp_controller_editor_sel_changed (editor->edit_sel, editor);
+      gimp_controller_editor_sel_changed (editor->sel, editor);
     }
 
   gtk_widget_destroy (dialog);

Modified: branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c	Sun Oct 12 15:38:02 2008
@@ -42,7 +42,7 @@
   const guint            keyval;
   const GdkModifierType  modifiers;
   const gchar           *name;
-  gchar                 *blurb;
+  const gchar           *blurb;
 };
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimpcontrollerwheel.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontrollerwheel.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontrollerwheel.c	Sun Oct 12 15:38:02 2008
@@ -44,7 +44,7 @@
   const GdkScrollDirection  direction;
   const GdkModifierType     modifiers;
   const gchar              *name;
-  gchar                    *blurb;
+  const gchar              *blurb;
 };
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimpcursorview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcursorview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcursorview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpdialogfactory.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdialogfactory.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdialogfactory.c	Sun Oct 12 15:38:02 2008
@@ -146,6 +146,7 @@
   factory->registered_dialogs = NULL;
   factory->session_infos      = NULL;
   factory->open_dialogs       = NULL;
+  factory->toggle_visibility  = FALSE;
 }
 
 static void
@@ -237,7 +238,8 @@
 gimp_dialog_factory_new (const gchar       *name,
                          GimpContext       *context,
                          GimpMenuFactory   *menu_factory,
-                         GimpDialogNewFunc  new_dock_func)
+                         GimpDialogNewFunc  new_dock_func,
+                         gboolean           toggle_visibility)
 {
   GimpDialogFactory *factory;
   gpointer           key;
@@ -267,9 +269,10 @@
   g_hash_table_insert (GIMP_DIALOG_FACTORY_GET_CLASS (factory)->factories,
                        key, factory);
 
-  factory->context       = context;
-  factory->menu_factory  = menu_factory;
-  factory->new_dock_func = new_dock_func;
+  factory->context           = context;
+  factory->menu_factory      = menu_factory;
+  factory->new_dock_func     = new_dock_func;
+  factory->toggle_visibility = toggle_visibility;
 
   return factory;
 }
@@ -1405,24 +1408,29 @@
 {
   GList *list;
 
+  if (! factory->toggle_visibility)
+    return;
+
   for (list = factory->open_dialogs; list; list = g_list_next (list))
     {
-      if (GTK_IS_WIDGET (list->data) && GTK_WIDGET_TOPLEVEL (list->data))
+      GtkWidget *widget = list->data;
+
+      if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget))
         {
           GimpDialogVisibilityState visibility = GIMP_DIALOG_VISIBILITY_UNKNOWN;
 
-          if (GTK_WIDGET_VISIBLE (list->data))
+          if (GTK_WIDGET_VISIBLE (widget))
             {
               visibility = GIMP_DIALOG_VISIBILITY_VISIBLE;
 
-              gtk_widget_hide (GTK_WIDGET (list->data));
+              gtk_widget_hide (widget);
             }
           else
             {
               visibility = GIMP_DIALOG_VISIBILITY_INVISIBLE;
             }
 
-          g_object_set_data (G_OBJECT (list->data),
+          g_object_set_data (G_OBJECT (widget),
                              GIMP_DIALOG_VISIBILITY_KEY,
                              GINT_TO_POINTER (visibility));
         }
@@ -1438,26 +1446,26 @@
 
   for (list = factory->open_dialogs; list; list = g_list_next (list))
     {
-      if (GTK_IS_WIDGET (list->data) && GTK_WIDGET_TOPLEVEL (list->data))
+      GtkWidget *widget = list->data;
+
+      if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget))
         {
           GimpDialogVisibilityState visibility;
 
           visibility =
-            GPOINTER_TO_INT (g_object_get_data (G_OBJECT (list->data),
+            GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
                                                 GIMP_DIALOG_VISIBILITY_KEY));
 
-          if (! GTK_WIDGET_VISIBLE (list->data) &&
+          if (! GTK_WIDGET_VISIBLE (widget) &&
               visibility == GIMP_DIALOG_VISIBILITY_VISIBLE)
             {
-              GtkWindow *window = GTK_WINDOW (list->data);
-
               /* Don't use gtk_window_present() here, we don't want the
                * keyboard focus to move.
                */
-              gtk_widget_show (GTK_WIDGET (window));
+              gtk_widget_show (widget);
 
-              if (GTK_WIDGET_VISIBLE (window))
-                gdk_window_raise (GTK_WIDGET (window)->window);
+              if (GTK_WIDGET_VISIBLE (widget))
+                gdk_window_raise (widget->window);
             }
         }
     }

Modified: branches/soc-2008-tagging/app/widgets/gimpdialogfactory.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdialogfactory.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdialogfactory.h	Sun Oct 12 15:38:02 2008
@@ -87,6 +87,7 @@
   GList                 *session_infos;
 
   GList                 *open_dialogs;
+  gboolean               toggle_visibility;
 };
 
 struct _GimpDialogFactoryClass
@@ -107,7 +108,8 @@
 GimpDialogFactory * gimp_dialog_factory_new       (const gchar       *name,
                                                    GimpContext       *context,
                                                    GimpMenuFactory   *menu_factory,
-                                                   GimpDialogNewFunc  new_dock_func);
+                                                   GimpDialogNewFunc  new_dock_func,
+                                                   gboolean           toggle_visibility);
 
 GimpDialogFactory * gimp_dialog_factory_from_name (const gchar       *name);
 

Modified: branches/soc-2008-tagging/app/widgets/gimpdnd-xds.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdnd-xds.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdnd-xds.c	Sun Oct 12 15:38:02 2008
@@ -29,6 +29,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpdnd.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdnd.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdnd.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpdock.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdock.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdock.c	Sun Oct 12 15:38:02 2008
@@ -40,15 +40,15 @@
 #include "gimpdockseparator.h"
 #include "gimpwidgets-utils.h"
 
-#include "gimpsessioninfo.h" /* FIXME */
+#include "gimpsessioninfo.h"    /* FIXME */
 #include "core/gimpcontainer.h" /* FIXME */
-#include "dialogs/dialogs.h" /* FIXME */
+#include "dialogs/dialogs.h"    /* FIXME */
 
 #include "gimp-intl.h"
 
 
-#define DEFAULT_DOCK_HEIGHT 300
-
+#define DEFAULT_DOCK_HEIGHT     300
+#define DEFAULT_DOCK_FONT_SCALE PANGO_SCALE_SMALL
 
 enum
 {
@@ -156,6 +156,13 @@
                                                              -1, G_MAXINT,
                                                              DEFAULT_DOCK_HEIGHT,
                                                              GIMP_PARAM_READABLE));
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_double ("font-scale",
+                                                                NULL, NULL,
+                                                                0.0,
+                                                                G_MAXDOUBLE,
+                                                                DEFAULT_DOCK_FONT_SCALE,
+                                                                GIMP_PARAM_READABLE));
 }
 
 static void
@@ -186,7 +193,7 @@
   gtk_container_add (GTK_CONTAINER (dock->main_vbox), dock->vbox);
   gtk_widget_show (dock->vbox);
 
-  separator = gimp_dock_separator_new (dock);
+  separator = gimp_dock_separator_new (dock, GTK_ANCHOR_NORTH);
   gtk_box_pack_start (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0);
   gtk_widget_show (separator);
 }
@@ -312,42 +319,53 @@
 gimp_dock_style_set (GtkWidget *widget,
                      GtkStyle  *prev_style)
 {
-  PangoContext         *context;
-  PangoFontDescription *font_desc;
-  gint                  font_size;
-  gint                  default_height;
-  gchar                *font_str;
-  gchar                *rc_string;
+  gint    default_height;
+  gdouble font_scale;
 
   GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
 
-  gtk_widget_style_get (widget, "default-height", &default_height, NULL);
+  gtk_widget_style_get (widget,
+                        "default-height", &default_height,
+                        "font-scale",     &font_scale,
+                        NULL);
 
   gtk_window_set_default_size (GTK_WINDOW (widget), -1, default_height);
 
-  context = gtk_widget_get_pango_context (widget);
-  font_desc = pango_context_get_font_description (context);
-  font_desc = pango_font_description_copy (font_desc);
-
-  font_size = pango_font_description_get_size (font_desc);
-  font_size = PANGO_SCALE_SMALL * font_size;
-  pango_font_description_set_size (font_desc, font_size);
-
-  font_str = pango_font_description_to_string (font_desc);
-  pango_font_description_free (font_desc);
-
-  rc_string =
-    g_strdup_printf ("style \"gimp-dock-style\""
-                     "{"
-                     "  font_name = \"%s\""
-                     "}"
-                     "widget \"gimp-dock-%d.*\" style \"gimp-dock-style\"",
-                     font_str,
-                     GIMP_DOCK (widget)->ID);
-  g_free (font_str);
+  if (font_scale != 1.0)
+    {
+      PangoContext         *context;
+      PangoFontDescription *font_desc;
+      gint                  font_size;
+      gchar                *font_str;
+      gchar                *rc_string;
+
+      context = gtk_widget_get_pango_context (widget);
+      font_desc = pango_context_get_font_description (context);
+      font_desc = pango_font_description_copy (font_desc);
+
+      font_size = pango_font_description_get_size (font_desc);
+      font_size = font_scale * font_size;
+      pango_font_description_set_size (font_desc, font_size);
+
+      font_str = pango_font_description_to_string (font_desc);
+      pango_font_description_free (font_desc);
+
+      rc_string =
+        g_strdup_printf ("style \"gimp-dock-style\""
+                         "{"
+                         "  font_name = \"%s\""
+                         "}"
+                         "widget \"gimp-dock-%d.*\" style \"gimp-dock-style\"",
+                         font_str,
+                         GIMP_DOCK (widget)->ID);
+      g_free (font_str);
 
-  gtk_rc_parse_string (rc_string);
-  g_free (rc_string);
+      gtk_rc_parse_string (rc_string);
+      g_free (rc_string);
+
+      if (gtk_bin_get_child (GTK_BIN (widget)))
+        gtk_widget_reset_rc_styles (gtk_bin_get_child (GTK_BIN (widget)));
+    }
 }
 
 static void
@@ -454,7 +472,7 @@
       gtk_box_pack_start (GTK_BOX (dock->vbox), GTK_WIDGET (dockbook),
                           TRUE, TRUE, 0);
 
-      separator = gimp_dock_separator_new (dock);
+      separator = gimp_dock_separator_new (dock, GTK_ANCHOR_SOUTH);
       gtk_box_pack_end (GTK_BOX (dock->vbox), separator, FALSE, FALSE, 0);
       gtk_widget_show (separator);
     }

Modified: branches/soc-2008-tagging/app/widgets/gimpdockable.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockable.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockable.c	Sun Oct 12 15:38:02 2008
@@ -89,7 +89,7 @@
                                                    GtkWidget      *widget);
 static GType      gimp_dockable_child_type        (GtkContainer   *container);
 static void       gimp_dockable_forall            (GtkContainer   *container,
-                                                   gboolean       include_internals,
+                                                   gboolean        include_internals,
                                                    GtkCallback     callback,
                                                    gpointer        callback_data);
 
@@ -692,6 +692,21 @@
 }
 
 static GtkWidget *
+gimp_dockable_get_icon (GimpDockable *dockable,
+                        GtkIconSize   size)
+{
+  GdkScreen    *screen = gtk_widget_get_screen (GTK_WIDGET (dockable));
+  GtkIconTheme *theme  = gtk_icon_theme_get_for_screen (screen);
+
+  if (gtk_icon_theme_has_icon (theme, dockable->stock_id))
+    {
+      return gtk_image_new_from_icon_name (dockable->stock_id, size);
+    }
+
+  return  gtk_image_new_from_stock (dockable->stock_id, size);
+}
+
+static GtkWidget *
 gimp_dockable_get_tab_widget_internal (GimpDockable *dockable,
                                        GimpContext  *context,
                                        GimpTabStyle  tab_style,
@@ -725,7 +740,7 @@
     case GIMP_TAB_STYLE_ICON:
     case GIMP_TAB_STYLE_ICON_NAME:
     case GIMP_TAB_STYLE_ICON_BLURB:
-      icon = gtk_image_new_from_stock (dockable->stock_id, size);
+      icon = gimp_dockable_get_icon (dockable, size);
       break;
 
     case GIMP_TAB_STYLE_PREVIEW:
@@ -739,7 +754,7 @@
                                           context, size);
 
         if (! icon)
-          icon = gtk_image_new_from_stock (dockable->stock_id, size);
+          icon = gimp_dockable_get_icon (dockable, size);
       }
       break;
 
@@ -1213,6 +1228,17 @@
                     "visible",  TRUE,
                     NULL);
 
+      if (dockable->stock_id)
+        {
+          if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
+                                       dockable->stock_id))
+            {
+              g_object_set (parent_menu_action,
+                            "icon-name", dockable->stock_id,
+                            NULL);
+            }
+        }
+
       if (! GTK_IS_MENU (child_menu_widget))
         {
           g_warning ("%s: child_menu_widget (%p) is not a GtkMenu",
@@ -1222,8 +1248,8 @@
 
       /* FIXME */
       {
-        GtkWidget *image = gtk_image_new_from_stock (dockable->stock_id,
-                                                     GTK_ICON_SIZE_MENU);
+        GtkWidget *image = gimp_dockable_get_icon (dockable,
+                                                   GTK_ICON_SIZE_MENU);
 
         gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (parent_menu_widget),
                                        image);

Modified: branches/soc-2008-tagging/app/widgets/gimpdockseparator.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockseparator.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockseparator.c	Sun Oct 12 15:38:02 2008
@@ -196,22 +196,14 @@
       if (dockable)
         {
           GtkWidget *dockbook;
-          GtkWidget *parent;
-          GList     *children;
-          gint       index;
+          gint       index = -1;
 
           g_object_set_data (G_OBJECT (dockable),
                              "gimp-dock-drag-widget", NULL);
 
-          parent = gtk_widget_get_parent (widget);
-
-          children = gtk_container_get_children (GTK_CONTAINER (parent));
-          index = g_list_index (children, widget);
-          g_list_free (children);
-
-          if (index == 0)
+          if (separator->anchor == GTK_ANCHOR_NORTH)
             index = 0;
-          else if (index == 2)
+          else if (separator->anchor == GTK_ANCHOR_SOUTH)
             index = -1;
 
           /*  if dropping to the same dock, take care that we don't try
@@ -219,8 +211,9 @@
            */
           if (dockable->dockbook->dock == dock)
             {
-              gint n_books;
-              gint n_dockables;
+              GList *children;
+              gint   n_books;
+              gint   n_dockables;
 
               n_books = g_list_length (dock->dockbooks);
 
@@ -255,7 +248,8 @@
 /*  public functions  */
 
 GtkWidget *
-gimp_dock_separator_new (GimpDock *dock)
+gimp_dock_separator_new (GimpDock      *dock,
+                         GtkAnchorType  anchor)
 {
   GimpDockSeparator *separator;
 
@@ -263,7 +257,8 @@
 
   separator = g_object_new (GIMP_TYPE_DOCK_SEPARATOR, NULL);
 
-  separator->dock = dock;
+  separator->dock   = dock;
+  separator->anchor = anchor;
 
   return GTK_WIDGET (separator);
 }

Modified: branches/soc-2008-tagging/app/widgets/gimpdockseparator.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockseparator.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockseparator.h	Sun Oct 12 15:38:02 2008
@@ -35,12 +35,14 @@
 
 struct _GimpDockSeparator
 {
-  GtkEventBox  parent_instance;
+  GtkEventBox    parent_instance;
 
-  GimpDock    *dock;
+  GimpDock      *dock;
 
-  GtkWidget   *frame;
-  GtkWidget   *label;
+  GtkWidget     *frame;
+  GtkWidget     *label;
+
+  GtkAnchorType  anchor;
 };
 
 struct _GimpDockSeparatorClass
@@ -51,7 +53,8 @@
 
 GType       gimp_dock_separator_get_type       (void) G_GNUC_CONST;
 
-GtkWidget * gimp_dock_separator_new            (GimpDock          *dock);
+GtkWidget * gimp_dock_separator_new            (GimpDock          *dock,
+                                                GtkAnchorType      anchor);
 
 void        gimp_dock_separator_set_show_label (GimpDockSeparator *separator,
                                                 gboolean           show);

Modified: branches/soc-2008-tagging/app/widgets/gimpdrawabletreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdrawabletreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpdrawabletreeview.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "widgets-types.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpfiledialog.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpfiledialog.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpfiledialog.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -403,10 +404,22 @@
 }
 
 void
-gimp_file_dialog_set_image (GimpFileDialog *dialog,
-                            GimpImage      *image,
-                            gboolean        save_a_copy,
-                            gboolean        close_after_saving)
+gimp_file_dialog_set_open_image (GimpFileDialog *dialog,
+                                 GimpImage      *image,
+                                 gboolean        open_as_layers)
+{
+  g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog));
+  g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image));
+
+  dialog->image          = image;
+  dialog->open_as_layers = open_as_layers;
+}
+
+void
+gimp_file_dialog_set_save_image (GimpFileDialog *dialog,
+                                 GimpImage      *image,
+                                 gboolean        save_a_copy,
+                                 gboolean        close_after_saving)
 {
   const gchar *uri = NULL;
   gchar       *dirname;

Modified: branches/soc-2008-tagging/app/widgets/gimpfiledialog.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpfiledialog.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpfiledialog.h	Sun Oct 12 15:38:02 2008
@@ -42,6 +42,7 @@
   GimpPlugInProcedure  *file_proc;
 
   GimpImage            *image;
+  gboolean              open_as_layers;
   gboolean              save_a_copy;
   gboolean              close_after_saving;
 
@@ -63,25 +64,28 @@
 typedef struct _GimpFileDialogState GimpFileDialogState;
 
 
-GType       gimp_file_dialog_get_type      (void) G_GNUC_CONST;
+GType       gimp_file_dialog_get_type       (void) G_GNUC_CONST;
 
-GtkWidget * gimp_file_dialog_new           (Gimp                 *gimp,
-                                            GtkFileChooserAction  action,
-                                            const gchar          *title,
-                                            const gchar          *role,
-                                            const gchar          *stock_id,
-                                            const gchar          *help_id);
-
-void        gimp_file_dialog_set_sensitive (GimpFileDialog       *dialog,
-                                            gboolean              sensitive);
-
-void        gimp_file_dialog_set_file_proc (GimpFileDialog       *dialog,
-                                            GimpPlugInProcedure  *file_proc);
-
-void        gimp_file_dialog_set_image     (GimpFileDialog       *dialog,
-                                            GimpImage            *image,
-                                            gboolean              save_a_copy,
-                                            gboolean              close_after_saving);
+GtkWidget * gimp_file_dialog_new            (Gimp                 *gimp,
+                                             GtkFileChooserAction  action,
+                                             const gchar          *title,
+                                             const gchar          *role,
+                                             const gchar          *stock_id,
+                                             const gchar          *help_id);
+
+void        gimp_file_dialog_set_sensitive  (GimpFileDialog       *dialog,
+                                             gboolean              sensitive);
+
+void        gimp_file_dialog_set_file_proc  (GimpFileDialog       *dialog,
+                                             GimpPlugInProcedure  *file_proc);
+
+void        gimp_file_dialog_set_open_image (GimpFileDialog       *dialog,
+                                             GimpImage            *image,
+                                             gboolean              open_as_layers);
+void        gimp_file_dialog_set_save_image (GimpFileDialog       *dialog,
+                                             GimpImage            *image,
+                                             gboolean              save_a_copy,
+                                             gboolean              close_after_saving);
 
 GimpFileDialogState * gimp_file_dialog_get_state     (GimpFileDialog      *dialog);
 void                  gimp_file_dialog_set_state     (GimpFileDialog      *dialog,

Modified: branches/soc-2008-tagging/app/widgets/gimphelp-ids.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp-ids.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp-ids.h	Sun Oct 12 15:38:02 2008
@@ -478,7 +478,6 @@
 #define GIMP_HELP_EXPORT_CONFIRM_DIALOG           "gimp-export-confirm-dialog"
 #define GIMP_HELP_UNIT_DIALOG                     "gimp-unit-dialog"
 
-#define GIMP_HELP_WINDOWS_SHOW_IMAGE_WINDOW       "gimp-windows-show-image-window"
 #define GIMP_HELP_WINDOWS_SHOW_DOCK               "gimp-windows-show-dock"
 #define GIMP_HELP_WINDOWS_OPEN_RECENT_DOCK        "gimp-windows-open-recent-dock"
 
@@ -500,5 +499,7 @@
 #define GIMP_HELP_CONTROLLER_MIDI                 "gimp-controller-midi"
 #define GIMP_HELP_CONTROLLER_WHEEL                "gimp-controller-wheel"
 
+#define GIMP_HELP_CONFIG_USE_GEGL                 "gimp-config-use-gegl"
+
 
 #endif /* __GIMP_HELP_IDS_H__ */

Modified: branches/soc-2008-tagging/app/widgets/gimphelp.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp.c	Sun Oct 12 15:38:02 2008
@@ -48,7 +48,7 @@
 #include "gimpmessagebox.h"
 #include "gimpmessagedialog.h"
 #include "gimpmessagedialog.h"
-#include "gimpwidgets-utils.c"
+#include "gimpwidgets-utils.h"
 
 #include "gimp-log.h"
 #include "gimp-intl.h"
@@ -503,13 +503,13 @@
   *domain_names = g_new0 (gchar *, n_domains + 1);
   *domain_uris  = g_new0 (gchar *, n_domains + 1);
 
-  *domain_names[0] = g_strdup ("http://www.gimp.org/help";);
-  *domain_uris[0]  = gimp_help_get_default_domain_uri (gimp);
+  (*domain_names)[0] = g_strdup ("http://www.gimp.org/help";);
+  (*domain_uris)[0]  = gimp_help_get_default_domain_uri (gimp);
 
   for (i = 0; i < n_domains; i++)
     {
-      *domain_names[i + 1] = plug_in_domains[i];
-      *domain_uris[i + 1]  = plug_in_uris[i];
+      (*domain_names)[i + 1] = plug_in_domains[i];
+      (*domain_uris)[i + 1]  = plug_in_uris[i];
     }
 
   g_free (plug_in_domains);

Modified: branches/soc-2008-tagging/app/widgets/gimphistogrameditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphistogrameditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimphistogrameditor.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpimagecommenteditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimagecommenteditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimagecommenteditor.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpimageeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimageeditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimageeditor.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "widgets-types.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpimageparasiteview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimageparasiteview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimageparasiteview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpimageprofileview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimageprofileview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimageprofileview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpimagepropview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimagepropview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimagepropview.c	Sun Oct 12 15:38:02 2008
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #endif
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <glib/gstdio.h>
 

Modified: branches/soc-2008-tagging/app/widgets/gimpimageview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpimageview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpimageview.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -734,7 +735,7 @@
 
       gimp_item_set_linked (new_item, FALSE, FALSE);
 
-      item_view_class->add_item (item_view->image, new_item, dest_index);
+      item_view_class->add_item (item_view->image, new_item, dest_index, TRUE);
     }
   else if (dest_viewable)
     {

Modified: branches/soc-2008-tagging/app/widgets/gimpitemtreeview.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpitemtreeview.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpitemtreeview.h	Sun Oct 12 15:38:02 2008
@@ -37,9 +37,12 @@
                                                   const gchar     *undo_desc);
 typedef void            (* GimpAddItemFunc)      (GimpImage       *image,
                                                   GimpItem        *item,
-                                                  gint             index);
+                                                  gint             index,
+                                                  gboolean         push_undo);
 typedef void            (* GimpRemoveItemFunc)   (GimpImage       *image,
-                                                  GimpItem        *item);
+                                                  GimpItem        *item,
+                                                  gboolean         push_undo,
+                                                  GimpItem        *new_active);
 typedef GimpItem      * (* GimpNewItemFunc)      (GimpImage       *image);
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimplayertreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimplayertreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimplayertreeview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -772,7 +773,7 @@
   gimp_object_take_name (GIMP_OBJECT (new_item),
                          g_strdup_printf (_("%s Channel Copy"), desc));
 
-  gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index);
+  gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index, TRUE);
   gimp_image_flush (item_view->image);
 }
 
@@ -801,7 +802,7 @@
                                 _("Dropped Buffer"),
                                 GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
 
-  gimp_image_add_layer (image, new_layer, index);
+  gimp_image_add_layer (image, new_layer, index, TRUE);
   gimp_image_flush (image);
 }
 
@@ -840,7 +841,7 @@
                               gimp_image_base_type_with_alpha (image),
                               _("Empty Layer"), 1.0, GIMP_NORMAL_MODE);
 
-  gimp_image_add_layer (image, new_layer, -1);
+  gimp_image_add_layer (image, new_layer, -1, TRUE);
 
   gimp_image_undo_group_end (image);
 
@@ -1001,7 +1002,7 @@
 
   if (layer)
     {
-      gdouble opacity = adjustment->value / 100.0;
+      gdouble opacity = gtk_adjustment_get_value (adjustment) / 100.0;
 
       if (gimp_layer_get_opacity (layer) != opacity)
         {
@@ -1078,7 +1079,8 @@
                gimp_layer_tree_view_lock_alpha_button_toggled);
     }
 
-  if (gimp_layer_get_opacity (layer) * 100.0 != view->opacity_adjustment->value)
+  if (gimp_layer_get_opacity (layer) * 100.0 !=
+      gtk_adjustment_get_value (view->opacity_adjustment))
     {
       BLOCK (view->opacity_adjustment,
              gimp_layer_tree_view_opacity_scale_changed);

Modified: branches/soc-2008-tagging/app/widgets/gimpmenudock.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpmenudock.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpmenudock.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpnavigationview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpnavigationview.c	Sun Oct 12 15:38:02 2008
@@ -24,6 +24,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -38,7 +39,7 @@
 #include "gimpviewrenderer.h"
 
 
-#define BORDER_PEN_WIDTH 3
+#define BORDER_WIDTH 2
 
 
 enum
@@ -69,17 +70,13 @@
   gint         motion_offset_x;
   gint         motion_offset_y;
   gboolean     has_grab;
-
-  GdkGC       *gc;
 };
 
 
-static void     gimp_navigation_view_realize        (GtkWidget      *widget);
-static void     gimp_navigation_view_unrealize      (GtkWidget      *widget);
 static void     gimp_navigation_view_size_allocate  (GtkWidget      *widget,
                                                      GtkAllocation  *allocation);
 static gboolean gimp_navigation_view_expose         (GtkWidget      *widget,
-                                                     GdkEventExpose *eevent);
+                                                     GdkEventExpose *event);
 static gboolean gimp_navigation_view_button_press   (GtkWidget      *widget,
                                                      GdkEventButton *bevent);
 static gboolean gimp_navigation_view_button_release (GtkWidget      *widget,
@@ -93,7 +90,13 @@
 
 static void     gimp_navigation_view_transform      (GimpNavigationView *nav_view);
 static void     gimp_navigation_view_draw_marker    (GimpNavigationView *nav_view,
-                                                     GdkRectangle       *area);
+                                                     cairo_t            *cr);
+static void     gimp_navigation_view_move_to        (GimpNavigationView *nav_view,
+                                                     gint                tx,
+                                                     gint                ty);
+static void     gimp_navigation_view_get_ratio      (GimpNavigationView *nav_view,
+                                                     gdouble            *ratiox,
+                                                     gdouble            *ratioy);
 
 
 G_DEFINE_TYPE (GimpNavigationView, gimp_navigation_view, GIMP_TYPE_VIEW)
@@ -141,8 +144,6 @@
                   G_TYPE_NONE, 1,
                   GDK_TYPE_SCROLL_DIRECTION);
 
-  widget_class->realize              = gimp_navigation_view_realize;
-  widget_class->unrealize            = gimp_navigation_view_unrealize;
   widget_class->size_allocate        = gimp_navigation_view_size_allocate;
   widget_class->expose_event         = gimp_navigation_view_expose;
   widget_class->button_press_event   = gimp_navigation_view_button_press;
@@ -172,37 +173,6 @@
   view->motion_offset_x = 0;
   view->motion_offset_y = 0;
   view->has_grab        = FALSE;
-
-  view->gc              = NULL;
-}
-
-static void
-gimp_navigation_view_realize (GtkWidget *widget)
-{
-  GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
-
-  GTK_WIDGET_CLASS (parent_class)->realize (widget);
-
-  nav_view->gc = gdk_gc_new (widget->window);
-
-  gdk_gc_set_function (nav_view->gc, GDK_INVERT);
-  gdk_gc_set_line_attributes (nav_view->gc,
-                              BORDER_PEN_WIDTH,
-                              GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
-}
-
-static void
-gimp_navigation_view_unrealize (GtkWidget *widget)
-{
-  GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
-
-  if (nav_view->gc)
-    {
-      g_object_unref (nav_view->gc);
-      nav_view->gc = NULL;
-    }
-
-  GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
 }
 
 static void
@@ -217,55 +187,25 @@
 
 static gboolean
 gimp_navigation_view_expose (GtkWidget      *widget,
-                             GdkEventExpose *eevent)
+                             GdkEventExpose *event)
 {
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
+      cairo_t *cr;
 
-      gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget),
-                                        &eevent->area);
-    }
+      GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
 
-  return TRUE;
-}
+      cr = gdk_cairo_create (widget->window);
 
-static void
-gimp_navigation_view_move_to (GimpNavigationView *nav_view,
-                              gint                tx,
-                              gint                ty)
-{
-  GimpView  *view = GIMP_VIEW (nav_view);
-  GimpImage *image;
-  gdouble    ratiox, ratioy;
-  gdouble    x, y;
+      gdk_cairo_region (cr, event->region);
+      cairo_clip (cr);
 
-  if (! view->renderer->viewable)
-    return;
-
-  tx = CLAMP (tx, 0, view->renderer->width  - nav_view->p_width);
-  ty = CLAMP (ty, 0, view->renderer->height - nav_view->p_height);
-
-  image = GIMP_IMAGE (view->renderer->viewable);
-
-  /*  transform to image coordinates  */
-  if (view->renderer->width != nav_view->p_width)
-    ratiox = ((gimp_image_get_width (image) - nav_view->width + 1.0) /
-              (view->renderer->width - nav_view->p_width));
-  else
-    ratiox = 1.0;
-
-  if (view->renderer->height != nav_view->p_height)
-    ratioy = ((gimp_image_get_height (image) - nav_view->height + 1.0) /
-              (view->renderer->height - nav_view->p_height));
-  else
-    ratioy = 1.0;
+      gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget), cr);
 
-  x = tx * ratiox;
-  y = ty * ratioy;
+      cairo_destroy (cr);
+    }
 
-  g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
-                 x, y, nav_view->width, nav_view->height);
+  return TRUE;
 }
 
 void
@@ -285,12 +225,12 @@
 
   window = GIMP_VIEW (nav_view)->event_window;
 
-  gdk_pointer_grab (window, TRUE,
+  gdk_pointer_grab (window, FALSE,
                     GDK_BUTTON_RELEASE_MASK      |
                     GDK_POINTER_MOTION_HINT_MASK |
                     GDK_BUTTON_MOTION_MASK       |
                     GDK_EXTENSION_EVENTS_ALL,
-                    window, cursor, GDK_CURRENT_TIME);
+                    NULL, cursor, GDK_CURRENT_TIME);
 
   gdk_cursor_unref (cursor);
 }
@@ -413,7 +353,6 @@
 {
   GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
   GimpView           *view     = GIMP_VIEW (widget);
-  gint                x, y;
 
   if (! nav_view->has_grab)
     {
@@ -446,11 +385,9 @@
       return FALSE;
     }
 
-  gdk_window_get_pointer (view->event_window, &x, &y, NULL);
-
   gimp_navigation_view_move_to (nav_view,
-                                x - nav_view->motion_offset_x,
-                                y - nav_view->motion_offset_y);
+                                mevent->x - nav_view->motion_offset_x,
+                                mevent->y - nav_view->motion_offset_y);
 
   gdk_event_request_motions (mevent);
 
@@ -498,63 +435,8 @@
   return FALSE;
 }
 
-static void
-gimp_navigation_view_transform (GimpNavigationView *nav_view)
-{
-  GimpView  *view = GIMP_VIEW (nav_view);
-  GimpImage *image;
-  gdouble    ratiox, ratioy;
-
-  image = GIMP_IMAGE (view->renderer->viewable);
-
-  ratiox = ((gdouble) view->renderer->width  /
-            (gdouble) gimp_image_get_width  (image));
-  ratioy = ((gdouble) view->renderer->height /
-            (gdouble) gimp_image_get_height (image));
-
-  nav_view->p_x = RINT (nav_view->x * ratiox);
-  nav_view->p_y = RINT (nav_view->y * ratioy);
-
-  nav_view->p_width  = RINT (nav_view->width  * ratiox);
-  nav_view->p_height = RINT (nav_view->height * ratioy);
-}
-
-static void
-gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
-                                  GdkRectangle       *area)
-{
-  GimpView *view = GIMP_VIEW (nav_view);
-
-  if (view->renderer->viewable  &&
-      nav_view->width           &&
-      nav_view->height)
-    {
-      GimpImage *image;
-
-      image = GIMP_IMAGE (view->renderer->viewable);
-
-      if (nav_view->x      > 0                             ||
-          nav_view->y      > 0                             ||
-          nav_view->width  < gimp_image_get_width  (image) ||
-          nav_view->height < gimp_image_get_height (image))
-        {
-          GtkWidget *widget = GTK_WIDGET (view);
-
-          if (area)
-            gdk_gc_set_clip_rectangle (nav_view->gc, area);
-
-          gdk_draw_rectangle (widget->window, nav_view->gc,
-                              FALSE,
-                              widget->allocation.x + nav_view->p_x + 1,
-                              widget->allocation.y + nav_view->p_y + 1,
-                              MAX (1, nav_view->p_width  - BORDER_PEN_WIDTH),
-                              MAX (1, nav_view->p_height - BORDER_PEN_WIDTH));
 
-          if (area)
-            gdk_gc_set_clip_rectangle (nav_view->gc, NULL);
-        }
-    }
-}
+/*  public functions  */
 
 void
 gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
@@ -563,8 +445,7 @@
                                  gdouble             width,
                                  gdouble             height)
 {
-  GimpView  *view;
-  GimpImage *image;
+  GimpView *view;
 
   g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
 
@@ -572,31 +453,15 @@
 
   g_return_if_fail (view->renderer->viewable);
 
-  image = GIMP_IMAGE (view->renderer->viewable);
-
-  /*  remove old marker  */
-  if (GTK_WIDGET_DRAWABLE (view))
-    gimp_navigation_view_draw_marker (nav_view, NULL);
-
-  nav_view->x = CLAMP (x, 0.0, gimp_image_get_width  (image) - 1.0);
-  nav_view->y = CLAMP (y, 0.0, gimp_image_get_height (image) - 1.0);
-
-  if (width < 0.0)
-    width = gimp_image_get_width (image);
-
-  if (height < 0.0)
-    height = gimp_image_get_height (image);
-
-  nav_view->width  = CLAMP (width,  1.0,
-                            gimp_image_get_width  (image) - nav_view->x);
-  nav_view->height = CLAMP (height, 1.0,
-                            gimp_image_get_height (image) - nav_view->y);
+  nav_view->x      = x;
+  nav_view->y      = y;
+  nav_view->width  = MAX (1.0, width);
+  nav_view->height = MAX (1.0, height);
 
   gimp_navigation_view_transform (nav_view);
 
-  /*  draw new marker  */
-  if (GTK_WIDGET_DRAWABLE (view))
-    gimp_navigation_view_draw_marker (nav_view, NULL);
+  /* Marker changed, redraw */
+  gtk_widget_queue_draw (GTK_WIDGET (view));
 }
 
 void
@@ -624,3 +489,89 @@
   if (width)  *width  = view->p_width;
   if (height) *height = view->p_height;
 }
+
+
+/*  private functions  */
+
+static void
+gimp_navigation_view_transform (GimpNavigationView *nav_view)
+{
+  gdouble ratiox, ratioy;
+
+  gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
+
+  nav_view->p_x = RINT (nav_view->x * ratiox);
+  nav_view->p_y = RINT (nav_view->y * ratioy);
+
+  nav_view->p_width  = ceil (nav_view->width  * ratiox);
+  nav_view->p_height = ceil (nav_view->height * ratioy);
+}
+
+static void
+gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
+                                  cairo_t            *cr)
+{
+  GimpView *view = GIMP_VIEW (nav_view);
+
+  if (view->renderer->viewable && nav_view->width && nav_view->height)
+    {
+      GtkWidget *widget = GTK_WIDGET (view);
+
+      cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+      cairo_rectangle (cr,
+                       0, 0,
+                       widget->allocation.width, widget->allocation.height);
+      cairo_rectangle (cr,
+                       nav_view->p_x, nav_view->p_y,
+                       nav_view->p_width, nav_view->p_height);
+
+      cairo_set_source_rgba (cr, 0, 0, 0, 0.5);
+      cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+      cairo_fill (cr);
+
+      cairo_rectangle (cr,
+                       nav_view->p_x, nav_view->p_y,
+                       nav_view->p_width, nav_view->p_height);
+
+      cairo_set_source_rgb (cr, 1, 1, 1);
+      cairo_set_line_width (cr, BORDER_WIDTH);
+      cairo_stroke (cr);
+    }
+}
+
+static void
+gimp_navigation_view_move_to (GimpNavigationView *nav_view,
+                              gint                tx,
+                              gint                ty)
+{
+  GimpView  *view = GIMP_VIEW (nav_view);
+  gdouble    ratiox, ratioy;
+  gdouble    x, y;
+
+  if (! view->renderer->viewable)
+    return;
+
+  gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
+
+  x = tx / ratiox;
+  y = ty / ratioy;
+
+  g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
+                 x, y, nav_view->width, nav_view->height);
+}
+
+static void
+gimp_navigation_view_get_ratio (GimpNavigationView *nav_view,
+                                gdouble            *ratiox,
+                                gdouble            *ratioy)
+{
+  GimpView  *view = GIMP_VIEW (nav_view);
+  GimpImage *image;
+
+  image = GIMP_IMAGE (view->renderer->viewable);
+
+  *ratiox = (gdouble) view->renderer->width  /
+            (gdouble) gimp_image_get_width  (image);
+  *ratioy = (gdouble) view->renderer->height /
+            (gdouble) gimp_image_get_height (image);
+}

Modified: branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c	Sun Oct 12 15:38:02 2008
@@ -264,7 +264,7 @@
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
-  spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 4, 1, 0);
+  spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 0, 1, 0);
   editor->columns_data = GTK_ADJUSTMENT (adj);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);

Modified: branches/soc-2008-tagging/app/widgets/gimpradioaction.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpradioaction.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpradioaction.c	Sun Oct 12 15:38:02 2008
@@ -80,13 +80,24 @@
                        const gchar *stock_id,
                        gint         value)
 {
-  return g_object_new (GIMP_TYPE_RADIO_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       "value",    value,
-                       NULL);
+  GtkRadioAction *action;
+
+  action = g_object_new (GIMP_TYPE_RADIO_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "value",    value,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_factory_lookup_default (stock_id))
+        g_object_set (action, "stock-id", stock_id, NULL);
+      else
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimpsamplepointeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsamplepointeditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpsamplepointeditor.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpselectiondata.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpselectiondata.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpselectiondata.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"
@@ -50,14 +51,15 @@
 
 /*  local function prototypes  */
 
-static gchar      * gimp_selection_data_get_name   (GtkSelectionData *selection);
-static GimpObject * gimp_selection_data_get_object (GtkSelectionData *selection,
-                                                    GimpContainer    *container,
-                                                    GimpObject       *additional);
-static gchar      * gimp_unescape_uri_string       (const char       *escaped,
-                                                    int               len,
-                                                    const char       *illegal_escaped_characters,
-                                                    gboolean          ascii_must_not_be_escaped);
+static const gchar * gimp_selection_data_get_name   (GtkSelectionData *selection,
+                                                     const gchar      *strfunc);
+static GimpObject  * gimp_selection_data_get_object (GtkSelectionData *selection,
+                                                     GimpContainer    *container,
+                                                     GimpObject       *additional);
+static gchar       * gimp_unescape_uri_string       (const char       *escaped,
+                                                     int               len,
+                                                     const char       *illegal_escaped_characters,
+                                                     gboolean          ascii_must_not_be_escaped);
 
 
 /*  public functions  */
@@ -92,7 +94,7 @@
     }
 
   gtk_selection_data_set (selection, selection->target,
-                          8, (guchar *) vals, strlen (vals) + 1);
+                          8, (guchar *) vals, strlen (vals));
 
   g_free (vals);
 }
@@ -360,7 +362,7 @@
   str = g_strdup_printf ("%d:%d", get_pid (), gimp_image_get_ID (image));
 
   gtk_selection_data_set (selection, selection->target,
-                          8, (guchar *) str, strlen (str) + 1);
+                          8, (guchar *) str, strlen (str));
 
   g_free (str);
 }
@@ -369,27 +371,26 @@
 gimp_selection_data_get_image (GtkSelectionData *selection,
                                Gimp             *gimp)
 {
-  GimpImage *image = NULL;
-  gchar     *str;
-  gint       pid;
-  gint       ID;
+  const gchar *str;
 
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
   g_return_val_if_fail (selection != NULL, NULL);
 
-  str = gimp_selection_data_get_name (selection);
-  if (! str)
-    return NULL;
+  str = gimp_selection_data_get_name (selection, G_STRFUNC);
 
-  if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
-      pid == get_pid ())
+  if (str)
     {
-      image = gimp_image_get_by_ID (gimp, ID);
-    }
+      gint pid;
+      gint ID;
 
-  g_free (str);
+      if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
+          pid == get_pid ())
+        {
+          return gimp_image_get_by_ID (gimp, ID);
+        }
+    }
 
-  return image;
+  return NULL;
 }
 
 void
@@ -406,7 +407,7 @@
                          (gint) channel);
 
   gtk_selection_data_set (selection, selection->target,
-                          8, (guchar *) str, strlen (str) + 1);
+                          8, (guchar *) str, strlen (str));
 
   g_free (str);
 }
@@ -416,11 +417,7 @@
                                    Gimp             *gimp,
                                    GimpChannelType  *channel)
 {
-  GimpImage *image = NULL;
-  gchar     *str;
-  gint       pid;
-  gint       ID;
-  gint       ch;
+  const gchar *str;
 
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
   g_return_val_if_fail (selection != NULL, NULL);
@@ -428,22 +425,27 @@
   if (channel)
     *channel = 0;
 
-  str = gimp_selection_data_get_name (selection);
-  if (! str)
-    return NULL;
+  str = gimp_selection_data_get_name (selection, G_STRFUNC);
 
-  if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
-      pid == get_pid ())
+  if (str)
     {
-      image = gimp_image_get_by_ID (gimp, ID);
+      gint pid;
+      gint ID;
+      gint ch;
 
-      if (image && channel)
-        *channel = ch;
-    }
+      if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
+          pid == get_pid ())
+        {
+          GimpImage *image = gimp_image_get_by_ID (gimp, ID);
 
-  g_free (str);
+          if (image && channel)
+            *channel = ch;
 
-  return image;
+          return image;
+        }
+    }
+
+  return NULL;
 }
 
 void
@@ -458,7 +460,7 @@
   str = g_strdup_printf ("%d:%d", get_pid (), gimp_item_get_ID (item));
 
   gtk_selection_data_set (selection, selection->target,
-                          8, (guchar *) str, strlen (str) + 1);
+                          8, (guchar *) str, strlen (str));
 
   g_free (str);
 }
@@ -467,27 +469,26 @@
 gimp_selection_data_get_item (GtkSelectionData *selection,
                               Gimp             *gimp)
 {
-  GimpItem *item = NULL;
-  gchar    *str;
-  gint      pid;
-  gint      ID;
+  const gchar *str;
 
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
   g_return_val_if_fail (selection != NULL, NULL);
 
-  str = gimp_selection_data_get_name (selection);
-  if (! str)
-    return NULL;
+  str = gimp_selection_data_get_name (selection, G_STRFUNC);
 
-  if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
-      pid == get_pid ())
+  if (str)
     {
-      item = gimp_item_get_by_ID (gimp, ID);
-    }
+      gint pid;
+      gint ID;
 
-  g_free (str);
+      if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
+          pid == get_pid ())
+        {
+          return gimp_item_get_by_ID (gimp, ID);
+        }
+    }
 
-  return item;
+  return NULL;
 }
 
 void
@@ -506,8 +507,10 @@
       gchar *str;
 
       str = g_strdup_printf ("%d:%p:%s", get_pid (), object, name);
+
       gtk_selection_data_set (selection, selection->target,
-                              8, (guchar *) str, strlen (str) + 1);
+                              8, (guchar *) str, strlen (str));
+
       g_free (str);
     }
 }
@@ -630,24 +633,24 @@
 
 /*  private functions  */
 
-static gchar *
-gimp_selection_data_get_name (GtkSelectionData *selection)
+static const gchar *
+gimp_selection_data_get_name (GtkSelectionData *selection,
+                              const gchar      *strfunc)
 {
-  gchar *name;
+  const gchar *name;
 
   if ((selection->format != 8) || (selection->length < 1))
     {
-      g_warning ("Received invalid selection data");
+      g_warning ("%s: received invalid selection data", strfunc);
       return NULL;
     }
 
-  name = g_strndup ((const gchar *) selection->data, selection->length);
+  name = (const gchar *) selection->data;
 
   if (! g_utf8_validate (name, -1, NULL))
     {
-      g_warning ("Received invalid selection data "
-                 "(doesn't validate as UTF-8)!");
-      g_free (name);
+      g_warning ("%s: received invalid selection data "
+                 "(doesn't validate as UTF-8)", strfunc);
       return NULL;
     }
 
@@ -661,42 +664,43 @@
                                 GimpContainer    *container,
                                 GimpObject       *additional)
 {
-  GimpObject *object = NULL;
-  gchar      *str;
-  gint        pid;
-  gpointer    object_addr;
-  gint        name_offset = 0;
+  const gchar *str;
 
-  str = gimp_selection_data_get_name (selection);
-  if (! str)
-    return NULL;
+  str = gimp_selection_data_get_name (selection, G_STRFUNC);
 
-  if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
-      pid == get_pid () && name_offset > 0)
+  if (str)
     {
-      gchar *name = str + name_offset;
+      gint     pid;
+      gpointer object_addr;
+      gint     name_offset = 0;
 
-      GIMP_LOG (DND, "pid = %d, addr = %p, name = '%s'",
-                pid, object_addr, name);
-
-      if (additional &&
-          strcmp (name, gimp_object_get_name (additional)) == 0 &&
-          object_addr == (gpointer) additional)
+      if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
+          pid == get_pid () && name_offset > 0)
         {
-          object = additional;
-        }
-      else
-        {
-          object = gimp_container_get_child_by_name (container, name);
+          const gchar *name = str + name_offset;
+
+          GIMP_LOG (DND, "pid = %d, addr = %p, name = '%s'",
+                    pid, object_addr, name);
 
-          if (object && object_addr != (gpointer) object)
-            object = NULL;
+          if (additional &&
+              strcmp (name, gimp_object_get_name (additional)) == 0 &&
+              object_addr == (gpointer) additional)
+            {
+              return additional;
+            }
+          else
+            {
+              GimpObject *object;
+
+              object = gimp_container_get_child_by_name (container, name);
+
+              if (object_addr == (gpointer) object)
+                return object;
+            }
         }
     }
 
-  g_free (str);
-
-  return object;
+  return NULL;
 }
 
 /*  the next two functions are straight cut'n'paste from glib/glib/gconvert.c,

Modified: branches/soc-2008-tagging/app/widgets/gimpselectioneditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpselectioneditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpselectioneditor.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c	Sun Oct 12 15:38:02 2008
@@ -44,6 +44,7 @@
 
 enum
 {
+  FILE_DIALOG_SETUP,
   IMPORT,
   EXPORT,
   LAST_SIGNAL
@@ -127,6 +128,17 @@
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  settings_box_signals[FILE_DIALOG_SETUP] =
+    g_signal_new ("file-dialog-setup",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (GimpSettingsBoxClass, file_dialog_setup),
+                  NULL, NULL,
+                  gimp_marshal_VOID__OBJECT_BOOLEAN,
+                  G_TYPE_NONE, 2,
+                  GTK_TYPE_FILE_CHOOSER_DIALOG,
+                  G_TYPE_BOOLEAN);
+
   settings_box_signals[IMPORT] =
     g_signal_new ("import",
                   G_TYPE_FROM_CLASS (klass),
@@ -152,6 +164,7 @@
   object_class->set_property = gimp_settings_box_set_property;
   object_class->get_property = gimp_settings_box_get_property;
 
+  klass->file_dialog_setup   = NULL;
   klass->import              = NULL;
   klass->export              = NULL;
 
@@ -741,6 +754,10 @@
   gimp_help_connect (box->file_dialog, gimp_standard_help_func,
                      box->file_dialog_help_id, NULL);
 
+  /*  allow callbacks to add widgets to the dialog  */
+  g_signal_emit (box, settings_box_signals[FILE_DIALOG_SETUP], 0,
+                 box->file_dialog, save);
+
   gtk_widget_show (box->file_dialog);
 }
 

Modified: branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h	Sun Oct 12 15:38:02 2008
@@ -60,10 +60,13 @@
 {
   GtkHBoxClass  parent_class;
 
-  void (* import) (GimpSettingsBox *box,
-                   const gchar     *filename);
-  void (* export) (GimpSettingsBox *box,
-                   const gchar     *filename);
+  void (* file_dialog_setup) (GimpSettingsBox      *box,
+                              GtkFileChooserDialog *dialog,
+                              gboolean              export);
+  void (* import)            (GimpSettingsBox      *box,
+                              const gchar          *filename);
+  void (* export)            (GimpSettingsBox      *box,
+                              const gchar          *filename);
 };
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimpstringaction.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpstringaction.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpstringaction.c	Sun Oct 12 15:38:02 2008
@@ -158,13 +158,23 @@
                         const gchar *stock_id,
                         const gchar *value)
 {
-  return g_object_new (GIMP_TYPE_STRING_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       "value",    value,
-                       NULL);
+  GimpStringAction *action;
+
+  action = g_object_new (GIMP_TYPE_STRING_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         "value",    value,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 static void

Modified: branches/soc-2008-tagging/app/widgets/gimptemplateview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptemplateview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptemplateview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpconfig/gimpconfig.h"

Modified: branches/soc-2008-tagging/app/widgets/gimptoggleaction.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoggleaction.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptoggleaction.c	Sun Oct 12 15:38:02 2008
@@ -79,12 +79,24 @@
                         const gchar *tooltip,
                         const gchar *stock_id)
 {
-  return g_object_new (GIMP_TYPE_TOGGLE_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       NULL);
+  GtkToggleAction *action;
+
+  action = g_object_new (GIMP_TYPE_TOGGLE_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_factory_lookup_default (stock_id))
+        g_object_set (action, "stock-id", stock_id, NULL);
+      else
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 

Modified: branches/soc-2008-tagging/app/widgets/gimptoolbox-dnd.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoolbox-dnd.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptoolbox-dnd.c	Sun Oct 12 15:38:02 2008
@@ -20,6 +20,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -93,6 +94,9 @@
 
   dock = GIMP_DOCK (toolbox);
 
+  gimp_dnd_uri_list_dest_add (GTK_WIDGET (toolbox),
+                              gimp_toolbox_drop_uri_list,
+                              dock->context);
   gimp_dnd_uri_list_dest_add (toolbox->vbox,
                               gimp_toolbox_drop_uri_list,
                               dock->context);
@@ -223,7 +227,7 @@
   gimp_layer_set_opacity (new_layer, GIMP_OPACITY_OPAQUE, FALSE);
   gimp_layer_set_lock_alpha (new_layer, FALSE, FALSE);
 
-  gimp_image_add_layer (new_image, new_layer, 0);
+  gimp_image_add_layer (new_image, new_layer, 0, TRUE);
 
   gimp_image_undo_enable (new_image);
 
@@ -309,7 +313,7 @@
   gimp_object_take_name (GIMP_OBJECT (new_layer),
                          g_strdup_printf (_("%s Channel Copy"), desc));
 
-  gimp_image_add_layer (new_image, new_layer, 0);
+  gimp_image_add_layer (new_image, new_layer, 0, TRUE);
 
   gimp_image_undo_enable (new_image);
 
@@ -358,7 +362,7 @@
                                 _("Dropped Buffer"),
                                 GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
 
-  gimp_image_add_layer (new_image, new_layer, 0);
+  gimp_image_add_layer (new_image, new_layer, 0, TRUE);
 
   gimp_image_undo_enable (new_image);
 

Modified: branches/soc-2008-tagging/app/widgets/gimptoolbox-image-area.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoolbox-image-area.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptoolbox-image-area.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimptoolbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoolbox.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimptoolbox.c	Sun Oct 12 15:38:02 2008
@@ -97,34 +97,38 @@
 static GtkWidget * toolbox_create_image_area       (GimpToolbox    *toolbox,
                                                     GimpContext    *context);
 
-static void        toolbox_area_notify           (GimpGuiConfig  *config,
-                                                  GParamSpec     *pspec,
-                                                  GtkWidget      *area);
-static void        toolbox_tool_changed          (GimpContext    *context,
-                                                  GimpToolInfo   *tool_info,
-                                                  gpointer        data);
-
-static void        toolbox_tool_reorder          (GimpContainer  *container,
-                                                  GimpToolInfo   *tool_info,
-                                                  gint            index,
-                                                  GtkWidget      *wrap_box);
-static void        toolbox_tool_visible_notify   (GimpToolInfo   *tool_info,
-                                                  GParamSpec     *pspec,
-                                                  GtkWidget      *button);
-
-static void        toolbox_tool_button_toggled   (GtkWidget      *widget,
-                                                  GimpToolInfo   *tool_info);
-static gboolean    toolbox_tool_button_press     (GtkWidget      *widget,
-                                                  GdkEventButton *bevent,
-                                                  GimpToolbox    *toolbox);
-
-static gboolean    toolbox_check_device          (GtkWidget      *widget,
-                                                  GdkEvent       *event,
-                                                  Gimp           *gimp);
-
-static void        toolbox_paste_received        (GtkClipboard   *clipboard,
-                                                  const gchar    *text,
-                                                  gpointer        data);
+static void        toolbox_area_notify             (GimpGuiConfig  *config,
+                                                    GParamSpec     *pspec,
+                                                    GtkWidget      *area);
+static void        toolbox_wilber_notify           (GimpGuiConfig  *config,
+                                                    GParamSpec     *pspec,
+                                                    GtkWidget      *wilber);
+
+static void        toolbox_tool_changed            (GimpContext    *context,
+                                                    GimpToolInfo   *tool_info,
+                                                    gpointer        data);
+
+static void        toolbox_tool_reorder            (GimpContainer  *container,
+                                                    GimpToolInfo   *tool_info,
+                                                    gint            index,
+                                                    GtkWidget      *wrap_box);
+static void        toolbox_tool_visible_notify     (GimpToolInfo   *tool_info,
+                                                    GParamSpec     *pspec,
+                                                    GtkWidget      *button);
+
+static void        toolbox_tool_button_toggled     (GtkWidget      *widget,
+                                                    GimpToolInfo   *tool_info);
+static gboolean    toolbox_tool_button_press       (GtkWidget      *widget,
+                                                    GdkEventButton *bevent,
+                                                    GimpToolbox    *toolbox);
+
+static gboolean    toolbox_check_device            (GtkWidget      *widget,
+                                                    GdkEvent       *event,
+                                                    Gimp           *gimp);
+
+static void        toolbox_paste_received          (GtkClipboard   *clipboard,
+                                                    const gchar    *text,
+                                                    gpointer        data);
 
 
 G_DEFINE_TYPE (GimpToolbox, gimp_toolbox, GIMP_TYPE_IMAGE_DOCK)
@@ -210,11 +214,17 @@
   gtk_frame_set_shadow_type (GTK_FRAME (toolbox->header), GTK_SHADOW_NONE);
   gtk_box_pack_start (GTK_BOX (toolbox->vbox), toolbox->header,
                       FALSE, FALSE, 0);
-  gtk_widget_show (toolbox->header);
+
+  if (config->toolbox_wilber)
+    gtk_widget_show (toolbox->header);
 
   gimp_help_set_help_data (toolbox->header,
                            _("Drop image files here to open them"), NULL);
 
+  g_signal_connect_object (config, "notify::toolbox-wilber",
+                           G_CALLBACK (toolbox_wilber_notify),
+                           toolbox->header, 0);
+
   toolbox->tool_wbox = gtk_hwrap_box_new (FALSE);
   gtk_wrap_box_set_justify (GTK_WRAP_BOX (toolbox->tool_wbox), GTK_JUSTIFY_TOP);
   gtk_wrap_box_set_line_justify (GTK_WRAP_BOX (toolbox->tool_wbox),
@@ -291,15 +301,6 @@
                            G_CALLBACK (toolbox_area_notify),
                            toolbox->image_area, 0);
 
-  {
-    GtkWidget *button;
-
-    button = gimp_prop_check_button_new (G_OBJECT (config), "use-gegl",
-                                         "Use GEGL");
-    gtk_box_pack_start (GTK_BOX (toolbox->vbox), button, FALSE, FALSE, 0);
-    gtk_widget_show (button);
-  }
-
   g_signal_connect_object (context, "tool-changed",
                            G_CALLBACK (toolbox_tool_changed),
                            toolbox->tool_wbox,
@@ -507,7 +508,8 @@
 
   GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
 
-  if (gdk_rectangle_intersect (&event->area,
+  if (GTK_WIDGET_VISIBLE (toolbox->header) &&
+      gdk_rectangle_intersect (&event->area,
                                &toolbox->header->allocation,
                                &clip_rect))
     {
@@ -595,7 +597,8 @@
 
       gtk_widget_set_size_request (toolbox->header,
                                    -1,
-                                   button_requisition.height * PANGO_SCALE_SMALL);
+                                   button_requisition.height *
+                                   PANGO_SCALE_SMALL);
 
       border_width = gtk_container_get_border_width (GTK_CONTAINER (main_vbox));
 
@@ -841,6 +844,17 @@
 }
 
 static void
+toolbox_wilber_notify (GimpGuiConfig *config,
+                       GParamSpec    *pspec,
+                       GtkWidget     *wilber)
+{
+  gboolean   visible;
+
+  g_object_get (config, pspec->name, &visible, NULL);
+  g_object_set (wilber, "visible", visible, NULL);
+}
+
+static void
 toolbox_tool_changed (GimpContext  *context,
                       GimpToolInfo *tool_info,
                       gpointer      data)

Modified: branches/soc-2008-tagging/app/widgets/gimpuimanager.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpuimanager.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpuimanager.c	Sun Oct 12 15:38:02 2008
@@ -58,58 +58,60 @@
 };
 
 
-static GObject * gimp_ui_manager_constructor    (GType               type,
-                                                 guint               n_params,
-                                                 GObjectConstructParam *params);
-static void     gimp_ui_manager_dispose         (GObject            *object);
-static void     gimp_ui_manager_finalize        (GObject            *object);
-static void     gimp_ui_manager_set_property    (GObject            *object,
-                                                 guint               prop_id,
-                                                 const GValue       *value,
-                                                 GParamSpec         *pspec);
-static void     gimp_ui_manager_get_property    (GObject            *object,
-                                                 guint               prop_id,
-                                                 GValue             *value,
-                                                 GParamSpec         *pspec);
-static void     gimp_ui_manager_connect_proxy   (GtkUIManager       *manager,
-                                                 GtkAction          *action,
-                                                 GtkWidget          *proxy);
-static GtkWidget * gimp_ui_manager_get_widget   (GtkUIManager       *manager,
-                                                 const gchar        *path);
-static GtkAction * gimp_ui_manager_get_action   (GtkUIManager       *manager,
-                                                 const gchar        *path);
-static void     gimp_ui_manager_real_update     (GimpUIManager      *manager,
-                                                 gpointer            update_data);
+static GObject *  gimp_ui_manager_constructor         (GType           type,
+                                                       guint           n_params,
+                                                       GObjectConstructParam *params);
+static void       gimp_ui_manager_dispose             (GObject        *object);
+static void       gimp_ui_manager_finalize            (GObject        *object);
+static void       gimp_ui_manager_set_property        (GObject        *object,
+                                                       guint           prop_id,
+                                                       const GValue   *value,
+                                                       GParamSpec     *pspec);
+static void       gimp_ui_manager_get_property        (GObject        *object,
+                                                       guint           prop_id,
+                                                       GValue         *value,
+                                                       GParamSpec     *pspec);
+static void       gimp_ui_manager_connect_proxy       (GtkUIManager   *manager,
+                                                       GtkAction      *action,
+                                                       GtkWidget      *proxy);
+static GtkWidget *gimp_ui_manager_get_widget          (GtkUIManager   *manager,
+                                                       const gchar    *path);
+static GtkAction *gimp_ui_manager_get_action          (GtkUIManager   *manager,
+                                                       const gchar    *path);
+static void       gimp_ui_manager_real_update         (GimpUIManager  *manager,
+                                                       gpointer        update_data);
 static GimpUIManagerUIEntry *
-                gimp_ui_manager_entry_get       (GimpUIManager      *manager,
-                                                 const gchar        *ui_path);
-static gboolean gimp_ui_manager_entry_load      (GimpUIManager      *manager,
-                                                 GimpUIManagerUIEntry *entry,
-                                                 GError            **error);
+                  gimp_ui_manager_entry_get           (GimpUIManager  *manager,
+                                                       const gchar    *ui_path);
+static gboolean   gimp_ui_manager_entry_load          (GimpUIManager  *manager,
+                                                       GimpUIManagerUIEntry *entry,
+                                                       GError        **error);
 static GimpUIManagerUIEntry *
-                gimp_ui_manager_entry_ensure    (GimpUIManager      *manager,
-                                                 const gchar        *path);
-static void     gimp_ui_manager_menu_position   (GtkMenu            *menu,
-                                                 gint               *x,
-                                                 gint               *y,
-                                                 gpointer            data);
-static void     gimp_ui_manager_menu_pos        (GtkMenu            *menu,
-                                                 gint               *x,
-                                                 gint               *y,
-                                                 gboolean           *push_in,
-                                                 gpointer            data);
-static void
-            gimp_ui_manager_delete_popdown_data (GtkObject          *object,
-                                                 GimpUIManager      *manager);
-static void     gimp_ui_manager_item_realize    (GtkWidget          *widget,
-                                                 GimpUIManager      *manager);
-static void    gimp_ui_manager_menu_item_select (GtkWidget          *widget,
-                                                 GimpUIManager      *manager);
-static void  gimp_ui_manager_menu_item_deselect (GtkWidget          *widget,
-                                                 GimpUIManager      *manager);
-static gboolean gimp_ui_manager_item_key_press  (GtkWidget          *widget,
-                                                 GdkEventKey        *kevent,
-                                                 GimpUIManager      *manager);
+                  gimp_ui_manager_entry_ensure        (GimpUIManager  *manager,
+                                                       const gchar    *path);
+static void       gimp_ui_manager_menu_position       (GtkMenu        *menu,
+                                                       gint           *x,
+                                                       gint           *y,
+                                                       gpointer        data);
+static void       gimp_ui_manager_menu_pos            (GtkMenu        *menu,
+                                                       gint           *x,
+                                                       gint           *y,
+                                                       gboolean       *push_in,
+                                                       gpointer        data);
+static void       gimp_ui_manager_delete_popdown_data (GtkObject      *object,
+                                                       GimpUIManager  *manager);
+static void       gimp_ui_manager_item_realize        (GtkWidget      *widget,
+                                                       GimpUIManager  *manager);
+static void       gimp_ui_manager_menu_item_select    (GtkWidget      *widget,
+                                                       GimpUIManager  *manager);
+static void       gimp_ui_manager_menu_item_deselect  (GtkWidget      *widget,
+                                                       GimpUIManager  *manager);
+static gboolean   gimp_ui_manager_item_key_press      (GtkWidget      *widget,
+                                                       GdkEventKey    *kevent,
+                                                       GimpUIManager  *manager);
+static GtkWidget *find_widget_under_pointer           (GdkWindow      *window,
+                                                       gint           *x,
+                                                       gint           *y);
 
 
 G_DEFINE_TYPE (GimpUIManager, gimp_ui_manager, GTK_TYPE_UI_MANAGER)
@@ -942,6 +944,24 @@
     {
       GtkWidget *menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
 
+      if (! menu_item && GTK_IS_MENU (widget))
+        {
+          GdkWindow *window = GTK_MENU (widget)->toplevel->window;
+          gint       x, y;
+
+          gdk_window_get_pointer (window, &x, &y, NULL);
+          menu_item = find_widget_under_pointer (window, &x, &y);
+
+          if (menu_item && ! GTK_IS_MENU_ITEM (menu_item))
+            {
+              menu_item = gtk_widget_get_ancestor (menu_item,
+                                                   GTK_TYPE_MENU_ITEM);
+
+              if (! GTK_IS_MENU_ITEM (menu_item))
+                menu_item = NULL;
+            }
+        }
+
       /*  first, get the help page from the item...
        */
       if (menu_item)
@@ -1031,3 +1051,202 @@
 
   return TRUE;
 }
+
+
+/* Stuff below taken from gtktooltip.c
+ */
+
+#ifdef __GNUC__
+#warning FIXME: remove this crack as soon as a GTK+ widget_under_pointer() is available
+#endif
+
+struct ChildLocation
+{
+  GtkWidget *child;
+  GtkWidget *container;
+
+  gint x;
+  gint y;
+};
+
+static void
+child_location_foreach (GtkWidget *child,
+			gpointer   data)
+{
+  gint x, y;
+  struct ChildLocation *child_loc = data;
+
+  /* Ignore invisible widgets */
+  if (!GTK_WIDGET_DRAWABLE (child))
+    return;
+
+  /* (child_loc->x, child_loc->y) are relative to
+   * child_loc->container's allocation.
+   */
+
+  if (!child_loc->child &&
+      gtk_widget_translate_coordinates (child_loc->container, child,
+					child_loc->x, child_loc->y,
+					&x, &y))
+    {
+#ifdef DEBUG_TOOLTIP
+      g_print ("candidate: %s  alloc=[(%d,%d)  %dx%d]     (%d, %d)->(%d, %d)\n",
+	       gtk_widget_get_name (child),
+	       child->allocation.x,
+	       child->allocation.y,
+	       child->allocation.width,
+	       child->allocation.height,
+	       child_loc->x, child_loc->y,
+	       x, y);
+#endif /* DEBUG_TOOLTIP */
+
+      /* (x, y) relative to child's allocation. */
+      if (x >= 0 && x < child->allocation.width
+	  && y >= 0 && y < child->allocation.height)
+        {
+	  if (GTK_IS_CONTAINER (child))
+	    {
+	      struct ChildLocation tmp = { NULL, NULL, 0, 0 };
+
+	      /* Take (x, y) relative the child's allocation and
+	       * recurse.
+	       */
+	      tmp.x = x;
+	      tmp.y = y;
+	      tmp.container = child;
+
+	      gtk_container_forall (GTK_CONTAINER (child),
+				    child_location_foreach, &tmp);
+
+	      if (tmp.child)
+		child_loc->child = tmp.child;
+	      else
+		child_loc->child = child;
+	    }
+	  else
+	    child_loc->child = child;
+	}
+    }
+}
+
+/* Translates coordinates from dest_widget->window relative (src_x, src_y),
+ * to allocation relative (dest_x, dest_y) of dest_widget.
+ */
+static void
+window_to_alloc (GtkWidget *dest_widget,
+		 gint       src_x,
+		 gint       src_y,
+		 gint      *dest_x,
+		 gint      *dest_y)
+{
+  /* Translate from window relative to allocation relative */
+  if (!GTK_WIDGET_NO_WINDOW (dest_widget) && dest_widget->parent)
+    {
+      gint wx, wy;
+      gdk_window_get_position (dest_widget->window, &wx, &wy);
+
+      /* Offset coordinates if widget->window is smaller than
+       * widget->allocation.
+       */
+      src_x += wx - dest_widget->allocation.x;
+      src_y += wy - dest_widget->allocation.y;
+    }
+  else
+    {
+      src_x -= dest_widget->allocation.x;
+      src_y -= dest_widget->allocation.y;
+    }
+
+  if (dest_x)
+    *dest_x = src_x;
+  if (dest_y)
+    *dest_y = src_y;
+}
+
+static GtkWidget *
+find_widget_under_pointer (GdkWindow *window,
+			   gint      *x,
+			   gint      *y)
+{
+  GtkWidget *event_widget;
+  struct ChildLocation child_loc = { NULL, NULL, 0, 0 };
+
+  gdk_window_get_user_data (window, (void **)&event_widget);
+
+  if (!event_widget)
+    return NULL;
+
+#ifdef DEBUG_TOOLTIP
+  g_print ("event window %p (belonging to %p (%s))  (%d, %d)\n",
+	   window, event_widget, gtk_widget_get_name (event_widget),
+	   *x, *y);
+#endif
+
+  /* Coordinates are relative to event window */
+  child_loc.x = *x;
+  child_loc.y = *y;
+
+  /* We go down the window hierarchy to the widget->window,
+   * coordinates stay relative to the current window.
+   * We end up with window == widget->window, coordinates relative to that.
+   */
+  while (window && window != event_widget->window)
+    {
+      gint px, py;
+
+      gdk_window_get_position (window, &px, &py);
+      child_loc.x += px;
+      child_loc.y += py;
+
+      window = gdk_window_get_parent (window);
+    }
+
+  /* Failing to find widget->window can happen for e.g. a detached handle box;
+   * chaining ::query-tooltip up to its parent probably makes little sense,
+   * and users better implement tooltips on handle_box->child.
+   * so we simply ignore the event for tooltips here.
+   */
+  if (!window)
+    return NULL;
+
+  /* Convert the window relative coordinates to allocation
+   * relative coordinates.
+   */
+  window_to_alloc (event_widget,
+		   child_loc.x, child_loc.y,
+		   &child_loc.x, &child_loc.y);
+
+  if (GTK_IS_CONTAINER (event_widget))
+    {
+      GtkWidget *container = event_widget;
+
+      child_loc.container = event_widget;
+      child_loc.child = NULL;
+
+      gtk_container_forall (GTK_CONTAINER (event_widget),
+			    child_location_foreach, &child_loc);
+
+      /* Here we have a widget, with coordinates relative to
+       * child_loc.container's allocation.
+       */
+
+      if (child_loc.child)
+	event_widget = child_loc.child;
+      else if (child_loc.container)
+	event_widget = child_loc.container;
+
+      /* Translate to event_widget's allocation */
+      gtk_widget_translate_coordinates (container, event_widget,
+					child_loc.x, child_loc.y,
+					&child_loc.x, &child_loc.y);
+
+    }
+
+  /* We return (x, y) relative to the allocation of event_widget. */
+  if (x)
+    *x = child_loc.x;
+  if (y)
+    *y = child_loc.y;
+
+  return event_widget;
+}

Modified: branches/soc-2008-tagging/app/widgets/gimpundoeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpundoeditor.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpundoeditor.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpvectorstreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpvectorstreeview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpvectorstreeview.c	Sun Oct 12 15:38:02 2008
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -252,7 +253,7 @@
 
   new_vectors = gimp_vectors_new (image, _("Empty Path"));
 
-  gimp_image_add_vectors (image, new_vectors, -1);
+  gimp_image_add_vectors (image, new_vectors, -1, TRUE);
 
   return GIMP_ITEM (new_vectors);
 }

Modified: branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpviewrenderer-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrenderer-utils.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrenderer-utils.c	Sun Oct 12 15:38:02 2008
@@ -21,13 +21,13 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "widgets-types.h"
 
 #include "core/gimpbrush.h"
 #include "core/gimpbuffer.h"
-#include "core/gimpdrawable.h"
 #include "core/gimpgradient.h"
 #include "core/gimpimage.h"
 #include "core/gimpimagefile.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpviewrendererdrawable.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrendererdrawable.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrendererdrawable.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpviewrendererimage.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrendererimage.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrendererimage.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpviewrendererlayer.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrendererlayer.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrendererlayer.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpwidgets/gimpwidgets.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c	Sun Oct 12 15:38:02 2008
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
+#include <gegl.h>
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"

Modified: branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c	Sun Oct 12 15:38:02 2008
@@ -1078,15 +1078,37 @@
 }
 
 void
+gimp_pango_layout_set_scale (PangoLayout *layout,
+                             gdouble      scale)
+{
+  PangoAttrList  *attrs;
+  PangoAttribute *attr;
+
+  g_return_if_fail (PANGO_IS_LAYOUT (layout));
+
+  attrs = pango_attr_list_new ();
+
+  attr = pango_attr_scale_new (scale);
+  attr->start_index = 0;
+  attr->end_index   = -1;
+  pango_attr_list_insert (attrs, attr);
+
+  pango_layout_set_attributes (layout, attrs);
+  pango_attr_list_unref (attrs);
+}
+
+void
 gimp_pango_layout_set_weight (PangoLayout *layout,
                               PangoWeight  weight)
 {
   PangoAttrList  *attrs;
   PangoAttribute *attr;
 
+  g_return_if_fail (PANGO_IS_LAYOUT (layout));
+
   attrs = pango_attr_list_new ();
 
-  attr = pango_attr_weight_new (PANGO_WEIGHT_SEMIBOLD);
+  attr = pango_attr_weight_new (weight);
   attr->start_index = 0;
   attr->end_index   = -1;
   pango_attr_list_insert (attrs, attr);

Modified: branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.h	Sun Oct 12 15:38:02 2008
@@ -90,6 +90,8 @@
 
 const gchar     * gimp_get_message_stock_id  (GimpMessageSeverity  severity);
 
+void          gimp_pango_layout_set_scale    (PangoLayout     *layout,
+                                              double           scale);
 void          gimp_pango_layout_set_weight   (PangoLayout     *layout,
                                               PangoWeight      weight);
 

Modified: branches/soc-2008-tagging/app/widgets/gtkscalebutton.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gtkscalebutton.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gtkscalebutton.c	Sun Oct 12 15:38:02 2008
@@ -35,7 +35,9 @@
 
 #include "config.h"
 
+#ifndef _WIN32
 #define _GNU_SOURCE
+#endif
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
@@ -175,7 +177,7 @@
   guint signal_id;
 
   g_return_val_if_fail (signal_name != NULL, 0);
-  
+
   va_start (args, n_params);
 
   signal_id = g_signal_new_valist (signal_name, itype, signal_flags,
@@ -184,7 +186,7 @@
                                    return_type, n_params, args);
 
   va_end (args);
- 
+
   return signal_id;
 }
 

Modified: branches/soc-2008-tagging/app/widgets/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/app/widgets/makefile.msc	(original)
+++ branches/soc-2008-tagging/app/widgets/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -178,12 +178,24 @@
 	gtkhwrapbox.obj \
 	gtkvwrapbox.obj \
 	gtkwrapbox.obj \
+	gimpactioneditor.obj \
+	gimpcairo-wilber.obj \
+	gimplanguageentry.obj \
+	gimplanguagestore-parser.obj \
+	gimplanguagestore.obj \
+	gimpradioaction.obj \
+	gimpscalebutton.obj \
+	gimpsettingsbox.obj \
+	gimpsettingseditor.obj \
+	gimptoggleaction.obj \
+	gimpwindow.obj \
+	gtkscalebutton.obj \
 #	widgets-enums.obj \
 
 INCLUDES = \
 	-FImsvc_recommended_pragmas.h \
-	-I$(top_srcdir) \
-	-I$(top_srcdir)/app \
+	-I $(PRJ_TOP) \
+	-I $(PRJ_TOP)/app \
 	$(GTK2_CFLAGS) \
 	-I$(includedir)
 

Modified: branches/soc-2008-tagging/app/widgets/widgets-types.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/widgets-types.h	(original)
+++ branches/soc-2008-tagging/app/widgets/widgets-types.h	Sun Oct 12 15:38:02 2008
@@ -149,6 +149,7 @@
 
 /*  misc widgets  */
 
+typedef struct _GimpActionEditor             GimpActionEditor;
 typedef struct _GimpActionView               GimpActionView;
 typedef struct _GimpBlobEditor               GimpBlobEditor;
 typedef struct _GimpColorBar                 GimpColorBar;

Modified: branches/soc-2008-tagging/app/xcf/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/xcf/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/xcf/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
+AM_CPPFLAGS = \
+	-DG_LOG_DOMAIN=\"Gimp-XCF\"
+
+INCLUDES = \
+	-I$(top_builddir)	\
+	-I$(top_srcdir)		\
+	-I$(top_builddir)/app	\
+	-I$(top_srcdir)/app	\
+	$(GEGL_CFLAGS)		\
+	$(GDK_PIXBUF_CFLAGS)	\
+	-I$(includedir)
+
 noinst_LIBRARIES = libappxcf.a
 
 libappxcf_a_SOURCES = \
@@ -17,16 +29,4 @@
 	xcf-write.c	\
 	xcf-write.h
 
-AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"Gimp-XCF\"
-
-INCLUDES = \
-	-I$(top_builddir)	\
-	-I$(top_srcdir)		\
-	-I$(top_builddir)/app	\
-	-I$(top_srcdir)/app	\
-	$(GDK_PIXBUF_CFLAGS)	\
-	$(GLIB_CFLAGS)		\
-	-I$(includedir)
-
 EXTRA_DIST = makefile.msc

Modified: branches/soc-2008-tagging/app/xcf/xcf-load.c
==============================================================================
--- branches/soc-2008-tagging/app/xcf/xcf-load.c	(original)
+++ branches/soc-2008-tagging/app/xcf/xcf-load.c	Sun Oct 12 15:38:02 2008
@@ -19,9 +19,9 @@
 #include "config.h"
 
 #include <stdio.h>
-#include <string.h> /* strcmp, memcmp */
+#include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
@@ -201,7 +201,8 @@
       /* add the layer to the image if its not the floating selection */
       if (layer != info->floating_sel)
         gimp_image_add_layer (image, layer,
-                              gimp_container_num_children (image->layers));
+                              gimp_container_num_children (image->layers),
+                              FALSE);
 
       /* restore the saved position so we'll be ready to
        *  read the next offset.
@@ -242,7 +243,8 @@
       /* add the channel to the image if its not the selection */
       if (channel != gimp_image_get_mask (image))
         gimp_image_add_channel (image, channel,
-                                gimp_container_num_children (image->channels));
+                                gimp_container_num_children (image->channels),
+                                FALSE);
 
       /* restore the saved position so we'll be ready to
        *  read the next offset.
@@ -1019,7 +1021,7 @@
       gimp_layer_mask_set_edit  (layer_mask, edit_mask);
       gimp_layer_mask_set_show  (layer_mask, show_mask, FALSE);
 
-      gimp_layer_add_mask (layer, layer_mask, FALSE);
+      gimp_layer_add_mask (layer, layer_mask, FALSE, NULL);
     }
 
   /* attach the floating selection... */
@@ -1527,8 +1529,7 @@
   while (num_paths-- > 0)
     xcf_load_old_path (info, image);
 
-  active_vectors = (GimpVectors *)
-    gimp_container_get_child_by_index (image->vectors, last_selected_row);
+  active_vectors = gimp_image_get_vectors_by_index (image, last_selected_row);
 
   if (active_vectors)
     gimp_image_set_active_vectors (image, active_vectors);
@@ -1625,7 +1626,8 @@
     gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
 
   gimp_image_add_vectors (image, vectors,
-                          gimp_container_num_children (image->vectors));
+                          gimp_container_num_children (image->vectors),
+                          FALSE);
 
   return TRUE;
 }
@@ -1667,8 +1669,7 @@
     if (! xcf_load_vector (info, image))
       return FALSE;
 
-  active_vectors = (GimpVectors *)
-    gimp_container_get_child_by_index (image->vectors, active_index);
+  active_vectors = gimp_image_get_vectors_by_index (image, active_index);
 
   if (active_vectors)
     gimp_image_set_active_vectors (image, active_vectors);
@@ -1814,7 +1815,8 @@
     }
 
   gimp_image_add_vectors (image, vectors,
-                          gimp_container_num_children (image->vectors));
+                          gimp_container_num_children (image->vectors),
+                          FALSE);
 
   return TRUE;
 }

Modified: branches/soc-2008-tagging/app/xcf/xcf-save.c
==============================================================================
--- branches/soc-2008-tagging/app/xcf/xcf-save.c	(original)
+++ branches/soc-2008-tagging/app/xcf/xcf-save.c	Sun Oct 12 15:38:02 2008
@@ -19,9 +19,9 @@
 #include "config.h"
 
 #include <stdio.h>
-#include <string.h> /* strcpy, strlen */
+#include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"

Modified: branches/soc-2008-tagging/app/xcf/xcf.c
==============================================================================
--- branches/soc-2008-tagging/app/xcf/xcf.c	(original)
+++ branches/soc-2008-tagging/app/xcf/xcf.c	Sun Oct 12 15:38:02 2008
@@ -22,7 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #include "libgimpbase/gimpbase.h"

Modified: branches/soc-2008-tagging/authors.xml
==============================================================================
--- branches/soc-2008-tagging/authors.xml	(original)
+++ branches/soc-2008-tagging/authors.xml	Sun Oct 12 15:38:02 2008
@@ -16,10 +16,13 @@
   <contributor role="author" last-active="1.2">Sven Anders</contributor>
   <contributor role="author" last-active="2.4">Henrik Brix Andersen</contributor>
   <contributor role="author" last-active="1.0">Karl-Johan Andersson</contributor>
+  <contributor role="documenter" last-active="2.6">Ignacio AntI</contributor>
   <contributor role="author" last-active="2.6">Nicola Archibald</contributor>
+  <contributor role="author" last-active="2.6">Luis Barrancos</contributor>
   <contributor role="author" last-active="1.0">John Beale</contributor>
   <contributor role="author" last-active="2.0">Zach Beane</contributor>
   <contributor role="author" last-active="1.0">Tom Bech</contributor>
+  <contributor role="documenter" last-active="2.6">Åygimantas BeruÄka</contributor>
   <contributor role="author" last-active="1.0">Marc Bless</contributor>
   <contributor role="author" last-active="1.0">Edward Blevins</contributor>
   <contributor role="author" last-active="1.0">Reagan Blundell</contributor>
@@ -28,7 +31,7 @@
   <contributor role="author" last-active="2.0">Stanislav Brabec</contributor>
   <contributor role="author" last-active="2.6">Hans Breuer</contributor>
   <contributor role="author" last-active="2.6">Simon Budig</contributor>
-  <contributor role="author" last-active="2.4">JoÃo S. O. Bueno</contributor>
+  <contributor role="author" last-active="2.6">JoÃo S. O. Bueno</contributor>
   <contributor role="documenter" last-active="1.2">Carey Bunks</contributor>
   <contributor role="author" last-active="2.4">Seth Burgess</contributor>
   <contributor role="author" last-active="1.0">Brent Burton</contributor>
@@ -36,11 +39,12 @@
   <contributor role="author" last-active="1.0">Albert Cahalan</contributor>
   <contributor role="artist" last-active="2.4">Lapo Calamandrei</contributor>
   <contributor role="author" last-active="2.0">George J. Carrette</contributor>
-  <contributor role="documenter" last-active="2.4">Marco Ciampa</contributor>
+  <contributor role="documenter" last-active="2.6">Marco Ciampa</contributor>
   <contributor role="author" last-active="1.0">Sean Cier</contributor>
   <contributor role="author" last-active="1.2">Winston Chang</contributor>
   <contributor role="author" last-active="2.4">Stephane Chauveau</contributor>
   <contributor role="author" last-active="2.4">Zbigniew Chyla</contributor>
+  <contributor role="author" last-active="2.6">Lars-Peter Clausen</contributor>
   <contributor role="author" last-active="2.0">Branko Collin</contributor>
   <contributor role="author" last-active="1.0">Ed Connel</contributor>
   <contributor role="author" last-active="1.2">Piers Cornwell</contributor>
@@ -49,19 +53,23 @@
   <contributor role="author" last-active="2.4">Jay Cox</contributor>
   <contributor role="author" last-active="2.6">Kevin Cozens</contributor>
   <contributor role="artist" last-active="2.4">Paul Davey</contributor>
+  <contributor role="author" last-active="2.6">Michael Deal</contributor>
+  <contributor role="artist author" last-active="2.6">Alexia Death</contributor>
   <contributor role="author" last-active="1.0">Brian Degenhardt</contributor>
   <contributor role="author" last-active="2.4">Karine Delvare</contributor>
+  <contributor role="artist" last-active="2.6">Aurore Derriennic</contributor>
   <contributor role="author" last-active="1.0">Andreas Dilger</contributor>
   <contributor role="author" last-active="2.0">Austin Donnelly</contributor>
   <contributor role="author" last-active="1.0">Scott Draves</contributor>
   <contributor role="author" last-active="1.0">Daniel Dunbar</contributor>
-  <contributor role="documenter" last-active="2.4">Dust</contributor>
+  <contributor role="documenter" last-active="2.6">Dust</contributor>
   <contributor role="author" last-active="1.2">Misha Dynin</contributor>
+  <contributor role="author" last-active="2.6">Daniel Eddeland</contributor>
   <contributor role="author" last-active="2.4">Daniel Egger</contributor>
-  <contributor role="documenter" last-active="2.6">Ulf-D. Ehlert</contributor>
+  <contributor role="author documenter" last-active="2.6">Ulf-D. Ehlert</contributor>
   <contributor role="author" last-active="2.0">Morton Eriksen</contributor>
   <contributor role="author" last-active="2.0">Larry Ewing</contributor>
-  <contributor role="documenter" last-active="2.4">Alessandro Falappa</contributor>
+  <contributor role="documenter" last-active="2.6">Alessandro Falappa</contributor>
   <contributor role="author" last-active="2.4">Pedro Alonso Ferrer</contributor>
   <contributor role="author" last-active="1.2">Nick Fetchak</contributor>
   <contributor role="author" last-active="2.4">Piotr Filiciak</contributor>
@@ -82,12 +90,13 @@
   <contributor role="author" last-active="1.2">Heiko Goller</contributor>
   <contributor role="author" last-active="1.0">Marcelo de Gomensoro Malheiros</contributor>
   <contributor role="author" last-active="2.4">Saul Goode</contributor>
-  <contributor role="author" last-active="2.4">David Gowers</contributor>
+  <contributor role="author" last-active="2.6">David Gowers</contributor>
   <contributor role="author" last-active="2.0">Cameron Gregory</contributor>
   <contributor role="author" last-active="1.2">Pavel Grinfeld</contributor>
   <contributor role="author" last-active="2.4">Dov Grobgeld</contributor>
   <contributor role="author documenter" last-active="2.4">Michael Hammel</contributor>
-  <contributor role="documenter" last-active="2.4">Julien Hardelin</contributor>
+  <contributor role="documenter" last-active="2.6">Julien Hardelin</contributor>
+  <contributor role="author" last-active="2.6">Marcus Heese</contributor>
   <contributor role="author" last-active="2.4">Robert Helgesson</contributor>
   <contributor role="author" last-active="2.0">James Henstridge</contributor>
   <contributor role="author" last-active="1.0">Eric Hernes</contributor>
@@ -95,21 +104,23 @@
   <contributor role="author" last-active="1.0">Christoph Hoegl</contributor>
   <contributor role="author" last-active="2.2">Wolfgang Hofer</contributor>
   <contributor role="author" last-active="2.2">Alan Horkan</contributor>
+  <contributor role="author" last-active="2.6">Daniel Hornung</contributor>
   <contributor role="author" last-active="1.2">Jan HubiÄka</contributor>
+  <contributor role="author" last-active="2.6">Barak Itkin</contributor>
   <contributor role="author" last-active="1.2">Ben Jackson</contributor>
   <contributor role="documenter" last-active="1.2">Simon Janes</contributor>
   <contributor role="author" last-active="2.2">Tim Janik</contributor>
   <contributor role="author" last-active="2.4">Kristian Jantz</contributor>
-  <contributor role="author documenter" last-active="2.4">RÃman Joost</contributor>
+  <contributor role="author documenter" last-active="2.6">RÃman Joost</contributor>
   <contributor role="documenter" last-active="2.4">Hans de Jonge</contributor>
-  <contributor role="author" last-active="2.4">Geert Jordaens</contributor>
-  <contributor role="author" last-active="2.4">Aurimas JuÅka</contributor>
+  <contributor role="author" last-active="2.6">Geert Jordaens</contributor>
+  <contributor role="author" last-active="2.6">Aurimas JuÅka</contributor>
   <contributor role="author" last-active="1.0">Andrew Kieschnick</contributor>
   <contributor role="author" last-active="2.2">Peter Kirchgessner</contributor>
   <contributor role="author" last-active="1.0">Philipp Klaus</contributor>
   <contributor role="author" last-active="2.0">David Koblas</contributor>
   <contributor role="author" last-active="2.2">Daniel Kobras</contributor>
-  <contributor role="author" last-active="2.4">Ãyvind KolÃs</contributor>
+  <contributor role="author" last-active="2.6">Ãyvind KolÃs</contributor>
   <contributor role="author" last-active="2.4">Robert L Krawitz</contributor>
   <contributor role="documenter" last-active="2.4">Semka KuloviÃ-Debals</contributor>
   <contributor role="artist author" last-active="2.0">Tuomas Kuosmanen</contributor>
@@ -123,6 +134,7 @@
   <contributor role="author" last-active="1.2">Marco Lamberto</contributor>
   <contributor role="author" last-active="1.2">Jens Lautenbacher</contributor>
   <contributor role="author" last-active="2.0">Laramie Leavitt</contributor>
+  <contributor role="author" last-active="2.6">Tom Lechner</contributor>
   <contributor role="author" last-active="1.0">Elliot Lee</contributor>
   <contributor role="author" last-active="2.0">Marc Lehmann</contributor>
   <contributor role="author" last-active="1.2">Ray Lehtiniemi</contributor>
@@ -132,10 +144,13 @@
   <contributor role="author" last-active="1.0">Wing Tung Leung</contributor>
   <contributor role="author" last-active="2.4">Adrian Likins</contributor>
   <contributor role="author" last-active="2.6">Tor Lillqvist</contributor>
+  <contributor role="documenter" last-active="2.6">Jean-Pierre Litzler</contributor>
+  <contributor role="documenter" last-active="2.6">Vitaly Lomov</contributor>
   <contributor role="author" last-active="1.2">Ingo LÃtkebohle</contributor>
   <contributor role="author" last-active="1.0">Josh MacDonald</contributor>
   <contributor role="author documenter" last-active="1.0">Ed Mackey</contributor>
   <contributor role="author" last-active="1.2">Vidar Madsen</contributor>
+  <contributor role="author" last-active="2.6">Luidnel Maignan</contributor>
   <contributor role="author documenter" last-active="1.2">Ian Main</contributor>
   <contributor role="author" last-active="2.4">Kjartan Maraas</contributor>
   <contributor role="author" last-active="2.6">John Marshall</contributor>
@@ -173,14 +188,17 @@
   <contributor role="author" last-active="2.0">Garry R. Osgood</contributor>
   <contributor role="author" last-active="1.0">Alan Paeth</contributor>
   <contributor role="author" last-active="1.2">Jay Painter</contributor>
-  <contributor role="author" last-active="2.0">Ville PÃtsi</contributor>
+  <contributor role="artist author" last-active="2.6">Ville PÃtsi</contributor>
   <contributor role="author" last-active="2.4">Akkana Peck</contributor>
+  <contributor role="documenter" last-active="2.6">Pierre Perrier</contributor>
   <contributor role="author" last-active="2.0">Asbjorn Pettersen</contributor>
   <contributor role="author" last-active="1.2">Mike Phillips</contributor>
   <contributor role="author" last-active="2.4">Nils Philippsen</contributor>
   <contributor role="author" last-active="2.4">Ari Pollak</contributor>
+  <contributor role="documenter" last-active="2.6">Alexandre Prokoudine</contributor>
   <contributor role="author" last-active="2.6">RaphaÃl Quinet</contributor>
   <contributor role="documenter" last-active="2.4">Manuel QuiÃones</contributor>
+  <contributor role="author" last-active="2.6">Dennis Ranke</contributor>
   <contributor role="author" last-active="1.2">Tom Rathborne</contributor>
   <contributor role="author" last-active="2.0">Jens Restemeier</contributor>
   <contributor role="author" last-active="2.4">Maurits Rijk</contributor>
@@ -190,19 +208,19 @@
   <contributor role="author" last-active="2.4">Stefan RÃllin</contributor>
   <contributor role="author" last-active="2.4">Guillermo S. Romero</contributor>
   <contributor role="author" last-active="1.0">Tim Rowley</contributor>
-  <contributor role="author artist" last-active="1.2">Mike Schaeffer</contributor>
+  <contributor role="artist author" last-active="1.2">Mike Schaeffer</contributor>
   <contributor role="author" last-active="1.0">John Schlag</contributor>
   <contributor role="author" last-active="1.0">Norbert Schmitz</contributor>
   <contributor role="author" last-active="1.0">Thorsten Schnier</contributor>
   <contributor role="author" last-active="1.2">Alexander Schulz</contributor>
-  <contributor role="author" last-active="2.4">Michael Schumacher</contributor>
+  <contributor role="author" last-active="2.6">Michael Schumacher</contributor>
   <contributor role="author" last-active="1.0">Tracy Scott</contributor>
   <contributor role="author" last-active="1.2">Craig Setera</contributor>
-  <contributor role="author" last-active="2.4">Peter Sikking</contributor>
+  <contributor role="author" last-active="2.6">Peter Sikking</contributor>
   <contributor role="author" last-active="2.4">Ted Shaneyfelt</contributor>
   <contributor role="author" last-active="1.2">Aaron Sherman</contributor>
   <contributor role="documenter" last-active="2.4">Nickolay V. Shmyrev</contributor>
-  <contributor role="author" last-active="2.4">Jernej SimonÄiÄ</contributor>
+  <contributor role="author" last-active="2.6">Jernej SimonÄiÄ</contributor>
   <contributor role="author" last-active="2.6">Manish Singh</contributor>
   <contributor role="author" last-active="2.4">Mukund Sivaraman</contributor>
   <contributor role="author" last-active="2.6">William Skaggs</contributor>
@@ -210,7 +228,9 @@
   <contributor role="author" last-active="2.4">Kevin Sookocheff</contributor>
   <contributor role="artist" last-active="2.4">Carol Spears</contributor>
   <contributor role="author" last-active="2.0">Adam Spiers</contributor>
+  <contributor role="documenter" last-active="2.6">Patrycja Stawiarska</contributor>
   <contributor role="artist author" last-active="2.6">Jakub Steiner</contributor>
+  <contributor role="documenter" last-active="2.6">KolbjÃrn StuestÃl</contributor>
   <contributor role="author" last-active="2.4">Nathan Summers</contributor>
   <contributor role="author" last-active="1.0">Mike Sweet</contributor>
   <contributor role="artist" last-active="2.4">William Szilveszter</contributor>
@@ -228,12 +248,11 @@
   <contributor role="author" last-active="2.0">Martin Weber</contributor>
   <contributor role="author" last-active="1.2">James Wang</contributor>
   <contributor role="author" last-active="1.2">Kris Wehner</contributor>
-  <contributor role="documenter" last-active="2.4">Axel Wernicke</contributor>
+  <contributor role="documenter" last-active="2.6">Axel Wernicke</contributor>
   <contributor role="author" last-active="1.0">Nigel Wetten</contributor>
   <contributor role="author" last-active="1.2">Calvin Williamson</contributor>
   <contributor role="author" last-active="2.4">Matthew Wilson</contributor>
   <contributor role="author" last-active="2.4">Karl GÃnter WÃnsch</contributor>
   <contributor role="author" last-active="2.4">Yoshinori Yamakawa</contributor>
   <contributor role="author" last-active="1.2">Shirasaki Yasuhiro</contributor>
-
 </gimp-authors>

Modified: branches/soc-2008-tagging/configure.in
==============================================================================
--- branches/soc-2008-tagging/configure.in	(original)
+++ branches/soc-2008-tagging/configure.in	Sun Oct 12 15:38:02 2008
@@ -7,8 +7,8 @@
 #   GIMP_INTERFACE_AGE += 1;
 
 m4_define([gimp_major_version], [2])
-m4_define([gimp_minor_version], [5])
-m4_define([gimp_micro_version], [3])
+m4_define([gimp_minor_version], [7])
+m4_define([gimp_micro_version], [0])
 m4_define([gimp_real_version],
           [gimp_major_version.gimp_minor_version.gimp_micro_version])
 m4_define([gimp_version], [gimp_real_version])
@@ -17,20 +17,20 @@
           [m4_eval(100 * gimp_minor_version + gimp_micro_version)])
 
 # For overriding the version string. Comment out if not needed.
-# m4_define([gimp_version], [2.5.0])
+# m4_define([gimp_version], [2.7.0])
 
 # This is the X.Y used in -lgimp-X.Y
 m4_define([gimp_api_version], [2.0])
 
 # Versions used for apps, plugins, tools, pkg-config files, and data,
 # as well as global and user prefs
-m4_define([gimp_app_version], [2.5])
+m4_define([gimp_app_version], [2.7])
 m4_define([gimp_plugin_version], [2.0])
 m4_define([gimp_tool_version], [2.0])
 m4_define([gimp_pkgconfig_version], [2.0])
 m4_define([gimp_data_version], [2.0])
 m4_define([gimp_sysconf_version], [2.0])
-m4_define([gimp_user_version], [2.5])
+m4_define([gimp_user_version], [2.7])
 
 m4_define([gimp_unstable],
           m4_if(m4_eval(gimp_minor_version % 2), [1], [yes], [no]))
@@ -43,7 +43,7 @@
 m4_define([babl_required_version], [0.0.22])
 m4_define([gegl_required_version], [0.0.18])
 m4_define([glib_required_version], [2.16.1])
-m4_define([gtk_required_version], [2.12.1])
+m4_define([gtk_required_version], [2.12.5])
 m4_define([gdk_pixbuf_required_version], [gtk_required_version])
 m4_define([pangoft2_required_version], [1.18.0])
 m4_define([fontconfig_required_version], [2.2.0])
@@ -410,15 +410,14 @@
 # Internationalisation
 ######################
 
-# Note to translators: you MUST have .po files in all 6 directories:
-# po, po-libgimp, po-plug-ins, po-python, po-script-fu and po-tips
-# before adding your language code to ALL_LINGUAS.
-ALL_LINGUAS="ar be bg ca ca valencia cs da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hu hr id is it ja km ko lt mk ms nb ne nl nn oc pa pl pt pt_BR ro ru rw sk sl sr sr Latn sv tr tt uk vi xh yi zh_CN zh_TW"
-
 IT_PROG_INTLTOOL(0.35.5)
 AM_GLIB_GNU_GETTEXT
 
 
+###########
+# iso-codes
+###########
+
 AC_MSG_CHECKING([for iso-codes])
 PKG_CHECK_EXISTS(iso-codes,
   have_iso_codes="yes"
@@ -438,14 +437,8 @@
 # Checks for required libraries
 ###############################
 
-
-PKG_CHECK_MODULES(BABL, babl >= babl_required_version, :,
-  AC_MSG_ERROR([Test for babl failed. Please get it from http://gegl.org/]))
-
-
-PKG_CHECK_MODULES(GEGL, gegl >= gegl_required_version, :,
-  AC_MSG_ERROR([Test for GEGL failed. Please get it from http://gegl.org/]))
-
+PKG_CHECK_MODULES(BABL, babl >= babl_required_version)
+PKG_CHECK_MODULES(GEGL, gegl >= gegl_required_version)
 
 AM_PATH_GLIB_2_0(glib_required_version, :,
   AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
@@ -892,11 +885,13 @@
 #############################
 
 AC_ARG_ENABLE(mp, [  --disable-mp            disable support for multiple processors])
+
 if test "x$enable_mp" != "xno"; then
   AC_DEFINE(ENABLE_MP, 1,
 	    [Define to 1 to enable support for multiple processors.])
 fi
 
+
 ###################################################
 # gimp-remote is obsolete, but can still be enabled
 ###################################################
@@ -993,34 +988,35 @@
 # Check for libtiff
 ###################
 
-have_libtiff=no
 AC_ARG_WITH(libtiff,  [  --without-libtiff       build without TIFF support])
-  if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
-    have_libtiff=yes
-    AC_CHECK_LIB(tiff, TIFFReadScanline,
+
+have_libtiff=no
+if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
+  have_libtiff=yes
+  AC_CHECK_LIB(tiff, TIFFReadScanline,
+    [AC_CHECK_HEADER(tiffio.h,
+      FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff',
+      [have_libtiff="no (TIFF header files not found)"])],
+    [AC_CHECK_LIB(tiff, TIFFWriteScanline,
       [AC_CHECK_HEADER(tiffio.h,
-	FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff',
+        FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff -ljpeg -lz',
 	[have_libtiff="no (TIFF header files not found)"])],
-      [AC_CHECK_LIB(tiff, TIFFWriteScanline,
+      [AC_CHECK_LIB(tiff34, TIFFFlushData,
 	[AC_CHECK_HEADER(tiffio.h,
-          FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff -ljpeg -lz',
+          FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff34 -ljpeg -lz',
 	  [have_libtiff="no (TIFF header files not found)"])],
-	[AC_CHECK_LIB(tiff34, TIFFFlushData,
-	  [AC_CHECK_HEADER(tiffio.h,
-            FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff34 -ljpeg -lz',
-	    [have_libtiff="no (TIFF header files not found)"])],
-        [have_libtiff="no (TIFF library not found)"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
-  fi
+      [have_libtiff="no (TIFF library not found)"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
+fi
 
-  if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
-    AC_MSG_ERROR([
+if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
+  AC_MSG_ERROR([
 *** Checks for TIFF libary failed. You can build without it by passing
 *** --without-libtiff to configure but you won't be able to use TIFFs then.])
-  fi
+fi
 
-  if test "x$have_libtiff" = xyes; then
-    MIME_TYPES="$MIME_TYPES;image/tiff"
-  fi
+if test "x$have_libtiff" = xyes; then
+  MIME_TYPES="$MIME_TYPES;image/tiff"
+fi
 
 AC_SUBST(FILE_TIFF_LOAD)
 AC_SUBST(FILE_TIFF_SAVE)
@@ -1031,45 +1027,45 @@
 # Check for libjpeg
 ###################
 
-jpeg_ok=no
-
 AC_ARG_WITH(libjpeg,  [  --without-libjpeg       build without JPEG support])
-  if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
-    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
-      jpeg_ok=yes,
-      [jpeg_ok="no (JPEG library not found)"
-      AC_MSG_WARN(*** XJT plug-in will not be built (JPEG library not found) ***)])
-    if test "$jpeg_ok" = yes; then
-      AC_MSG_CHECKING([for jpeglib.h])
-      AC_TRY_CPP([
+
+jpeg_ok=no
+if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
+  AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
+    jpeg_ok=yes,
+    [jpeg_ok="no (JPEG library not found)"
+    AC_MSG_WARN(*** XJT plug-in will not be built (JPEG library not found) ***)])
+  if test "$jpeg_ok" = yes; then
+    AC_MSG_CHECKING([for jpeglib.h])
+    AC_TRY_CPP([
 #include <stdio.h>
 #undef HAVE_STDDEF_H
 #undef HAVE_STDLIB_H
 #undef PACKAGE
 #undef VERSION
 #include <jpeglib.h>],
-	jpeg_ok=yes,
-	jpeg_ok="no (Can't include jpeglib.h)")
-      AC_MSG_RESULT($jpeg_ok)
-      if test "$jpeg_ok" = yes; then
-	AC_CHECK_LIB(jpeg, jpeg_save_markers,
-	JPEG='jpeg$(EXEEXT)'; JPEG_LIBS='-ljpeg',
-        jpeg_ok="no (JPEG library is too old)")
-      else
-	jpeg_ok="no (JPEG header file not found)"
-      fi
+      jpeg_ok=yes,
+      jpeg_ok="no (Can't include jpeglib.h)")
+    AC_MSG_RESULT($jpeg_ok)
+    if test "$jpeg_ok" = yes; then
+      AC_CHECK_LIB(jpeg, jpeg_save_markers,
+      JPEG='jpeg$(EXEEXT)'; JPEG_LIBS='-ljpeg',
+      jpeg_ok="no (JPEG library is too old)")
+    else
+      jpeg_ok="no (JPEG header file not found)"
     fi
   fi
+fi
 
-  if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
-    AC_MSG_ERROR([
+if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
+  AC_MSG_ERROR([
 *** Checks for JPEG library failed. You can build without it by passing
 *** --without-libjpeg to configure but you won't be able to use JPEGs then.])
-  fi
+fi
 
-  if test "x$jpeg_ok" = xyes; then
-    MIME_TYPES="$MIME_TYPES;image/jpeg"
-  fi
+if test "x$jpeg_ok" = xyes; then
+  MIME_TYPES="$MIME_TYPES;image/jpeg"
+fi
 
 AM_CONDITIONAL(BUILD_JPEG, test "x$jpeg_ok" = xyes)
 AC_SUBST(JPEG_LIBS)
@@ -1112,8 +1108,9 @@
 # Check for libpng
 ##################
 
-have_libpng=no
 AC_ARG_WITH(libpng,  [  --without-libpng        build without PNG support])
+
+have_libpng=no
 if test "x$with_libpng" != xno; then
   have_libpng=yes
   PKG_CHECK_MODULES(PNG, libpng,
@@ -1137,20 +1134,21 @@
 # Check for libmng
 ##################
 
-have_libmng=no
 AC_ARG_WITH(libmng,  [  --without-libmng        build without MNG support])
-  have_libmng=yes
-  if test "x$with_libmng" != xno && test -z "$MNG_LIBS" &&
-     test -n "$PNG_LIBS" && test -n "$JPEG_LIBS" && test -n "$Z_LIBS"; then
-    AC_CHECK_LIB(mng, mng_create,
-      [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
-      [have_libmng="no (MNG library not found)"], -lz -lm)
-    if test "$mng_ok" = yes; then
-      FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"
-    else
-      have_libmng="no (MNG header file not found)"
-    fi
+
+have_libmng=no
+if test "x$with_libmng" != xno && test -z "$MNG_LIBS" &&
+   test -n "$PNG_LIBS" && test -n "$JPEG_LIBS" && test -n "$Z_LIBS"; then
+  AC_CHECK_LIB(mng, mng_create,
+    [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
+    [have_libmng="no (MNG library not found)"], -lz -lm)
+  if test "$mng_ok" = yes; then
+    have_libmng=yes
+    FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"
+  else
+    have_libmng="no (MNG header file not found)"
   fi
+fi
 
 AC_SUBST(FILE_MNG)
 AC_SUBST(MNG_LIBS)
@@ -1162,8 +1160,9 @@
 # avoid destruction, but no data modification is performed.
 ############################################################
 
-have_libexif=no
 AC_ARG_WITH(libexif,  [  --without-libexif       build without EXIF support])
+
+have_libexif=no
 if test "x$with_libexif" != xno && test -z "$EXIF_LIBS" && test -n "$JPEG_LIBS"; then
   have_libexif=yes
   PKG_CHECK_MODULES(EXIF, libexif >= exif_required_version,
@@ -1179,9 +1178,9 @@
 # Check for libaa
 #################
 
+AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
 
 have_libaa=no
-AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
 if test "x$with_aa" != xno && test -z "$AA_LIBS"; then
   have_libaa=yes
   AC_CHECK_LIB(aa, aa_printf,
@@ -1279,12 +1278,13 @@
 # Allow to disable the print plug-in
 ####################################
 
-enable_print="no (disabled)"
 AC_ARG_WITH(print,[  --without-print         build without print support])
 
+enable_print="no (disabled)"
 if test "x$with_print" != xno; then
-    enable_print="yes"
+  enable_print="yes"
 fi
+
 AM_CONDITIONAL(BUILD_PRINT, test "x$enable_print" == xyes)
 
 
@@ -1292,9 +1292,9 @@
 # Check for libpoppler
 ######################
 
-have_poppler=no
 AC_ARG_WITH(poppler,[  --without-poppler       build without poppler support])
 
+have_poppler=no
 if test "x$with_poppler" != xno; then
   PKG_CHECK_MODULES(POPPLER,
     poppler-glib >= poppler_required_version gthread-2.0,
@@ -1394,22 +1394,26 @@
 # Check for libwmf2
 ###################
 
+AC_ARG_WITH(wmf, [  --without-wmf           build without WMF support])
+
 have_libwmf=no
-AC_PATH_PROG(WMF_CONFIG, libwmf-config, no)
-if test "x$WMF_CONFIG" != "xno" ; then
-  have_libwmf=yes
-  AC_MSG_CHECKING(for libwmf >= wmf_required_version)
-  wmf_version=`$WMF_CONFIG --version`
-  if expr $wmf_version \>= wmf_required_version >/dev/null; then
-    AC_MSG_RESULT([yes (version $wmf_version)])
-    FILE_WMF='file-wmf$(EXEEXT)'
-    WMF_LIBS=`$WMF_CONFIG --libs`
-    WMF_CFLAGS=`$WMF_CONFIG --cflags`
+if test "x$with_wmf" != xno; then
+  AC_PATH_PROG(WMF_CONFIG, libwmf-config, no)
+  if test "x$WMF_CONFIG" != "xno" ; then
+    have_libwmf=yes
+    AC_MSG_CHECKING(for libwmf >= wmf_required_version)
+    wmf_version=`$WMF_CONFIG --version`
+    if expr $wmf_version \>= wmf_required_version >/dev/null; then
+      AC_MSG_RESULT([yes (version $wmf_version)])
+      FILE_WMF='file-wmf$(EXEEXT)'
+      WMF_LIBS=`$WMF_CONFIG --libs`
+      WMF_CFLAGS=`$WMF_CONFIG --cflags`
+    else
+      have_libwmf="no (libwmf is too old)"
+   fi
   else
-    have_libwmf="no (libwmf is too old)"
+    have_libwmf="no (libwmf not found)"
   fi
-else
-  have_libwmf="no (libwmf not found)"
 fi
 
 if test "x$have_libwmf" = xyes; then
@@ -1444,9 +1448,9 @@
 # Check for alsa
 ################
 
-have_alsa=no
 AC_ARG_WITH(alsa, [  --without-alsa          disable alsa support in midi input controller])
 
+have_alsa="no (alsa support disabled)"
 if test "x$with_alsa" != xno; then
   have_alsa=yes
   AM_PATH_ALSA(alsa_required_version,
@@ -1461,7 +1465,7 @@
 
 AC_ARG_WITH(linux-input, [  --without-linux-input   don't build linux input event controller module])
 
-have_linux_input=no
+have_linux_input="no (linux input support disabled)"
 if test "x$with_linux_input" != "xno"; then
   AC_CHECK_HEADER(linux/input.h,
 	AC_CHECK_DECL(KEY_OK,
@@ -1517,11 +1521,9 @@
 have_dbus_glib="no (disabled)"
 
 if test "x$with_dbus" != xno; then
-
-PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_required_version,
-  have_dbus_glib=yes,
-  have_dbus_glib=no)
-
+  PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_required_version,
+    have_dbus_glib=yes,
+    have_dbus_glib=no)
 fi
 
 if test "x$have_dbus_glib" = xyes; then
@@ -1552,11 +1554,10 @@
 fi
 
 if test "x$have_linux_input" = xyes && test "x$have_dbus_glib" = xyes &&
-    test "x$with_hal" != xno; then
+   test "x$with_hal" != xno; then
   PKG_CHECK_MODULES(HAL, hal >= libhal_required_version,
     have_libhal=yes,
-    have_libhal="no (libhal not found)"
-    )
+    have_libhal="no (libhal not found)")
 fi
 
 if test "x$have_libhal" = xyes; then
@@ -1635,8 +1636,8 @@
 if test "x$enable_python" != xno; then
   enable_python="yes"
   # check for Python
-  AM_PATH_PYTHON(2.3.5,,
-    [AC_MSG_ERROR([pycheck_error([Python 2.3.5 or newer], [it])])])
+  AM_PATH_PYTHON(2.5.0,,
+    [AC_MSG_ERROR([pycheck_error([Python 2.5.0 or newer], [it])])])
   AM_CHECK_PYTHON_HEADERS(,
     [AC_MSG_ERROR([pycheck_error([Python headers], [them])])])
 
@@ -1647,7 +1648,7 @@
   PYLINK_LIBS=
   if test "x$platform_win32" = "xyes"; then
     PYBIN_PATH="$py_exec_prefix\pythonw.exe"
-    PYTHON_INCLUDES=`$echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
+    PYTHON_INCLUDES=`echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
     py_exec_prefix=`echo "$py_exec_prefix" | sed -e 's/\\\\/\\//g'`
     pylibversion=`echo $PYTHON_VERSION | sed -e 's/\\.//'`
     PYLINK_LIBS="-L${py_exec_prefix}/libs -lpython${pylibversion}"
@@ -1849,7 +1850,7 @@
 # Disable deprecated APIs
 #########################
 
-CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
+CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED"
 
 if test "x$have_glib_2_19" != "xyes"; then
   CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED"
@@ -2005,7 +2006,6 @@
 plug-ins/pygimp/plug-ins/Makefile
 plug-ins/script-fu/Makefile
 plug-ins/script-fu/ftx/Makefile
-plug-ins/script-fu/re/Makefile
 plug-ins/script-fu/scripts/Makefile
 plug-ins/script-fu/scripts/images/Makefile
 plug-ins/script-fu/tinyscheme/Makefile

Modified: branches/soc-2008-tagging/cursors/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/cursors/makefile.msc	(original)
+++ branches/soc-2008-tagging/cursors/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -60,6 +60,7 @@
 	tool_paths_segment	tool-paths-segment.png \
 	tool_pencil		tool-pencil.png \
 	tool_perspective		tool-perspective.png \
+	tool_polygon_select	tool-polygon-select.png \
 	tool_rect_select		tool-rect-select.png \
 	tool_resize		tool-resize.png \
 	tool_rotate		tool-rotate.png \

Modified: branches/soc-2008-tagging/data/images/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/data/images/Makefile.am	(original)
+++ branches/soc-2008-tagging/data/images/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -2,8 +2,14 @@
 
 imagedatadir = $(gimpdatadir)/images
 
+if GIMP_UNSTABLE
+GIMP_LOGO = gimp-devel-logo.png
+else
+GIMP_LOGO = gimp-logo.png
+endif
+
 imagedata_DATA = \
-	gimp-logo.png	\
+	$(GIMP_LOGO)	\
 	gimp-splash.png	\
 	wilber.png
 

Modified: branches/soc-2008-tagging/data/images/gimp-splash.png
==============================================================================
Binary files. No diff available.

Modified: branches/soc-2008-tagging/devel-docs/app/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/devel-docs/app/Makefile.am	(original)
+++ branches/soc-2008-tagging/devel-docs/app/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -100,7 +100,6 @@
         $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la       \
         $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la   \
         $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la       \
-        $(REGEXREPL)							     \
         $(GTK_LIBS)                                                          \
         $(LIBART_LIBS)                                                       \
         $(PANGOFT2_LIBS)                                                     \

Modified: branches/soc-2008-tagging/devel-docs/app/app-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/app/app-sections.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/app/app-sections.txt	Sun Oct 12 15:38:02 2008
@@ -449,6 +449,7 @@
 gimp_new
 gimp_initialize
 gimp_restore
+gimp_is_restored
 gimp_exit
 gimp_load_config
 gimp_create_image
@@ -771,6 +772,7 @@
 gimp_buffer_get_image_type
 gimp_buffer_get_width
 gimp_buffer_get_height
+gimp_buffer_get_tiles
 <SUBSECTION Standard>
 GimpBufferClass
 GIMP_BUFFER
@@ -1064,6 +1066,7 @@
 gimp_data_get_mime_type
 gimp_data_duplicate
 gimp_data_make_internal
+gimp_data_compare
 gimp_data_name_compare
 GIMP_DATA_ERROR
 gimp_data_error_quark
@@ -1561,6 +1564,7 @@
 gimp_image_clean
 gimp_image_clean_all
 gimp_image_flush
+gimp_image_get_projection
 gimp_image_get_foreground
 gimp_image_get_background
 gimp_image_get_color
@@ -2658,6 +2662,19 @@
 gimp_value_set_stringarray
 gimp_value_set_static_stringarray
 gimp_value_take_stringarray
+gimp_param_color_array_get_type
+GIMP_TYPE_PARAM_COLOR_ARRAY
+GIMP_PARAM_SPEC_COLOR_ARRAY
+GIMP_IS_PARAM_SPEC_COLOR_ARRAY
+GimpParamSpecColorArray
+gimp_color_array_get_type
+gimp_param_spec_color_array
+gimp_value_dup_colorarray
+gimp_value_get_colorarray
+gimp_value_set_colorarray
+gimp_value_set_static_colorarray
+gimp_value_take_colorarray
+
 <SUBSECTION Standard>
 GIMP_PARAM_SPEC_INT32
 GIMP_IS_PARAM_SPEC_INT32
@@ -2693,6 +2710,7 @@
 gimp_canvas_set_custom_gc
 gimp_canvas_set_stipple_index
 gimp_canvas_set_bg_color
+gimp_canvas_scroll
 <SUBSECTION Standard>
 GimpCanvasClass
 GIMP_CANVAS
@@ -2873,7 +2891,6 @@
 <SECTION>
 <FILE>gimpdisplayshell-callbacks</FILE>
 <TITLE>GimpDisplayShell-callbacks</TITLE>
-GIMP_DISPLAY_SHELL_CANVAS_EVENT_MASK
 gimp_display_shell_events
 gimp_display_shell_canvas_realize
 gimp_display_shell_canvas_size_allocate
@@ -2987,19 +3004,22 @@
 <SECTION>
 <FILE>gimpdisplayshell-scale</FILE>
 <TITLE>GimpDisplayShell-scale</TITLE>
-gimp_display_shell_scale_setup
+gimp_display_shell_update_scrollbars_and_rulers
+gimp_display_shell_scale_update_scrollbars
+gimp_display_shell_scale_update_rulers
 gimp_display_shell_scale_revert
 gimp_display_shell_scale_can_revert
 gimp_display_shell_scale_set_dot_for_dot
 gimp_display_shell_scale
-gimp_display_shell_scale_to
 gimp_display_shell_scale_fit_in
+gimp_display_shell_scale_image_is_within_viewport
 gimp_display_shell_scale_fill
+gimp_display_shell_scale_handle_zoom_revert
 gimp_display_shell_scale_by_values
 gimp_display_shell_scale_shrink_wrap
 gimp_display_shell_scale_resize
+gimp_display_shell_calculate_scale_x_and_y
 gimp_display_shell_set_initial_scale
-gimp_display_shell_scale_dialog
 </SECTION>
 
 <SECTION>
@@ -3539,8 +3559,8 @@
 <TITLE>GimpPerspectiveClone</TITLE>
 GimpPerspectiveClone
 gimp_perspective_clone_register
+gimp_perspective_clone_set_transform
 gimp_perspective_clone_get_source_point
-gimp_perspective_clone_get_matrix
 <SUBSECTION Standard>
 GimpPerspectiveCloneClass
 GIMP_PERSPECTIVE_CLONE
@@ -4169,6 +4189,7 @@
 gimp_draw_tool_in_radius
 gimp_draw_tool_draw_line
 gimp_draw_tool_draw_dashed_line
+gimp_draw_tool_draw_guide_line
 gimp_draw_tool_draw_rectangle
 gimp_draw_tool_draw_arc
 gimp_draw_tool_draw_rectangle_by_anchor
@@ -4449,7 +4470,6 @@
 <FILE>gimpimagemaptool-settings</FILE>
 <TITLE>GimpImageMapTool-settings</TITLE>
 gimp_image_map_tool_add_settings_gui
-gimp_image_map_tool_add_recent_settings
 gimp_image_map_tool_real_settings_import
 gimp_image_map_tool_real_settings_export
 </SECTION>
@@ -5109,6 +5129,8 @@
 gimp_tool_control_get_cursor
 gimp_tool_control_get_tool_cursor
 gimp_tool_control_get_cursor_modifier
+gimp_tool_control_get_precision
+gimp_tool_control_set_precision
 gimp_tool_control_set_action_value_1
 gimp_tool_control_get_action_value_1
 gimp_tool_control_set_action_value_2
@@ -5464,6 +5486,7 @@
 <TITLE>GimpActionView</TITLE>
 GimpActionView
 gimp_action_view_new
+gimp_action_view_set_filter
 <SUBSECTION Standard>
 GimpActionViewClass
 GIMP_ACTION_VIEW
@@ -5936,6 +5959,7 @@
 <TITLE>GimpContainerTreeView</TITLE>
 GimpContainerTreeView
 gimp_container_tree_view_new
+gimp_container_tree_view_connect_name_edited
 <SUBSECTION Standard>
 GimpContainerTreeViewClass
 GIMP_CONTAINER_TREE_VIEW
@@ -7222,6 +7246,8 @@
 <TITLE>GimpNavigationView</TITLE>
 GimpNavigationView
 gimp_navigation_view_set_marker
+gimp_navigation_view_set_motion_offset
+gimp_navigation_view_get_local_marker
 gimp_navigation_view_grab_pointer
 <SUBSECTION Standard>
 GimpNavigationViewClass
@@ -8116,6 +8142,7 @@
 <FILE>gimphistogram</FILE>
 GimpHistogram
 gimp_histogram_new
+gimp_histogram_duplicate
 gimp_histogram_ref
 gimp_histogram_unref
 gimp_histogram_calculate
@@ -8209,7 +8236,9 @@
 <SECTION>
 <FILE>pixel-surround</FILE>
 PixelSurround
+PixelSurroundMode
 pixel_surround_new
+pixel_surround_set_bg
 pixel_surround_lock
 pixel_surround_release
 pixel_surround_destroy
@@ -9138,12 +9167,14 @@
 gimp_marshal_BOOLEAN__ENUM_INT
 gimp_marshal_BOOLEAN__OBJECT_POINTER
 gimp_marshal_BOOLEAN__OBJECT_POINTER_STRING
+gimp_marshal_BOOLEAN__STRING
 gimp_marshal_VOID__BOOLEAN
 gimp_marshal_VOID__BOOLEAN_INT_INT_INT_INT
 gimp_marshal_VOID__BOXED
 gimp_marshal_VOID__BOXED_ENUM
 gimp_marshal_VOID__DOUBLE
 gimp_marshal_VOID__DOUBLE_DOUBLE
+gimp_marshal_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE
 gimp_marshal_VOID__ENUM
 gimp_marshal_VOID__ENUM_ENUM_BOXED_INT
 gimp_marshal_VOID__ENUM_OBJECT
@@ -9623,6 +9654,7 @@
 shade_region
 copy_region
 copy_region_nocow
+clear_region
 add_alpha_region
 flatten_region
 extract_alpha_region
@@ -9819,6 +9851,7 @@
 gimp_plug_in_procedure_set_help_domain
 gimp_plug_in_procedure_get_locale_domain
 gimp_plug_in_procedure_set_locale_domain
+gimp_plug_in_procedure_handle_return_values
 <SUBSECTION Standard>
 GimpPlugInProcedureClass
 GIMP_PLUG_IN_PROCEDURE
@@ -9897,6 +9930,8 @@
 gimp_plug_in_menu_register
 gimp_plug_in_add_temp_proc
 gimp_plug_in_remove_temp_proc
+gimp_plug_in_set_error_handler
+gimp_plug_in_get_error_handler
 WRITE_BUFFER_SIZE
 <SUBSECTION Standard>
 GimpPlugInClass
@@ -9969,7 +10004,7 @@
 gimp_plug_in_proc_frame_dispose
 gimp_plug_in_proc_frame_ref
 gimp_plug_in_proc_frame_unref
-gimp_plug_in_proc_frame_get_return_vals
+gimp_plug_in_proc_frame_get_return_values
 </SECTION>
 
 <SECTION>
@@ -10153,12 +10188,10 @@
 <SECTION>
 <FILE>gimpeditselectiontool</FILE>
 <TITLE>GimpEditSelectionTool</TITLE>
-GimpEditSelectionTool
 gimp_edit_selection_tool_start
 gimp_edit_selection_tool_key_press
 gimp_edit_selection_tool_translate
 <SUBSECTION Standard>
-GimpEditSelectionToolClass
 GIMP_EDIT_SELECTION_TOOL
 GIMP_IS_EDIT_SELECTION_TOOL
 GIMP_TYPE_EDIT_SELECTION_TOOL
@@ -10452,6 +10485,7 @@
 <SECTION>
 <FILE>gimphelp</FILE>
 gimp_help_show
+gimp_help_user_manual_is_installed
 </SECTION>
 
 <SECTION>
@@ -11015,6 +11049,7 @@
 edit_paste_cmd_callback
 edit_paste_into_cmd_callback
 edit_paste_as_new_cmd_callback
+edit_paste_as_new_layer_cmd_callback
 edit_named_cut_cmd_callback
 edit_named_copy_cmd_callback
 edit_named_copy_visible_cmd_callback
@@ -11123,6 +11158,7 @@
 layers_lower_to_bottom_cmd_callback
 layers_new_cmd_callback
 layers_new_last_vals_cmd_callback
+layers_new_from_visible_cmd_callback
 layers_duplicate_cmd_callback
 layers_anchor_cmd_callback
 layers_merge_down_cmd_callback

Modified: branches/soc-2008-tagging/devel-docs/app/app.types
==============================================================================
--- branches/soc-2008-tagging/devel-docs/app/app.types	(original)
+++ branches/soc-2008-tagging/devel-docs/app/app.types	Sun Oct 12 15:38:02 2008
@@ -1,6 +1,7 @@
 #include <gtk/gtk.h>
 #include "libgimpwidgets/gimpwidgets.h"
 
+gimp_action_editor_get_type
 gimp_action_factory_get_type
 gimp_action_get_type
 gimp_action_group_get_type
@@ -282,8 +283,10 @@
 gimp_selection_options_get_type
 gimp_selection_tool_get_type
 gimp_session_info_get_type
+gimp_settings_box_get_type
 gimp_shear_tool_get_type
 gimp_size_box_get_type
+gimp_settings_editor_get_type
 gimp_smudge_get_type
 gimp_smudge_options_get_type
 gimp_smudge_tool_get_type

Modified: branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt	Sun Oct 12 15:38:02 2008
@@ -24,6 +24,7 @@
 gimp_run_procedure2
 gimp_destroy_params
 gimp_destroy_paramdefs
+gimp_get_pdb_error
 gimp_tile_width
 gimp_tile_height
 gimp_shm_ID
@@ -519,6 +520,7 @@
 gimp_image_resize
 gimp_image_resize_to_layers
 gimp_image_scale
+gimp_image_scale_full
 gimp_image_crop
 gimp_image_get_layers
 gimp_image_get_channels
@@ -595,6 +597,7 @@
 gimp_layer_new_from_visible
 gimp_layer_copy
 gimp_layer_scale
+gimp_layer_scale_full
 gimp_layer_resize
 gimp_layer_resize_to_image_size
 gimp_layer_translate
@@ -772,6 +775,8 @@
 gimp_plugin_icon_register
 gimp_plugin_menu_register
 gimp_plugin_menu_branch_register
+gimp_plugin_set_pdb_error_handler
+gimp_plugin_get_pdb_error_handler
 </SECTION>
 
 <SECTION>

Modified: branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimp.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimp.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimp.sgml	Sun Oct 12 15:38:02 2008
@@ -249,6 +249,14 @@
 @n_params: 
 
 
+<!-- ##### FUNCTION gimp_get_pdb_error ##### -->
+<para>
+
+</para>
+
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_tile_width ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpimage.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpimage.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpimage.sgml	Sun Oct 12 15:38:02 2008
@@ -155,6 +155,18 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_image_scale_full ##### -->
+<para>
+
+</para>
+
+ image_ID: 
+ new_width: 
+ new_height: 
+ interpolation: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_image_crop ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimplayer.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimplayer.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimplayer.sgml	Sun Oct 12 15:38:02 2008
@@ -75,6 +75,19 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_layer_scale_full ##### -->
+<para>
+
+</para>
+
+ layer_ID: 
+ new_width: 
+ new_height: 
+ local_origin: 
+ interpolation: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_layer_resize ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpplugin.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpplugin.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimpplugin.sgml	Sun Oct 12 15:38:02 2008
@@ -69,3 +69,20 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_plugin_set_pdb_error_handler ##### -->
+<para>
+
+</para>
+
+ handler: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gimp_plugin_get_pdb_error_handler ##### -->
+<para>
+
+</para>
+
+ Returns: 
+
+

Modified: branches/soc-2008-tagging/devel-docs/libgimpbase/libgimpbase-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpbase/libgimpbase-sections.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpbase/libgimpbase-sections.txt	Sun Oct 12 15:38:02 2008
@@ -32,6 +32,7 @@
 GimpMessageHandlerType
 GimpPaintApplicationMode
 GimpPDBArgType
+GimpPDBErrorHandler
 GimpPDBProcType
 GimpPDBStatusType
 GimpProgressCommand
@@ -67,6 +68,7 @@
 GIMP_TYPE_MESSAGE_HANDLER_TYPE
 GIMP_TYPE_PAINT_APPLICATION_MODE
 GIMP_TYPE_PDB_ARG_TYPE
+GIMP_TYPE_PDB_ERROR_HANDLER
 GIMP_TYPE_PDB_PROC_TYPE
 GIMP_TYPE_PDB_STATUS_TYPE
 GIMP_TYPE_PROGRESS_COMMAND
@@ -101,6 +103,7 @@
 gimp_message_handler_type_get_type
 gimp_paint_application_mode_get_type
 gimp_pdb_arg_type_get_type
+gimp_pdb_error_handler_get_type
 gimp_pdb_proc_type_get_type
 gimp_pdb_status_type_get_type
 gimp_progress_command_get_type

Modified: branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	Sun Oct 12 15:38:02 2008
@@ -240,6 +240,14 @@
 @GIMP_PDB_PATH: 
 @GIMP_PDB_BOUNDARY: 
 
+<!-- ##### ENUM GimpPDBErrorHandler ##### -->
+<para>
+
+</para>
+
+ GIMP_PDB_ERROR_HANDLER_INTERNAL: 
+ GIMP_PDB_ERROR_HANDLER_PLUGIN: 
+
 <!-- ##### ENUM GimpPDBProcType ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-docs.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-docs.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-docs.sgml	Sun Oct 12 15:38:02 2008
@@ -40,7 +40,6 @@
     <xi:include href="xml/gimpfileentry.xml" />
     <xi:include href="xml/gimpframe.xml" />
     <xi:include href="xml/gimphintbox.xml" />
-    <xi:include href="xml/gimphruler.xml" />
     <xi:include href="xml/gimpintcombobox.xml" />
     <xi:include href="xml/gimpintstore.xml" />
     <xi:include href="xml/gimpmemsizeentry.xml" />
@@ -57,7 +56,6 @@
     <xi:include href="xml/gimpsizeentry.xml" />
     <xi:include href="xml/gimpstringcombobox.xml" />
     <xi:include href="xml/gimpunitmenu.xml" />
-    <xi:include href="xml/gimpvruler.xml" />
     <xi:include href="xml/gimpzoommodel.xml" />
   </part>
   

Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets-sections.txt	Sun Oct 12 15:38:02 2008
@@ -568,6 +568,7 @@
 <FILE>gimpruler</FILE>
 <TITLE>GimpRuler</TITLE>
 GimpRuler
+gimp_ruler_new
 gimp_ruler_set_unit
 gimp_ruler_get_unit
 gimp_ruler_set_position
@@ -586,38 +587,6 @@
 </SECTION>
 
 <SECTION>
-<FILE>gimphruler</FILE>
-<TITLE>GimpHRuler</TITLE>
-gimp_hruler_new
-<SUBSECTION Standard>
-GimpHRuler
-GimpHRulerClass
-GIMP_HRULER
-GIMP_IS_HRULER
-GIMP_TYPE_HRULER
-gimp_hruler_get_type
-GIMP_HRULER_CLASS
-GIMP_IS_HRULER_CLASS
-GIMP_HRULER_GET_CLASS
-</SECTION>
-
-<SECTION>
-<FILE>gimpvruler</FILE>
-<TITLE>GimpVRuler</TITLE>
-gimp_vruler_new
-<SUBSECTION Standard>
-GimpVRuler
-GimpVRulerClass
-GIMP_VRULER
-GIMP_IS_VRULER
-GIMP_TYPE_VRULER
-gimp_vruler_get_type
-GIMP_VRULER_CLASS
-GIMP_IS_VRULER_CLASS
-GIMP_VRULER_GET_CLASS
-</SECTION>
-
-<SECTION>
 <FILE>gimpunitmenu</FILE>
 <TITLE>GimpUnitMenu</TITLE>
 GimpUnitMenu

Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets.types
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets.types	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/libgimpwidgets.types	Sun Oct 12 15:38:02 2008
@@ -28,7 +28,6 @@
 gimp_file_entry_get_type
 gimp_frame_get_type
 gimp_hint_box_get_type
-gimp_hruler_get_type
 gimp_int_combo_box_get_type
 gimp_int_store_get_type
 gimp_memsize_entry_get_type
@@ -45,5 +44,4 @@
 gimp_size_entry_get_type
 gimp_string_combo_box_get_type
 gimp_unit_menu_get_type
-gimp_vruler_get_type
 gimp_zoom_model_get_type

Modified: branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpruler.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpruler.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpwidgets/tmpl/gimpruler.sgml	Sun Oct 12 15:38:02 2008
@@ -33,6 +33,11 @@
 
 </para>
 
+<!-- ##### ARG GimpRuler:orientation ##### -->
+<para>
+
+</para>
+
 <!-- ##### ARG GimpRuler:position ##### -->
 <para>
 
@@ -48,6 +53,20 @@
 
 </para>
 
+<!-- ##### ARG GimpRuler:font-scale ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION gimp_ruler_new ##### -->
+<para>
+
+</para>
+
+ orientation: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_ruler_set_unit ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/release-howto.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/release-howto.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/release-howto.txt	Sun Oct 12 15:38:02 2008
@@ -14,7 +14,6 @@
      bugzilla.gimp.org and to the news section on www.gimp.org, or that
      someone can do the changes for you.
 
-
  ( ) Make sure the checkout is up to date, clean from uncommitted changes.
 
  ( ) Check that the version number is correct in configure.in
@@ -23,8 +22,6 @@
 
  ( ) Run ./autogen.sh --enable-gtk-doc
 
- ( ) Revert po/Makefile.in.in to the state in SVN.
-
  ( ) Do a complete build of the source tree.
 
  ( ) Check if NEWS, README or INSTALL need to be updated.

Modified: branches/soc-2008-tagging/devel-docs/tools/shadow.c
==============================================================================
--- branches/soc-2008-tagging/devel-docs/tools/shadow.c	(original)
+++ branches/soc-2008-tagging/devel-docs/tools/shadow.c	Sun Oct 12 15:38:02 2008
@@ -112,13 +112,13 @@
                   sumb += src_pixels [src_y * src_rowstride +
                                       src_x * src_bpp + 2] *
                     filter->data [i * filter->size + j];
-                
+
                   if (src_bpp == 4)
                     suma += src_pixels [src_y * src_rowstride +
                                         src_x * src_bpp + 3] *
                     filter->data [i * filter->size + j];
 
-                
+
                 }
             }
 

Modified: branches/soc-2008-tagging/docs/gimprc.5.in
==============================================================================
--- branches/soc-2008-tagging/docs/gimprc.5.in	(original)
+++ branches/soc-2008-tagging/docs/gimprc.5.in	Sun Oct 12 15:38:02 2008
@@ -208,8 +208,8 @@
 
 .TP
 (default-image
-    (width 610)
-    (height 377)
+    (width 640)
+    (height 400)
     (unit pixels)
     (xresolution 72.000000)
     (yresolution 72.000000)
@@ -646,7 +646,7 @@
 no.
 
 .TP
-(trust-dirty-flag no)
+(trust-dirty-flag yes)
 
 When enabled, GIMP will not save an image if it has not been changed since it
 was opened.  Possible values are yes and no.
@@ -728,20 +728,26 @@
 .TP
 (toolbox-color-area yes)
 
-The toolbox-color-area property has no description.  Possible values are yes
-and no.
+Show the current foreground and background colors in the toolbox.  Possible
+values are yes and no.
 
 .TP
 (toolbox-foo-area no)
 
-The toolbox-foo-area property has no description.  Possible values are yes and
-no.
+Show the currently selected brush, pattern and gradient in the toolbox. 
+Possible values are yes and no.
 
 .TP
 (toolbox-image-area no)
 
-The toolbox-image-area property has no description.  Possible values are yes
-and no.
+Show the currently active image in the toolbox.  Possible values are yes and
+no.
+
+.TP
+(toolbox-wilber yes)
+
+Show the GIMP mascot at the top of the toolbox.  Possible values are yes and
+no.
 
 .TP
 (theme-path "${gimp_dir}/themes:${gimp_data_dir}/themes")
@@ -796,7 +802,7 @@
 Otherwise the locally installed copy is used.  Possible values are yes and no.
 
 .TP
-(user-manual-online-uri "http://docs.gimp.org/2.5";)
+(user-manual-online-uri "http://docs.gimp.org/2.6";)
 
 The location of the online user manual. This is used if 'user-manual-online'
 is enabled.  This is a string value.

Modified: branches/soc-2008-tagging/etc/gimprc
==============================================================================
--- branches/soc-2008-tagging/etc/gimprc	(original)
+++ branches/soc-2008-tagging/etc/gimprc	Sun Oct 12 15:38:02 2008
@@ -159,8 +159,8 @@
 # Sets the default image in the "File/New" dialog.  This is a parameter list.
 # 
 # (default-image
-#     (width 610)
-#     (height 377)
+#     (width 640)
+#     (height 400)
 #     (unit pixels)
 #     (xresolution 72.000000)
 #     (yresolution 72.000000)
@@ -503,7 +503,7 @@
 # When enabled, GIMP will not save an image if it has not been changed since
 # it was opened.  Possible values are yes and no.
 # 
-# (trust-dirty-flag no)
+# (trust-dirty-flag yes)
 
 # Remember the current tool, pattern, color, and brush across GIMP sessions. 
 # Possible values are yes and no.
@@ -567,21 +567,26 @@
 # 
 # (max-new-image-size 128M)
 
-# The toolbox-color-area property has no description.  Possible values are
-# yes and no.
+# Show the current foreground and background colors in the toolbox.  Possible
+# values are yes and no.
 # 
 # (toolbox-color-area yes)
 
-# The toolbox-foo-area property has no description.  Possible values are yes
-# and no.
+# Show the currently selected brush, pattern and gradient in the toolbox. 
+# Possible values are yes and no.
 # 
 # (toolbox-foo-area no)
 
-# The toolbox-image-area property has no description.  Possible values are
-# yes and no.
+# Show the currently active image in the toolbox.  Possible values are yes
+# and no.
 # 
 # (toolbox-image-area no)
 
+# Show the GIMP mascot at the top of the toolbox.  Possible values are yes
+# and no.
+# 
+# (toolbox-wilber yes)
+
 # Sets the theme search path.  This is a colon-separated list of folders to
 # search.
 # 
@@ -631,7 +636,7 @@
 # The location of the online user manual. This is used if
 # 'user-manual-online' is enabled.  This is a string value.
 # 
-# (user-manual-online-uri "http://docs.gimp.org/2.5";)
+# (user-manual-online-uri "http://docs.gimp.org/2.6";)
 
 # The window type hint that is set on the toolbox. This may affect how your
 # window manager decorates and handles the toolbox window.  Possible values

Modified: branches/soc-2008-tagging/gimpdefs.msc
==============================================================================
--- branches/soc-2008-tagging/gimpdefs.msc	(original)
+++ branches/soc-2008-tagging/gimpdefs.msc	Sun Oct 12 15:38:02 2008
@@ -9,6 +9,14 @@
 # don't interfer with stable version
 GIMPDIR = _gimp-2.5
 
+GIMP_VERSION_DEFINES = \
+	-DGIMP_PACKAGE=\"gimp-2.6\" \
+	-DGIMP_DATA_VERSION=\"2.6\" \
+	-DGIMP_PLUGIN_VERSION=\"2.6\" \
+	-DGIMP_SYSCONF_VERSION=\"2.6\" \
+	-DGIMP_APP_VERSION=\"2.6\" \
+	-DGIMP_APP_VERSION_STRING=\"2.6\"
+
 # Build app/* as DLLs; don't define this, it doesn't work yet.
 #DLLGIMP = 1 
 

Modified: branches/soc-2008-tagging/libgimp/gimp.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.c	Sun Oct 12 15:38:02 2008
@@ -998,7 +998,8 @@
  * @paramdefs: the #GimpParamDef array to destroy
  * @n_params:  the number of elements in the array
  *
- * Destroys a #GimpParamDef array as returned by gimp_query_procedure()
+ * Destroys a #GimpParamDef array as returned by
+ * gimp_procedural_db_proc_info().
  **/
 void
 gimp_destroy_paramdefs (GimpParamDef *paramdefs,
@@ -1893,8 +1894,7 @@
       (* PLUG_IN_INFO.run_proc) (proc_run->name,
                                  proc_run->nparams,
                                  (GimpParam *) proc_run->params,
-                                 &n_return_vals,
-                                 &return_vals);
+                                 &n_return_vals, &return_vals);
 
       proc_return.name    = proc_run->name;
       proc_return.nparams = n_return_vals;
@@ -1909,10 +1909,7 @@
 static void
 gimp_temp_proc_run (GPProcRun *proc_run)
 {
-  GimpRunProc run_proc;
-
-  run_proc = (GimpRunProc) g_hash_table_lookup (temp_proc_ht,
-                                                (gpointer) proc_run->name);
+  GimpRunProc run_proc = g_hash_table_lookup (temp_proc_ht, proc_run->name);
 
   if (run_proc)
     {
@@ -1922,9 +1919,8 @@
 
       (* run_proc) (proc_run->name,
                     proc_run->nparams,
-                    (GimpParam*) proc_run->params,
-                    &n_return_vals,
-                    &return_vals);
+                    (GimpParam *) proc_run->params,
+                    &n_return_vals, &return_vals);
 
       proc_return.name    = proc_run->name;
       proc_return.nparams = n_return_vals;

Modified: branches/soc-2008-tagging/libgimp/gimp.def
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.def	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.def	Sun Oct 12 15:38:02 2008
@@ -382,6 +382,7 @@
 	gimp_image_resize_to_layers
 	gimp_image_rotate
 	gimp_image_scale
+	gimp_image_scale_full
 	gimp_image_set_active_channel
 	gimp_image_set_active_layer
 	gimp_image_set_active_vectors
@@ -429,6 +430,7 @@
 	gimp_layer_resize
 	gimp_layer_resize_to_image_size
 	gimp_layer_scale
+	gimp_layer_scale_full
 	gimp_layer_set_apply_mask
 	gimp_layer_set_edit_mask
 	gimp_layer_set_lock_alpha
@@ -536,10 +538,12 @@
 	gimp_pixel_rgns_register
 	gimp_pixel_rgns_register2
 	gimp_plugin_domain_register
+	gimp_plugin_get_pdb_error_handler
 	gimp_plugin_help_register
 	gimp_plugin_icon_register
 	gimp_plugin_menu_branch_register
 	gimp_plugin_menu_register
+	gimp_plugin_set_pdb_error_handler
 	gimp_posterize
 	gimp_procedural_db_dump
 	gimp_procedural_db_get_data

Modified: branches/soc-2008-tagging/libgimp/gimp.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.h	Sun Oct 12 15:38:02 2008
@@ -302,7 +302,7 @@
 
 /* Destroy the an array of GimpParamDef's. This is useful for
  *  destroying the return values returned by a call to
- *  'gimp_query_procedure'.
+ *  'gimp_procedural_db_proc_info'.
  */
 void           gimp_destroy_paramdefs   (GimpParamDef    *paramdefs,
                                          gint             n_params);

Modified: branches/soc-2008-tagging/libgimp/gimpenums.c.tail
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpenums.c.tail	(original)
+++ branches/soc-2008-tagging/libgimp/gimpenums.c.tail	Sun Oct 12 15:38:02 2008
@@ -36,6 +36,7 @@
   gimp_offset_type_get_type,
   gimp_orientation_type_get_type,
   gimp_pdb_arg_type_get_type,
+  gimp_pdb_error_handler_get_type,
   gimp_pdb_proc_type_get_type,
   gimp_pdb_status_type_get_type,
   gimp_paint_application_mode_get_type,
@@ -90,6 +91,7 @@
   "GimpOffsetType",
   "GimpOrientationType",
   "GimpPDBArgType",
+  "GimpPDBErrorHandler",
   "GimpPDBProcType",
   "GimpPDBStatusType",
   "GimpPaintApplicationMode",

Modified: branches/soc-2008-tagging/libgimp/gimpexport.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpexport.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpexport.c	Sun Oct 12 15:38:02 2008
@@ -39,11 +39,11 @@
 /* the export action structure */
 typedef struct
 {
-  ExportFunc  default_action;
-  ExportFunc  alt_action;
-  gchar      *reason;
-  gchar      *possibilities[2];
-  gint        choice;
+  ExportFunc   default_action;
+  ExportFunc   alt_action;
+  const gchar *reason;
+  const gchar *possibilities[2];
+  gint         choice;
 } ExportAction;
 
 

Modified: branches/soc-2008-tagging/libgimp/gimpimage.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpimage.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpimage.c	Sun Oct 12 15:38:02 2008
@@ -63,7 +63,7 @@
 /**
  * gimp_image_get_colormap:
  * @image_ID:   The image.
- * @num_colors: Number of colors in the colormap array.
+ * @num_colors: Returns the number of colors in the colormap array.
  *
  * Returns the image's colormap
  *
@@ -82,7 +82,8 @@
 
   cmap = _gimp_image_get_colormap (image_ID, &num_bytes);
 
-  *num_colors = num_bytes / 3;
+  if (num_colors)
+    *num_colors = num_bytes / 3;
 
   return cmap;
 }

Modified: branches/soc-2008-tagging/libgimp/gimpimage_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpimage_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpimage_pdb.c	Sun Oct 12 15:38:02 2008
@@ -339,12 +339,11 @@
  *
  * This procedure resizes the image so that it's new width and height
  * are equal to the supplied parameters. Offsets are also provided
- * which describe the position of the previous image's content. No
- * bounds checking is currently provided, so don't supply parameters
- * that are out of bounds. All channels within the image are resized
- * according to the specified parameters; this includes the image
- * selection mask. All layers within the image are repositioned
- * according to the specified offsets.
+ * which describe the position of the previous image's content. All
+ * channels within the image are resized according to the specified
+ * parameters; this includes the image selection mask. All layers
+ * within the image are repositioned according to the specified
+ * offsets.
  *
  * Returns: TRUE on success.
  */
@@ -415,16 +414,13 @@
  * @new_width: New image width.
  * @new_height: New image height.
  *
- * Scale the image to the specified extents.
+ * Scale the image using the default interpolation method.
  *
  * This procedure scales the image so that its new width and height are
- * equal to the supplied parameters. Offsets are also provided which
- * describe the position of the previous image's content. No bounds
- * checking is currently provided, so don't supply parameters that are
- * out of bounds. All channels within the image are scaled according to
- * the specified parameters; this includes the image selection mask.
- * All layers within the image are repositioned according to the
- * specified offsets.
+ * equal to the supplied parameters. All layers and channels within the
+ * image are scaled according to the specified parameters; this
+ * includes the image selection mask. The default interpolation method
+ * is used.
  *
  * Returns: TRUE on success.
  */
@@ -452,12 +448,56 @@
 }
 
 /**
+ * gimp_image_scale_full:
+ * @image_ID: The image.
+ * @new_width: New image width.
+ * @new_height: New image height.
+ * @interpolation: Type of interpolation.
+ *
+ * Scale the image using a specific interpolation method.
+ *
+ * This procedure scales the image so that its new width and height are
+ * equal to the supplied parameters. All layers and channels within the
+ * image are scaled according to the specified parameters; this
+ * includes the image selection mask. This procedure allows you to
+ * specify the interpolation method explicitly.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.6
+ */
+gboolean
+gimp_image_scale_full (gint32                image_ID,
+                       gint                  new_width,
+                       gint                  new_height,
+                       GimpInterpolationType interpolation)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-image-scale-full",
+                                    &nreturn_vals,
+                                    GIMP_PDB_IMAGE, image_ID,
+                                    GIMP_PDB_INT32, new_width,
+                                    GIMP_PDB_INT32, new_height,
+                                    GIMP_PDB_INT32, interpolation,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
  * gimp_image_crop:
  * @image_ID: The image.
  * @new_width: New image width: (0 < new_width <= width).
  * @new_height: New image height: (0 < new_height <= height).
- * @offx: x offset: (0 <= offx <= (width - new_width)).
- * @offy: y offset: (0 <= offy <= (height - new_height)).
+ * @offx: X offset: (0 <= offx <= (width - new_width)).
+ * @offy: Y offset: (0 <= offy <= (height - new_height)).
  *
  * Crop the image to the specified extents.
  *
@@ -1000,8 +1040,8 @@
  *
  * Returns the position of the layer in the layer stack.
  *
- * This procedure determines the positioin of the specified layer in
- * the images layer stack. If the layer doesn't exist in the image, an
+ * This procedure determines the position of the specified layer in the
+ * images layer stack. If the layer doesn't exist in the image, an
  * error is returned.
  *
  * Returns: The position of the layer in the layer stack.
@@ -1038,7 +1078,7 @@
  * Raise the specified layer in the image's layer stack
  *
  * This procedure raises the specified layer one step in the existing
- * layer stack. It will not move the layer if there is no layer above
+ * layer stack. The procecure call will fail if there is no layer above
  * it.
  *
  * Returns: TRUE on success.
@@ -1072,7 +1112,7 @@
  * Lower the specified layer in the image's layer stack
  *
  * This procedure lowers the specified layer one step in the existing
- * layer stack. It will not move the layer if there is no layer below
+ * layer stack. The procecure call will fail if there is no layer below
  * it.
  *
  * Returns: TRUE on success.
@@ -1244,7 +1284,7 @@
  *
  * Returns the position of the channel in the channel stack.
  *
- * This procedure determines the positioin of the specified channel in
+ * This procedure determines the position of the specified channel in
  * the images channel stack. If the channel doesn't exist in the image,
  * an error is returned.
  *
@@ -1282,7 +1322,7 @@
  * Raise the specified channel in the image's channel stack
  *
  * This procedure raises the specified channel one step in the existing
- * channel stack. It will not move the channel if there is no channel
+ * channel stack. The procecure call will fail if there is no channel
  * above it.
  *
  * Returns: TRUE on success.
@@ -1316,7 +1356,7 @@
  * Lower the specified channel in the image's channel stack
  *
  * This procedure lowers the specified channel one step in the existing
- * channel stack. It will not move the channel if there is no channel
+ * channel stack. The procecure call will fail if there is no channel
  * below it.
  *
  * Returns: TRUE on success.
@@ -1422,7 +1462,7 @@
  * Returns the position of the vectors object in the vectors objects
  * stack.
  *
- * This procedure determines the positioin of the specified vectors
+ * This procedure determines the position of the specified vectors
  * object in the images vectors object stack. If the vectors object
  * doesn't exist in the image, an error is returned.
  *
@@ -1460,7 +1500,7 @@
  * Raise the specified vectors in the image's vectors stack
  *
  * This procedure raises the specified vectors one step in the existing
- * vectors stack. It will not move the vectors if there is no vectors
+ * vectors stack. The procecure call will fail if there is no vectors
  * above it.
  *
  * Returns: TRUE on success.
@@ -1496,7 +1536,7 @@
  * Lower the specified vectors in the image's vectors stack
  *
  * This procedure lowers the specified vectors one step in the existing
- * vectors stack. It will not move the vectors if there is no vectors
+ * vectors stack. The procecure call will fail if there is no vectors
  * below it.
  *
  * Returns: TRUE on success.

Modified: branches/soc-2008-tagging/libgimp/gimpimage_pdb.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpimage_pdb.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimpimage_pdb.h	Sun Oct 12 15:38:02 2008
@@ -29,162 +29,166 @@
 /* For information look into the C source or the html documentation */
 
 
-gboolean                 gimp_image_is_valid                 (gint32                image_ID);
-gint*                    gimp_image_list                     (gint                 *num_images);
-gint32                   gimp_image_new                      (gint                  width,
-                                                              gint                  height,
-                                                              GimpImageBaseType     type);
-gint32                   gimp_image_duplicate                (gint32                image_ID);
-gboolean                 gimp_image_delete                   (gint32                image_ID);
-GimpImageBaseType        gimp_image_base_type                (gint32                image_ID);
-gint                     gimp_image_width                    (gint32                image_ID);
-gint                     gimp_image_height                   (gint32                image_ID);
+gboolean                 gimp_image_is_valid                 (gint32                  image_ID);
+gint*                    gimp_image_list                     (gint                   *num_images);
+gint32                   gimp_image_new                      (gint                    width,
+                                                              gint                    height,
+                                                              GimpImageBaseType       type);
+gint32                   gimp_image_duplicate                (gint32                  image_ID);
+gboolean                 gimp_image_delete                   (gint32                  image_ID);
+GimpImageBaseType        gimp_image_base_type                (gint32                  image_ID);
+gint                     gimp_image_width                    (gint32                  image_ID);
+gint                     gimp_image_height                   (gint32                  image_ID);
 #ifndef GIMP_DISABLE_DEPRECATED
-gboolean                 gimp_image_free_shadow              (gint32                image_ID);
+gboolean                 gimp_image_free_shadow              (gint32                  image_ID);
 #endif /* GIMP_DISABLE_DEPRECATED */
-gboolean                 gimp_image_resize                   (gint32                image_ID,
-                                                              gint                  new_width,
-                                                              gint                  new_height,
-                                                              gint                  offx,
-                                                              gint                  offy);
-gboolean                 gimp_image_resize_to_layers         (gint32                image_ID);
-gboolean                 gimp_image_scale                    (gint32                image_ID,
-                                                              gint                  new_width,
-                                                              gint                  new_height);
-gboolean                 gimp_image_crop                     (gint32                image_ID,
-                                                              gint                  new_width,
-                                                              gint                  new_height,
-                                                              gint                  offx,
-                                                              gint                  offy);
-gboolean                 gimp_image_flip                     (gint32                image_ID,
-                                                              GimpOrientationType   flip_type);
-gboolean                 gimp_image_rotate                   (gint32                image_ID,
-                                                              GimpRotationType      rotate_type);
-gint*                    gimp_image_get_layers               (gint32                image_ID,
-                                                              gint                 *num_layers);
-gint*                    gimp_image_get_channels             (gint32                image_ID,
-                                                              gint                 *num_channels);
-gint*                    gimp_image_get_vectors              (gint32                image_ID,
-                                                              gint                 *num_vectors);
-gint32                   gimp_image_get_active_drawable      (gint32                image_ID);
-gboolean                 gimp_image_unset_active_channel     (gint32                image_ID);
-gint32                   gimp_image_get_floating_sel         (gint32                image_ID);
-gint32                   gimp_image_floating_sel_attached_to (gint32                image_ID);
-gboolean                 gimp_image_pick_color               (gint32                image_ID,
-                                                              gint32                drawable_ID,
-                                                              gdouble               x,
-                                                              gdouble               y,
-                                                              gboolean              sample_merged,
-                                                              gboolean              sample_average,
-                                                              gdouble               average_radius,
-                                                              GimpRGB              *color);
-gint32                   gimp_image_pick_correlate_layer     (gint32                image_ID,
-                                                              gint                  x,
-                                                              gint                  y);
-gboolean                 gimp_image_add_layer                (gint32                image_ID,
-                                                              gint32                layer_ID,
-                                                              gint                  position);
-gboolean                 gimp_image_remove_layer             (gint32                image_ID,
-                                                              gint32                layer_ID);
-gint                     gimp_image_get_layer_position       (gint32                image_ID,
-                                                              gint32                layer_ID);
-gboolean                 gimp_image_raise_layer              (gint32                image_ID,
-                                                              gint32                layer_ID);
-gboolean                 gimp_image_lower_layer              (gint32                image_ID,
-                                                              gint32                layer_ID);
-gboolean                 gimp_image_raise_layer_to_top       (gint32                image_ID,
-                                                              gint32                layer_ID);
-gboolean                 gimp_image_lower_layer_to_bottom    (gint32                image_ID,
-                                                              gint32                layer_ID);
-gboolean                 gimp_image_add_channel              (gint32                image_ID,
-                                                              gint32                channel_ID,
-                                                              gint                  position);
-gboolean                 gimp_image_remove_channel           (gint32                image_ID,
-                                                              gint32                channel_ID);
-gint                     gimp_image_get_channel_position     (gint32                image_ID,
-                                                              gint32                channel_ID);
-gboolean                 gimp_image_raise_channel            (gint32                image_ID,
-                                                              gint32                channel_ID);
-gboolean                 gimp_image_lower_channel            (gint32                image_ID,
-                                                              gint32                channel_ID);
-gboolean                 gimp_image_add_vectors              (gint32                image_ID,
-                                                              gint32                vectors_ID,
-                                                              gint                  position);
-gboolean                 gimp_image_remove_vectors           (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gint                     gimp_image_get_vectors_position     (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gboolean                 gimp_image_raise_vectors            (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gboolean                 gimp_image_lower_vectors            (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gboolean                 gimp_image_raise_vectors_to_top     (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gboolean                 gimp_image_lower_vectors_to_bottom  (gint32                image_ID,
-                                                              gint32                vectors_ID);
-gint32                   gimp_image_flatten                  (gint32                image_ID);
-gint32                   gimp_image_merge_visible_layers     (gint32                image_ID,
-                                                              GimpMergeType         merge_type);
-gint32                   gimp_image_merge_down               (gint32                image_ID,
-                                                              gint32                merge_layer_ID,
-                                                              GimpMergeType         merge_type);
-G_GNUC_INTERNAL guint8*  _gimp_image_get_colormap            (gint32                image_ID,
-                                                              gint                 *num_bytes);
-G_GNUC_INTERNAL gboolean _gimp_image_set_colormap            (gint32                image_ID,
-                                                              gint                  num_bytes,
-                                                              const guint8         *colormap);
-gboolean                 gimp_image_clean_all                (gint32                image_ID);
-gboolean                 gimp_image_is_dirty                 (gint32                image_ID);
-G_GNUC_INTERNAL gboolean _gimp_image_thumbnail               (gint32                image_ID,
-                                                              gint                  width,
-                                                              gint                  height,
-                                                              gint                 *actual_width,
-                                                              gint                 *actual_height,
-                                                              gint                 *bpp,
-                                                              gint                 *thumbnail_data_count,
-                                                              guint8              **thumbnail_data);
-gint32                   gimp_image_get_active_layer         (gint32                image_ID);
-gboolean                 gimp_image_set_active_layer         (gint32                image_ID,
-                                                              gint32                active_layer_ID);
-gint32                   gimp_image_get_active_channel       (gint32                image_ID);
-gboolean                 gimp_image_set_active_channel       (gint32                image_ID,
-                                                              gint32                active_channel_ID);
-gint32                   gimp_image_get_active_vectors       (gint32                image_ID);
-gboolean                 gimp_image_set_active_vectors       (gint32                image_ID,
-                                                              gint32                active_vectors_ID);
-gint32                   gimp_image_get_selection            (gint32                image_ID);
-gboolean                 gimp_image_get_component_active     (gint32                image_ID,
-                                                              GimpChannelType       component);
-gboolean                 gimp_image_set_component_active     (gint32                image_ID,
-                                                              GimpChannelType       component,
-                                                              gboolean              active);
-gboolean                 gimp_image_get_component_visible    (gint32                image_ID,
-                                                              GimpChannelType       component);
-gboolean                 gimp_image_set_component_visible    (gint32                image_ID,
-                                                              GimpChannelType       component,
-                                                              gboolean              visible);
-gchar*                   gimp_image_get_filename             (gint32                image_ID);
-gboolean                 gimp_image_set_filename             (gint32                image_ID,
-                                                              const gchar          *filename);
-gchar*                   gimp_image_get_name                 (gint32                image_ID);
-gboolean                 gimp_image_get_resolution           (gint32                image_ID,
-                                                              gdouble              *xresolution,
-                                                              gdouble              *yresolution);
-gboolean                 gimp_image_set_resolution           (gint32                image_ID,
-                                                              gdouble               xresolution,
-                                                              gdouble               yresolution);
-GimpUnit                 gimp_image_get_unit                 (gint32                image_ID);
-gboolean                 gimp_image_set_unit                 (gint32                image_ID,
-                                                              GimpUnit              unit);
-gint                     gimp_image_get_tattoo_state         (gint32                image_ID);
-gboolean                 gimp_image_set_tattoo_state         (gint32                image_ID,
-                                                              gint                  tattoo_state);
-gint32                   gimp_image_get_layer_by_tattoo      (gint32                image_ID,
-                                                              gint                  tattoo);
-gint32                   gimp_image_get_channel_by_tattoo    (gint32                image_ID,
-                                                              gint                  tattoo);
-gint32                   gimp_image_get_vectors_by_tattoo    (gint32                image_ID,
-                                                              gint                  tattoo);
+gboolean                 gimp_image_resize                   (gint32                  image_ID,
+                                                              gint                    new_width,
+                                                              gint                    new_height,
+                                                              gint                    offx,
+                                                              gint                    offy);
+gboolean                 gimp_image_resize_to_layers         (gint32                  image_ID);
+gboolean                 gimp_image_scale                    (gint32                  image_ID,
+                                                              gint                    new_width,
+                                                              gint                    new_height);
+gboolean                 gimp_image_scale_full               (gint32                  image_ID,
+                                                              gint                    new_width,
+                                                              gint                    new_height,
+                                                              GimpInterpolationType   interpolation);
+gboolean                 gimp_image_crop                     (gint32                  image_ID,
+                                                              gint                    new_width,
+                                                              gint                    new_height,
+                                                              gint                    offx,
+                                                              gint                    offy);
+gboolean                 gimp_image_flip                     (gint32                  image_ID,
+                                                              GimpOrientationType     flip_type);
+gboolean                 gimp_image_rotate                   (gint32                  image_ID,
+                                                              GimpRotationType        rotate_type);
+gint*                    gimp_image_get_layers               (gint32                  image_ID,
+                                                              gint                   *num_layers);
+gint*                    gimp_image_get_channels             (gint32                  image_ID,
+                                                              gint                   *num_channels);
+gint*                    gimp_image_get_vectors              (gint32                  image_ID,
+                                                              gint                   *num_vectors);
+gint32                   gimp_image_get_active_drawable      (gint32                  image_ID);
+gboolean                 gimp_image_unset_active_channel     (gint32                  image_ID);
+gint32                   gimp_image_get_floating_sel         (gint32                  image_ID);
+gint32                   gimp_image_floating_sel_attached_to (gint32                  image_ID);
+gboolean                 gimp_image_pick_color               (gint32                  image_ID,
+                                                              gint32                  drawable_ID,
+                                                              gdouble                 x,
+                                                              gdouble                 y,
+                                                              gboolean                sample_merged,
+                                                              gboolean                sample_average,
+                                                              gdouble                 average_radius,
+                                                              GimpRGB                *color);
+gint32                   gimp_image_pick_correlate_layer     (gint32                  image_ID,
+                                                              gint                    x,
+                                                              gint                    y);
+gboolean                 gimp_image_add_layer                (gint32                  image_ID,
+                                                              gint32                  layer_ID,
+                                                              gint                    position);
+gboolean                 gimp_image_remove_layer             (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gint                     gimp_image_get_layer_position       (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gboolean                 gimp_image_raise_layer              (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gboolean                 gimp_image_lower_layer              (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gboolean                 gimp_image_raise_layer_to_top       (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gboolean                 gimp_image_lower_layer_to_bottom    (gint32                  image_ID,
+                                                              gint32                  layer_ID);
+gboolean                 gimp_image_add_channel              (gint32                  image_ID,
+                                                              gint32                  channel_ID,
+                                                              gint                    position);
+gboolean                 gimp_image_remove_channel           (gint32                  image_ID,
+                                                              gint32                  channel_ID);
+gint                     gimp_image_get_channel_position     (gint32                  image_ID,
+                                                              gint32                  channel_ID);
+gboolean                 gimp_image_raise_channel            (gint32                  image_ID,
+                                                              gint32                  channel_ID);
+gboolean                 gimp_image_lower_channel            (gint32                  image_ID,
+                                                              gint32                  channel_ID);
+gboolean                 gimp_image_add_vectors              (gint32                  image_ID,
+                                                              gint32                  vectors_ID,
+                                                              gint                    position);
+gboolean                 gimp_image_remove_vectors           (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gint                     gimp_image_get_vectors_position     (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gboolean                 gimp_image_raise_vectors            (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gboolean                 gimp_image_lower_vectors            (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gboolean                 gimp_image_raise_vectors_to_top     (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gboolean                 gimp_image_lower_vectors_to_bottom  (gint32                  image_ID,
+                                                              gint32                  vectors_ID);
+gint32                   gimp_image_flatten                  (gint32                  image_ID);
+gint32                   gimp_image_merge_visible_layers     (gint32                  image_ID,
+                                                              GimpMergeType           merge_type);
+gint32                   gimp_image_merge_down               (gint32                  image_ID,
+                                                              gint32                  merge_layer_ID,
+                                                              GimpMergeType           merge_type);
+G_GNUC_INTERNAL guint8*  _gimp_image_get_colormap            (gint32                  image_ID,
+                                                              gint                   *num_bytes);
+G_GNUC_INTERNAL gboolean _gimp_image_set_colormap            (gint32                  image_ID,
+                                                              gint                    num_bytes,
+                                                              const guint8           *colormap);
+gboolean                 gimp_image_clean_all                (gint32                  image_ID);
+gboolean                 gimp_image_is_dirty                 (gint32                  image_ID);
+G_GNUC_INTERNAL gboolean _gimp_image_thumbnail               (gint32                  image_ID,
+                                                              gint                    width,
+                                                              gint                    height,
+                                                              gint                   *actual_width,
+                                                              gint                   *actual_height,
+                                                              gint                   *bpp,
+                                                              gint                   *thumbnail_data_count,
+                                                              guint8                **thumbnail_data);
+gint32                   gimp_image_get_active_layer         (gint32                  image_ID);
+gboolean                 gimp_image_set_active_layer         (gint32                  image_ID,
+                                                              gint32                  active_layer_ID);
+gint32                   gimp_image_get_active_channel       (gint32                  image_ID);
+gboolean                 gimp_image_set_active_channel       (gint32                  image_ID,
+                                                              gint32                  active_channel_ID);
+gint32                   gimp_image_get_active_vectors       (gint32                  image_ID);
+gboolean                 gimp_image_set_active_vectors       (gint32                  image_ID,
+                                                              gint32                  active_vectors_ID);
+gint32                   gimp_image_get_selection            (gint32                  image_ID);
+gboolean                 gimp_image_get_component_active     (gint32                  image_ID,
+                                                              GimpChannelType         component);
+gboolean                 gimp_image_set_component_active     (gint32                  image_ID,
+                                                              GimpChannelType         component,
+                                                              gboolean                active);
+gboolean                 gimp_image_get_component_visible    (gint32                  image_ID,
+                                                              GimpChannelType         component);
+gboolean                 gimp_image_set_component_visible    (gint32                  image_ID,
+                                                              GimpChannelType         component,
+                                                              gboolean                visible);
+gchar*                   gimp_image_get_filename             (gint32                  image_ID);
+gboolean                 gimp_image_set_filename             (gint32                  image_ID,
+                                                              const gchar            *filename);
+gchar*                   gimp_image_get_name                 (gint32                  image_ID);
+gboolean                 gimp_image_get_resolution           (gint32                  image_ID,
+                                                              gdouble                *xresolution,
+                                                              gdouble                *yresolution);
+gboolean                 gimp_image_set_resolution           (gint32                  image_ID,
+                                                              gdouble                 xresolution,
+                                                              gdouble                 yresolution);
+GimpUnit                 gimp_image_get_unit                 (gint32                  image_ID);
+gboolean                 gimp_image_set_unit                 (gint32                  image_ID,
+                                                              GimpUnit                unit);
+gint                     gimp_image_get_tattoo_state         (gint32                  image_ID);
+gboolean                 gimp_image_set_tattoo_state         (gint32                  image_ID,
+                                                              gint                    tattoo_state);
+gint32                   gimp_image_get_layer_by_tattoo      (gint32                  image_ID,
+                                                              gint                    tattoo);
+gint32                   gimp_image_get_channel_by_tattoo    (gint32                  image_ID,
+                                                              gint                    tattoo);
+gint32                   gimp_image_get_vectors_by_tattoo    (gint32                  image_ID,
+                                                              gint                    tattoo);
 
 
 G_END_DECLS

Modified: branches/soc-2008-tagging/libgimp/gimplayer_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimplayer_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimplayer_pdb.c	Sun Oct 12 15:38:02 2008
@@ -269,13 +269,13 @@
  * @new_height: New layer height.
  * @local_origin: Use a local origin (as opposed to the image origin).
  *
- * Scale the layer to the specified extents.
+ * Scale the layer using the default interpolation method.
  *
  * This procedure scales the layer so that its new width and height are
  * equal to the supplied parameters. The 'local-origin' parameter
  * specifies whether to scale from the center of the layer, or from the
  * image origin. This operation only works if the layer has been added
- * to an image.
+ * to an image. The default interpolation method is used for scaling.
  *
  * Returns: TRUE on success.
  */
@@ -305,6 +305,54 @@
 }
 
 /**
+ * gimp_layer_scale_full:
+ * @layer_ID: The layer.
+ * @new_width: New layer width.
+ * @new_height: New layer height.
+ * @local_origin: Use a local origin (as opposed to the image origin).
+ * @interpolation: Type of interpolation.
+ *
+ * Scale the layer using a specific interpolation method.
+ *
+ * This procedure scales the layer so that its new width and height are
+ * equal to the supplied parameters. The 'local-origin' parameter
+ * specifies whether to scale from the center of the layer, or from the
+ * image origin. This operation only works if the layer has been added
+ * to an image. This procedure allows you to specify the interpolation
+ * method explicitly.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.6
+ */
+gboolean
+gimp_layer_scale_full (gint32                layer_ID,
+                       gint                  new_width,
+                       gint                  new_height,
+                       gboolean              local_origin,
+                       GimpInterpolationType interpolation)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-layer-scale-full",
+                                    &nreturn_vals,
+                                    GIMP_PDB_LAYER, layer_ID,
+                                    GIMP_PDB_INT32, new_width,
+                                    GIMP_PDB_INT32, new_height,
+                                    GIMP_PDB_INT32, local_origin,
+                                    GIMP_PDB_INT32, interpolation,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
  * gimp_layer_resize:
  * @layer_ID: The layer.
  * @new_width: New layer width.

Modified: branches/soc-2008-tagging/libgimp/gimplayer_pdb.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimplayer_pdb.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimplayer_pdb.h	Sun Oct 12 15:38:02 2008
@@ -29,65 +29,70 @@
 /* For information look into the C source or the html documentation */
 
 
-G_GNUC_INTERNAL gint32 _gimp_layer_new                 (gint32                image_ID,
-                                                        gint                  width,
-                                                        gint                  height,
-                                                        GimpImageType         type,
-                                                        const gchar          *name,
-                                                        gdouble               opacity,
-                                                        GimpLayerModeEffects  mode);
-gint32                 gimp_layer_new_from_visible     (gint32                image_ID,
-                                                        gint32                dest_image_ID,
-                                                        const gchar          *name);
-gint32                 gimp_layer_new_from_drawable    (gint32                drawable_ID,
-                                                        gint32                dest_image_ID);
-G_GNUC_INTERNAL gint32 _gimp_layer_copy                (gint32                layer_ID,
-                                                        gboolean              add_alpha);
-gboolean               gimp_layer_add_alpha            (gint32                layer_ID);
-gboolean               gimp_layer_flatten              (gint32                layer_ID);
-gboolean               gimp_layer_scale                (gint32                layer_ID,
-                                                        gint                  new_width,
-                                                        gint                  new_height,
-                                                        gboolean              local_origin);
-gboolean               gimp_layer_resize               (gint32                layer_ID,
-                                                        gint                  new_width,
-                                                        gint                  new_height,
-                                                        gint                  offx,
-                                                        gint                  offy);
-gboolean               gimp_layer_resize_to_image_size (gint32                layer_ID);
-gboolean               gimp_layer_translate            (gint32                layer_ID,
-                                                        gint                  offx,
-                                                        gint                  offy);
-gboolean               gimp_layer_set_offsets          (gint32                layer_ID,
-                                                        gint                  offx,
-                                                        gint                  offy);
-gint32                 gimp_layer_create_mask          (gint32                layer_ID,
-                                                        GimpAddMaskType       mask_type);
-gint32                 gimp_layer_get_mask             (gint32                layer_ID);
-gint32                 gimp_layer_from_mask            (gint32                mask_ID);
-gboolean               gimp_layer_add_mask             (gint32                layer_ID,
-                                                        gint32                mask_ID);
-gboolean               gimp_layer_remove_mask          (gint32                layer_ID,
-                                                        GimpMaskApplyMode     mode);
-gboolean               gimp_layer_is_floating_sel      (gint32                layer_ID);
-gboolean               gimp_layer_get_lock_alpha       (gint32                layer_ID);
-gboolean               gimp_layer_set_lock_alpha       (gint32                layer_ID,
-                                                        gboolean              lock_alpha);
-gboolean               gimp_layer_get_apply_mask       (gint32                layer_ID);
-gboolean               gimp_layer_set_apply_mask       (gint32                layer_ID,
-                                                        gboolean              apply_mask);
-gboolean               gimp_layer_get_show_mask        (gint32                layer_ID);
-gboolean               gimp_layer_set_show_mask        (gint32                layer_ID,
-                                                        gboolean              show_mask);
-gboolean               gimp_layer_get_edit_mask        (gint32                layer_ID);
-gboolean               gimp_layer_set_edit_mask        (gint32                layer_ID,
-                                                        gboolean              edit_mask);
-gdouble                gimp_layer_get_opacity          (gint32                layer_ID);
-gboolean               gimp_layer_set_opacity          (gint32                layer_ID,
-                                                        gdouble               opacity);
-GimpLayerModeEffects   gimp_layer_get_mode             (gint32                layer_ID);
-gboolean               gimp_layer_set_mode             (gint32                layer_ID,
-                                                        GimpLayerModeEffects  mode);
+G_GNUC_INTERNAL gint32 _gimp_layer_new                 (gint32                 image_ID,
+                                                        gint                   width,
+                                                        gint                   height,
+                                                        GimpImageType          type,
+                                                        const gchar           *name,
+                                                        gdouble                opacity,
+                                                        GimpLayerModeEffects   mode);
+gint32                 gimp_layer_new_from_visible     (gint32                 image_ID,
+                                                        gint32                 dest_image_ID,
+                                                        const gchar           *name);
+gint32                 gimp_layer_new_from_drawable    (gint32                 drawable_ID,
+                                                        gint32                 dest_image_ID);
+G_GNUC_INTERNAL gint32 _gimp_layer_copy                (gint32                 layer_ID,
+                                                        gboolean               add_alpha);
+gboolean               gimp_layer_add_alpha            (gint32                 layer_ID);
+gboolean               gimp_layer_flatten              (gint32                 layer_ID);
+gboolean               gimp_layer_scale                (gint32                 layer_ID,
+                                                        gint                   new_width,
+                                                        gint                   new_height,
+                                                        gboolean               local_origin);
+gboolean               gimp_layer_scale_full           (gint32                 layer_ID,
+                                                        gint                   new_width,
+                                                        gint                   new_height,
+                                                        gboolean               local_origin,
+                                                        GimpInterpolationType  interpolation);
+gboolean               gimp_layer_resize               (gint32                 layer_ID,
+                                                        gint                   new_width,
+                                                        gint                   new_height,
+                                                        gint                   offx,
+                                                        gint                   offy);
+gboolean               gimp_layer_resize_to_image_size (gint32                 layer_ID);
+gboolean               gimp_layer_translate            (gint32                 layer_ID,
+                                                        gint                   offx,
+                                                        gint                   offy);
+gboolean               gimp_layer_set_offsets          (gint32                 layer_ID,
+                                                        gint                   offx,
+                                                        gint                   offy);
+gint32                 gimp_layer_create_mask          (gint32                 layer_ID,
+                                                        GimpAddMaskType        mask_type);
+gint32                 gimp_layer_get_mask             (gint32                 layer_ID);
+gint32                 gimp_layer_from_mask            (gint32                 mask_ID);
+gboolean               gimp_layer_add_mask             (gint32                 layer_ID,
+                                                        gint32                 mask_ID);
+gboolean               gimp_layer_remove_mask          (gint32                 layer_ID,
+                                                        GimpMaskApplyMode      mode);
+gboolean               gimp_layer_is_floating_sel      (gint32                 layer_ID);
+gboolean               gimp_layer_get_lock_alpha       (gint32                 layer_ID);
+gboolean               gimp_layer_set_lock_alpha       (gint32                 layer_ID,
+                                                        gboolean               lock_alpha);
+gboolean               gimp_layer_get_apply_mask       (gint32                 layer_ID);
+gboolean               gimp_layer_set_apply_mask       (gint32                 layer_ID,
+                                                        gboolean               apply_mask);
+gboolean               gimp_layer_get_show_mask        (gint32                 layer_ID);
+gboolean               gimp_layer_set_show_mask        (gint32                 layer_ID,
+                                                        gboolean               show_mask);
+gboolean               gimp_layer_get_edit_mask        (gint32                 layer_ID);
+gboolean               gimp_layer_set_edit_mask        (gint32                 layer_ID,
+                                                        gboolean               edit_mask);
+gdouble                gimp_layer_get_opacity          (gint32                 layer_ID);
+gboolean               gimp_layer_set_opacity          (gint32                 layer_ID,
+                                                        gdouble                opacity);
+GimpLayerModeEffects   gimp_layer_get_mode             (gint32                 layer_ID);
+gboolean               gimp_layer_set_mode             (gint32                 layer_ID,
+                                                        GimpLayerModeEffects   mode);
 
 
 G_END_DECLS

Modified: branches/soc-2008-tagging/libgimp/gimpplugin_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpplugin_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpplugin_pdb.c	Sun Oct 12 15:38:02 2008
@@ -209,3 +209,73 @@
 
   return success;
 }
+
+/**
+ * gimp_plugin_set_pdb_error_handler:
+ * @handler: Who is responsible for handling procedure call errors.
+ *
+ * Sets an error handler for procedure calls.
+ *
+ * This procedure changes the way that errors in procedure calls are
+ * handled. By default GIMP will raise an error dialog if a procedure
+ * call made by a plug-in fails. Using this procedure the plug-in can
+ * change this behavior. If the error handler is set to
+ * %GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for
+ * calling gimp_get_pdb_error() and handling the error whenever one if
+ * its procedure calls fails. It can do this by displaying the error
+ * message or by forwarding it in its own return values.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.6
+ */
+gboolean
+gimp_plugin_set_pdb_error_handler (GimpPDBErrorHandler handler)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-plugin-set-pdb-error-handler",
+                                    &nreturn_vals,
+                                    GIMP_PDB_INT32, handler,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_plugin_get_pdb_error_handler:
+ *
+ * Retrieves the active error handler for procedure calls.
+ *
+ * This procedure retrieves the currently active error handler for
+ * procedure calls made by the calling plug-in. See
+ * gimp_plugin_set_pdb_error_handler() for details.
+ *
+ * Returns: Who is responsible for handling procedure call errors.
+ *
+ * Since: GIMP 2.6
+ */
+GimpPDBErrorHandler
+gimp_plugin_get_pdb_error_handler (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  GimpPDBErrorHandler handler = 0;
+
+  return_vals = gimp_run_procedure ("gimp-plugin-get-pdb-error-handler",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    handler = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return handler;
+}

Modified: branches/soc-2008-tagging/libgimp/gimpplugin_pdb.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpplugin_pdb.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimpplugin_pdb.h	Sun Oct 12 15:38:02 2008
@@ -29,18 +29,20 @@
 /* For information look into the C source or the html documentation */
 
 
-gboolean                 gimp_plugin_domain_register      (const gchar  *domain_name,
-                                                           const gchar  *domain_path);
-gboolean                 gimp_plugin_help_register        (const gchar  *domain_name,
-                                                           const gchar  *domain_uri);
-gboolean                 gimp_plugin_menu_register        (const gchar  *procedure_name,
-                                                           const gchar  *menu_path);
-gboolean                 gimp_plugin_menu_branch_register (const gchar  *menu_path,
-                                                           const gchar  *menu_name);
-G_GNUC_INTERNAL gboolean _gimp_plugin_icon_register       (const gchar  *procedure_name,
-                                                           GimpIconType  icon_type,
-                                                           gint          icon_data_length,
-                                                           const guint8 *icon_data);
+gboolean                 gimp_plugin_domain_register       (const gchar         *domain_name,
+                                                            const gchar         *domain_path);
+gboolean                 gimp_plugin_help_register         (const gchar         *domain_name,
+                                                            const gchar         *domain_uri);
+gboolean                 gimp_plugin_menu_register         (const gchar         *procedure_name,
+                                                            const gchar         *menu_path);
+gboolean                 gimp_plugin_menu_branch_register  (const gchar         *menu_path,
+                                                            const gchar         *menu_name);
+G_GNUC_INTERNAL gboolean _gimp_plugin_icon_register        (const gchar         *procedure_name,
+                                                            GimpIconType         icon_type,
+                                                            gint                 icon_data_length,
+                                                            const guint8        *icon_data);
+gboolean                 gimp_plugin_set_pdb_error_handler (GimpPDBErrorHandler  handler);
+GimpPDBErrorHandler      gimp_plugin_get_pdb_error_handler (void);
 
 
 G_END_DECLS

Modified: branches/soc-2008-tagging/libgimp/gimpprocview.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpprocview.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpprocview.c	Sun Oct 12 15:38:02 2008
@@ -44,28 +44,28 @@
 
 /*  local function prototypes  */
 
-static GtkWidget * gimp_proc_view_create_params (GimpParamDef *params,
-                                                 gint          n_params,
-                                                 GtkSizeGroup *name_group,
-                                                 GtkSizeGroup *type_group,
-                                                 GtkSizeGroup *desc_group);
+static GtkWidget * gimp_proc_view_create_params (const GimpParamDef *params,
+                                                 gint                n_params,
+                                                 GtkSizeGroup       *name_group,
+                                                 GtkSizeGroup       *type_group,
+                                                 GtkSizeGroup       *desc_group);
 
 
 /*  public functions  */
 
 GtkWidget *
-gimp_proc_view_new (const gchar     *name,
-                    const gchar     *menu_path,
-                    const gchar     *blurb,
-                    const gchar     *help,
-                    const gchar     *author,
-                    const gchar     *copyright,
-                    const gchar     *date,
-                    GimpPDBProcType  type,
-                    gint             n_params,
-                    gint             n_return_vals,
-                    GimpParamDef    *params,
-                    GimpParamDef    *return_vals)
+gimp_proc_view_new (const gchar        *name,
+                    const gchar        *menu_path,
+                    const gchar        *blurb,
+                    const gchar        *help,
+                    const gchar        *author,
+                    const gchar        *copyright,
+                    const gchar        *date,
+                    GimpPDBProcType     type,
+                    gint                n_params,
+                    gint                n_return_vals,
+                    const GimpParamDef *params,
+                    const GimpParamDef *return_vals)
 {
   GtkWidget    *main_vbox;
   GtkWidget    *frame;
@@ -241,11 +241,11 @@
 /*  private functions  */
 
 static GtkWidget *
-gimp_proc_view_create_params (GimpParamDef *params,
-                              gint          n_params,
-                              GtkSizeGroup *name_group,
-                              GtkSizeGroup *type_group,
-                              GtkSizeGroup *desc_group)
+gimp_proc_view_create_params (const GimpParamDef *params,
+                              gint                n_params,
+                              GtkSizeGroup       *name_group,
+                              GtkSizeGroup       *type_group,
+                              GtkSizeGroup       *desc_group)
 {
   GtkWidget *table;
   gint       i;

Modified: branches/soc-2008-tagging/libgimp/gimpprocview.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpprocview.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimpprocview.h	Sun Oct 12 15:38:02 2008
@@ -28,18 +28,18 @@
 /* For information look into the C source or the html documentation */
 
 
-GtkWidget * gimp_proc_view_new (const gchar     *name,
-                                const gchar     *menu_path,
-                                const gchar     *blurb,
-                                const gchar     *help,
-                                const gchar     *author,
-                                const gchar     *copyright,
-                                const gchar     *date,
-                                GimpPDBProcType  type,
-                                gint             n_params,
-                                gint             n_return_vals,
-                                GimpParamDef    *params,
-                                GimpParamDef    *return_vals);
+GtkWidget * gimp_proc_view_new (const gchar        *name,
+                                const gchar        *menu_path,
+                                const gchar        *blurb,
+                                const gchar        *help,
+                                const gchar        *author,
+                                const gchar        *copyright,
+                                const gchar        *date,
+                                GimpPDBProcType     type,
+                                gint                n_params,
+                                gint                n_return_vals,
+                                const GimpParamDef *params,
+                                const GimpParamDef *return_vals);
 
 
 G_END_DECLS

Modified: branches/soc-2008-tagging/libgimp/gimpselection_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpselection_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpselection_pdb.c	Sun Oct 12 15:38:02 2008
@@ -496,12 +496,12 @@
  *
  * Transfer the specified layer's alpha channel to the selection mask.
  *
- * This procedure requires a layer with an alpha channel. The alpha
- * channel information is used to create a selection mask such that for
- * any pixel in the image defined in the specified layer, that layer
- * pixel's alpha value is transferred to the selection mask. If the
- * layer is undefined at a particular image pixel, the associated
- * selection mask value is set to 0.
+ * The alpha channel information is used to create a selection mask
+ * such that for any pixel in the image defined in the specified layer,
+ * that layer pixel's alpha value is transferred to the selection mask.
+ * If the layer is undefined at a particular image pixel, the
+ * associated selection mask value is set to 0. A layer without an
+ * alpha channel is considered opaque.
  *
  * Returns: TRUE on success.
  */

Modified: branches/soc-2008-tagging/libgimp/gimpzoompreview.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpzoompreview.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpzoompreview.c	Sun Oct 12 15:38:02 2008
@@ -518,6 +518,8 @@
       gint     src_y;
       gint     src_width;
       gint     src_height;
+      gint     offsx = 0;
+      gint     offsy = 0;
 
       selection_id = gimp_image_get_selection (image_id);
 
@@ -532,8 +534,9 @@
                                                   src_x, src_y,
                                                   src_width, src_height,
                                                   &width, &height, &bpp);
+      gimp_drawable_offsets (drawable->drawable_id, &offsx, &offsy);
       sel = gimp_drawable_get_sub_thumbnail_data (selection_id,
-                                                  src_x, src_y,
+                                                  src_x + offsx, src_y + offsy,
                                                   src_width, src_height,
                                                   &width, &height, &bpp);
 
@@ -632,10 +635,10 @@
 
   priv->drawable = drawable;
 
-  if (_gimp_drawable_preview_get_bounds (drawable, &x1, &y1, &x2, &y2))
+  if (gimp_drawable_mask_intersect (drawable->drawable_id, &x1, &y1, &width, &height))
     {
-      width  = x2 - x1;
-      height = y2 - y1;
+      x2 = x1 + width;
+      y2 = y1 + height;
 
       priv->extents.x = x1;
       priv->extents.y = y1;

Modified: branches/soc-2008-tagging/libgimp/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/libgimp/makefile.msc	(original)
+++ branches/soc-2008-tagging/libgimp/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -77,6 +77,7 @@
 	gimpprogress_pdb.obj \
 	gimpselection_pdb.obj \
 	gimpselectiontools_pdb.obj \
+	gimptextlayer_pdb.obj \
 	gimptexttool_pdb.obj \
 	gimptransformtools_pdb.obj \
 	gimpundo_pdb.obj \

Modified: branches/soc-2008-tagging/libgimpbase/gimpbase.def
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbase.def	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbase.def	Sun Oct 12 15:38:02 2008
@@ -76,6 +76,7 @@
 	gimp_path_parse
 	gimp_path_to_str
 	gimp_pdb_arg_type_get_type
+	gimp_pdb_error_handler_get_type
 	gimp_pdb_proc_type_get_type
 	gimp_pdb_status_type_get_type
 	gimp_personal_rc_file

Modified: branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c	Sun Oct 12 15:38:02 2008
@@ -864,6 +864,35 @@
 }
 
 GType
+gimp_pdb_error_handler_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_PDB_ERROR_HANDLER_INTERNAL, "GIMP_PDB_ERROR_HANDLER_INTERNAL", "internal" },
+    { GIMP_PDB_ERROR_HANDLER_PLUGIN, "GIMP_PDB_ERROR_HANDLER_PLUGIN", "plugin" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_PDB_ERROR_HANDLER_INTERNAL, "GIMP_PDB_ERROR_HANDLER_INTERNAL", NULL },
+    { GIMP_PDB_ERROR_HANDLER_PLUGIN, "GIMP_PDB_ERROR_HANDLER_PLUGIN", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpPDBErrorHandler", values);
+      gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_pdb_proc_type_get_type (void)
 {
   static const GEnumValue values[] =

Modified: branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h	Sun Oct 12 15:38:02 2008
@@ -385,6 +385,17 @@
 } GimpPDBArgType;
 
 
+#define GIMP_TYPE_PDB_ERROR_HANDLER (gimp_pdb_error_handler_get_type ())
+
+GType gimp_pdb_error_handler_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_PDB_ERROR_HANDLER_INTERNAL,
+  GIMP_PDB_ERROR_HANDLER_PLUGIN
+} GimpPDBErrorHandler;
+
+
 #define GIMP_TYPE_PDB_PROC_TYPE (gimp_pdb_proc_type_get_type ())
 
 GType gimp_pdb_proc_type_get_type (void) G_GNUC_CONST;

Modified: branches/soc-2008-tagging/libgimpbase/gimpbasetypes.h
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbasetypes.h	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbasetypes.h	Sun Oct 12 15:38:02 2008
@@ -45,16 +45,16 @@
 
 struct _GimpEnumDesc
 {
-  gint   value;
-  gchar *value_desc;
-  gchar *value_help;
+  gint         value;
+  const gchar *value_desc;
+  const gchar *value_help;
 };
 
 struct _GimpFlagsDesc
 {
-  guint  value;
-  gchar *value_desc;
-  gchar *value_help;
+  guint        value;
+  const gchar *value_desc;
+  const gchar *value_help;
 };
 
 

Modified: branches/soc-2008-tagging/libgimpbase/gimpreloc.c
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpreloc.c	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpreloc.c	Sun Oct 12 15:38:02 2008
@@ -353,7 +353,7 @@
 static void
 set_gerror (GError **error, GimpBinrelocInitError errcode)
 {
-        gchar *error_message;
+        const gchar *error_message;
 
         if (error == NULL)
                 return;

Modified: branches/soc-2008-tagging/libgimpbase/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/makefile.msc	(original)
+++ branches/soc-2008-tagging/libgimpbase/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -10,10 +10,7 @@
 
 DEFINES = -DGIMPDIR=\"$(GIMPDIR)\" -DDATADIR=\"\" -DSYSCONFDIR=\"\" \
 	-DPLUGINDIR=\"plug-ins\" -DLOCALEDIR=\"locale\" \
-	-DGIMP_PACKAGE=\"gimp-2.4\" \
-	-DGIMP_DATA_VERSION=\"2.4\" \
-	-DGIMP_PLUGIN_VERSION=\"2.4\" \
-	-DGIMP_SYSCONF_VERSION=\"2.4\" \
+	$(GIMP_VERSION_DEFINES)
 
 top_srcdir = $(PRJ_TOP)
 top_builddir = $(PRJ_TOP)

Modified: branches/soc-2008-tagging/libgimpconfig/gimpconfig-utils.c
==============================================================================
--- branches/soc-2008-tagging/libgimpconfig/gimpconfig-utils.c	(original)
+++ branches/soc-2008-tagging/libgimpconfig/gimpconfig-utils.c	Sun Oct 12 15:38:02 2008
@@ -206,7 +206,6 @@
   /* we use the internal versions here for a number of reasons:
    *  - it saves a g_list_reverse()
    *  - it avoids duplicated parameter checks
-   *  - it makes GimpTemplateEditor work (resolution is set before size)
    */
   if (G_TYPE_FROM_INSTANCE (src) == G_TYPE_FROM_INSTANCE (dest))
     diff = gimp_config_diff_same (src, dest, (flags | G_PARAM_READWRITE));

Modified: branches/soc-2008-tagging/libgimpwidgets/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/Makefile.am	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -122,8 +122,6 @@
 	gimphelpui.h			\
 	gimphintbox.c			\
 	gimphintbox.h			\
-	gimphruler.c			\
-	gimphruler.h			\
 	gimpintcombobox.c		\
 	gimpintcombobox.h		\
 	gimpintstore.c			\
@@ -166,8 +164,6 @@
 	gimpstringcombobox.h		\
 	gimpunitmenu.c			\
 	gimpunitmenu.h			\
-	gimpvruler.c			\
-	gimpvruler.h			\
 	gimpzoommodel.c			\
 	gimpzoommodel.h			\
 	gimpwidgets-private.c		\
@@ -218,7 +214,6 @@
 	gimpframe.h			\
 	gimphelpui.h			\
 	gimphintbox.h			\
-	gimphruler.h			\
 	gimpintcombobox.h		\
 	gimpintstore.h			\
 	gimpmemsizeentry.h		\
@@ -240,7 +235,6 @@
 	gimpstock.h			\
 	gimpstringcombobox.h		\
 	gimpunitmenu.h			\
-	gimpvruler.h			\
 	gimpzoommodel.h
 
 libgimpwidgets_2_0_la_LDFLAGS = \

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpbutton.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpbutton.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpbutton.c	Sun Oct 12 15:38:02 2008
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  *
  * gimpbutton.c
- * Copyright (C) 2000 Michael Natterer <mitch gimp org>
+ * Copyright (C) 2000-2008 Michael Natterer <mitch gimp org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -36,10 +36,9 @@
 };
 
 
-static gboolean   gimp_button_button_press   (GtkWidget      *widget,
-                                              GdkEventButton *event);
-static gboolean   gimp_button_button_release (GtkWidget      *widget,
-                                              GdkEventButton *event);
+static gboolean   gimp_button_button_press (GtkWidget      *widget,
+                                            GdkEventButton *event);
+static void       gimp_button_clicked      (GtkButton      *button);
 
 
 G_DEFINE_TYPE (GimpButton, gimp_button, GTK_TYPE_BUTTON)
@@ -53,6 +52,7 @@
 gimp_button_class_init (GimpButtonClass *klass)
 {
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+  GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
 
   button_signals[EXTENDED_CLICKED] =
     g_signal_new ("extended-clicked",
@@ -64,8 +64,9 @@
                   G_TYPE_NONE, 1,
                   GDK_TYPE_MODIFIER_TYPE);
 
-  widget_class->button_press_event   = gimp_button_button_press;
-  widget_class->button_release_event = gimp_button_button_release;
+  widget_class->button_press_event = gimp_button_button_press;
+
+  button_class->clicked            = gimp_button_clicked;
 }
 
 static void
@@ -118,52 +119,18 @@
       button->press_state = 0;
     }
 
-  if (GTK_WIDGET_CLASS (parent_class)->button_press_event)
-    return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent);
-
-  return TRUE;
+  return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent);
 }
 
-static gboolean
-gimp_button_button_release (GtkWidget      *widget,
-                            GdkEventButton *bevent)
+static void
+gimp_button_clicked (GtkButton *button)
 {
-  GtkButton *button           = GTK_BUTTON (widget);
-  gboolean   extended_clicked = FALSE;
-
-  if (bevent->button == 1)
+  if (GIMP_BUTTON (button)->press_state &
+      (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK))
     {
-      if (button->in_button &&
-          (GIMP_BUTTON (button)->press_state &
-           (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)))
-        {
-          gimp_button_extended_clicked (GIMP_BUTTON (button),
-                                        GIMP_BUTTON (button)->press_state);
-
-          extended_clicked = TRUE;
-
-          /* HACK: don't let GtkButton emit "clicked" by telling it that
-           * the mouse pointer is outside the widget
-           */
-          button->in_button = FALSE;
-        }
-    }
-
-  if (GTK_WIDGET_CLASS (parent_class)->button_release_event)
-    GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, bevent);
+      g_signal_stop_emission_by_name (button, "clicked");
 
-  if (extended_clicked)
-    {
-      /* revert the above HACK and let the button draw itself in the
-       * correct state, because upchaining with "in_button" == FALSE
-       * messed it up
-       */
-      button->in_button = TRUE;
-
-      gtk_widget_set_state (widget, GTK_STATE_PRELIGHT);
-      gtk_widget_queue_draw (widget);
-      gdk_window_process_updates (widget->window, TRUE);
-   }
-
-  return TRUE;
+      gimp_button_extended_clicked (GIMP_BUTTON (button),
+                                    GIMP_BUTTON (button)->press_state);
+    }
 }

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c	Sun Oct 12 15:38:02 2008
@@ -345,6 +345,7 @@
                                 GimpColorScales *scales)
 {
   GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
+  gdouble            value    = gtk_adjustment_get_value (adjustment);
   gint               i;
 
   for (i = 0; i < 7; i++)
@@ -354,32 +355,31 @@
   switch (i)
     {
     case GIMP_COLOR_SELECTOR_HUE:
-      selector->hsv.h = GTK_ADJUSTMENT (adjustment)->value / 360.0;
+      selector->hsv.h = value / 360.0;
       break;
 
     case GIMP_COLOR_SELECTOR_SATURATION:
-      selector->hsv.s = GTK_ADJUSTMENT (adjustment)->value / 100.0;
+      selector->hsv.s = value / 100.0;
       break;
 
     case GIMP_COLOR_SELECTOR_VALUE:
-      selector->hsv.v = GTK_ADJUSTMENT (adjustment)->value / 100.0;
+      selector->hsv.v = value / 100.0;
       break;
 
     case GIMP_COLOR_SELECTOR_RED:
-      selector->rgb.r = GTK_ADJUSTMENT (adjustment)->value / 255.0;
+      selector->rgb.r = value / 255.0;
       break;
 
     case GIMP_COLOR_SELECTOR_GREEN:
-      selector->rgb.g = GTK_ADJUSTMENT (adjustment)->value / 255.0;
+      selector->rgb.g = value / 255.0;
       break;
 
     case GIMP_COLOR_SELECTOR_BLUE:
-      selector->rgb.b = GTK_ADJUSTMENT (adjustment)->value / 255.0;
+      selector->rgb.b = value / 255.0;
       break;
 
     case GIMP_COLOR_SELECTOR_ALPHA:
-      selector->hsv.a = selector->rgb.a =
-        GTK_ADJUSTMENT (adjustment)->value / 100.0;
+      selector->hsv.a = selector->rgb.a = value / 100.0;
       break;
     }
 

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c	Sun Oct 12 15:38:02 2008
@@ -667,15 +667,8 @@
 
     case GDK_MOTION_NOTIFY:
       mevent = (GdkEventMotion *) event;
-      if (mevent->is_hint)
-        {
-          gdk_window_get_pointer (widget->window, &x, &y, NULL);
-        }
-      else
-        {
-          x = mevent->x;
-          y = mevent->y;
-        }
+      x = mevent->x;
+      y = mevent->y;
       break;
 
     default:
@@ -700,8 +693,8 @@
 
   gimp_color_select_update (select, UPDATE_VALUES | UPDATE_CALLER);
 
-  if (event->type == GDK_MOTION_NOTIFY)
-    gdk_event_request_motions ((GdkEventMotion *) event);
+  /* Ask for more motion events in case the event was a hint */
+  gdk_event_request_motions ((GdkEventMotion *) event);
 
   return TRUE;
 }
@@ -760,14 +753,7 @@
 
     case GDK_MOTION_NOTIFY:
       mevent = (GdkEventMotion *) event;
-      if (mevent->is_hint)
-        {
-          gdk_window_get_pointer (widget->window, NULL, &z, NULL);
-        }
-      else
-        {
-          z = mevent->y;
-        }
+      z = mevent->y;
       break;
 
     default:
@@ -787,6 +773,9 @@
   gimp_color_select_update (select,
                             UPDATE_VALUES | UPDATE_XY_COLOR | UPDATE_CALLER);
 
+  /* Ask for more motion events in case the event was a hint */
+  gdk_event_request_motions ((GdkEventMotion *) event);
+
   return TRUE;
 }
 

Modified: branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c	Sun Oct 12 15:38:02 2008
@@ -220,14 +220,10 @@
 gimp_preview_area_expose (GtkWidget      *widget,
                           GdkEventExpose *event)
 {
-  GimpPreviewArea *area;
+  GimpPreviewArea *area = GIMP_PREVIEW_AREA (widget);
   GdkRectangle     rect;
   GdkRectangle     render;
 
-  g_return_val_if_fail (GIMP_IS_PREVIEW_AREA (widget), FALSE);
-
-  area = GIMP_PREVIEW_AREA (widget);
-
   if (! area->buf)
     return FALSE;
 

Modified: branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c	Sun Oct 12 15:38:02 2008
@@ -1291,56 +1291,55 @@
                                GObject       *config)
 {
   GParamSpec *param_spec;
+  gdouble     value;
 
   param_spec = get_param_spec (G_OBJECT (adjustment));
   if (! param_spec)
     return;
 
+  value = gtk_adjustment_get_value (adjustment);
+
   if (G_IS_PARAM_SPEC_INT (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (gint) adjustment->value,
+                    param_spec->name, (gint) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_UINT (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (guint) adjustment->value,
+                    param_spec->name, (guint) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_LONG (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (glong) adjustment->value,
+                    param_spec->name, (glong) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_ULONG (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (gulong) adjustment->value,
+                    param_spec->name, (gulong) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_INT64 (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (gint64) adjustment->value,
+                    param_spec->name, (gint64) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_UINT64 (param_spec))
     {
       g_object_set (config,
-                    param_spec->name, (guint64) adjustment->value,
+                    param_spec->name, (guint64) value,
                     NULL);
     }
   else if (G_IS_PARAM_SPEC_DOUBLE (param_spec))
     {
-      gdouble value;
-
       if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (adjustment),
                                               "opacity-scale")))
-        value = adjustment->value / 100.0;
-      else
-        value = adjustment->value;
+        value /= 100.0;
 
       g_object_set (config, param_spec->name, value, NULL);
     }
@@ -1420,7 +1419,7 @@
       return;
     }
 
-  if (adjustment->value != value)
+  if (gtk_adjustment_get_value (adjustment) != value)
     {
       g_signal_handlers_block_by_func (adjustment,
                                        gimp_prop_adjustment_callback,
@@ -3528,14 +3527,15 @@
                               GParamSpec *param_spec,
                               GtkWidget  *image)
 {
-  gchar *stock_id;
+  gchar       *stock_id;
+  GtkIconSize  icon_size;
 
   g_object_get (config,
                 param_spec->name, &stock_id,
                 NULL);
 
-  gtk_image_set_from_stock (GTK_IMAGE (image), stock_id,
-                            GTK_IMAGE (image)->icon_size);
+  gtk_image_get_stock (GTK_IMAGE (image), NULL, &icon_size);
+  gtk_image_set_from_stock (GTK_IMAGE (image), stock_id, icon_size);
 
   if (stock_id)
     g_free (stock_id);

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpruler.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpruler.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpruler.c	Sun Oct 12 15:38:02 2008
@@ -19,33 +19,26 @@
 
 #include "config.h"
 
+#include <string.h>
+
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
+#include "libgimpmath/gimpmath.h"
 
 #include "gimpwidgetstypes.h"
 
 #include "gimpruler.h"
 
 
-/* All distances below are in 1/72nd's of an inch. (According to
- * Adobe that's a point, but points are really 1/72.27 in.)
- */
-typedef struct
-{
-  GimpUnit   unit;
-  gdouble    lower;
-  gdouble    upper;
-  gdouble    position;
-  gdouble    max_size;
+#define DEFAULT_RULER_FONT_SCALE  PANGO_SCALE_SMALL
+#define MINIMUM_INCR              5
 
-  GdkPixmap *backing_store;
-  GdkGC     *non_gr_exp_gc;
-} GimpRulerPrivate;
 
 enum
 {
   PROP_0,
+  PROP_ORIENTATION,
   PROP_UNIT,
   PROP_LOWER,
   PROP_UPPER,
@@ -53,23 +46,69 @@
   PROP_MAX_SIZE
 };
 
-static void  gimp_ruler_realize       (GtkWidget      *widget);
-static void  gimp_ruler_unrealize     (GtkWidget      *widget);
-static void  gimp_ruler_size_allocate (GtkWidget      *widget,
-                                       GtkAllocation  *allocation);
-static gint  gimp_ruler_expose        (GtkWidget      *widget,
-                                       GdkEventExpose *event);
-static void  gimp_ruler_draw_ticks    (GimpRuler      *ruler);
-static void  gimp_ruler_draw_pos      (GimpRuler      *ruler);
-static void  gimp_ruler_make_pixmap   (GimpRuler      *ruler);
-static void  gimp_ruler_set_property  (GObject        *object,
-                                       guint            prop_id,
-                                       const GValue   *value,
-                                       GParamSpec     *pspec);
-static void  gimp_ruler_get_property  (GObject        *object,
-                                       guint           prop_id,
-                                       GValue         *value,
-                                       GParamSpec     *pspec);
+
+/* All distances below are in 1/72nd's of an inch. (According to
+ * Adobe that's a point, but points are really 1/72.27 in.)
+ */
+typedef struct
+{
+  GtkOrientation  orientation;
+  GimpUnit        unit;
+  gdouble         lower;
+  gdouble         upper;
+  gdouble         position;
+  gdouble         max_size;
+
+  GdkPixmap      *backing_store;
+  GdkGC          *non_gr_exp_gc;
+  PangoLayout    *layout;
+  gdouble         font_scale;
+
+  gint            xsrc;
+  gint            ysrc;
+} GimpRulerPrivate;
+
+
+static const struct
+{
+  const gdouble  ruler_scale[16];
+  const gint     subdivide[5];
+} ruler_metric =
+{
+  { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000 },
+  { 1, 5, 10, 50, 100 }
+};
+
+
+static void          gimp_ruler_set_property  (GObject        *object,
+                                               guint            prop_id,
+                                               const GValue   *value,
+                                               GParamSpec     *pspec);
+static void          gimp_ruler_get_property  (GObject        *object,
+                                               guint           prop_id,
+                                               GValue         *value,
+                                               GParamSpec     *pspec);
+
+static void          gimp_ruler_realize       (GtkWidget      *widget);
+static void          gimp_ruler_unrealize     (GtkWidget      *widget);
+static void          gimp_ruler_size_allocate (GtkWidget      *widget,
+                                               GtkAllocation  *allocation);
+static void          gimp_ruler_size_request  (GtkWidget      *widget,
+                                               GtkRequisition *requisition);
+static void          gimp_ruler_style_set     (GtkWidget      *widget,
+                                               GtkStyle       *prev_style);
+static gboolean      gimp_ruler_motion_notify (GtkWidget      *widget,
+                                               GdkEventMotion *event);
+static gboolean      gimp_ruler_expose        (GtkWidget      *widget,
+                                               GdkEventExpose *event);
+
+static void          gimp_ruler_draw_ticks    (GimpRuler      *ruler);
+static void          gimp_ruler_draw_pos      (GimpRuler      *ruler);
+static void          gimp_ruler_make_pixmap   (GimpRuler      *ruler);
+
+static PangoLayout * gimp_ruler_get_layout    (GtkWidget      *widget,
+                                               const gchar    *text);
+
 
 G_DEFINE_TYPE (GimpRuler, gimp_ruler, GTK_TYPE_WIDGET)
 
@@ -83,20 +122,29 @@
   GObjectClass   *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->set_property = gimp_ruler_set_property;
-  object_class->get_property = gimp_ruler_get_property;
+  object_class->set_property        = gimp_ruler_set_property;
+  object_class->get_property        = gimp_ruler_get_property;
 
-  widget_class->realize       = gimp_ruler_realize;
-  widget_class->unrealize     = gimp_ruler_unrealize;
-  widget_class->size_allocate = gimp_ruler_size_allocate;
-  widget_class->expose_event  = gimp_ruler_expose;
-
-  klass->draw_ticks = NULL;
-  klass->draw_pos   = NULL;
+  widget_class->realize             = gimp_ruler_realize;
+  widget_class->unrealize           = gimp_ruler_unrealize;
+  widget_class->size_allocate       = gimp_ruler_size_allocate;
+  widget_class->size_request        = gimp_ruler_size_request;
+  widget_class->style_set           = gimp_ruler_style_set;
+  widget_class->motion_notify_event = gimp_ruler_motion_notify;
+  widget_class->expose_event        = gimp_ruler_expose;
 
   g_type_class_add_private (object_class, sizeof (GimpRulerPrivate));
 
   g_object_class_install_property (object_class,
+                                   PROP_ORIENTATION,
+                                   g_param_spec_enum ("orientation",
+                                                      "Orientation",
+                                                      "The orientation of the ruler",
+                                                      GTK_TYPE_ORIENTATION,
+                                                      GTK_ORIENTATION_HORIZONTAL,
+                                                      GIMP_PARAM_READWRITE));
+
+  g_object_class_install_property (object_class,
                                    PROP_LOWER,
                                    gimp_param_spec_unit ("unit",
                                                          "Unit",
@@ -144,6 +192,14 @@
                                                         G_MAXDOUBLE,
                                                         0.0,
                                                         GIMP_PARAM_READWRITE));
+
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_double ("font-scale",
+                                                                NULL, NULL,
+                                                                0.0,
+                                                                G_MAXDOUBLE,
+                                                                DEFAULT_RULER_FONT_SCALE,
+                                                                GIMP_PARAM_READABLE));
 }
 
 static void
@@ -151,6 +207,7 @@
 {
   GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
 
+  priv->orientation   = GTK_ORIENTATION_HORIZONTAL;
   priv->unit          = GIMP_PIXELS;
   priv->lower         = 0;
   priv->upper         = 0;
@@ -158,6 +215,7 @@
   priv->max_size      = 0;
   priv->backing_store = NULL;
   priv->non_gr_exp_gc = NULL;
+  priv->font_scale    = DEFAULT_RULER_FONT_SCALE;
 }
 
 static void
@@ -171,9 +229,15 @@
 
   switch (prop_id)
     {
+    case PROP_ORIENTATION:
+      priv->orientation = g_value_get_enum (value);
+      gtk_widget_queue_resize (GTK_WIDGET (ruler));
+      break;
+
     case PROP_UNIT:
       gimp_ruler_set_unit (ruler, g_value_get_int (value));
       break;
+
     case PROP_LOWER:
       gimp_ruler_set_range (ruler,
                             g_value_get_double (value),
@@ -186,15 +250,18 @@
                             g_value_get_double (value),
                             priv->max_size);
       break;
+
     case PROP_POSITION:
       gimp_ruler_set_position (ruler, g_value_get_double (value));
       break;
+
     case PROP_MAX_SIZE:
       gimp_ruler_set_range (ruler,
                             priv->lower,
                             priv->upper,
                             g_value_get_double (value));
       break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -202,31 +269,40 @@
 }
 
 static void
-gimp_ruler_get_property (GObject      *object,
-                         guint         prop_id,
-                         GValue       *value,
-                         GParamSpec   *pspec)
+gimp_ruler_get_property (GObject    *object,
+                         guint       prop_id,
+                         GValue     *value,
+                         GParamSpec *pspec)
 {
   GimpRuler        *ruler = GIMP_RULER (object);
   GimpRulerPrivate *priv  = GIMP_RULER_GET_PRIVATE (ruler);
 
   switch (prop_id)
     {
+    case PROP_ORIENTATION:
+      g_value_set_enum (value, priv->orientation);
+      break;
+
     case PROP_UNIT:
       g_value_set_int (value, priv->unit);
       break;
+
     case PROP_LOWER:
       g_value_set_double (value, priv->lower);
       break;
+
     case PROP_UPPER:
       g_value_set_double (value, priv->upper);
       break;
+
     case PROP_POSITION:
       g_value_set_double (value, priv->position);
       break;
+
     case PROP_MAX_SIZE:
       g_value_set_double (value, priv->max_size);
       break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -234,6 +310,24 @@
 }
 
 /**
+ * gimp_ruler_new:
+ * @orientation: the ruler's orientation.
+ *
+ * Creates a new ruler.
+ *
+ * Return value: a new #GimpRuler widget.
+ *
+ * Since: GIMP 2.8
+ **/
+GtkWidget *
+gimp_ruler_new (GtkOrientation orientation)
+{
+  return g_object_new (GIMP_TYPE_RULER,
+                       "orientation", orientation,
+                       NULL);
+}
+
+/**
  * gimp_ruler_set_position:
  * @ruler: a #GimpRuler
  * @unit:  the #GimpUnit to set the ruler to
@@ -399,35 +493,6 @@
     *max_size = priv->max_size;
 }
 
-GdkDrawable *
-_gimp_ruler_get_backing_store (GimpRuler *ruler)
-{
-  return GIMP_RULER_GET_PRIVATE (ruler)->backing_store;
-}
-
-PangoLayout *
-_gimp_ruler_create_pango_layout (GtkWidget   *widget,
-                                 const gchar *text)
-{
-  PangoLayout    *layout;
-  PangoAttrList  *attrs;
-  PangoAttribute *attr;
-
-  layout = gtk_widget_create_pango_layout (widget, text);
-
-  attrs = pango_attr_list_new ();
-
-  attr = pango_attr_scale_new (PANGO_SCALE_X_SMALL);
-  attr->start_index = 0;
-  attr->end_index   = -1;
-  pango_attr_list_insert (attrs, attr);
-
-  pango_layout_set_attributes (layout, attrs);
-  pango_attr_list_unref (attrs);
-
-  return layout;
-}
-
 static void
 gimp_ruler_realize (GtkWidget *widget)
 {
@@ -445,9 +510,9 @@
   attributes.wclass      = GDK_INPUT_OUTPUT;
   attributes.visual      = gtk_widget_get_visual (widget);
   attributes.colormap    = gtk_widget_get_colormap (widget);
-  attributes.event_mask  = gtk_widget_get_events (widget);
-  attributes.event_mask |= (GDK_EXPOSURE_MASK |
-                            GDK_POINTER_MOTION_MASK |
+  attributes.event_mask  = (gtk_widget_get_events (widget) |
+                            GDK_EXPOSURE_MASK              |
+                            GDK_POINTER_MOTION_MASK        |
                             GDK_POINTER_MOTION_HINT_MASK);
 
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
@@ -457,7 +522,8 @@
   gdk_window_set_user_data (widget->window, ruler);
 
   widget->style = gtk_style_attach (widget->style, widget->window);
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE);
+  gtk_style_set_background (gtk_widget_get_style (widget), widget->window,
+                            GTK_STATE_ACTIVE);
 
   gimp_ruler_make_pixmap (ruler);
 }
@@ -480,8 +546,13 @@
       priv->non_gr_exp_gc = NULL;
     }
 
-  if (GTK_WIDGET_CLASS (gimp_ruler_parent_class)->unrealize)
-    (* GTK_WIDGET_CLASS (gimp_ruler_parent_class)->unrealize) (widget);
+  if (priv->layout)
+    {
+      g_object_unref (priv->layout);
+      priv->layout = NULL;
+    }
+
+  GTK_WIDGET_CLASS (gimp_ruler_parent_class)->unrealize (widget);
 }
 
 static void
@@ -502,7 +573,84 @@
     }
 }
 
-static gint
+static void
+gimp_ruler_size_request (GtkWidget      *widget,
+                         GtkRequisition *requisition)
+{
+  GimpRulerPrivate *priv  = GIMP_RULER_GET_PRIVATE (widget);
+  GtkStyle         *style = gtk_widget_get_style (widget);
+  PangoLayout      *layout;
+  PangoRectangle    ink_rect;
+  gint              size;
+
+  layout = gimp_ruler_get_layout (widget, "0123456789");
+  pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
+
+  size = 2 + ink_rect.height * 1.7;
+
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      widget->requisition.width  = style->xthickness * 2 + 1;
+      widget->requisition.height = style->ythickness * 2 + size;
+    }
+  else
+    {
+      widget->requisition.width  = style->xthickness * 2 + size;
+      widget->requisition.height = style->ythickness * 2 + 1;
+    }
+}
+
+static void
+gimp_ruler_style_set (GtkWidget *widget,
+                      GtkStyle  *prev_style)
+{
+  GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
+
+  GTK_WIDGET_CLASS (gimp_ruler_parent_class)->style_set (widget, prev_style);
+
+  gtk_widget_style_get (widget,
+                        "font-scale", &priv->font_scale,
+                        NULL);
+
+  if (priv->layout)
+    {
+      g_object_unref (priv->layout);
+      priv->layout = NULL;
+    }
+}
+
+static gboolean
+gimp_ruler_motion_notify (GtkWidget      *widget,
+                          GdkEventMotion *event)
+{
+  GimpRuler        *ruler = GIMP_RULER (widget);
+  GimpRulerPrivate *priv  = GIMP_RULER_GET_PRIVATE (ruler);
+  gdouble           lower;
+  gdouble           upper;
+
+  gdk_event_request_motions (event);
+
+  gimp_ruler_get_range (ruler, &lower, &upper, NULL);
+
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      gimp_ruler_set_position (ruler,
+                               lower +
+                               (upper - lower) * event->x /
+                               widget->allocation.width);
+    }
+  else
+    {
+      gimp_ruler_set_position (ruler,
+                               lower +
+                               (upper - lower) * event->y /
+                               widget->allocation.height);
+    }
+
+  return FALSE;
+}
+
+static gboolean
 gimp_ruler_expose (GtkWidget      *widget,
                    GdkEventExpose *event)
 {
@@ -529,30 +677,321 @@
 static void
 gimp_ruler_draw_ticks (GimpRuler *ruler)
 {
-  g_return_if_fail (GIMP_IS_RULER (ruler));
+  GtkWidget        *widget = GTK_WIDGET (ruler);
+  GtkStyle         *style  = gtk_widget_get_style (widget);
+  GimpRulerPrivate *priv   = GIMP_RULER_GET_PRIVATE (ruler);
+  cairo_t          *cr;
+  gint              i;
+  gint              width, height;
+  gint              xthickness;
+  gint              ythickness;
+  gint              length, ideal_length;
+  gdouble           lower, upper;  /* Upper and lower limits, in ruler units */
+  gdouble           increment;     /* Number of pixels per unit */
+  gint              scale;         /* Number of units per major unit */
+  gdouble           start, end, cur;
+  gchar             unit_str[32];
+  gint              digit_height;
+  gint              digit_offset;
+  gint              text_size;
+  gint              pos;
+  gdouble           max_size;
+  GimpUnit          unit;
+  PangoLayout      *layout;
+  PangoRectangle    logical_rect, ink_rect;
+
+  if (! GTK_WIDGET_DRAWABLE (widget))
+    return;
+
+  xthickness = style->xthickness;
+  ythickness = style->ythickness;
+
+  layout = gimp_ruler_get_layout (widget, "0123456789");
+  pango_layout_get_extents (layout, &ink_rect, &logical_rect);
+
+  digit_height = PANGO_PIXELS (ink_rect.height) + 2;
+  digit_offset = ink_rect.y;
+
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      width  = widget->allocation.width;
+      height = widget->allocation.height - ythickness * 2;
+    }
+  else
+    {
+      width  = widget->allocation.height;
+      height = widget->allocation.width - ythickness * 2;
+    }
+
+  gtk_paint_box (style, priv->backing_store,
+                 GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                 NULL, widget,
+                 priv->orientation == GTK_ORIENTATION_HORIZONTAL ?
+                 "hruler" : "vruler",
+                 0, 0,
+                 widget->allocation.width, widget->allocation.height);
+
+  cr = gdk_cairo_create (priv->backing_store);
+  gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
+
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      cairo_rectangle (cr,
+                       xthickness,
+                       height + ythickness,
+                       widget->allocation.width - 2 * xthickness,
+                       1);
+    }
+  else
+    {
+      cairo_rectangle (cr,
+                       height + xthickness,
+                       ythickness,
+                       1,
+                       widget->allocation.height - 2 * ythickness);
+    }
+
+  gimp_ruler_get_range (ruler, &lower, &upper, &max_size);
+
+  if ((upper - lower) == 0)
+    goto out;
+
+  increment = (gdouble) width / (upper - lower);
+
+  /* determine the scale
+   *   use the maximum extents of the ruler to determine the largest
+   *   possible number to be displayed.  Calculate the height in pixels
+   *   of this displayed text. Use this height to find a scale which
+   *   leaves sufficient room for drawing the ruler.
+   *
+   *   We calculate the text size as for the vruler instead of using
+   *   text_size = gdk_string_width(font, unit_str), so that the result
+   *   for the scale looks consistent with an accompanying vruler
+   */
+  scale = ceil (max_size);
+  g_snprintf (unit_str, sizeof (unit_str), "%d", scale);
+  text_size = strlen (unit_str) * digit_height + 1;
+
+  for (scale = 0; scale < G_N_ELEMENTS (ruler_metric.ruler_scale); scale++)
+    if (ruler_metric.ruler_scale[scale] * fabs (increment) > 2 * text_size)
+      break;
+
+  if (scale == G_N_ELEMENTS (ruler_metric.ruler_scale))
+    scale = G_N_ELEMENTS (ruler_metric.ruler_scale) - 1;
+
+  unit = gimp_ruler_get_unit (ruler);
+
+  /* drawing starts here */
+  length = 0;
+  for (i = G_N_ELEMENTS (ruler_metric.subdivide) - 1; i >= 0; i--)
+    {
+      gdouble subd_incr;
 
-  if (GIMP_RULER_GET_CLASS (ruler)->draw_ticks)
-    GIMP_RULER_GET_CLASS (ruler)->draw_ticks (ruler);
+      /* hack to get proper subdivisions at full pixels */
+      if (unit == GIMP_UNIT_PIXEL && scale == 1 && i == 1)
+        subd_incr = 1.0;
+      else
+        subd_incr = ((gdouble) ruler_metric.ruler_scale[scale] /
+                     (gdouble) ruler_metric.subdivide[i]);
+
+      if (subd_incr * fabs (increment) <= MINIMUM_INCR)
+        continue;
+
+      /* don't subdivide pixels */
+      if (unit == GIMP_UNIT_PIXEL && subd_incr < 1.0)
+        continue;
+
+      /* Calculate the length of the tickmarks. Make sure that
+       * this length increases for each set of ticks
+       */
+      ideal_length = height / (i + 1) - 1;
+      if (ideal_length > ++length)
+        length = ideal_length;
+
+      if (lower < upper)
+        {
+          start = floor (lower / subd_incr) * subd_incr;
+          end   = ceil  (upper / subd_incr) * subd_incr;
+        }
+      else
+        {
+          start = floor (upper / subd_incr) * subd_incr;
+          end   = ceil  (lower / subd_incr) * subd_incr;
+        }
+
+      for (cur = start; cur <= end; cur += subd_incr)
+        {
+          pos = ROUND ((cur - lower) * increment);
+
+          if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+            {
+              cairo_rectangle (cr,
+                               pos, height + ythickness - length,
+                               1,   length);
+            }
+          else
+            {
+              cairo_rectangle (cr,
+                               height + xthickness - length, pos,
+                               length,                       1);
+            }
+
+          /* draw label */
+          if (i == 0)
+            {
+              g_snprintf (unit_str, sizeof (unit_str), "%d", (int) cur);
+
+              if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+                {
+                  pango_layout_set_text (layout, unit_str, -1);
+                  pango_layout_get_extents (layout, &logical_rect, NULL);
+
+                  gtk_paint_layout (style,
+                                    priv->backing_store,
+                                    GTK_WIDGET_STATE (widget),
+                                    FALSE,
+                                    NULL,
+                                    widget,
+                                    "hruler",
+                                    pos + 2,
+                                    ythickness + PANGO_PIXELS (logical_rect.y - digit_offset),
+                                    layout);
+                }
+              else
+                {
+                  gint j;
+
+                  for (j = 0; j < (int) strlen (unit_str); j++)
+                    {
+                      pango_layout_set_text (layout, unit_str + j, 1);
+                      pango_layout_get_extents (layout, NULL, &logical_rect);
+
+                      gtk_paint_layout (style,
+                                        priv->backing_store,
+                                        GTK_WIDGET_STATE (widget),
+                                        FALSE,
+                                        NULL,
+                                        widget,
+                                        "vruler",
+                                        xthickness + 1,
+                                        pos + digit_height * j + 2 + PANGO_PIXELS (logical_rect.y - digit_offset),
+                                        layout);
+                    }
+                }
+            }
+        }
+    }
+
+  cairo_fill (cr);
+out:
+  cairo_destroy (cr);
 }
 
 static void
 gimp_ruler_draw_pos (GimpRuler *ruler)
 {
-  g_return_if_fail (GIMP_IS_RULER (ruler));
+  GtkWidget        *widget = GTK_WIDGET (ruler);
+  GtkStyle         *style  = gtk_widget_get_style (widget);
+  GimpRulerPrivate *priv   = GIMP_RULER_GET_PRIVATE (ruler);
+  gint              x, y;
+  gint              width, height;
+  gint              bs_width, bs_height;
+  gint              xthickness;
+  gint              ythickness;
+
+  if (! GTK_WIDGET_DRAWABLE (ruler))
+    return;
+
+  xthickness = style->xthickness;
+  ythickness = style->ythickness;
+
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      width  = widget->allocation.width;
+      height = widget->allocation.height - ythickness * 2;
+
+      bs_width = height / 2 + 2;
+      bs_width |= 1;  /* make sure it's odd */
+      bs_height = bs_width / 2 + 1;
+    }
+  else
+    {
+      width  = widget->allocation.width - xthickness * 2;
+      height = widget->allocation.height;
 
-  if (GIMP_RULER_GET_CLASS (ruler)->draw_pos)
-     GIMP_RULER_GET_CLASS (ruler)->draw_pos (ruler);
+      bs_height = width / 2 + 2;
+      bs_height |= 1;  /* make sure it's odd */
+      bs_width = bs_height / 2 + 1;
+    }
+
+  if ((bs_width > 0) && (bs_height > 0))
+    {
+      cairo_t *cr = gdk_cairo_create (widget->window);
+      gdouble  lower;
+      gdouble  upper;
+      gdouble  position;
+      gdouble  increment;
+
+      /*  If a backing store exists, restore the ruler  */
+      if (priv->backing_store)
+        gdk_draw_drawable (widget->window,
+                           style->black_gc,
+                           priv->backing_store,
+                           priv->xsrc, priv->ysrc,
+                           priv->xsrc, priv->ysrc,
+                           bs_width, bs_height);
+
+      position = gimp_ruler_get_position (ruler);
+
+      gimp_ruler_get_range (ruler, &lower, &upper, NULL);
+
+      if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          increment = (gdouble) width / (upper - lower);
+
+          x = ROUND ((position - lower) * increment) + (xthickness - bs_width) / 2 - 1;
+          y = (height + bs_height) / 2 + ythickness;
+        }
+      else
+        {
+          increment = (gdouble) height / (upper - lower);
+
+          x = (width + bs_width) / 2 + xthickness;
+          y = ROUND ((position - lower) * increment) + (ythickness - bs_height) / 2 - 1;
+        }
+
+      gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
+
+      cairo_move_to (cr, x, y);
+
+      if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          cairo_line_to (cr, x + bs_width / 2.0, y + bs_height);
+          cairo_line_to (cr, x + bs_width,       y);
+        }
+      else
+        {
+          cairo_line_to (cr, x + bs_width, y + bs_height / 2.0);
+          cairo_line_to (cr, x,            y + bs_height);
+        }
+
+      cairo_fill (cr);
+
+      cairo_destroy (cr);
+
+      priv->xsrc = x;
+      priv->ysrc = y;
+    }
 }
 
 static void
 gimp_ruler_make_pixmap (GimpRuler *ruler)
 {
-  GimpRulerPrivate *priv   = GIMP_RULER_GET_PRIVATE (ruler);
   GtkWidget        *widget = GTK_WIDGET (ruler);
+  GimpRulerPrivate *priv   = GIMP_RULER_GET_PRIVATE (ruler);
   gint              width;
   gint              height;
 
-
   if (priv->backing_store)
     {
       gdk_drawable_get_size (priv->backing_store, &width, &height);
@@ -574,3 +1013,45 @@
       gdk_gc_set_exposures (priv->non_gr_exp_gc, FALSE);
     }
 }
+
+
+static PangoLayout *
+gimp_ruler_create_layout (GtkWidget   *widget,
+                          const gchar *text)
+{
+  GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
+  PangoLayout      *layout;
+  PangoAttrList    *attrs;
+  PangoAttribute   *attr;
+
+  layout = gtk_widget_create_pango_layout (widget, text);
+
+  attrs = pango_attr_list_new ();
+
+  attr = pango_attr_scale_new (priv->font_scale);
+  attr->start_index = 0;
+  attr->end_index   = -1;
+  pango_attr_list_insert (attrs, attr);
+
+  pango_layout_set_attributes (layout, attrs);
+  pango_attr_list_unref (attrs);
+
+  return layout;
+}
+
+static PangoLayout *
+gimp_ruler_get_layout (GtkWidget   *widget,
+                       const gchar *text)
+{
+  GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
+
+  if (priv->layout)
+    {
+      pango_layout_set_text (priv->layout, text, -1);
+      return priv->layout;
+    }
+
+  priv->layout = gimp_ruler_create_layout (widget, text);
+
+  return priv->layout;
+}

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpruler.h
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpruler.h	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpruler.h	Sun Oct 12 15:38:02 2008
@@ -20,7 +20,6 @@
 #ifndef __GIMP_RULER_H__
 #define __GIMP_RULER_H__
 
-
 G_BEGIN_DECLS
 
 #define GIMP_TYPE_RULER            (gimp_ruler_get_type ())
@@ -35,15 +34,12 @@
 
 struct _GimpRuler
 {
-  GtkWidget parent_instance;
+  GtkWidget  parent_instance;
 };
 
 struct _GimpRulerClass
 {
-  GtkWidgetClass parent_class;
-
-  void (* draw_ticks) (GimpRuler *ruler);
-  void (* draw_pos)   (GimpRuler *ruler);
+  GtkWidgetClass  parent_class;
 
   /* Padding for future expansion */
   void (*_gimp_reserved1) (void);
@@ -53,28 +49,23 @@
 };
 
 
-GType     gimp_ruler_get_type   (void) G_GNUC_CONST;
-
-void      gimp_ruler_set_unit     (GimpRuler *ruler,
-                                   GimpUnit   unit);
-GimpUnit  gimp_ruler_get_unit     (GimpRuler *ruler);
-void      gimp_ruler_set_position (GimpRuler *ruler,
-                                   gdouble    position);
-gdouble   gimp_ruler_get_position (GimpRuler *ruler);
-void      gimp_ruler_set_range    (GimpRuler *ruler,
-                                   gdouble    lower,
-                                   gdouble    upper,
-                                   gdouble    max_size);
-void      gimp_ruler_get_range    (GimpRuler *ruler,
-                                   gdouble   *lower,
-                                   gdouble   *upper,
-                                   gdouble   *max_size);
-
-
-GdkDrawable * _gimp_ruler_get_backing_store   (GimpRuler   *ruler) G_GNUC_INTERNAL;
-PangoLayout * _gimp_ruler_create_pango_layout (GtkWidget   *widget,
-                                               const gchar *text)  G_GNUC_INTERNAL;
+GType       gimp_ruler_get_type     (void) G_GNUC_CONST;
 
+GtkWidget * gimp_ruler_new          (GtkOrientation  orientation);
+void        gimp_ruler_set_unit     (GimpRuler      *ruler,
+                                     GimpUnit        unit);
+GimpUnit    gimp_ruler_get_unit     (GimpRuler      *ruler);
+void        gimp_ruler_set_position (GimpRuler      *ruler,
+                                     gdouble         position);
+gdouble     gimp_ruler_get_position (GimpRuler      *ruler);
+void        gimp_ruler_set_range    (GimpRuler      *ruler,
+                                     gdouble         lower,
+                                     gdouble         upper,
+                                     gdouble         max_size);
+void        gimp_ruler_get_range    (GimpRuler      *ruler,
+                                     gdouble        *lower,
+                                     gdouble        *upper,
+                                     gdouble        *max_size);
 
 G_END_DECLS
 

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpscaleentry.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpscaleentry.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpscaleentry.c	Sun Oct 12 15:38:02 2008
@@ -66,7 +66,7 @@
                                    gimp_scale_entry_unconstrained_adjustment_callback,
                                    adjustment);
 
-  gtk_adjustment_set_value (other_adj, adjustment->value);
+  gtk_adjustment_set_value (other_adj, gtk_adjustment_get_value (adjustment));
 
   g_signal_handlers_unblock_by_func (other_adj,
                                      gimp_scale_entry_unconstrained_adjustment_callback,
@@ -104,7 +104,7 @@
                                    gimp_scale_entry_log_adjustment_callback,
                                    adjustment);
 
-  value = exp (adjustment->value);
+  value = exp (gtk_adjustment_get_value (adjustment));
   if (other_adj->lower <= 0.0)
     value += other_adj->lower  - 0.1;
 

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c	Sun Oct 12 15:38:02 2008
@@ -33,7 +33,6 @@
 
 
 #define POPUP_SIZE  100
-#define PEN_WIDTH     3
 
 
 typedef struct
@@ -76,16 +75,13 @@
                                                             GdkEventButton           *event,
                                                             GimpScrolledPreview      *preview);
 
-static void      gimp_scrolled_preview_nav_popup_realize   (GtkWidget                *widget,
-                                                            GimpScrolledPreview      *preview);
-static void      gimp_scrolled_preview_nav_popup_unrealize (GtkWidget                *widget,
-                                                            GimpScrolledPreview      *preview);
 static gboolean  gimp_scrolled_preview_nav_popup_event     (GtkWidget                *widget,
                                                             GdkEvent                 *event,
                                                             GimpScrolledPreview      *preview);
 static gboolean  gimp_scrolled_preview_nav_popup_expose    (GtkWidget                *widget,
                                                             GdkEventExpose           *event,
                                                             GimpScrolledPreview      *preview);
+
 static void      gimp_scrolled_preview_set_cursor          (GimpPreview              *preview);
 
 
@@ -595,12 +591,6 @@
 
       gtk_container_add (GTK_CONTAINER (inner), area);
 
-      g_signal_connect (area, "realize",
-                        G_CALLBACK (gimp_scrolled_preview_nav_popup_realize),
-                        preview);
-      g_signal_connect (area, "unrealize",
-                        G_CALLBACK (gimp_scrolled_preview_nav_popup_unrealize),
-                        preview);
       g_signal_connect (area, "event",
                         G_CALLBACK (gimp_scrolled_preview_nav_popup_event),
                         preview);
@@ -649,32 +639,6 @@
   return TRUE;
 }
 
-static void
-gimp_scrolled_preview_nav_popup_realize (GtkWidget           *widget,
-                                         GimpScrolledPreview *preview)
-{
-  if (! preview->nav_gc)
-    {
-      preview->nav_gc = gdk_gc_new (widget->window);
-
-      gdk_gc_set_function (preview->nav_gc, GDK_INVERT);
-      gdk_gc_set_line_attributes (preview->nav_gc,
-                                  PEN_WIDTH,
-                                  GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
-    }
-}
-
-static void
-gimp_scrolled_preview_nav_popup_unrealize (GtkWidget           *widget,
-                                           GimpScrolledPreview *preview)
-{
-  if (preview->nav_gc)
-    {
-      g_object_unref (preview->nav_gc);
-      preview->nav_gc = NULL;
-    }
-}
-
 static gboolean
 gimp_scrolled_preview_nav_popup_event (GtkWidget           *widget,
                                        GdkEvent            *event,
@@ -744,10 +708,11 @@
                                         GimpScrolledPreview *preview)
 {
   GtkAdjustment *adj;
+  cairo_t       *cr;
   gdouble        x, y;
   gdouble        w, h;
 
-  adj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
+  adj   = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
 
   x = adj->value / (adj->upper - adj->lower);
   w = adj->page_size / (adj->upper - adj->lower);
@@ -760,16 +725,32 @@
   if (w >= 1.0 && h >= 1.0)
     return FALSE;
 
-  gdk_gc_set_clip_rectangle (preview->nav_gc, &event->area);
+  x = floor (x * (gdouble) widget->allocation.width);
+  y = floor (y * (gdouble) widget->allocation.height);
+  w = MAX (1, ceil (w * (gdouble) widget->allocation.width));
+  h = MAX (1, ceil (h * (gdouble) widget->allocation.height));
+
+  cr = gdk_cairo_create (widget->window);
+
+  gdk_cairo_region (cr, event->region);
+  cairo_clip (cr);
+
+  cairo_rectangle (cr,
+                   0, 0, widget->allocation.width, widget->allocation.height);
+
+  cairo_rectangle (cr, x, y, w, h);
+
+  cairo_set_source_rgba (cr, 0, 0, 0, 0.5);
+  cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+  cairo_fill (cr);
+
+  cairo_rectangle (cr, x, y, w, h);
+
+  cairo_set_source_rgb (cr, 1, 1, 1);
+  cairo_set_line_width (cr, 2);
+  cairo_stroke (cr);
 
-  gdk_draw_rectangle (widget->window, preview->nav_gc,
-                      FALSE,
-                      x * (gdouble) widget->allocation.width  + PEN_WIDTH / 2,
-                      y * (gdouble) widget->allocation.height + PEN_WIDTH / 2,
-                      MAX (1,
-                           ceil (w * widget->allocation.width)  - PEN_WIDTH),
-                      MAX (1,
-                           ceil (h * widget->allocation.height) - PEN_WIDTH));
+  cairo_destroy (cr);
 
   return FALSE;
 }

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.h
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.h	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.h	Sun Oct 12 15:38:02 2008
@@ -50,7 +50,7 @@
   GtkWidget    *nav_icon;
   GtkWidget    *nav_popup;
   GdkCursor    *cursor_move;
-  GdkGC        *nav_gc;
+  GdkGC        *nav_gc; /* unused */
 
   /*< private >*/
   gpointer      priv;

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.c	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.c	Sun Oct 12 15:38:02 2008
@@ -728,7 +728,7 @@
   GtkWidget           *sizeentry;
   GtkWidget           *chainbutton;
 
-  spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2);
+  spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 0, 1, 2);
 
   if (spinbutton_width > 0)
     {
@@ -975,7 +975,7 @@
 {
   gint *val = (gint *) data;
 
-  *val = RINT (adjustment->value);
+  *val = RINT (gtk_adjustment_get_value (adjustment));
 }
 
 /**
@@ -993,7 +993,7 @@
 {
   guint *val = (guint *) data;
 
-  *val = (guint) (adjustment->value + 0.5);
+  *val = (guint) (gtk_adjustment_get_value (adjustment) + 0.5);
 }
 
 /**
@@ -1007,7 +1007,8 @@
                               gpointer       data)
 {
   gfloat *val = (gfloat *) data;
-  *val = adjustment->value;
+
+  *val = gtk_adjustment_get_value (adjustment);
 
 }
 
@@ -1023,7 +1024,7 @@
 {
   gdouble *val = (gdouble *) data;
 
-  *val = adjustment->value;
+  *val = gtk_adjustment_get_value (adjustment);
 }
 
 /**

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.def
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.def	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.def	Sun Oct 12 15:38:02 2008
@@ -157,8 +157,6 @@
 	gimp_help_set_help_data_with_markup
 	gimp_hint_box_get_type
 	gimp_hint_box_new
-	gimp_hruler_get_type
-	gimp_hruler_new
 	gimp_int_adjustment_update
 	gimp_int_combo_box_append
 	gimp_int_combo_box_connect
@@ -307,6 +305,7 @@
 	gimp_ruler_get_range
 	gimp_ruler_get_type
 	gimp_ruler_get_unit
+	gimp_ruler_new
 	gimp_ruler_set_position
 	gimp_ruler_set_range
 	gimp_ruler_set_unit
@@ -358,8 +357,6 @@
 	gimp_unit_menu_set_pixel_digits
 	gimp_unit_menu_set_unit
 	gimp_unit_menu_update
-	gimp_vruler_get_type
-	gimp_vruler_new
 	gimp_widgets_init
 	gimp_zoom_button_new
 	gimp_zoom_model_get_factor

Modified: branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.h
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.h	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpwidgets.h	Sun Oct 12 15:38:02 2008
@@ -54,7 +54,6 @@
 #include <libgimpwidgets/gimpframe.h>
 #include <libgimpwidgets/gimphelpui.h>
 #include <libgimpwidgets/gimphintbox.h>
-#include <libgimpwidgets/gimphruler.h>
 #include <libgimpwidgets/gimpintcombobox.h>
 #include <libgimpwidgets/gimpintstore.h>
 #include <libgimpwidgets/gimpmemsizeentry.h>
@@ -75,7 +74,6 @@
 #include <libgimpwidgets/gimpstock.h>
 #include <libgimpwidgets/gimpstringcombobox.h>
 #include <libgimpwidgets/gimpunitmenu.h>
-#include <libgimpwidgets/gimpvruler.h>
 #include <libgimpwidgets/gimpzoommodel.h>
 
 #include <libgimpwidgets/gimpoldwidgets.h>

Modified: branches/soc-2008-tagging/libgimpwidgets/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/makefile.msc	(original)
+++ branches/soc-2008-tagging/libgimpwidgets/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -77,6 +77,8 @@
 	gimpscrolledpreview.obj \
 	gimpstringcombobox.obj \
 	gimpquerybox.obj \
+	gimpruler.obj \
+	gimpscaleentry.obj \
 	gimpsizeentry.obj \
 	gimpstock.obj \
 	gimpunitmenu.obj \

Modified: branches/soc-2008-tagging/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/makefile.msc	(original)
+++ branches/soc-2008-tagging/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -16,12 +16,12 @@
 	libgimpthumb \
 	libgimpwidgets \
 	libgimp \
-#	libgimptool \
 	libgimpmodule \
 	cursors \
 	app \
 #	plug-ins \
-	modules
+	modules \
+	menus
 
 sub-all: 
 	for %d in ($(SUBDIRS)) do nmake -nologo -f makefile.msc sub-one THIS=%d

Modified: branches/soc-2008-tagging/menus/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/menus/Makefile.am	(original)
+++ branches/soc-2008-tagging/menus/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -51,7 +51,7 @@
 DEBUG_MENU_PARAMS = --stringparam debug-menu yes
 endif
 
-%.xml: %.xml.in $(srcdir)/menus.xsl dialogs-menuitems.xml
+%.xml: %.xml.in $(top_srcdir)/configure.in $(srcdir)/menus.xsl dialogs-menuitems.xml
 if HAVE_XSLTPROC
 	$(XSLTPROC) --xinclude $(DEBUG_MENU_PARAMS) $(srcdir)/menus.xsl $< > $(@) || rm -f $(@)
 else

Modified: branches/soc-2008-tagging/menus/image-menu.xml.in
==============================================================================
--- branches/soc-2008-tagging/menus/image-menu.xml.in	(original)
+++ branches/soc-2008-tagging/menus/image-menu.xml.in	Sun Oct 12 15:38:02 2008
@@ -6,7 +6,7 @@
 
     <menu action="file-menu" name="File">
       <menuitem action="image-new" />
-      <menu action="file-new-menu" name="New">
+      <menu action="file-create-menu" name="Create">
         <placeholder name="Acquire">
           <menuitem action="edit-paste-as-new" />
         </placeholder>
@@ -288,6 +288,8 @@
       <menuitem action="view-show-scrollbars" />
       <menuitem action="view-show-statusbar" />
       <separator />
+      <menuitem action="view-use-gegl" />
+      <separator />
     </menu>
 
     <menu action="image-menu" name="Image">
@@ -486,6 +488,8 @@
         <menuitem action="drawable-invert" />
       </placeholder>
       <separator />
+      <menuitem action="config-use-gegl" />
+      <separator />
       <menu action="colors-auto-menu" name="Auto">
         <menuitem action="drawable-equalize" />
         <menuitem action="drawable-levels-stretch" />

Modified: branches/soc-2008-tagging/menus/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/menus/makefile.msc	(original)
+++ branches/soc-2008-tagging/menus/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -4,12 +4,11 @@
 
 menudata_in_files = \
 	dockable-menu.xml.in	\
-	image-menu.xml.in	\
-	toolbox-menu.xml.in
+	image-menu.xml.in
 
 menudata_built_files = $(menudata_in_files:.xml.in=.xml)
 
-MENUS = dockable image toolbox
+MENUS = dockable image
 
 _MENUS = \
 	brushes buffers channels colormap-editor documents \

Modified: branches/soc-2008-tagging/modules/color-selector-water.c
==============================================================================
--- branches/soc-2008-tagging/modules/color-selector-water.c	(original)
+++ branches/soc-2008-tagging/modules/color-selector-water.c	Sun Oct 12 15:38:02 2008
@@ -395,8 +395,8 @@
         }
     }
 
-  if (event->is_hint)
-    gdk_device_get_state (event->device, event->window, NULL, NULL);
+  /* Ask for more motion events in case the event was a hint */
+  gdk_event_request_motions (event);
 
   return TRUE;
 }

Modified: branches/soc-2008-tagging/modules/color-selector-wheel.c
==============================================================================
--- branches/soc-2008-tagging/modules/color-selector-wheel.c	(original)
+++ branches/soc-2008-tagging/modules/color-selector-wheel.c	Sun Oct 12 15:38:02 2008
@@ -31,6 +31,10 @@
 #include "libgimp/libgimp-intl.h"
 
 
+#ifdef __GNUC__
+#warning FIXME: remove hacks here as soon as we depend on GTK 2.14
+#endif
+
 #ifndef __GTK_HSV_H__
 
 #define GTK_TYPE_HSV (gtk_hsv_get_type ())
@@ -38,6 +42,7 @@
 
 typedef struct _GtkHSV      GtkHSV;
 
+GType      gtk_hsv_get_type     (void) G_GNUC_CONST;
 GtkWidget* gtk_hsv_new          (void);
 void       gtk_hsv_set_color    (GtkHSV    *hsv,
                                  double     h,
@@ -86,7 +91,7 @@
 static void   colorsel_wheel_size_allocate (GtkWidget         *frame,
                                             GtkAllocation     *allocation,
                                             ColorselWheel     *wheel);
-static void   colorsel_wheel_size_request  (GtkWidget         *hsv,
+static void   colorsel_wheel_size_request  (GtkWidget         *dont_use,
                                             GtkRequisition    *requisition,
                                             ColorselWheel     *wheel);
 static void   colorsel_wheel_changed       (GtkHSV            *hsv,
@@ -153,12 +158,20 @@
 
   if (gtk_check_version (2, 13, 7))
     {
+      /*  for old versions of GtkHSV, we pack the thing into an alignment
+       *  and force the alignment to have a small requisition, because
+       *  it will be smart enough to deal with a larger allocation
+       */
       GtkWidget *alignment;
 
       alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
       gtk_container_add (GTK_CONTAINER (frame), alignment);
       gtk_widget_show (alignment);
 
+      g_signal_connect (alignment, "size-request",
+                        G_CALLBACK (colorsel_wheel_size_request),
+                        wheel);
+
       frame = alignment;
     }
 
@@ -166,9 +179,16 @@
   gtk_container_add (GTK_CONTAINER (frame), wheel->hsv);
   gtk_widget_show (wheel->hsv);
 
-  g_signal_connect (wheel->hsv, "size-request",
-                    G_CALLBACK (colorsel_wheel_size_request),
-                    wheel);
+  if (! gtk_check_version (2, 13, 7))
+    {
+      /*  for new versions of GtkHSV we don't need above alignment hack,
+       *  because it is smart enough by itself to cope with a larger
+       *  allocation than it requested
+       */
+      g_signal_connect (wheel->hsv, "size-request",
+                        G_CALLBACK (colorsel_wheel_size_request),
+                        wheel);
+    }
 
   g_signal_connect (wheel->hsv, "changed",
                     G_CALLBACK (colorsel_wheel_changed),
@@ -208,14 +228,14 @@
 }
 
 static void
-colorsel_wheel_size_request (GtkWidget      *hsv,
+colorsel_wheel_size_request (GtkWidget      *dont_use,
                              GtkRequisition *requisition,
                              ColorselWheel  *wheel)
 {
   gint focus_width;
   gint focus_padding;
 
-  gtk_widget_style_get (hsv,
+  gtk_widget_style_get (wheel->hsv,
                         "focus-line-width", &focus_width,
                         "focus-padding",    &focus_padding,
                         NULL);

Modified: branches/soc-2008-tagging/modules/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/modules/makefile.msc	(original)
+++ branches/soc-2008-tagging/modules/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -21,15 +21,15 @@
 BIN = $(GIMP)\modules
 
 MODULES = \
-	colorsel_triangle-$(GIMP_VER).dll \
-	colorsel_water-$(GIMP_VER).dll \
-	colorsel_cmyk-$(GIMP_VER).dll \
-	cdisplay_colorblind-$(GIMP_VER).dll \
-	cdisplay_gamma-$(GIMP_VER).dll \
-	cdisplay_highcontrast-$(GIMP_VER).dll \
+	color-selector-water-$(GIMP_VER).dll \
+	color-selector-wheel-$(GIMP_VER).dll \
+	color-selector-cmyk-$(GIMP_VER).dll \
+	display-filter-color-blind-$(GIMP_VER).dll \
+	display-filter-gamma-$(GIMP_VER).dll \
+	display-filter-high-contrast-$(GIMP_VER).dll \
 !IFDEF LCMS_CFLAGS
-	cdisplay_lcms-$(GIMP_VER).dll \
-	cdisplay_proof-$(GIMP_VER).dll \
+	display-filter-lcms-$(GIMP_VER).dll \
+	display-filter-proof-$(GIMP_VER).dll \
 !ENDIF
 
 
@@ -42,54 +42,60 @@
 ..\config.h : ..\config.h.win32
 	copy ..\config.h.win32 ..\config.h
 
-colorsel_triangle-$(GIMP_VER).dll : colorsel_triangle.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_triangle.obj $(LDFLAGS) \
+color-selector-triangle-$(GIMP_VER).dll : color-selector-triangle.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ color-selector-triangle.obj $(LDFLAGS) \
 	..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	..\libgimpmodule\gimpmodule-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-colorsel_water-$(GIMP_VER).dll : colorsel_water.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_water.obj $(LDFLAGS) \
+color-selector-water-$(GIMP_VER).dll : color-selector-water.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ color-selector-water.obj $(LDFLAGS) \
 	..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-colorsel_cmyk-$(GIMP_VER).dll : colorsel_cmyk.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_cmyk.obj $(LDFLAGS) \
+color-selector-wheel-$(GIMP_VER).dll : color-selector-wheel.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ color-selector-wheel.obj $(LDFLAGS) \
 	..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-cdisplay_colorblind-$(GIMP_VER).dll : cdisplay_colorblind.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ cdisplay_colorblind.obj $(LDFLAGS) \
+color-selector-cmyk-$(GIMP_VER).dll : color-selector-cmyk.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ color-selector-cmyk.obj $(LDFLAGS) \
+	..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
+	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
+	$(DEPLIBS)
+
+display-filter-color-blind-$(GIMP_VER).dll : display-filter-color-blind.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ display-filter-color-blind.obj $(LDFLAGS) \
 	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	..\libgimpmodule\gimpmodule-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-cdisplay_gamma-$(GIMP_VER).dll : cdisplay_gamma.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ cdisplay_gamma.obj $(LDFLAGS) \
+display-filter-gamma-$(GIMP_VER).dll : display-filter-gamma.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ display-filter-gamma.obj $(LDFLAGS) \
 	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-cdisplay_highcontrast-$(GIMP_VER).dll : cdisplay_highcontrast.obj
-	$(CC) $(CFLAGS) -LD -Fe$@ cdisplay_highcontrast.obj $(LDFLAGS) \
+display-filter-high-contrast-$(GIMP_VER).dll : display-filter-high-contrast.obj
+	$(CC) $(CFLAGS) -LD -Fe$@ display-filter-high-contrast.obj $(LDFLAGS) \
 	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	$(DEPLIBS)
 
-cdisplay_lcms-$(GIMP_VER).dll : cdisplay_lcms.obj
-	$(CC) $(CFLAGS) $(LCMS_CFLAGS) -LD -Fe$@ cdisplay_lcms.obj $(LDFLAGS) \
+display-filter-lcms-$(GIMP_VER).dll : display-filter-lcms.obj
+	$(CC) $(CFLAGS) $(LCMS_CFLAGS) -LD -Fe$@ display-filter-lcms.obj $(LDFLAGS) \
 	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
 	..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
 	..\libgimpconfig\gimpconfig-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \
 	$(DEPLIBS) $(LCMS_LIBS) user32.lib gdi32.lib
 
-cdisplay_proof-$(GIMP_VER).dll : cdisplay_proof.obj
-	$(CC) $(CFLAGS) $(LCMS_CFLAGS) -LD -Fe$@ cdisplay_proof.obj $(LDFLAGS) \
+display-filter-proof-$(GIMP_VER).dll : display-filter-proof.obj
+	$(CC) $(CFLAGS) $(LCMS_CFLAGS) -LD -Fe$@ display-filter-proof.obj $(LDFLAGS) \
 	..\libgimpbase\gimpbase-$(GIMP_VER).lib \
 	..\libgimpconfig\gimpconfig-$(GIMP_VER).lib \
 	..\libgimpwidgets\gimpwidgets-$(GIMP_VER).lib \

Modified: branches/soc-2008-tagging/plug-ins/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/plug-ins/Makefile.am	(original)
+++ branches/soc-2008-tagging/plug-ins/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -10,6 +10,7 @@
 
 if BUILD_JPEG
 file_jpeg = file-jpeg
+file_psd = file-psd
 endif
 
 if BUILD_PRINT
@@ -57,7 +58,7 @@
 	file-fli		\
 	$(file_ico)		\
 	$(file_jpeg)		\
-	file-psd		\
+	$(file_psd)		\
 	file-sgi		\
 	$(file_uri)		\
 	$(file_xjt)		\

Modified: branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c	(original)
+++ branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c	Sun Oct 12 15:38:02 2008
@@ -65,7 +65,7 @@
   }
 }
 
-gchar *
+const gchar *
 rcm_units_string (gint units)
 {
   switch (units)
@@ -348,9 +348,9 @@
 /* Circle events */
 
 gboolean
-rcm_expose_event (GtkWidget *widget,
-		  GdkEvent  *event,
-		  RcmCircle *circle)
+rcm_expose_event (GtkWidget      *widget,
+		  GdkEventExpose *event,
+		  RcmCircle      *circle)
 {
   if (circle->action_flag == VIRGIN)
     {
@@ -365,25 +365,23 @@
 }
 
 gboolean
-rcm_button_press_event (GtkWidget *widget,
-			GdkEvent  *event,
-			RcmCircle *circle)
-{
-  float           clicked_angle;
-  float          *alpha;
-  float          *beta;
-  GdkEventButton *bevent;
+rcm_button_press_event (GtkWidget      *widget,
+			GdkEventButton *event,
+			RcmCircle      *circle)
+{
+  float  clicked_angle;
+  float *alpha;
+  float *beta;
 
   alpha  = &circle->angle->alpha;
   beta   = &circle->angle->beta;
-  bevent = (GdkEventButton *) event;
 
   circle->action_flag = DRAG_START;
-  clicked_angle = angle_mod_2PI (arctg (CENTER-bevent->y, bevent->x-CENTER));
+  clicked_angle = angle_mod_2PI (arctg (CENTER - event->y, event->x - CENTER));
   circle->prev_clicked = clicked_angle;
 
-  if ((sqrt (SQR (bevent->y-CENTER) +
-             SQR (bevent->x-CENTER)) > RADIUS * EACH_OR_BOTH) &&
+  if ((sqrt (SQR (event->y - CENTER) +
+             SQR (event->x - CENTER)) > RADIUS * EACH_OR_BOTH) &&
       (min_prox (*alpha, *beta, clicked_angle) < G_PI / 12))
     {
       circle->mode = EACH;
@@ -418,9 +416,9 @@
 }
 
 gboolean
-rcm_release_event (GtkWidget *widget,
-		   GdkEvent  *event,
-		   RcmCircle *circle)
+rcm_release_event (GtkWidget      *widget,
+		   GdkEventButton *event,
+		   RcmCircle      *circle)
 {
   if (circle->action_flag == DRAGING)
     {
@@ -440,11 +438,10 @@
 }
 
 gboolean
-rcm_motion_notify_event (GtkWidget *widget,
-			 GdkEvent  *event,
-			 RcmCircle *circle)
+rcm_motion_notify_event (GtkWidget      *widget,
+			 GdkEventMotion *event,
+			 RcmCircle      *circle)
 {
-  gint         x, y;
   gfloat       clicked_angle, delta;
   gfloat      *alpha, *beta;
   gint         cw_ccw;
@@ -460,8 +457,7 @@
                                    &values,
                                    GDK_GC_FUNCTION);
 
-  gdk_window_get_pointer (widget->window, &x, &y, NULL);
-  clicked_angle = angle_mod_2PI (arctg (CENTER-y, x-CENTER));
+  clicked_angle = angle_mod_2PI (arctg (CENTER - event->y, event->x - CENTER));
 
   delta = clicked_angle - circle->prev_clicked;
   circle->prev_clicked = clicked_angle;
@@ -502,7 +498,9 @@
 
       if (Current.RealTime)
         rcm_render_preview (Current.Bna->after);
-  }
+    }
+
+  gdk_event_request_motions (event);
 
   return TRUE;
 }
@@ -511,9 +509,9 @@
 /* Gray circle events */
 
 gboolean
-rcm_gray_expose_event (GtkWidget *widget,
-		       GdkEvent  *event,
-		       RcmGray   *circle)
+rcm_gray_expose_event (GtkWidget      *widget,
+		       GdkEventExpose *event,
+		       RcmGray        *circle)
 {
   if (circle->action_flag == VIRGIN)
     {
@@ -532,17 +530,15 @@
 }
 
 gboolean
-rcm_gray_button_press_event (GtkWidget *widget,
-			     GdkEvent  *event,
-			     RcmGray   *circle)
-{
-  GtkStyle       *style = gtk_widget_get_style (widget);
-  GdkEventButton *bevent;
-  int             x, y;
-
-  bevent = (GdkEventButton *) event;
-  x      = bevent->x - GRAY_CENTER - LITTLE_RADIUS;
-  y      = GRAY_CENTER - bevent->y + LITTLE_RADIUS;
+rcm_gray_button_press_event (GtkWidget      *widget,
+			     GdkEventButton *event,
+			     RcmGray        *circle)
+{
+  GtkStyle *style = gtk_widget_get_style (widget);
+  int       x, y;
+
+  x = event->x - GRAY_CENTER - LITTLE_RADIUS;
+  y = GRAY_CENTER - event->y + LITTLE_RADIUS;
 
   circle->action_flag = DRAG_START;
   circle->hue         = angle_mod_2PI(arctg(y, x));
@@ -573,9 +569,9 @@
 }
 
 gboolean
-rcm_gray_release_event (GtkWidget *widget,
-			GdkEvent  *event,
-			RcmGray   *circle)
+rcm_gray_release_event (GtkWidget      *widget,
+			GdkEventButton *event,
+			RcmGray        *circle)
 {
   if (circle->action_flag == DRAGING)
     {
@@ -595,9 +591,9 @@
 }
 
 gboolean
-rcm_gray_motion_notify_event (GtkWidget *widget,
-			      GdkEvent  *event,
-			      RcmGray   *circle)
+rcm_gray_motion_notify_event (GtkWidget      *widget,
+			      GdkEventMotion *event,
+			      RcmGray        *circle)
 {
   gint        x, y;
   GdkGCValues values;
@@ -624,10 +620,8 @@
                                        circle->hue, circle->satur); /* erase */
     }
 
-  gdk_window_get_pointer (widget->window, &x, &y, NULL);
-
-  x = x - GRAY_CENTER - LITTLE_RADIUS;
-  y = GRAY_CENTER - y + LITTLE_RADIUS;
+  x = event->x - GRAY_CENTER - LITTLE_RADIUS;
+  y = GRAY_CENTER - event->y + LITTLE_RADIUS;
 
   circle->hue   = angle_mod_2PI (arctg (y, x));
   circle->satur = sqrt (SQR (x) + SQR (y)) / GRAY_RADIUS;
@@ -647,6 +641,8 @@
   if (Current.RealTime)
     rcm_render_preview (Current.Bna->after);
 
+  gdk_event_request_motions (event);
+
   return TRUE;
 }
 
@@ -655,10 +651,9 @@
 
 void
 rcm_set_alpha (GtkWidget *entry,
-	       gpointer   data)
+               RcmCircle *circle)
 {
-  RcmCircle *circle = data;
-  GtkStyle  *style  = gtk_widget_get_style (circle->preview);
+  GtkStyle *style = gtk_widget_get_style (circle->preview);
 
   if (circle->action_flag != VIRGIN)
     return;
@@ -677,10 +672,9 @@
 
 void
 rcm_set_beta (GtkWidget *entry,
-	      gpointer   data)
+              RcmCircle *circle)
 {
-  RcmCircle *circle = data;
-  GtkStyle  *style  = gtk_widget_get_style (circle->preview);
+  GtkStyle *style = gtk_widget_get_style (circle->preview);
 
   if (circle->action_flag != VIRGIN)
     return;
@@ -699,10 +693,9 @@
 
 void
 rcm_set_hue (GtkWidget *entry,
-	     gpointer   data)
+             RcmGray   *circle)
 {
-  RcmGray  *circle = data;
-  GtkStyle *style  = gtk_widget_get_style (circle->preview);
+  GtkStyle *style = gtk_widget_get_style (circle->preview);
 
   if (circle->action_flag != VIRGIN)
     return;
@@ -725,10 +718,9 @@
 
 void
 rcm_set_satur (GtkWidget *entry,
-	       gpointer   data)
+               RcmGray   *circle)
 {
-  RcmGray  *circle = data;
-  GtkStyle *style  = gtk_widget_get_style (circle->preview);
+  GtkStyle *style = gtk_widget_get_style (circle->preview);
 
   if (circle->action_flag != VIRGIN)
     return;
@@ -750,10 +742,9 @@
 
 void
 rcm_set_gray_sat (GtkWidget *entry,
-		  gpointer   data)
+                  RcmGray   *circle)
 {
-  RcmGray  *circle = data;
-  GtkStyle *style  = gtk_widget_get_style (circle->preview);
+  GtkStyle *style = gtk_widget_get_style (circle->preview);
 
   circle->gray_sat = gtk_spin_button_get_value (GTK_SPIN_BUTTON (entry));
 

Modified: branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.h	(original)
+++ branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.h	Sun Oct 12 15:38:02 2008
@@ -39,20 +39,14 @@
 
 /* Misc functions */
 
-float  rcm_units_factor (gint        units);
+float         rcm_units_factor (gint        units);
 
-gchar *rcm_units_string (gint        units);
+const gchar * rcm_units_string (gint        units);
 
-void   rcm_set_pixmap   (GtkWidget **widget,
-                         GtkWidget  *parent,
-                         GtkWidget  *label_box,
-                         gchar     **pixmap_data);
-
-
-/* Ok Button */
-
-void rcm_ok_callback    (GtkWidget *widget,
-                         gpointer   data);
+void          rcm_set_pixmap   (GtkWidget **widget,
+                                GtkWidget  *parent,
+                                GtkWidget  *label_box,
+                                gchar     **pixmap_data);
 
 
 /* Circle buttons */
@@ -94,45 +88,46 @@
 
 /* Circle events */
 
-gboolean rcm_expose_event        (GtkWidget *widget,
-                                  GdkEvent  *event,
-                                  RcmCircle *circle);
-gboolean rcm_button_press_event  (GtkWidget *widget,
-                                  GdkEvent  *event,
-                                  RcmCircle *circle);
-gboolean rcm_release_event       (GtkWidget *widget,
-                                  GdkEvent  *event,
-                                  RcmCircle *circle);
-gboolean rcm_motion_notify_event (GtkWidget *widget,
-                                  GdkEvent  *event,
-                                  RcmCircle *circle);
+gboolean rcm_expose_event        (GtkWidget      *widget,
+                                  GdkEventExpose *event,
+                                  RcmCircle      *circle);
+gboolean rcm_button_press_event  (GtkWidget      *widget,
+                                  GdkEventButton *event,
+                                  RcmCircle      *circle);
+gboolean rcm_release_event       (GtkWidget      *widget,
+                                  GdkEventButton *event,
+                                  RcmCircle      *circle);
+gboolean rcm_motion_notify_event (GtkWidget      *widget,
+                                  GdkEventMotion *event,
+                                  RcmCircle      *circle);
 
 
 /* Gray circle events */
 
-gboolean rcm_gray_expose_event        (GtkWidget *widget,
-                                       GdkEvent  *event,
-                                       RcmGray   *circle);
-gboolean rcm_gray_button_press_event  (GtkWidget *widget,
-                                       GdkEvent  *event,
-                                       RcmGray   *circle);
-gboolean rcm_gray_release_event       (GtkWidget *widget,
-                                       GdkEvent  *event,
-                                       RcmGray   *circle);
-gboolean rcm_gray_motion_notify_event (GtkWidget *widget,
-                                       GdkEvent  *event,
-                                       RcmGray   *circle);
+gboolean rcm_gray_expose_event        (GtkWidget      *widget,
+                                       GdkEventExpose *event,
+                                       RcmGray        *circle);
+gboolean rcm_gray_button_press_event  (GtkWidget      *widget,
+                                       GdkEventButton *event,
+                                       RcmGray        *circle);
+gboolean rcm_gray_release_event       (GtkWidget      *widget,
+                                       GdkEventButton *event,
+                                       RcmGray        *circle);
+gboolean rcm_gray_motion_notify_event (GtkWidget      *widget,
+                                       GdkEventMotion *event,
+                                       RcmGray        *circle);
 
 
 /* Spinbuttons */
 
 void rcm_set_alpha    (GtkWidget *entry,
-                       gpointer   data);
+                       RcmCircle *circle);
 void rcm_set_beta     (GtkWidget *entry,
-                       gpointer   data);
+                       RcmCircle *circle);
+
 void rcm_set_hue      (GtkWidget *entry,
-                       gpointer   data);
+                       RcmGray   *circle);
 void rcm_set_satur    (GtkWidget *entry,
-                       gpointer   data);
+                       RcmGray   *circle);
 void rcm_set_gray_sat (GtkWidget *entry,
-                       gpointer   data);
+                       RcmGray   *circle);

Modified: branches/soc-2008-tagging/plug-ins/common/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/Makefile.am	(original)
+++ branches/soc-2008-tagging/plug-ins/common/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -60,7 +60,6 @@
 	colorify \
 	colormap-remap \
 	compose \
-	compressor \
 	contrast-normalize \
 	contrast-retinex \
 	contrast-stretch \
@@ -86,6 +85,7 @@
 	engrave \
 	$(FILE_AA) \
 	file-cel \
+	file-compressor \
 	file-csource \
 	file-desktop-link \
 	file-dicom \
@@ -585,19 +585,6 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-compressor_SOURCES = \
-	compressor.c
-
-compressor_LDADD = \
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 contrast_normalize_SOURCES = \
 	contrast-normalize.c
 
@@ -981,6 +968,19 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
+file_compressor_SOURCES = \
+	file-compressor.c
+
+file_compressor_LDADD = \
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GLIB_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
+
 file_csource_SOURCES = \
 	file-csource.c
 

Modified: branches/soc-2008-tagging/plug-ins/common/align-layers.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/align-layers.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/align-layers.c	Sun Oct 12 15:38:02 2008
@@ -146,7 +146,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[1];
+  static GimpParam  values[2];
   GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
   GimpRunMode       run_mode;
   gint              image_id, layer_num;
@@ -168,7 +168,9 @@
       gimp_image_get_layers (image_id, &layer_num);
       if (layer_num < 2)
         {
-          g_message (_("There are not enough layers to align."));
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("There are not enough layers to align.");
           return;
         }
       gimp_get_data (PLUG_IN_PROC, &VALS);

Modified: branches/soc-2008-tagging/plug-ins/common/animation-play.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/animation-play.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/animation-play.c	Sun Oct 12 15:38:02 2008
@@ -1438,7 +1438,7 @@
   playing = gtk_toggle_action_get_active (action);
 
   if (playing)
-    timer = g_timeout_add (get_frame_duration (frame_number) * 
+    timer = g_timeout_add (get_frame_duration (frame_number) *
                            get_duration_factor (duration_index),
                            advance_frame_callback, NULL);
 

Modified: branches/soc-2008-tagging/plug-ins/common/blur-gauss.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/blur-gauss.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/blur-gauss.c	Sun Oct 12 15:38:02 2008
@@ -265,7 +265,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   gint32             image_ID;
   GimpDrawable      *drawable;
   GimpRunMode        run_mode;
@@ -442,8 +442,10 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
 
       gimp_drawable_detach (drawable);

Modified: branches/soc-2008-tagging/plug-ins/common/blur-motion.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/blur-motion.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/blur-motion.c	Sun Oct 12 15:38:02 2008
@@ -1082,7 +1082,7 @@
                             G_CALLBACK (gimp_preview_invalidate),
                             preview);
 
-  spinbutton = gimp_spin_button_new (&adj, 1, 0, 1, 1, 10, 1, 1, 2);
+  spinbutton = gimp_spin_button_new (&adj, 1, 0, 1, 1, 10, 0, 1, 2);
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (spinbutton), NULL);
   gtk_table_attach_defaults (GTK_TABLE (entry), spinbutton, 1, 2, 0, 1);

Modified: branches/soc-2008-tagging/plug-ins/common/cartoon.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/cartoon.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/cartoon.c	Sun Oct 12 15:38:02 2008
@@ -160,7 +160,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpDrawable      *drawable;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -226,8 +226,10 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/curve-bend.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/curve-bend.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/curve-bend.c	Sun Oct 12 15:38:02 2008
@@ -573,13 +573,12 @@
 {
   const gchar  *l_env;
   BenderDialog *cd;
-
   GimpDrawable *l_active_drawable    = NULL;
   gint32        l_active_drawable_id = -1;
   gint32        l_image_id           = -1;
   gint32        l_layer_id           = -1;
   gint32        l_layer_mask_id      = -1;
-  gint32        l_bent_layer_id      = -1;
+  GError       *error                = NULL;
 
   /* Get the runmode from the in-parameters */
   GimpRunMode run_mode = param[0].data.d_int32;
@@ -641,10 +640,12 @@
 
               p_delta_gdouble (&bval.rotation, bval_from.rotation,
                                bval_to.rotation, total_steps, current_step);
-              /* note: iteration of curve and points arrays would not give useful results.
-               *       (there might be different number of points in the from/to bender values )
-               *       the iteration is done later, (see p_bender_calculate_iter_curve)
-               *       when the curve is calculated.
+              /* note: iteration of curve and points arrays would not
+               *       give useful results.  (there might be different
+               *       number of points in the from/to bender values )
+               *       the iteration is done later, (see
+               *       p_bender_calculate_iter_curve) when the curve
+               *       is calculated.
                */
 
               bval.total_steps = total_steps;
@@ -672,7 +673,9 @@
 
   if (! gimp_drawable_is_layer (l_layer_id))
     {
-      g_message (_("Can operate on layers only (but was called on channel or mask)."));
+      g_set_error (&error, 0, 0, "%s",
+                   _("Can operate on layers only "
+                     "(but was called on channel or mask)."));
       status = GIMP_PDB_EXECUTION_ERROR;
     }
 
@@ -680,7 +683,8 @@
   l_layer_mask_id = gimp_layer_get_mask (l_layer_id);
   if (l_layer_mask_id >= 0)
     {
-      g_message (_("Cannot operate on layers with masks."));
+      g_set_error (&error, 0, 0, "%s",
+                   _("Cannot operate on layers with masks."));
       status = GIMP_PDB_EXECUTION_ERROR;
     }
 
@@ -691,7 +695,8 @@
       /* could not float the selection because selection rectangle
        * is completely empty return GIMP_PDB_EXECUTION_ERROR
        */
-       g_message (_("Cannot operate on empty selections."));
+      g_set_error (&error, 0, 0, "%s",
+                   _("Cannot operate on empty selections."));
        status = GIMP_PDB_EXECUTION_ERROR;
     }
   else
@@ -779,6 +784,8 @@
 
       if (cd->run)
         {
+          gint32 l_bent_layer_id;
+
           gimp_image_undo_group_start (l_image_id);
 
           l_bent_layer_id = p_main_bend (cd, cd->drawable, cd->work_on_copy);
@@ -790,6 +797,9 @@
             {
               p_store_values (cd);
             }
+
+          /* return the id of handled layer */
+          values[1].data.d_int32 = l_bent_layer_id;
         }
       else
         {
@@ -800,8 +810,14 @@
         gimp_displays_flush ();
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
-  values[1].data.d_int32 = l_bent_layer_id;   /* return the id of handled layer */
 }
 
 static int

Modified: branches/soc-2008-tagging/plug-ins/common/displace.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/displace.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/displace.c	Sun Oct 12 15:38:02 2008
@@ -843,10 +843,10 @@
       for (j = 0; j < 2; j++)
         {
           GtkRequisition  requisition;
-  
+
           gtk_button_set_label (GTK_BUTTON (toggle_x), gettext (mtext[i][j]));
           gtk_widget_size_request (toggle_x, &requisition);
-  
+
           if (requisition.width > label_maxwidth)
             label_maxwidth = requisition.width;
         }

Modified: branches/soc-2008-tagging/plug-ins/common/edge-dog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/edge-dog.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/edge-dog.c	Sun Oct 12 15:38:02 2008
@@ -153,11 +153,12 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   gint32             image_ID;
   GimpDrawable      *drawable;
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -169,57 +170,68 @@
   values[0].type          = GIMP_PDB_STATUS;
   values[0].data.d_status = status;
 
-  /*  Get the specified image and drawable  */
-  image_ID = param[1].data.d_image;
-  drawable = gimp_drawable_get (param[2].data.d_drawable);
-
-  /*  set the tile cache size so that the gaussian blur works well  */
-  gimp_tile_cache_ntiles (2 *
-                          (MAX (drawable->width, drawable->height) /
-                           gimp_tile_width () + 1));
-
-  if (strcmp (name, PLUG_IN_PROC) == 0)
-    {
-      switch (run_mode)
-        {
-        case GIMP_RUN_INTERACTIVE:
-          /*  Possibly retrieve data  */
-          gimp_get_data (PLUG_IN_PROC, &dogvals);
-
-          /*  First acquire information with a dialog  */
-          if (! dog_dialog (image_ID, drawable))
-            return;
-          break;
-
-        case GIMP_RUN_NONINTERACTIVE:
-          /*  Make sure all the arguments are there!  */
-          if (nparams != 7)
-            status = GIMP_PDB_CALLING_ERROR;
+  if (! gimp_drawable_is_layer (param[2].data.d_drawable))
+    {
+      g_set_error (&error, 0, 0, "%s",
+                   _("Can operate on layers only "
+                     "(but was called on channel or mask)."));
+      status = GIMP_PDB_EXECUTION_ERROR;
+    }
+
+  if (status == GIMP_PDB_SUCCESS)
+    {
+      /*  Get the specified image and drawable  */
+      image_ID = param[1].data.d_image;
+      drawable = gimp_drawable_get (param[2].data.d_drawable);
+
+      /*  set the tile cache size so that the gaussian blur works well  */
+      gimp_tile_cache_ntiles (2 *
+                              (MAX (drawable->width, drawable->height) /
+                               gimp_tile_width () + 1));
 
-          if (status == GIMP_PDB_SUCCESS)
+      if (strcmp (name, PLUG_IN_PROC) == 0)
+        {
+          switch (run_mode)
             {
-              dogvals.inner     = param[3].data.d_float;
-              dogvals.outer     = param[4].data.d_float;
-              dogvals.normalize = param[5].data.d_int32;
-              dogvals.invert    = param[6].data.d_int32;
-            }
-          if (status == GIMP_PDB_SUCCESS &&
-              (dogvals.inner <= 0.0 && dogvals.outer <= 0.0))
-            status = GIMP_PDB_CALLING_ERROR;
-          break;
-
-        case GIMP_RUN_WITH_LAST_VALS:
-          /*  Possibly retrieve data  */
-          gimp_get_data (PLUG_IN_PROC, &dogvals);
-          break;
+            case GIMP_RUN_INTERACTIVE:
+              /*  Possibly retrieve data  */
+              gimp_get_data (PLUG_IN_PROC, &dogvals);
+
+              /*  First acquire information with a dialog  */
+              if (! dog_dialog (image_ID, drawable))
+                return;
+              break;
+
+            case GIMP_RUN_NONINTERACTIVE:
+              /*  Make sure all the arguments are there!  */
+              if (nparams != 7)
+                status = GIMP_PDB_CALLING_ERROR;
+
+              if (status == GIMP_PDB_SUCCESS)
+                {
+                  dogvals.inner     = param[3].data.d_float;
+                  dogvals.outer     = param[4].data.d_float;
+                  dogvals.normalize = param[5].data.d_int32;
+                  dogvals.invert    = param[6].data.d_int32;
+
+                  if (dogvals.inner <= 0.0 || dogvals.outer <= 0.0)
+                    status = GIMP_PDB_CALLING_ERROR;
+                }
+              break;
+
+            case GIMP_RUN_WITH_LAST_VALS:
+              /*  Possibly retrieve data  */
+              gimp_get_data (PLUG_IN_PROC, &dogvals);
+              break;
 
-        default:
-          break;
+            default:
+              break;
+            }
+        }
+      else
+        {
+          status = GIMP_PDB_CALLING_ERROR;
         }
-    }
-  else
-    {
-      status = GIMP_PDB_CALLING_ERROR;
     }
 
   if (status == GIMP_PDB_SUCCESS)
@@ -248,13 +260,23 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
 
       gimp_drawable_detach (drawable);
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/common/edge-neon.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/edge-neon.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/edge-neon.c	Sun Oct 12 15:38:02 2008
@@ -152,7 +152,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpDrawable      *drawable;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -222,8 +222,10 @@
     }
   else
     {
-      g_message (_("Cannot operate on indexed color images."));
-      status = GIMP_PDB_EXECUTION_ERROR;
+      status        = GIMP_PDB_EXECUTION_ERROR;
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = _("Cannot operate on indexed color images.");
     }
 
   values[0].data.d_status = status;

Modified: branches/soc-2008-tagging/plug-ins/common/edge-sobel.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/edge-sobel.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/edge-sobel.c	Sun Oct 12 15:38:02 2008
@@ -134,7 +134,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpDrawable      *drawable;
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -206,8 +206,10 @@
     }
   else
     {
-      /* g_message ("Cannot operate on indexed color images"); */
-      status = GIMP_PDB_EXECUTION_ERROR;
+      status        = GIMP_PDB_EXECUTION_ERROR;
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = _("Cannot operate on indexed color images.");
     }
 
   gimp_drawable_detach (drawable);

Modified: branches/soc-2008-tagging/plug-ins/common/file-cel.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-cel.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-cel.c	Sun Oct 12 15:38:02 2008
@@ -44,16 +44,18 @@
                    gint             *nreturn_vals,
                    GimpParam       **return_vals);
 
-static gint      load_palette   (FILE        *fp,
-                                 guchar       palette[]);
-static gint32    load_image     (const gchar *file,
-                                 const gchar *brief);
-static gboolean  save_image     (const gchar *file,
-                                 const gchar *brief,
-                                 gint32       image,
-                                 gint32       layer);
-static void      palette_dialog (const gchar *title);
-static gboolean  need_palette   (const gchar *file);
+static gint      load_palette   (FILE         *fp,
+                                 guchar        palette[]);
+static gint32    load_image     (const gchar  *file,
+                                 const gchar  *brief,
+                                 GError      **error);
+static gboolean  save_image     (const gchar  *file,
+                                 const gchar  *brief,
+                                 gint32        image,
+                                 gint32        layer,
+                                 GError      **error);
+static void      palette_dialog (const gchar  *title);
+static gboolean  need_palette   (const gchar  *file);
 
 
 /* Globals... */
@@ -147,6 +149,7 @@
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   gint32             image;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -190,7 +193,8 @@
           gimp_set_data (SAVE_PROC, palette_file, data_length);
         }
 
-      image = load_image (param[1].data.d_string, param[2].data.d_string);
+      image = load_image (param[1].data.d_string, param[2].data.d_string,
+                          &error);
 
       if (image != -1)
         {
@@ -230,7 +234,7 @@
 	}
 
       if (save_image (param[3].data.d_string, param[4].data.d_string,
-		      image_ID, drawable_ID))
+		      image_ID, drawable_ID, &error))
         {
           gimp_set_data (SAVE_PROC, palette_file, data_length);
         }
@@ -247,6 +251,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -270,8 +281,9 @@
 /* Load CEL image into GIMP */
 
 static gint32
-load_image (const gchar *file,
-            const gchar *brief)
+load_image (const gchar  *file,
+            const gchar  *brief,
+            GError      **error)
 {
   FILE      *fp;            /* Read file pointer */
   guchar     header[32];    /* File header */
@@ -296,8 +308,9 @@
 
   if (fp == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (file), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (file), g_strerror (errno));
       return -1;
     }
 
@@ -481,7 +494,7 @@
   gimp_drawable_flush (drawable);
   gimp_drawable_detach (drawable);
 
-  return (image);
+  return image;
 }
 
 static gint
@@ -530,10 +543,11 @@
 }
 
 static gboolean
-save_image (const gchar *file,
-            const gchar *brief,
-            gint32       image,
-            gint32       layer)
+save_image (const gchar  *file,
+            const gchar  *brief,
+            gint32        image,
+            gint32        layer,
+            GError      **error)
 {
   FILE          *fp;            /* Write file pointer */
   guchar         header[32];    /* File header */
@@ -565,8 +579,9 @@
 
   if (fp == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (file), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (file), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-csource.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-csource.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-csource.c	Sun Oct 12 15:38:02 2008
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <string.h>
+#include <errno.h>
 
 #include <glib/gstdio.h>
 
@@ -50,17 +51,18 @@
 
 
 /* --- prototypes --- */
-static void	query		(void);
-static void	run		(const gchar      *name,
-				 gint              nparams,
-				 const GimpParam  *param,
-				 gint             *nreturn_vals,
-				 GimpParam       **return_vals);
-
-static gint	save_image	(Config           *config,
-				 gint32            image_ID,
-				 gint32            drawable_ID);
-static gboolean	run_save_dialog	(Config           *config);
+static void     query           (void);
+static void     run             (const gchar      *name,
+                                 gint              nparams,
+                                 const GimpParam  *param,
+                                 gint             *nreturn_vals,
+                                 GimpParam       **return_vals);
+
+static gboolean save_image      (Config           *config,
+                                 gint32            image_ID,
+                                 gint32            drawable_ID,
+                                 GError          **error);
+static gboolean run_save_dialog (Config           *config);
 
 
 /* --- variables --- */
@@ -108,7 +110,7 @@
                           "Tim Janik",
                           "1999",
                           N_("C source code"),
-			  "RGB*",
+                          "RGB*",
                           GIMP_PLUGIN,
                           G_N_ELEMENTS (save_args), 0,
                           save_args, NULL);
@@ -124,10 +126,11 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -154,62 +157,73 @@
 
       config.file_name = param[3].data.d_string;
       config.alpha = (drawable_type == GIMP_RGBA_IMAGE ||
-		      drawable_type == GIMP_GRAYA_IMAGE ||
-		      drawable_type == GIMP_INDEXEDA_IMAGE);
+                      drawable_type == GIMP_GRAYA_IMAGE ||
+                      drawable_type == GIMP_INDEXEDA_IMAGE);
 
       parasite = gimp_image_parasite_find (image_ID, "gimp-comment");
       if (parasite)
-	{
-	  config.comment = g_strndup (gimp_parasite_data (parasite),
+        {
+          config.comment = g_strndup (gimp_parasite_data (parasite),
                                       gimp_parasite_data_size (parasite));
-	  gimp_parasite_free (parasite);
-	}
+          gimp_parasite_free (parasite);
+        }
       x = config.comment;
 
       gimp_ui_init (PLUG_IN_BINARY, FALSE);
+
       export = gimp_export_image (&image_ID, &drawable_ID, "C Source",
-				  (GIMP_EXPORT_CAN_HANDLE_RGB |
-				   GIMP_EXPORT_CAN_HANDLE_ALPHA ));
+                                  (GIMP_EXPORT_CAN_HANDLE_RGB |
+                                   GIMP_EXPORT_CAN_HANDLE_ALPHA ));
+
       if (export == GIMP_EXPORT_CANCEL)
-	{
-	  values[0].data.d_status = GIMP_PDB_CANCEL;
-	  return;
-	}
+        {
+          values[0].data.d_status = GIMP_PDB_CANCEL;
+          return;
+        }
 
       if (run_save_dialog (&config))
-	{
-	  if (x != config.comment &&
-	      !(x && config.comment && strcmp (x, config.comment) == 0))
-	    {
-	      if (!config.comment || !config.comment[0])
-		gimp_image_parasite_detach (image_ID, "gimp-comment");
-	      else
-		{
-		  parasite = gimp_parasite_new ("gimp-comment",
-						GIMP_PARASITE_PERSISTENT,
-						strlen (config.comment) + 1,
-						config.comment);
-		  gimp_image_parasite_attach (image_ID, parasite);
-		  gimp_parasite_free (parasite);
-		}
-	    }
-
-	  if (! save_image (&config, image_ID, drawable_ID))
-	    {
-	      status = GIMP_PDB_EXECUTION_ERROR;
-	    }
-	  else
-	    {
-	      gimp_set_data (SAVE_PROC, &config, sizeof (config));
-	    }
-	}
+        {
+          if (x != config.comment &&
+              !(x && config.comment && strcmp (x, config.comment) == 0))
+            {
+              if (!config.comment || !config.comment[0])
+                {
+                  gimp_image_parasite_detach (image_ID, "gimp-comment");
+                }
+              else
+                {
+                  parasite = gimp_parasite_new ("gimp-comment",
+                                                GIMP_PARASITE_PERSISTENT,
+                                                strlen (config.comment) + 1,
+                                                config.comment);
+                  gimp_image_parasite_attach (image_ID, parasite);
+                  gimp_parasite_free (parasite);
+                }
+            }
+
+          if (! save_image (&config, image_ID, drawable_ID, &error))
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+
+              if (error)
+                {
+                  *nreturn_vals = 2;
+                  values[1].type          = GIMP_PDB_STRING;
+                  values[1].data.d_string = error->message;
+                }
+            }
+          else
+            {
+              gimp_set_data (SAVE_PROC, &config, sizeof (config));
+            }
+        }
       else
-	{
-	  status = GIMP_PDB_CANCEL;
-	}
+        {
+          status = GIMP_PDB_CANCEL;
+        }
 
       if (export == GIMP_EXPORT_EXPORT)
-	gimp_image_delete (image_ID);
+        gimp_image_delete (image_ID);
     }
   else
     {
@@ -233,9 +247,9 @@
 
 static guint8 *
 rl_encode_rgbx (guint8 *bp,
-		guint8 *ip,
-		guint8 *limit,
-		guint   n_ch)
+                guint8 *ip,
+                guint8 *limit,
+                guint   n_ch)
 {
   gboolean (*diff2_pix) (guint8 *) = n_ch > 3 ? diff2_rgba : diff2_rgb;
   guint8 *ilimit = limit - n_ch;
@@ -245,38 +259,38 @@
       g_assert (ip < ilimit); /* paranoid */
 
       if (diff2_pix (ip))
-	{
-	  guint8 *s_ip = ip;
-	  guint l = 1;
-
-	  ip += n_ch;
-	  while (l < 127 && ip < ilimit && diff2_pix (ip))
-	    { ip += n_ch; l += 1; }
-	  if (ip == ilimit && l < 127)
+        {
+          guint8 *s_ip = ip;
+          guint l = 1;
+
+          ip += n_ch;
+          while (l < 127 && ip < ilimit && diff2_pix (ip))
+            { ip += n_ch; l += 1; }
+          if (ip == ilimit && l < 127)
             { ip += n_ch; l += 1; }
-	  *(bp++) = l;
-	  memcpy (bp, s_ip, l * n_ch);
-	  bp += l * n_ch;
-	}
+          *(bp++) = l;
+          memcpy (bp, s_ip, l * n_ch);
+          bp += l * n_ch;
+        }
       else
-	{
-	  guint l = 2;
+        {
+          guint l = 2;
 
-	  ip += n_ch;
-	  while (l < 127 && ip < ilimit && !diff2_pix (ip))
+          ip += n_ch;
+          while (l < 127 && ip < ilimit && !diff2_pix (ip))
             { ip += n_ch; l += 1; }
-	  *(bp++) = l | 128;
-	  memcpy (bp, ip, n_ch);
-	  ip += n_ch;
-	  bp += n_ch;
-	}
+          *(bp++) = l | 128;
+          memcpy (bp, ip, n_ch);
+          ip += n_ch;
+          bp += n_ch;
+        }
       if (ip == ilimit)
-	{
-	  *(bp++) = 1;
-	  memcpy (bp, ip, n_ch);
-	  ip += n_ch;
-	  bp += n_ch;
-	}
+        {
+          *(bp++) = 1;
+          memcpy (bp, ip, n_ch);
+          ip += n_ch;
+          bp += n_ch;
+        }
     }
 
   return bp;
@@ -284,13 +298,13 @@
 
 static inline void
 save_rle_decoder (FILE        *fp,
-		  const gchar *macro_name,
-		  const gchar *s_uint,
-		  const gchar *s_uint_8,
-		  guint        n_ch)
+                  const gchar *macro_name,
+                  const gchar *s_uint,
+                  const gchar *s_uint_8,
+                  guint        n_ch)
 {
   fprintf (fp, "#define %s_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) do \\\n",
-	   macro_name);
+           macro_name);
   fprintf (fp, "{ %s __bpp; %s *__ip; const %s *__il, *__rd; \\\n", s_uint, s_uint_8, s_uint_8);
   fprintf (fp, "  __bpp = (bpp); __ip = (image_buf); __il = __ip + (size) * __bpp; \\\n");
 
@@ -315,24 +329,24 @@
 
 static inline guint
 save_uchar (FILE   *fp,
-	    guint   c,
-	    guint8  d,
-	    Config *config)
+            guint   c,
+            guint8  d,
+            Config *config)
 {
   static guint8 pad = 0;
 
   if (c > 74)
     {
       if (!config->use_macros)
-	{
-	  fprintf (fp, "\"\n  \"");
-	  c = 3;
-	}
+        {
+          fprintf (fp, "\"\n  \"");
+          c = 3;
+        }
       else
-	{
-	  fprintf (fp, "\"\n \"");
-	  c = 2;
-	}
+        {
+          fprintf (fp, "\"\n \"");
+          c = 2;
+        }
     }
   if (d < 33 || d > 126)
     {
@@ -369,27 +383,34 @@
   return c;
 }
 
-static gint
-save_image (Config *config,
-	    gint32  image_ID,
-	    gint32  drawable_ID)
+static gboolean
+save_image (Config  *config,
+            gint32   image_ID,
+            gint32   drawable_ID,
+            GError **error)
 {
   GimpDrawable *drawable      = gimp_drawable_get (drawable_ID);
   GimpImageType drawable_type = gimp_drawable_type (drawable_ID);
   GimpPixelRgn pixel_rgn;
-  gchar *s_uint_8, *s_uint_32, *s_uint, *s_char, *s_null;
-  FILE *fp;
-  guint c;
-  gchar *macro_name;
+  gchar  *s_uint_8, *s_uint_32, *s_uint, *s_char, *s_null;
+  FILE   *fp;
+  guint   c;
+  gchar  *macro_name;
   guint8 *img_buffer, *img_buffer_end;
-  gchar *basename;
+  gchar  *basename;
 
   fp = g_fopen (config->file_name, "w");
-  if (!fp)
-    return FALSE;
+  if (! fp)
+    {
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (config->file_name),
+                   g_strerror (errno));
+      return FALSE;
+    }
 
   gimp_pixel_rgn_init (&pixel_rgn, drawable,
-		       0, 0, drawable->width, drawable->height, FALSE, FALSE);
+                       0, 0, drawable->width, drawable->height, FALSE, FALSE);
 
   if (1)
     {
@@ -400,45 +421,47 @@
       n_bytes = drawable->width * drawable->height * bpp;
       pad = drawable->width * drawable->bpp;
       if (config->use_rle)
-	pad = MAX (pad, 130 + n_bytes / 127);
+        pad = MAX (pad, 130 + n_bytes / 127);
       data = g_new (guint8, pad + n_bytes);
       p = data + pad;
       for (y = 0; y < drawable->height; y++)
-	{
-	  gimp_pixel_rgn_get_row (&pixel_rgn, data, 0, y, drawable->width);
-	  if (config->alpha)
-	    for (x = 0; x < drawable->width; x++)
-	      {
-		guint8 *d = data + x * drawable->bpp;
-		gdouble alpha = drawable_type == GIMP_RGBA_IMAGE ? d[3] : 0xff;
-
-		alpha *= config->opacity / 100.0;
-		*(p++) = d[0];
-		*(p++) = d[1];
-		*(p++) = d[2];
-		*(p++) = alpha + 0.5;
-	      }
-	  else
-	    for (x = 0; x < drawable->width; x++)
-	      {
-		guint8 *d = data + x * drawable->bpp;
-		gdouble alpha = drawable_type == GIMP_RGBA_IMAGE ? d[3] : 0xff;
-
-		alpha *= config->opacity / 25500.0;
-		*(p++) = 0.5 + alpha * (gdouble) d[0];
-		*(p++) = 0.5 + alpha * (gdouble) d[1];
-		*(p++) = 0.5 + alpha * (gdouble) d[2];
-	      }
-	}
+        {
+          gimp_pixel_rgn_get_row (&pixel_rgn, data, 0, y, drawable->width);
+          if (config->alpha)
+            for (x = 0; x < drawable->width; x++)
+              {
+                guint8 *d = data + x * drawable->bpp;
+                gdouble alpha = drawable_type == GIMP_RGBA_IMAGE ? d[3] : 0xff;
+
+                alpha *= config->opacity / 100.0;
+                *(p++) = d[0];
+                *(p++) = d[1];
+                *(p++) = d[2];
+                *(p++) = alpha + 0.5;
+              }
+          else
+            for (x = 0; x < drawable->width; x++)
+              {
+                guint8 *d = data + x * drawable->bpp;
+                gdouble alpha = drawable_type == GIMP_RGBA_IMAGE ? d[3] : 0xff;
+
+                alpha *= config->opacity / 25500.0;
+                *(p++) = 0.5 + alpha * (gdouble) d[0];
+                *(p++) = 0.5 + alpha * (gdouble) d[1];
+                *(p++) = 0.5 + alpha * (gdouble) d[2];
+              }
+        }
       img_buffer = data + pad;
       if (config->use_rle)
-	{
-	  img_buffer_end = rl_encode_rgbx (data, img_buffer,
-					   img_buffer + n_bytes, bpp);
-	  img_buffer = data;
-	}
+        {
+          img_buffer_end = rl_encode_rgbx (data, img_buffer,
+                                           img_buffer + n_bytes, bpp);
+          img_buffer = data;
+        }
       else
-	img_buffer_end = img_buffer + n_bytes;
+        {
+          img_buffer_end = img_buffer + n_bytes;
+        }
     }
 
   if (!config->use_macros && config->glib_types)
@@ -479,18 +502,18 @@
   basename = g_path_get_basename (config->file_name);
 
   fprintf (fp, "/* GIMP %s C-Source image dump %s(%s) */\n\n",
-	   config->alpha ? "RGBA" : "RGB",
-	   config->use_rle ? "1-byte-run-length-encoded " : "",
-	   basename);
+           config->alpha ? "RGBA" : "RGB",
+           config->use_rle ? "1-byte-run-length-encoded " : "",
+           basename);
 
   g_free (basename);
 
   if (config->use_rle && !config->use_macros)
     save_rle_decoder (fp,
-		      macro_name,
-		      config->glib_types ? "guint" : "unsigned int",
-		      config->glib_types ? "guint8" : "unsigned char",
-		      config->alpha ? 4 : 3);
+                      macro_name,
+                      config->glib_types ? "guint" : "unsigned int",
+                      config->glib_types ? "guint8" : "unsigned char",
+                      config->alpha ? 4 : 3);
 
   if (!config->use_macros)
     {
@@ -499,96 +522,96 @@
       fprintf (fp, "  %s\t height;\n", s_uint);
       fprintf (fp, "  %s\t bytes_per_pixel; /* 3:RGB, 4:RGBA */ \n", s_uint);
       if (config->use_comment)
-	fprintf (fp, "  %s\t*comment;\n", s_char);
+        fprintf (fp, "  %s\t*comment;\n", s_char);
       fprintf (fp, "  %s\t %spixel_data[",
-	       s_uint_8,
-	       config->use_rle ? "rle_" : "");
+               s_uint_8,
+               config->use_rle ? "rle_" : "");
       if (config->use_rle)
-	fprintf (fp, "%u + 1];\n", (guint) (img_buffer_end - img_buffer));
+        fprintf (fp, "%u + 1];\n", (guint) (img_buffer_end - img_buffer));
       else
-	fprintf (fp, "%u * %u * %u + 1];\n",
-		 drawable->width,
-		 drawable->height,
-		 config->alpha ? 4 : 3);
+        fprintf (fp, "%u * %u * %u + 1];\n",
+                 drawable->width,
+                 drawable->height,
+                 config->alpha ? 4 : 3);
       fprintf (fp, "} %s = {\n", config->prefixed_name);
       fprintf (fp, "  %u, %u, %u,\n",
-	       drawable->width,
-	       drawable->height,
-	       config->alpha ? 4 : 3);
+               drawable->width,
+               drawable->height,
+               config->alpha ? 4 : 3);
     }
   else /* use macros */
     {
       fprintf (fp, "#define %s_WIDTH (%u)\n",
-	       macro_name, drawable->width);
+               macro_name, drawable->width);
       fprintf (fp, "#define %s_HEIGHT (%u)\n",
-	       macro_name, drawable->height);
+               macro_name, drawable->height);
       fprintf (fp, "#define %s_BYTES_PER_PIXEL (%u) /* 3:RGB, 4:RGBA */\n",
-	       macro_name, config->alpha ? 4 : 3);
+               macro_name, config->alpha ? 4 : 3);
     }
   if (config->use_comment && !config->comment)
     {
       if (!config->use_macros)
-	fprintf (fp, "  %s,\n", s_null);
+        fprintf (fp, "  %s,\n", s_null);
       else /* use macros */
-	fprintf (fp, "#define %s_COMMENT (%s)\n", macro_name, s_null);
+        fprintf (fp, "#define %s_COMMENT (%s)\n", macro_name, s_null);
     }
   else if (config->use_comment)
     {
       gchar *p = config->comment - 1;
 
       if (config->use_macros)
-	fprintf (fp, "#define %s_COMMENT \\\n", macro_name);
+        fprintf (fp, "#define %s_COMMENT \\\n", macro_name);
       fprintf (fp, "  \"");
       while (*(++p))
-	if (*p == '\\')
-	  fprintf (fp, "\\\\");
-	else if (*p == '"')
-	  fprintf (fp, "\\\"");
-	else if (*p == '\n' && p[1])
-	  fprintf (fp, "\\n\"%s\n  \"",
-		   config->use_macros ? " \\" : "");
-	else if (*p == '\n')
-	  fprintf (fp, "\\n");
-	else if (*p == '\r')
-	  fprintf (fp, "\\r");
-	else if (*p == '\b')
-	  fprintf (fp, "\\b");
-	else if (*p == '\f')
-	  fprintf (fp, "\\f");
-	else if (*p >= 32 && *p <= 126)
-	  fprintf (fp, "%c", *p);
-	else
-	  fprintf (fp, "\\%03o", *p);
+        if (*p == '\\')
+          fprintf (fp, "\\\\");
+        else if (*p == '"')
+          fprintf (fp, "\\\"");
+        else if (*p == '\n' && p[1])
+          fprintf (fp, "\\n\"%s\n  \"",
+                   config->use_macros ? " \\" : "");
+        else if (*p == '\n')
+          fprintf (fp, "\\n");
+        else if (*p == '\r')
+          fprintf (fp, "\\r");
+        else if (*p == '\b')
+          fprintf (fp, "\\b");
+        else if (*p == '\f')
+          fprintf (fp, "\\f");
+        else if (*p >= 32 && *p <= 126)
+          fprintf (fp, "%c", *p);
+        else
+          fprintf (fp, "\\%03o", *p);
       if (!config->use_macros)
-	fprintf (fp, "\",\n");
+        fprintf (fp, "\",\n");
       else /* use macros */
-	fprintf (fp, "\"\n");
+        fprintf (fp, "\"\n");
     }
   if (config->use_macros)
     {
       fprintf (fp, "#define %s_%sPIXEL_DATA ((%s*) %s_%spixel_data)\n",
-	       macro_name,
-	       config->use_rle ? "RLE_" : "",
-	       s_uint_8,
-	       macro_name,
-	       config->use_rle ? "rle_" : "");
+               macro_name,
+               config->use_rle ? "RLE_" : "",
+               s_uint_8,
+               macro_name,
+               config->use_rle ? "rle_" : "");
       if (config->use_rle)
-	save_rle_decoder (fp,
-			  macro_name,
-			  s_uint,
-			  s_uint_8,
-			  config->alpha ? 4 : 3);
+        save_rle_decoder (fp,
+                          macro_name,
+                          s_uint,
+                          s_uint_8,
+                          config->alpha ? 4 : 3);
       fprintf (fp, "static const %s %s_%spixel_data[",
-	       s_uint_8,
-	       macro_name,
-	       config->use_rle ? "rle_" : "");
+               s_uint_8,
+               macro_name,
+               config->use_rle ? "rle_" : "");
       if (config->use_rle)
-	fprintf (fp, "%u] =\n", (guint) (img_buffer_end - img_buffer));
+        fprintf (fp, "%u] =\n", (guint) (img_buffer_end - img_buffer));
       else
-	fprintf (fp, "%u * %u * %u + 1] =\n",
-		 drawable->width,
-		 drawable->height,
-		 config->alpha ? 4 : 3);
+        fprintf (fp, "%u * %u * %u + 1] =\n",
+                 drawable->width,
+                 drawable->height,
+                 config->alpha ? 4 : 3);
       fprintf (fp, "(\"");
       c = 2;
     }
@@ -602,7 +625,7 @@
     case GIMP_RGB_IMAGE:
     case GIMP_RGBA_IMAGE:
       do
-	c = save_uchar (fp, c, *(img_buffer++), config);
+        c = save_uchar (fp, c, *(img_buffer++), config);
       while (img_buffer < img_buffer_end);
       break;
     default:
@@ -625,7 +648,7 @@
 static GtkWidget *centry;
 
 static gboolean
-run_save_dialog	(Config *config)
+run_save_dialog (Config *config)
 {
   GtkWidget *dialog;
   GtkWidget *vbox;
@@ -636,12 +659,12 @@
 
   dialog = gimp_dialog_new (_("Save as C-Source"), PLUG_IN_BINARY,
                             NULL, 0,
-			    gimp_standard_help_func, SAVE_PROC,
+                            gimp_standard_help_func, SAVE_PROC,
 
-			    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			    GTK_STOCK_SAVE,   GTK_RESPONSE_OK,
+                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                            GTK_STOCK_SAVE,   GTK_RESPONSE_OK,
 
-			    NULL);
+                            NULL);
 
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
                                            GTK_RESPONSE_OK,
@@ -665,26 +688,26 @@
    */
   prefixed_name = gtk_entry_new ();
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-			     _("_Prefixed name:"), 0.0, 0.5,
-			     prefixed_name, 1, FALSE);
+                             _("_Prefixed name:"), 0.0, 0.5,
+                             prefixed_name, 1, FALSE);
   gtk_entry_set_text (GTK_ENTRY (prefixed_name),
-		      config->prefixed_name ? config->prefixed_name : "");
+                      config->prefixed_name ? config->prefixed_name : "");
 
   /* Comment Entry
    */
   centry = gtk_entry_new ();
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
-			     _("Co_mment:"), 0.0, 0.5,
-			     centry, 1, FALSE);
+                             _("Co_mment:"), 0.0, 0.5,
+                             centry, 1, FALSE);
   gtk_entry_set_text (GTK_ENTRY (centry),
-		      config->comment ? config->comment : "");
+                      config->comment ? config->comment : "");
 
   /* Use Comment
    */
   toggle = gtk_check_button_new_with_mnemonic (_("_Save comment to file"));
   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
-				config->use_comment);
+                                config->use_comment);
   gtk_widget_show (toggle);
 
   g_signal_connect (toggle, "toggled",
@@ -696,7 +719,7 @@
   toggle = gtk_check_button_new_with_mnemonic (_("_Use GLib types (guint8*)"));
   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
-				config->glib_types);
+                                config->glib_types);
   gtk_widget_show (toggle);
 
   g_signal_connect (toggle, "toggled",
@@ -708,7 +731,7 @@
   toggle = gtk_check_button_new_with_mnemonic (_("Us_e macros instead of struct"));
   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
-				config->use_macros);
+                                config->use_macros);
   gtk_widget_show (toggle);
 
   g_signal_connect (toggle, "toggled",
@@ -720,7 +743,7 @@
   toggle = gtk_check_button_new_with_mnemonic (_("Use _1 byte Run-Length-Encoding"));
   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
-				config->use_rle);
+                                config->use_rle);
   gtk_widget_show (toggle);
 
   g_signal_connect (toggle, "toggled",
@@ -732,7 +755,7 @@
   toggle = gtk_check_button_new_with_mnemonic (_("Sa_ve alpha channel (RGBA/RGB)"));
   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
-				config->alpha);
+                                config->alpha);
   gtk_widget_show (toggle);
 
   g_signal_connect (toggle, "toggled",
@@ -747,10 +770,10 @@
   gtk_widget_show (table);
 
   adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
-			      _("Op_acity:"), 100, 0,
-			      config->opacity, 0, 100, 1, 10, 1,
-			      TRUE, 0, 0,
-			      NULL, NULL);
+                              _("Op_acity:"), 100, 0,
+                              config->opacity, 0, 100, 1, 10, 1,
+                              TRUE, 0, 0,
+                              NULL, NULL);
   g_signal_connect (adj, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),
                     &config->opacity);

Modified: branches/soc-2008-tagging/plug-ins/common/file-dicom.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-dicom.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-dicom.c	Sun Oct 12 15:38:02 2008
@@ -66,10 +66,12 @@
                                         const GimpParam  *param,
                                         gint             *nreturn_vals,
                                         GimpParam       **return_vals);
-static gint32    load_image            (const gchar      *filename);
+static gint32    load_image            (const gchar      *filename,
+                                        GError          **error);
 static gboolean  save_image            (const gchar      *filename,
                                         gint32            image_ID,
-                                        gint32            drawable_ID);
+                                        gint32            drawable_ID,
+                                        GError          **error);
 static void      dicom_loader          (guint8           *pix_buf,
                                         DicomInfo        *info,
                                         GimpPixelRgn     *pixel_rgn);
@@ -190,6 +192,7 @@
   gint32             image_ID;
   gint32             drawable_ID;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   INIT_I18N ();
 
@@ -202,7 +205,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -214,7 +217,14 @@
       else
 	{
 	  status = GIMP_PDB_EXECUTION_ERROR;
-	}
+
+          if (error)
+            {
+              *nreturn_vals = 2;
+              values[1].type          = GIMP_PDB_STRING;
+              values[1].data.d_string = error->message;
+            }
+ 	}
     }
   else if (strcmp (name, SAVE_PROC) == 0)
     {
@@ -226,6 +236,7 @@
 	case GIMP_RUN_INTERACTIVE:
 	case GIMP_RUN_WITH_LAST_VALS:
 	  gimp_ui_init (PLUG_IN_BINARY, FALSE);
+
 	  export = gimp_export_image (&image_ID, &drawable_ID, "DICOM",
 				      GIMP_EXPORT_CAN_HANDLE_RGB |
                                       GIMP_EXPORT_CAN_HANDLE_GRAY);
@@ -260,9 +271,19 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID))
-	    status = GIMP_PDB_EXECUTION_ERROR;
-	}
+	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID,
+                            &error))
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+
+              if (error)
+                {
+                  *nreturn_vals = 2;
+                  values[1].type          = GIMP_PDB_STRING;
+                  values[1].data.d_string = error->message;
+                }
+            }
+        }
 
       if (export == GIMP_EXPORT_EXPORT)
 	gimp_image_delete (image_ID);
@@ -276,7 +297,8 @@
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   GimpPixelRgn    pixel_rgn;
   gint32 volatile image_ID          = -1;
@@ -297,10 +319,11 @@
   /* open the file */
   DICOM = g_fopen (filename, "rb");
 
-  if (!DICOM)
+  if (! DICOM)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -325,8 +348,9 @@
   fread (buf, 1, 4, DICOM); /* This should be dicom */
   if (g_ascii_strncasecmp (buf,"DICM",4) != 0)
     {
-      g_message (_("'%s' is not a DICOM file."),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a DICOM file."),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -721,7 +745,8 @@
 static gboolean
 save_image (const gchar  *filename,
 	    gint32        image_ID,
-	    gint32        drawable_ID)
+	    gint32        drawable_ID,
+            GError      **error)
 {
   FILE          *DICOM;
   GimpImageType  drawable_type;
@@ -771,9 +796,10 @@
 
   if (!DICOM)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
       gimp_drawable_detach (drawable);
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-gbr.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-gbr.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-gbr.c	Sun Oct 12 15:38:02 2008
@@ -88,10 +88,12 @@
                                   gint             *nreturn_vals,
                                   GimpParam       **return_vals);
 
-static gint32     load_image     (const gchar      *filename);
+static gint32     load_image     (const gchar      *filename,
+                                  GError          **error);
 static gboolean   save_image     (const gchar      *filename,
                                   gint32            image_ID,
-                                  gint32            drawable_ID);
+                                  gint32            drawable_ID,
+                                  GError          **error);
 
 static gboolean   save_dialog    (void);
 static void       entry_callback (GtkWidget        *widget,
@@ -189,12 +191,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -208,7 +211,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -292,7 +295,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+	  if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
 	    {
 	      gimp_set_data (SAVE_PROC, &info, sizeof (info));
 	    }
@@ -322,11 +326,19 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gchar             *name;
   gint               fd;
@@ -345,8 +357,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -408,8 +421,9 @@
 
       if ((read (fd, temp, bn_size)) < bn_size)
 	{
-	  g_message (_("Error in GIMP brush file '%s'"),
-                     gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Error in GIMP brush file '%s'"),
+                       gimp_filename_to_utf8 (filename));
 	  close (fd);
 	  g_free (temp);
 	  return -1;
@@ -578,9 +592,10 @@
 }
 
 static gboolean
-save_image (const gchar *filename,
-	    gint32       image_ID,
-	    gint32       drawable_ID)
+save_image (const gchar  *filename,
+	    gint32        image_ID,
+	    gint32        drawable_ID,
+            GError      **error)
 {
   gint          fd;
   BrushHeader   bh;
@@ -613,8 +628,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-gif-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-gif-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-gif-load.c	Sun Oct 12 15:38:02 2008
@@ -92,7 +92,8 @@
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
 static gint32 load_image (const gchar      *filename,
-                          gboolean          thumbnail);
+                          gboolean          thumbnail,
+                          GError          **error);
 
 
 static guchar        used_cmap[3][256];
@@ -177,6 +178,7 @@
 {
   static GimpParam   values[2];
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GError            *error  = NULL;
   gint32             image_ID;
 
   INIT_I18N ();
@@ -189,11 +191,11 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string, FALSE);
+      image_ID = load_image (param[1].data.d_string, FALSE, &error);
     }
   else if (strcmp (name, LOAD_THUMB_PROC) == 0)
     {
-      image_ID = load_image (param[0].data.d_string, TRUE);
+      image_ID = load_image (param[0].data.d_string, TRUE, &error);
     }
   else
     {
@@ -228,6 +230,13 @@
       else
         {
           status = GIMP_PDB_EXECUTION_ERROR;
+
+          if (error)
+            {
+              *nreturn_vals = 2;
+              values[1].type          = GIMP_PDB_STRING;
+              values[1].data.d_string = error->message;
+            }
         }
     }
 
@@ -253,44 +262,64 @@
 #define GRAYSCALE        1
 #define COLOR            2
 
-typedef unsigned char CMap[3][MAXCOLORMAPSIZE];
+typedef guchar CMap[3][MAXCOLORMAPSIZE];
 
 static struct
 {
-  unsigned int Width;
-  unsigned int Height;
-  CMap         ColorMap;
-  unsigned int BitPixel;
-  unsigned int ColorResolution;
-  unsigned int Background;
-  unsigned int AspectRatio;
+  guint Width;
+  guint Height;
+  CMap  ColorMap;
+  guint BitPixel;
+  guint ColorResolution;
+  guint Background;
+  guint AspectRatio;
   /*
    **
    */
-  int          GrayScale;
+  gint  GrayScale;
 } GifScreen;
 
 static struct
 {
-  int transparent;
-  int delayTime;
-  int inputFlag;
-  int disposal;
+  gint transparent;
+  gint delayTime;
+  gint inputFlag;
+  gint disposal;
 } Gif89 = { -1, -1, -1, 0 };
 
-static int ReadColorMap (FILE *, int, CMap, int *);
-static int DoExtension  (FILE *, int);
-static int GetDataBlock (FILE *, unsigned char *);
-static int GetCode      (FILE *, int, int);
-static int LZWReadByte  (FILE *, int, int);
-static gint32 ReadImage (FILE *, const gchar *,
-                         int, int, CMap, int, int, int, int,
-                         guint, guint, guint, guint);
+static gboolean ReadColorMap (FILE        *fd,
+                              gint         number,
+                              CMap         buffer,
+                              gint        *format);
+static gint     DoExtension  (FILE        *fd,
+                              gint         label);
+static gint     GetDataBlock (FILE        *fd,
+                              guchar      *buf);
+static gint     GetCode      (FILE        *fd,
+                              gint         code_size,
+                              gboolean     flag);
+static gint     LZWReadByte  (FILE        *fd,
+                              gint         just_reset_LZW,
+                              gint         input_code_size);
+static gint32   ReadImage    (FILE        *fd,
+                              const gchar *filename,
+                              gint         len,
+                              gint         height,
+                              CMap         cmap,
+                              gint         ncols,
+                              gint         format,
+                              gint         interlace,
+                              gint         number,
+                              guint        leftpos,
+                              guint        toppos,
+                              guint        screenwidth,
+                              guint        screenheight);
 
 
 static gint32
-load_image (const gchar *filename,
-            gboolean     thumbnail)
+load_image (const gchar  *filename,
+            gboolean      thumbnail,
+            GError      **error)
 {
   FILE     *fd;
   guchar    buf[16];
@@ -304,17 +333,19 @@
   gint32    image_ID = -1;
 
   fd = g_fopen (filename, "rb");
-  if (!fd)
+
+  if (! fd)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
   gimp_progress_init_printf (_("Opening '%s'"),
                              gimp_filename_to_utf8 (filename));
 
-  if (!ReadOK (fd, buf, 6))
+  if (! ReadOK (fd, buf, 6))
     {
       g_message ("Error reading magic number");
       return -1;
@@ -322,7 +353,8 @@
 
   if (strncmp ((gchar *) buf, "GIF", 3) != 0)
     {
-      g_message (_("This is not a GIF file"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("This is not a GIF file"));
       return -1;
     }
 
@@ -335,24 +367,24 @@
       return -1;
     }
 
-  if (!ReadOK (fd, buf, 7))
+  if (! ReadOK (fd, buf, 7))
     {
       g_message ("Failed to read screen descriptor");
       return -1;
     }
 
-  GifScreen.Width = LM_to_uint (buf[0], buf[1]);
-  GifScreen.Height = LM_to_uint (buf[2], buf[3]);
-  GifScreen.BitPixel = 2 << (buf[4] & 0x07);
+  GifScreen.Width           = LM_to_uint (buf[0], buf[1]);
+  GifScreen.Height          = LM_to_uint (buf[2], buf[3]);
+  GifScreen.BitPixel        = 2 << (buf[4] & 0x07);
   GifScreen.ColorResolution = (((buf[4] & 0x70) >> 3) + 1);
-  GifScreen.Background = buf[5];
-  GifScreen.AspectRatio = buf[6];
+  GifScreen.Background      = buf[5];
+  GifScreen.AspectRatio     = buf[6];
 
   if (BitSet (buf[4], LOCALCOLORMAP))
     {
       /* Global Colormap */
-      if (ReadColorMap (fd, GifScreen.BitPixel, GifScreen.ColorMap,
-                        &GifScreen.GrayScale))
+      if (! ReadColorMap (fd, GifScreen.BitPixel, GifScreen.ColorMap,
+                          &GifScreen.GrayScale))
         {
           g_message ("Error reading global colormap");
           return -1;
@@ -367,9 +399,9 @@
 
   highest_used_index = 0;
 
-  for (;;)
+  while (TRUE)
     {
-      if (!ReadOK (fd, &c, 1))
+      if (! ReadOK (fd, &c, 1))
         {
           g_message ("EOF / read error on image data");
           return image_ID; /* will be -1 if failed on first image! */
@@ -384,7 +416,7 @@
       if (c == '!')
         {
           /* Extension */
-          if (!ReadOK (fd, &c, 1))
+          if (! ReadOK (fd, &c, 1))
             {
               g_message ("EOF / read error on extension function code");
               return image_ID; /* will be -1 if failed on first image! */
@@ -402,7 +434,7 @@
 
       ++imageCount;
 
-      if (!ReadOK (fd, buf, 9))
+      if (! ReadOK (fd, buf, 9))
         {
           g_message ("Couldn't read left/top/width/height");
           return image_ID; /* will be -1 if failed on first image! */
@@ -414,7 +446,7 @@
 
       if (! useGlobalColormap)
         {
-          if (ReadColorMap (fd, bitPixel, localColorMap, &grayScale))
+          if (! ReadColorMap (fd, bitPixel, localColorMap, &grayScale))
             {
               g_message ("Error reading local colormap");
               return image_ID; /* will be -1 if failed on first image! */
@@ -460,11 +492,11 @@
   return image_ID;
 }
 
-static int
+static gboolean
 ReadColorMap (FILE *fd,
-              int   number,
+              gint  number,
               CMap  buffer,
-              int  *format)
+              gint *format)
 {
   guchar rgb[3];
   gint   flag;
@@ -474,11 +506,8 @@
 
   for (i = 0; i < number; ++i)
     {
-      if (!ReadOK (fd, rgb, sizeof (rgb)))
-        {
-          g_message ("Bad colormap");
-          return TRUE;
-        }
+      if (! ReadOK (fd, rgb, sizeof (rgb)))
+        return FALSE;
 
       buffer[CM_RED][i] = rgb[0];
       buffer[CM_GREEN][i] = rgb[1];
@@ -489,12 +518,12 @@
 
   *format = (flag) ? GRAYSCALE : COLOR;
 
-  return FALSE;
+  return TRUE;
 }
 
-static int
+static gint
 DoExtension (FILE *fd,
-             int   label)
+             gint  label)
 {
   static guchar  buf[256];
   gchar         *str;
@@ -504,19 +533,19 @@
     case 0x01:                  /* Plain Text Extension */
       str = "Plain Text Extension";
 #ifdef notdef
-      if (GetDataBlock (fd, (unsigned char *) buf) == 0)
+      if (GetDataBlock (fd, (guchar *) buf) == 0)
         ;
 
-      lpos = LM_to_uint (buf[0], buf[1]);
-      tpos = LM_to_uint (buf[2], buf[3]);
-      width = LM_to_uint (buf[4], buf[5]);
-      height = LM_to_uint (buf[6], buf[7]);
-      cellw = buf[8];
-      cellh = buf[9];
+      lpos       = LM_to_uint (buf[0], buf[1]);
+      tpos       = LM_to_uint (buf[2], buf[3]);
+      width      = LM_to_uint (buf[4], buf[5]);
+      height     = LM_to_uint (buf[6], buf[7]);
+      cellw      = buf[8];
+      cellh      = buf[9];
       foreground = buf[10];
       background = buf[11];
 
-      while (GetDataBlock (fd, (unsigned char *) buf) > 0)
+      while (GetDataBlock (fd, (guchar *) buf) > 0)
         {
           PPM_ASSIGN (image[ypos][xpos],
                       cmap[CM_RED][v],
@@ -529,16 +558,17 @@
 #else
       break;
 #endif
+
     case 0xff:                  /* Application Extension */
       str = "Application Extension";
       break;
     case 0xfe:                  /* Comment Extension */
       str = "Comment Extension";
-      while (GetDataBlock (fd, (unsigned char *) buf) > 0)
+      while (GetDataBlock (fd, (guchar *) buf) > 0)
         {
           gchar *comment = (gchar *) buf;
 
-          if (!g_utf8_validate (comment, -1, NULL))
+          if (! g_utf8_validate (comment, -1, NULL))
             continue;
 
           if (comment_parasite)
@@ -550,10 +580,11 @@
         }
       return TRUE;
       break;
+
     case 0xf9:                  /* Graphic Control Extension */
       str = "Graphic Control Extension";
-      (void) GetDataBlock (fd, (unsigned char *) buf);
-      Gif89.disposal = (buf[0] >> 2) & 0x7;
+      (void) GetDataBlock (fd, (guchar *) buf);
+      Gif89.disposal  = (buf[0] >> 2) & 0x7;
       Gif89.inputFlag = (buf[0] >> 1) & 0x1;
       Gif89.delayTime = LM_to_uint (buf[1], buf[2]);
       if ((buf[0] & 0x1) != 0)
@@ -561,13 +592,14 @@
       else
         Gif89.transparent = -1;
 
-      while (GetDataBlock (fd, (unsigned char *) buf) > 0)
-        ;
+      while (GetDataBlock (fd, (guchar *) buf) > 0);
+
       return FALSE;
       break;
+
     default:
-      str = (char *)buf;
-      sprintf ((char *)buf, "UNKNOWN (0x%02x)", label);
+      str = (gchar *)buf;
+      sprintf ((gchar *)buf, "UNKNOWN (0x%02x)", label);
       break;
     }
 
@@ -575,21 +607,20 @@
   g_print ("GIF: got a '%s'\n", str);
 #endif
 
-  while (GetDataBlock (fd, (unsigned char *) buf) > 0)
-    ;
+  while (GetDataBlock (fd, (guchar *) buf) > 0);
 
   return FALSE;
 }
 
-static int ZeroDataBlock = FALSE;
+static gint ZeroDataBlock = FALSE;
 
-static int
-GetDataBlock (FILE          *fd,
-              unsigned char *buf)
+static gint
+GetDataBlock (FILE   *fd,
+              guchar *buf)
 {
-  unsigned char count;
+  guchar count;
 
-  if (!ReadOK (fd, &count, 1))
+  if (! ReadOK (fd, &count, 1))
     {
       g_message ("Error in getting DataBlock size");
       return -1;
@@ -597,7 +628,7 @@
 
   ZeroDataBlock = count == 0;
 
-  if ((count != 0) && (!ReadOK (fd, buf, count)))
+  if ((count != 0) && (! ReadOK (fd, buf, count)))
     {
       g_message ("Error in reading DataBlock");
       return -1;
@@ -606,14 +637,14 @@
   return count;
 }
 
-static int
-GetCode (FILE *fd,
-         int   code_size,
-         int   flag)
+static gint
+GetCode (FILE     *fd,
+         gint      code_size,
+         gboolean  flag)
 {
-  static unsigned char buf[280];
-  static int curbit, lastbit, done, last_byte;
-  int i, j, ret, count;
+  static guchar buf[280];
+  static gint   curbit, lastbit, done, last_byte;
+  gint          i, j, ret, count;
 
   if (flag)
     {
@@ -629,10 +660,8 @@
       if (done)
         {
           if (curbit >= lastbit)
-            {
-              g_message ("Ran off the end of my bits");
-              gimp_quit ();
-            }
+            g_message ("Ran off the end of my bits");
+
           return -1;
         }
 
@@ -656,35 +685,35 @@
   return ret;
 }
 
-static int
+static gint
 LZWReadByte (FILE *fd,
-             int   just_reset_LZW,
-             int   input_code_size)
+             gint  just_reset_LZW,
+             gint  input_code_size)
 {
-  static int fresh = FALSE;
-  int code, incode;
-  static int code_size, set_code_size;
-  static int max_code, max_code_size;
-  static int firstcode, oldcode;
-  static int clear_code, end_code;
-  static int table[2][(1 << MAX_LZW_BITS)];
-  static int stack[(1 << (MAX_LZW_BITS)) * 2], *sp;
-  register int i;
+  static gint fresh = FALSE;
+  gint        code, incode;
+  static gint code_size, set_code_size;
+  static gint max_code, max_code_size;
+  static gint firstcode, oldcode;
+  static gint clear_code, end_code;
+  static gint table[2][(1 << MAX_LZW_BITS)];
+  static gint stack[(1 << (MAX_LZW_BITS)) * 2], *sp;
+  gint        i;
 
   if (just_reset_LZW)
     {
       if (input_code_size > MAX_LZW_BITS)
         {
-          g_message("Value out of range for code size (corrupted file?)");
+          g_message ("Value out of range for code size (corrupted file?)");
           return -1;
         }
 
       set_code_size = input_code_size;
-      code_size = set_code_size + 1;
-      clear_code = 1 << set_code_size;
-      end_code = clear_code + 1;
+      code_size     = set_code_size + 1;
+      clear_code    = 1 << set_code_size;
+      end_code      = clear_code + 1;
       max_code_size = 2 * clear_code;
-      max_code = clear_code + 2;
+      max_code      = clear_code + 2;
 
       GetCode (fd, 0, TRUE);
 
@@ -710,10 +739,10 @@
       fresh = FALSE;
       do
         {
-          firstcode = oldcode =
-            GetCode (fd, code_size, FALSE);
+          firstcode = oldcode = GetCode (fd, code_size, FALSE);
         }
       while (firstcode == clear_code);
+
       return firstcode;
     }
 
@@ -734,18 +763,19 @@
               table[0][i] = 0;
               table[1][i] = 0;
             }
-          code_size = set_code_size + 1;
+
+          code_size     = set_code_size + 1;
           max_code_size = 2 * clear_code;
-          max_code = clear_code + 2;
-          sp = stack;
-          firstcode = oldcode =
-            GetCode (fd, code_size, FALSE);
+          max_code      = clear_code + 2;
+          sp            = stack;
+          firstcode     = oldcode = GetCode (fd, code_size, FALSE);
+
           return firstcode;
         }
       else if (code == end_code)
         {
-          int count;
-          unsigned char buf[260];
+          gint   count;
+          guchar buf[260];
 
           if (ZeroDataBlock)
             return -2;
@@ -755,6 +785,7 @@
 
           if (count != 0)
             g_print ("GIF: missing EOD in data stream (common occurence)");
+
           return -2;
         }
 
@@ -797,6 +828,7 @@
       if (sp > stack)
         return *--sp;
     }
+
   return code;
 }
 
@@ -816,21 +848,21 @@
            guint        screenheight)
 {
   static gint32 image_ID   = -1;
-  static gint frame_number = 1;
+  static gint   frame_number = 1;
 
-  gint32 layer_ID;
-  GimpPixelRgn pixel_rgn;
+  gint32        layer_ID;
+  GimpPixelRgn  pixel_rgn;
   GimpDrawable *drawable;
-  guchar *dest, *temp;
-  guchar c;
-  gint xpos = 0, ypos = 0, pass = 0;
-  gint cur_progress, max_progress;
-  gint v;
-  gint i, j;
-  gchar *framename;
-  gchar *framename_ptr;
-  gboolean alpha_frame = FALSE;
-  static int previous_disposal;
+  guchar       *dest, *temp;
+  guchar        c;
+  gint          xpos = 0, ypos = 0, pass = 0;
+  gint          cur_progress, max_progress;
+  gint          v;
+  gint          i, j;
+  gchar        *framename;
+  gchar        *framename_ptr;
+  gboolean      alpha_frame = FALSE;
+  static gint   previous_disposal;
 
   /* Guard against bogus frame size */
   if (len < 1 || height < 1)
@@ -842,7 +874,7 @@
   /*
    **  Initialize the Compression routines
    */
-  if (!ReadOK (fd, &c, 1))
+  if (! ReadOK (fd, &c, 1))
     {
       g_message ("EOF / read error on image data");
       return -1;
@@ -907,7 +939,7 @@
       gimp_progress_pulse ();
 
        /* If the colourmap is now different, we have to promote to RGB! */
-      if (!promote_to_rgb)
+      if (! promote_to_rgb)
         {
           for (i = 0; i < ncols; i++)
             {
@@ -994,8 +1026,7 @@
   max_progress = height;
 
   if (alpha_frame)
-    dest = (guchar *) g_malloc (len * height *
-                                (promote_to_rgb ? 4 : 2));
+    dest = (guchar *) g_malloc (len * height * (promote_to_rgb ? 4 : 2));
   else
     dest = (guchar *) g_malloc (len * height);
 
@@ -1004,7 +1035,7 @@
              len, height, interlace ? " interlaced" : "", ncols);
 #endif
 
-  if (!alpha_frame && promote_to_rgb)
+  if (! alpha_frame && promote_to_rgb)
     {
       /* I don't see how one would easily construct a GIF in which
          this could happen, but it's a mad mad world. */
@@ -1101,7 +1132,7 @@
         break;
     }
 
-fini:
+ fini:
   if (LZWReadByte (fd, FALSE, c) >= 0)
     g_print ("GIF: too much input data, ignoring extra...\n");
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-gif-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-gif-save.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-gif-save.c	Sun Oct 12 15:38:02 2008
@@ -82,19 +82,22 @@
 
 /* Declare some local functions.
  */
-static void   query                    (void);
-static void   run                      (const gchar      *name,
+static void     query                  (void);
+static void     run                    (const gchar      *name,
                                         gint              nparams,
                                         const GimpParam  *param,
                                         gint             *nreturn_vals,
                                         GimpParam       **return_vals);
-static gint   save_image               (const gchar      *filename,
+
+static gboolean  save_image            (const gchar      *filename,
                                         gint32            image_ID,
                                         gint32            drawable_ID,
-                                        gint32            orig_image_ID);
+                                        gint32            orig_image_ID,
+                                        GError          **error);
 
-static gboolean sanity_check           (const gchar      *filename,
-                                        gint32            image_ID);
+static GimpPDBStatusType sanity_check  (const gchar      *filename,
+                                        gint32            image_ID,
+                                        GError          **error);
 static gboolean bad_bounds_dialog      (void);
 
 static gboolean save_dialog            (gint32            image_ID);
@@ -182,6 +185,7 @@
   static GimpParam  values[2];
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
   GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  GError           *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -210,6 +214,7 @@
         case GIMP_RUN_INTERACTIVE:
         case GIMP_RUN_WITH_LAST_VALS:
           gimp_ui_init (PLUG_IN_BINARY, FALSE);
+
           export = gimp_export_image (&image_ID, &drawable_ID, "GIF",
                                       (GIMP_EXPORT_CAN_HANDLE_INDEXED |
                                        GIMP_EXPORT_CAN_HANDLE_GRAY |
@@ -225,7 +230,9 @@
           break;
         }
 
-      if (sanity_check (filename, image_ID))
+      status = sanity_check (filename, image_ID, &error);
+
+      if (status == GIMP_PDB_SUCCESS)
         {
           switch (run_mode)
             {
@@ -266,9 +273,8 @@
           if (status == GIMP_PDB_SUCCESS)
             {
               if (save_image (param[3].data.d_string,
-                              image_ID,
-                              drawable_ID,
-                              orig_image_ID))
+                              image_ID, drawable_ID, orig_image_ID,
+                              &error))
                 {
                   /*  Store psvals data  */
                   gimp_set_data (SAVE_PROC, &gsvals, sizeof (GIFSaveVals));
@@ -279,17 +285,18 @@
                 }
             }
         }
-      else
-        /* Some layers were out of bounds and the user wishes
-          to abort.  */
-        {
-          status = GIMP_PDB_CANCEL;
-        }
 
       if (export == GIMP_EXPORT_EXPORT)
         gimp_image_delete (image_ID);
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -535,9 +542,10 @@
 }
 
 
-static gboolean
-sanity_check (const gchar *filename,
-              gint32       image_ID)
+static GimpPDBStatusType
+sanity_check (const gchar  *filename,
+              gint32        image_ID,
+              GError      **error)
 {
   gint32 *layers;
   gint    nlayers;
@@ -550,9 +558,13 @@
 
   if (image_width > G_MAXUSHORT || image_height > G_MAXUSHORT)
     {
-      g_message (_("Unable to save '%s'.  The GIF file format does not support images that are more than %d pixels wide or tall."),
-                 gimp_filename_to_utf8 (filename), G_MAXUSHORT);
-      return FALSE;
+      g_set_error (error, 0, 0,
+                   _("Unable to save '%s'.  "
+                   "The GIF file format does not support images that are "
+                   "more than %d pixels wide or tall."),
+                   gimp_filename_to_utf8 (filename), G_MAXUSHORT);
+
+      return GIMP_PDB_EXECUTION_ERROR;
     }
 
   /*** Iterate through the layers to make sure they're all ***/
@@ -577,30 +589,32 @@
           /* Image has illegal bounds - ask the user what it wants to do */
 
           /* Do the crop if we can't talk to the user, or if we asked
-           * the user and they said yes. */
+           * the user and they said yes.
+           */
           if ((run_mode == GIMP_RUN_NONINTERACTIVE) || bad_bounds_dialog ())
             {
               gimp_image_crop (image_ID, image_width, image_height, 0, 0);
-              return TRUE;
+              return GIMP_PDB_SUCCESS;
             }
           else
             {
-              return FALSE;
+              return GIMP_PDB_CANCEL;
             }
         }
     }
 
   g_free (layers);
 
-  return TRUE;
+  return GIMP_PDB_SUCCESS;
 }
 
 
-static gint
+static gboolean
 save_image (const gchar *filename,
             gint32       image_ID,
             gint32       drawable_ID,
-            gint32       orig_image_ID)
+            gint32       orig_image_ID,
+            GError     **error)
 {
   GimpPixelRgn pixel_rgn;
   GimpDrawable *drawable;
@@ -743,8 +757,9 @@
   outfile = g_fopen (filename, "wb");
   if (!outfile)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-gih.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-gih.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-gih.c	Sun Oct 12 15:38:02 2008
@@ -99,13 +99,13 @@
 
 static gint num_useable_layers;
 
-static gchar *selection_modes[] = {"incremental",
-                                   "angular",
-                                   "random",
-                                   "velocity",
-                                   "pressure",
-                                   "xtilt",
-                                   "ytilt"};
+static const gchar *selection_modes[] = { "incremental",
+                                          "angular",
+                                          "random",
+                                          "velocity",
+                                          "pressure",
+                                          "xtilt",
+                                          "ytilt" };
 
 static GimpPixPipeParams gihparams;
 
@@ -139,18 +139,20 @@
 			gint             *nreturn_vals,
 			GimpParam       **return_vals);
 
-static gint32    gih_load_image      (const gchar  *filename);
-static gboolean  gih_load_one_brush  (gint          fd,
-				      gint32        image_ID);
-
-static gboolean  gih_save_dialog     (gint32        image_ID);
-static gboolean  gih_save_one_brush  (gint          fd,
-				      GimpPixelRgn *pixel_rgn,
-				      gchar        *name);
-static gboolean  gih_save_image      (const gchar  *filename,
-				      gint32        image_ID,
-				      gint32        orig_image_ID,
-				      gint32        drawable_ID);
+static gint32    gih_load_image      (const gchar   *filename,
+                                      GError       **error);
+static gboolean  gih_load_one_brush  (gint           fd,
+				      gint32         image_ID);
+
+static gboolean  gih_save_dialog     (gint32         image_ID);
+static gboolean  gih_save_one_brush  (gint           fd,
+				      GimpPixelRgn  *pixel_rgn,
+				      gchar         *name);
+static gboolean  gih_save_image      (const gchar   *filename,
+				      gint32         image_ID,
+				      gint32         orig_image_ID,
+				      gint32         drawable_ID,
+                                      GError       **error);
 
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -258,6 +260,7 @@
   gchar             *layer_name;
   gint               i;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -271,7 +274,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = gih_load_image (param[1].data.d_string);
+      image_ID = gih_load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -337,7 +340,8 @@
 	  if (gihparams.rows < 1) gihparams.rows = 1;
 	  if (gihparams.cols < 1) gihparams.cols = 1;
 
-	  gihparams.ncells = num_useable_layers * gihparams.rows * gihparams.cols;
+	  gihparams.ncells = (num_useable_layers *
+                              gihparams.rows * gihparams.cols);
 
 	  if (gihparams.cellwidth == 1 && gihparams.cellheight == 1)
 	    {
@@ -409,7 +413,7 @@
       if (status == GIMP_PDB_SUCCESS)
 	{
 	  if (gih_save_image (param[3].data.d_string,
-			      image_ID, orig_image_ID, drawable_ID))
+			      image_ID, orig_image_ID, drawable_ID, &error))
 	    {
 	      gimp_set_data (SAVE_PROC, &info, sizeof (info));
 	    }
@@ -427,6 +431,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -489,7 +500,7 @@
       name = g_new (gchar, bn_size);
       if ((read (fd, name, bn_size)) < bn_size)
 	{
-	  g_message (_("Error in GIMP brush pipe file."));
+          g_message (_("Error in GIMP brush pipe file."));
 	  g_free (name);
 	  return FALSE;
 	}
@@ -630,7 +641,8 @@
 }
 
 static gint32
-gih_load_image (const gchar *filename)
+gih_load_image (const gchar  *filename,
+                GError      **error)
 {
   gint     fd;
   gint     i;
@@ -646,8 +658,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -700,7 +713,9 @@
     {
       if (! gih_load_one_brush (fd, image_ID))
 	{
-	  g_message (_("Couldn't load one brush in the pipe, giving up."));
+	  g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       "%s",
+                       _("Couldn't load one brush in the pipe, giving up."));
 	  close (fd);
 	  g_free (name);
 	  g_string_free (buffer, TRUE);
@@ -891,7 +906,7 @@
    * Spacing: __
    */
   spinbutton = gimp_spin_button_new (&adjustment, info.spacing,
-				     1, 1000, 1, 10, 10, 1, 0);
+				     1, 1000, 1, 10, 0, 1, 0);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
 			     _("Spacing (percent):"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -921,7 +936,7 @@
 
   spinbutton = gimp_spin_button_new (&adjustment,
 				     gihparams.cellwidth,
-				     2, gimp_image_width (image_ID), 1, 1, 1,
+				     2, gimp_image_width (image_ID), 1, 10, 0,
 				     1, 0);
   gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
@@ -944,7 +959,7 @@
 
   spinbutton = gimp_spin_button_new (&adjustment,
 				     gihparams.cellheight,
-				     2, gimp_image_height (image_ID), 1, 1, 1,
+				     2, gimp_image_height (image_ID), 1, 10, 0,
 				     1, 0);
   gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
@@ -974,7 +989,7 @@
    * Number of cells: ___
    */
   spinbutton = gimp_spin_button_new (&adjustment,
-				     gihparams.ncells, 1, 1000, 1, 10, 10,
+				     gihparams.ncells, 1, 1000, 1, 10, 0,
 				     1, 0);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
 			     _("Number of cells:"), 0.0, 0.5,
@@ -1034,7 +1049,7 @@
    * Dimension: ___
    */
   spinbutton = gimp_spin_button_new (&adjustment, gihparams.dim,
-				     1, GIMP_PIXPIPE_MAXDIM, 1, 1, 1, 1, 0);
+				     1, GIMP_PIXPIPE_MAXDIM, 1, 1, 0, 1, 0);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
 			     _("Dimension:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -1054,7 +1069,7 @@
       gint j;
 
       spinbutton = gimp_spin_button_new (&adjustment,
-					 gihparams.rank[i], 1, 100, 1, 1, 1,
+					 gihparams.rank[i], 1, 100, 1, 1, 0,
 					 1, 0);
       gtk_table_attach (GTK_TABLE (dimtable), spinbutton, 0, 1, i, i + 1,
 			GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -1228,21 +1243,22 @@
 }
 
 static gboolean
-gih_save_image (const gchar *filename,
-		gint32       image_ID,
-		gint32       orig_image_ID,
-		gint32       drawable_ID)
+gih_save_image (const gchar  *filename,
+		gint32        image_ID,
+		gint32        orig_image_ID,
+		gint32        drawable_ID,
+                GError      **error)
 {
   GimpDrawable *drawable;
   GimpPixelRgn  pixel_rgn;
   GimpParasite *pipe_parasite;
-  gchar *header;
-  gchar *parstring;
+  gchar  *header;
+  gchar  *parstring;
   gint32 *layer_ID;
-  gint fd;
-  gint nlayers, layer, row, col;
-  gint imagew, imageh, offsetx, offsety;
-  gint k, x, y, thisx, thisy, xnext, ynext, thisw, thish;
+  gint    fd;
+  gint    nlayers, layer, row, col;
+  gint    imagew, imageh, offsetx, offsety;
+  gint    k, x, y, thisx, thisy, xnext, ynext, thisw, thish;
 
   if (gihparams.ncells < 1)
     return FALSE;
@@ -1255,8 +1271,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-header.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-header.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-header.c	Sun Oct 12 15:38:02 2008
@@ -34,15 +34,15 @@
 
 /* Declare some local functions.
  */
-static void   query      (void);
-static void   run        (const gchar      *name,
-                          gint              nparams,
-                          const GimpParam  *param,
-                          gint             *nreturn_vals,
-                          GimpParam       **return_vals);
-static gint   save_image (const gchar      *filename,
-			  gint32            image_ID,
-			  gint32            drawable_ID);
+static void       query      (void);
+static void       run        (const gchar      *name,
+                              gint              nparams,
+                              const GimpParam  *param,
+                              gint             *nreturn_vals,
+                              GimpParam       **return_vals);
+static gboolean   save_image (const gchar      *filename,
+                              gint32            image_ID,
+                              gint32            drawable_ID);
 
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -94,9 +94,6 @@
   static GimpParam  values[2];
   GimpRunMode       run_mode;
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
 
   run_mode = param[0].data.d_int32;
 
@@ -109,6 +106,10 @@
 
   if (strcmp (name, SAVE_PROC) == 0)
     {
+      gint32           image_ID;
+      gint32           drawable_ID;
+      GimpExportReturn export = GIMP_EXPORT_CANCEL;
+
       image_ID    = param[1].data.d_int32;
       drawable_ID = param[2].data.d_int32;
 
@@ -127,6 +128,7 @@
 	      return;
 	    }
 	  break;
+
 	default:
 	  break;
 	}
@@ -147,7 +149,7 @@
   values[0].data.d_status = status;
 }
 
-static int
+static gboolean
 save_image (const gchar *filename,
 	    gint32       image_ID,
 	    gint32       drawable_ID)
@@ -155,16 +157,16 @@
   GimpPixelRgn   pixel_rgn;
   GimpDrawable  *drawable;
   GimpImageType  drawable_type;
-  FILE *fp;
-  gint x, y, b, c;
-  gchar *backslash = "\\\\";
-  gchar *quote = "\\\"";
-  gchar *newline = "\"\n\t\"";
-  gchar buf[4];
-  guchar *d = NULL;
-  guchar *data;
-  guchar *cmap;
-  gint colors;
+  FILE          *fp;
+  gint           x, y, b, c;
+  const gchar   *backslash = "\\\\";
+  const gchar   *quote     = "\\\"";
+  const gchar   *newline   = "\"\n\t\"";
+  gchar          buf[4];
+  guchar        *d         = NULL;
+  guchar        *data;
+  guchar        *cmap;
+  gint           colors;
 
   if ((fp = g_fopen (filename, "w")) == NULL)
     return FALSE;
@@ -179,10 +181,16 @@
   fprintf (fp, "static unsigned int width = %d;\n", drawable->width);
   fprintf (fp, "static unsigned int height = %d;\n\n", drawable->height);
   fprintf (fp, "/*  Call this macro repeatedly.  After each use, the pixel data can be extracted  */\n\n");
+
   switch (drawable_type)
     {
     case GIMP_RGB_IMAGE:
-      fprintf (fp, "#define HEADER_PIXEL(data,pixel) {\\\n  pixel[0] = (((data[0] - 33) << 2) | ((data[1] - 33) >> 4)); \\\n  pixel[1] = ((((data[1] - 33) & 0xF) << 4) | ((data[2] - 33) >> 2)); \\\n  pixel[2] = ((((data[2] - 33) & 0x3) << 6) | ((data[3] - 33))); \\\n  data += 4; \\\n}\n");
+      fprintf (fp,
+               "#define HEADER_PIXEL(data,pixel) {\\\n"
+               "pixel[0] = (((data[0] - 33) << 2) | ((data[1] - 33) >> 4)); \\\n"
+               "pixel[1] = ((((data[1] - 33) & 0xF) << 4) | ((data[2] - 33) >> 2)); \\\n"
+               "pixel[2] = ((((data[2] - 33) & 0x3) << 6) | ((data[3] - 33))); \\\n"
+               "data += 4; \\\n}\n");
       fprintf (fp, "static char *header_data =\n\t\"");
 
       data = g_new (guchar, drawable->width * drawable->bpp);
@@ -191,6 +199,7 @@
       for (y = 0; y < drawable->height; y++)
 	{
 	  gimp_pixel_rgn_get_row (&pixel_rgn, data, 0, y, drawable->width);
+
 	  for (x = 0; x < drawable->width; x++)
 	    {
 	      d = data + x * drawable->bpp;
@@ -201,12 +210,14 @@
 	      buf[3] = (d[2] & 0x3F) + 33;
 
 	      for (b = 0; b < 4; b++)
-		if (buf[b] == '"')
-		  fwrite (quote, 1, 2, fp);
-		else if (buf[b] == '\\')
-		  fwrite (backslash, 1, 2, fp);
-		else
-		  fwrite (buf + b, 1, 1, fp);
+                {
+                  if (buf[b] == '"')
+                    fwrite (quote, 1, 2, fp);
+                  else if (buf[b] == '\\')
+                    fwrite (backslash, 1, 2, fp);
+                  else
+                    fwrite (buf + b, 1, 1, fp);
+                }
 
 	      c++;
 	      if (c >= 16)
@@ -216,24 +227,33 @@
 		}
 	    }
 	}
+
       fprintf (fp, "\";\n");
       break;
 
     case GIMP_INDEXED_IMAGE:
-      fprintf (fp, "#define HEADER_PIXEL(data,pixel) {\\\n  pixel[0] = header_data_cmap[(unsigned char)data[0]][0]; \\\n  pixel[1] = header_data_cmap[(unsigned char)data[0]][1]; \\\n  pixel[2] = header_data_cmap[(unsigned char)data[0]][2]; \\\n  data ++; }\n\n");
+      fprintf (fp,
+               "#define HEADER_PIXEL(data,pixel) {\\\n"
+               "pixel[0] = header_data_cmap[(unsigned char)data[0]][0]; \\\n"
+               "pixel[1] = header_data_cmap[(unsigned char)data[0]][1]; \\\n"
+               "pixel[2] = header_data_cmap[(unsigned char)data[0]][2]; \\\n"
+               "data ++; }\n\n");
       /* save colormap */
       cmap = gimp_image_get_colormap (image_ID, &colors);
 
       fprintf (fp, "static char header_data_cmap[256][3] = {");
-      fprintf(fp, "\n\t{%3d,%3d,%3d}", (int)cmap[0], (int)cmap[1], (int)cmap[2]);
+      fprintf (fp, "\n\t{%3d,%3d,%3d}", (int)cmap[0], (int)cmap[1], (int)cmap[2]);
+
       for (c = 1; c < colors; c++)
-        fprintf(fp, ",\n\t{%3d,%3d,%3d}", (int)cmap[3*c], (int)cmap[3*c+1], (int)cmap[3*c+2]);
+        fprintf (fp, ",\n\t{%3d,%3d,%3d}", (int)cmap[3*c], (int)cmap[3*c+1], (int)cmap[3*c+2]);
+
       /* fill the rest */
       for ( ; c < 256; c++)
-        fprintf(fp, ",\n\t{255,255,255}");
+        fprintf (fp, ",\n\t{255,255,255}");
+
       /* close bracket */
-      fprintf(fp, "\n\t};\n");
-      g_free(cmap);
+      fprintf (fp, "\n\t};\n");
+      g_free (cmap);
 
       /* save image */
       fprintf (fp, "static char header_data[] = {\n\t");
@@ -244,11 +264,12 @@
       for (y = 0; y < drawable->height; y++)
         {
           gimp_pixel_rgn_get_row (&pixel_rgn, data, 0, y, drawable->width);
+
           for (x = 0; x < drawable->width-1; x++)
 	    {
 	      d = data + x * drawable->bpp;
 
-              fprintf(fp, "%d,", (int)d[0]);
+              fprintf (fp, "%d,", (int)d[0]);
 
 	      c++;
 	      if (c >= 16)
@@ -259,17 +280,19 @@
 	    }
 
           if (y != drawable->height - 1)
-            fprintf(fp, "%d,\n\t", (int)d[1]);
+            fprintf (fp, "%d,\n\t", (int)d[1]);
           else
-            fprintf(fp, "%d\n\t", (int)d[1]);
+            fprintf (fp, "%d\n\t", (int)d[1]);
+
           c = 0; /* reset line counter */
         }
       fprintf (fp, "};\n");
       break;
+
     default:
       g_warning ("unhandled drawable type (%d)", drawable_type);
       return FALSE;
-    } /* switch (drawable_type) */
+    }
 
   fclose (fp);
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-html-table.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-html-table.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-html-table.c	Sun Oct 12 15:38:02 2008
@@ -108,7 +108,8 @@
                                           GimpParam       **return_vals);
 
 static gboolean save_image               (const gchar      *filename,
-                                          GimpDrawable     *drawable);
+                                          GimpDrawable     *drawable,
+                                          GError          **error);
 static gboolean save_dialog              (gint32            image_ID);
 
 static gboolean color_comp               (guchar           *buffer,
@@ -172,6 +173,7 @@
   static GimpParam   values[2];
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   GimpDrawable      *drawable;
+  GError            *error  = NULL;
 
   INIT_I18N ();
 
@@ -187,7 +189,7 @@
 
   if (save_dialog (param[1].data.d_int32))
     {
-      if (save_image (param[3].data.d_string, drawable))
+      if (save_image (param[3].data.d_string, drawable, &error))
 	{
 	  gimp_set_data (SAVE_PROC, &gtmvals, sizeof (GTMValues));
 	}
@@ -201,12 +203,20 @@
       status = GIMP_PDB_CANCEL;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gboolean
-save_image (const gchar  *filename,
-	    GimpDrawable *drawable)
+save_image (const gchar   *filename,
+	    GimpDrawable  *drawable,
+            GError       **error)
 {
   gint          row,col, cols, rows, x, y;
   gint          colcount, colspan, rowspan;
@@ -222,8 +232,9 @@
 
   if (! fp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-mng.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-mng.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-mng.c	Sun Oct 12 15:38:02 2008
@@ -172,43 +172,45 @@
  * Function prototypes
  */
 
-static mng_ptr  myalloc       (mng_size_t  size);
-static void     myfree        (mng_ptr     ptr,
-                               mng_size_t  size);
-static mng_bool myopenstream  (mng_handle  handle);
-static mng_bool myclosestream (mng_handle  handle);
-static mng_bool mywritedata   (mng_handle  handle,
-                               mng_ptr     buf,
-                               mng_uint32  size,
-                               mng_uint32 *written_size);
-
-
-static gint32   parse_chunks_type_from_layer_name   (const gchar *str);
-static gint32   parse_disposal_type_from_layer_name (const gchar *str);
-static gint32   parse_ms_tag_from_layer_name        (const gchar *str);
-static gint     find_unused_ia_colour               (guchar      *pixels,
-                                                     gint         numpixels,
-                                                     gint        *colors);
-static gboolean ia_has_transparent_pixels           (guchar      *pixels,
-                                                     gint         numpixels);
-
-
-static gboolean respin_cmap     (png_structp       png_ptr,
-                                 png_infop         png_info_ptr,
-                                 guchar           *remap,
-                                 gint32            image_id,
-                                 GimpDrawable     *drawable);
-static gboolean mng_save_image  (const gchar      *filename,
-                                 gint32            image_id,
-                                 gint32            drawable_id,
-                                 gint32            original_image_id);
-static gint     mng_save_dialog (gint32            image_id);
-static void     query           (void);
-static void     run             (const gchar      *name,
-                                 gint              nparams,
-                                 const GimpParam  *param,
-                                 gint             *nreturn_vals,
-                                 GimpParam       **return_vals);
+static mng_ptr   myalloc       (mng_size_t  size);
+static void      myfree        (mng_ptr     ptr,
+                                mng_size_t  size);
+static mng_bool  myopenstream  (mng_handle  handle);
+static mng_bool  myclosestream (mng_handle  handle);
+static mng_bool  mywritedata   (mng_handle  handle,
+                                mng_ptr     buf,
+                                mng_uint32  size,
+                                mng_uint32 *written_size);
+
+
+static gint32    parse_chunks_type_from_layer_name   (const gchar *str);
+static gint32    parse_disposal_type_from_layer_name (const gchar *str);
+static gint32    parse_ms_tag_from_layer_name        (const gchar *str);
+static gint      find_unused_ia_colour               (guchar      *pixels,
+                                                      gint         numpixels,
+                                                      gint        *colors);
+static gboolean  ia_has_transparent_pixels           (guchar      *pixels,
+                                                      gint         numpixels);
+
+static gboolean  respin_cmap     (png_structp       png_ptr,
+                                  png_infop         png_info_ptr,
+                                  guchar           *remap,
+                                  gint32            image_id,
+                                  GimpDrawable     *drawable);
+
+static gboolean  mng_save_image  (const gchar      *filename,
+                                  gint32            image_id,
+                                  gint32            drawable_id,
+                                  gint32            original_image_id,
+                                  GError          **error);
+static gboolean  mng_save_dialog (gint32            image_id);
+
+static void      query           (void);
+static void      run             (const gchar      *name,
+                                  gint              nparams,
+                                  const GimpParam  *param,
+                                  gint             *nreturn_vals,
+                                  GimpParam       **return_vals);
 
 
 /*
@@ -505,10 +507,11 @@
 
 
 static gboolean
-mng_save_image (const gchar *filename,
-                gint32       image_id,
-                gint32       drawable_id,
-                gint32       original_image_id)
+mng_save_image (const gchar  *filename,
+                gint32        image_id,
+                gint32        drawable_id,
+                gint32        original_image_id,
+                GError      **error)
 {
   gboolean        ret = FALSE;
   gint            rows, cols;
@@ -568,8 +571,9 @@
 
   if (NULL == userdata->fp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       goto err;
     }
 
@@ -655,7 +659,7 @@
                              MNG_BACKGROUNDCOLOR_MANDATORY,
                              0, MNG_BACKGROUNDIMAGE_NOTILE) != MNG_NOERROR)
         {
-          g_warning("Unable to mng_putchunk_back() in mng_save_image()");
+          g_warning ("Unable to mng_putchunk_back() in mng_save_image()");
           goto err3;
         }
 
@@ -663,7 +667,7 @@
                              gimp_rgb_luminance_uchar (&bgcolor),
                              red, green, blue) != MNG_NOERROR)
         {
-          g_warning("Unable to mng_putchunk_bkgd() in mng_save_image()");
+          g_warning ("Unable to mng_putchunk_bkgd() in mng_save_image()");
           goto err3;
         }
     }
@@ -691,7 +695,7 @@
                              (mng_uint32) (xres * 39.37),
                              (mng_uint32) (yres * 39.37), 1) != MNG_NOERROR)
         {
-          g_warning("Unable to mng_putchunk_phyg() in mng_save_image()");
+          g_warning ("Unable to mng_putchunk_phyg() in mng_save_image()");
           goto err3;
         }
 
@@ -699,7 +703,7 @@
                              (mng_uint32) (xres * 39.37),
                              (mng_uint32) (yres * 39.37), 1) != MNG_NOERROR)
         {
-          g_warning("Unable to mng_putchunk_phys() in mng_save_image()");
+          g_warning ("Unable to mng_putchunk_phys() in mng_save_image()");
           goto err3;
         }
     }
@@ -901,9 +905,10 @@
 
       if ((outfile = g_fopen (temp_file_name, "wb")) == NULL)
         {
-          g_message (_("Could not open '%s' for writing: %s"),
-                     gimp_filename_to_utf8 (temp_file_name),
-                     g_strerror (errno));
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for writing: %s"),
+                       gimp_filename_to_utf8 (temp_file_name),
+                       g_strerror (errno));
           g_unlink (temp_file_name);
           goto err3;
         }
@@ -1064,9 +1069,10 @@
       infile = g_fopen (temp_file_name, "rb");
       if (NULL == infile)
         {
-          g_message (_("Could not open '%s' for reading: %s"),
-                     gimp_filename_to_utf8 (temp_file_name),
-                     g_strerror (errno));
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for reading: %s"),
+                       gimp_filename_to_utf8 (temp_file_name),
+                       g_strerror (errno));
           g_unlink (temp_file_name);
           goto err3;
         }
@@ -1226,7 +1232,7 @@
 
 /* The interactive dialog. */
 
-static gint
+static gboolean
 mng_save_dialog (gint32 image_id)
 {
   GtkWidget *dialog;
@@ -1245,7 +1251,6 @@
   gint       num_layers;
   gboolean   run;
 
-
   dialog = gimp_dialog_new (_("Save as MNG"), PLUG_IN_BINARY,
                             NULL, 0,
                             gimp_standard_help_func, SAVE_PROC,
@@ -1540,7 +1545,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam values[1];
+  static GimpParam values[2];
 
   INIT_I18N ();
 
@@ -1551,14 +1556,11 @@
 
   if (strcmp (name, SAVE_PROC) == 0)
     {
-      GimpRunMode      run_mode;
-      gint32           image_id, original_image_id;
-      gint32           drawable_id;
-      GimpExportReturn export = GIMP_EXPORT_IGNORE;
-
-      run_mode = param[0].data.d_int32;
-      image_id = original_image_id = param[1].data.d_int32;
-      drawable_id = param[2].data.d_int32;
+      GimpRunMode      run_mode          = param[0].data.d_int32;
+      gint32           image_id          = param[1].data.d_int32;
+      gint32           original_image_id = image_id;
+      gint32           drawable_id       = param[2].data.d_int32;
+      GimpExportReturn export            = GIMP_EXPORT_IGNORE;
 
       if ((run_mode == GIMP_RUN_INTERACTIVE)
           || (run_mode == GIMP_RUN_WITH_LAST_VALS))
@@ -1575,9 +1577,10 @@
         }
 
       if (export == GIMP_EXPORT_CANCEL)
-        values[0].data.d_status = GIMP_PDB_CANCEL;
-      else if ((export == GIMP_EXPORT_IGNORE)
-               || (export == GIMP_EXPORT_EXPORT))
+        {
+          values[0].data.d_status = GIMP_PDB_CANCEL;
+        }
+      else if (export == GIMP_EXPORT_IGNORE || export == GIMP_EXPORT_EXPORT)
         {
           if (run_mode == GIMP_RUN_INTERACTIVE)
             {
@@ -1656,12 +1659,25 @@
 
           if (values[0].data.d_status == GIMP_PDB_SUCCESS)
             {
+              GError *error = NULL;
+
               if (mng_save_image (param[3].data.d_string,
                                   image_id, drawable_id,
-                                  original_image_id))
-                gimp_set_data (SAVE_PROC, &mng_data, sizeof (mng_data));
+                                  original_image_id, &error))
+                {
+                  gimp_set_data (SAVE_PROC, &mng_data, sizeof (mng_data));
+                }
               else
-                values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+                {
+                  values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+
+                  if (error)
+                    {
+                      *nreturn_vals = 2;
+                      values[1].type          = GIMP_PDB_STRING;
+                      values[1].data.d_string = error->message;
+                    }
+                }
             }
 
           if (export == GIMP_EXPORT_EXPORT)
@@ -1670,10 +1686,13 @@
 
     }
   else
-    values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+    {
+      values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
+    }
 }
 
 
+
 /* Only query and run are implemented by this plug-in. */
 
 const GimpPlugInInfo PLUG_IN_INFO =

Modified: branches/soc-2008-tagging/plug-ins/common/file-pat.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-pat.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-pat.c	Sun Oct 12 15:38:02 2008
@@ -63,10 +63,12 @@
 				  const GimpParam  *param,
 				  gint             *nreturn_vals,
 				  GimpParam       **return_vals);
-static gint32     load_image     (const gchar      *filename);
+static gint32     load_image     (const gchar      *filename,
+                                  GError          **error);
 static gboolean   save_image     (const gchar      *filename,
 				  gint32            image_ID,
-				  gint32            drawable_ID);
+				  gint32            drawable_ID,
+                                  GError          **error);
 
 static gboolean   save_dialog    (void);
 
@@ -159,12 +161,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -178,7 +181,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -261,7 +264,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+	  if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
 	    {
 	      gimp_set_data (SAVE_PROC, description, sizeof (description));
 	    }
@@ -291,11 +295,19 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint              fd;
   PatternHeader     ph;
@@ -314,8 +326,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -429,9 +442,10 @@
 }
 
 static gboolean
-save_image (const gchar *filename,
-	    gint32       image_ID,
-	    gint32       drawable_ID)
+save_image (const gchar  *filename,
+	    gint32        image_ID,
+	    gint32        drawable_ID,
+            GError      **error)
 {
   gint          fd;
   PatternHeader ph;
@@ -444,8 +458,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-pcx.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-pcx.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-pcx.c	Sun Oct 12 15:38:02 2008
@@ -46,7 +46,9 @@
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
 
-static gint32 load_image (const gchar      *filename);
+static gint32 load_image (const gchar      *filename,
+                          GError          **error);
+
 static void   load_1     (FILE             *fp,
                           gint              width,
                           gint              height,
@@ -73,7 +75,9 @@
 
 static gint   save_image (const gchar      *filename,
                           gint32            image,
-                          gint32            layer);
+                          gint32            layer,
+                          GError          **error);
+
 static void   save_8     (FILE             *fp,
                           gint              width,
                           gint              height,
@@ -162,12 +166,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -181,7 +186,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -205,6 +210,7 @@
         case GIMP_RUN_INTERACTIVE:
         case GIMP_RUN_WITH_LAST_VALS:
           gimp_ui_init (PLUG_IN_BINARY, FALSE);
+
           export = gimp_export_image (&image_ID, &drawable_ID, "PCX",
                                       (GIMP_EXPORT_CAN_HANDLE_RGB |
                                        GIMP_EXPORT_CAN_HANDLE_GRAY |
@@ -238,7 +244,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (! save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (! save_image (param[3].data.d_string, image_ID, drawable_ID,
+                            &error))
             {
               status = GIMP_PDB_EXECUTION_ERROR;
             }
@@ -252,6 +259,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -327,7 +341,8 @@
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   FILE         *fd;
   GimpDrawable *drawable;
@@ -339,10 +354,12 @@
   guint8        header_buf[128];
 
   fd = g_fopen (filename, "rb");
-  if (!fd)
+
+  if (! fd)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -351,8 +368,9 @@
 
   if (fread (header_buf, 128, 1, fd) == 0)
     {
-      g_message (_("Could not read header from '%s'"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not read header from '%s'"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -360,8 +378,9 @@
 
   if (pcx_header.manufacturer != 10)
     {
-      g_message (_("'%s' is not a PCX file"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a PCX file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -582,9 +601,10 @@
 }
 
 static gint
-save_image (const gchar *filename,
-            gint32       image,
-            gint32       layer)
+save_image (const gchar  *filename,
+            gint32        image,
+            gint32        layer,
+            GError      **error)
 {
   FILE          *fp;
   GimpPixelRgn   pixel_rgn;
@@ -642,8 +662,9 @@
 
   if ((fp = g_fopen (filename, "wb")) == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 
@@ -727,10 +748,12 @@
 
   if (fclose (fp) != 0)
     {
-      g_message (_("Writing to file '%s' failed: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Writing to file '%s' failed: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
+
   return TRUE;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-pdf.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-pdf.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-pdf.c	Sun Oct 12 15:38:02 2008
@@ -77,7 +77,8 @@
 static gboolean          load_dialog       (PopplerDocument        *doc,
                                             PdfSelectedPages       *pages);
 
-static PopplerDocument * open_document     (const gchar            *filename);
+static PopplerDocument * open_document     (const gchar            *filename,
+                                            GError                **error);
 
 static GdkPixbuf *       get_thumbnail     (PopplerDocument        *doc,
                                             gint                    page,
@@ -327,6 +328,7 @@
   GimpPDBStatusType status   = GIMP_PDB_SUCCESS;
   gint32            image_ID = -1;
   PopplerDocument  *doc      = NULL;
+  GError           *error    = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -351,7 +353,7 @@
           /* Possibly retrieve last settings */
           gimp_get_data (LOAD_PROC, &loadvals);
 
-          doc = open_document (param[1].data.d_string);
+          doc = open_document (param[1].data.d_string, &error);
 
           if (!doc)
             {
@@ -371,7 +373,7 @@
           break;
 
         case GIMP_RUN_NONINTERACTIVE:
-          doc = open_document (param[1].data.d_string);
+          doc = open_document (param[1].data.d_string, &error);
 
           if (doc)
             {
@@ -392,8 +394,9 @@
                 }
             }
           else
-            status = GIMP_PDB_EXECUTION_ERROR;
-
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+            }
           break;
         }
 
@@ -439,7 +442,7 @@
           /* Possibly retrieve last settings */
           gimp_get_data (LOAD_PROC, &loadvals);
 
-          doc = open_document (param[0].data.d_string);
+          doc = open_document (param[0].data.d_string, &error);
 
           if (doc)
             {
@@ -499,37 +502,46 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static PopplerDocument*
-open_document (const gchar *filename)
+open_document (const gchar  *filename,
+               GError      **load_error)
 {
   PopplerDocument *doc;
-  GError          *err = NULL;
   gchar           *uri;
+  GError          *error = NULL;
 
-  uri = g_filename_to_uri (filename, NULL, &err);
+  uri = g_filename_to_uri (filename, NULL, &error);
 
-  if (err)
+  if (! uri)
     {
-      g_warning ("Could not convert '%s' to an URI: %s",
-                 gimp_filename_to_utf8 (filename),
-                 err->message);
-
+      g_set_error (load_error, 0, 0,
+                   "Could not convert '%s' to an URI: %s",
+                   gimp_filename_to_utf8 (filename), error->message);
+      g_error_free (error);
       return NULL;
     }
 
-  doc = poppler_document_new_from_file (uri, NULL, &err);
+  doc = poppler_document_new_from_file (uri, NULL, &error);
 
   g_free (uri);
 
-  if (err)
+  if (! doc)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename),
-                 err->message);
-
+      g_set_error (load_error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename),
+                   error->message);
+      g_error_free (error);
       return NULL;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-pix.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-pix.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-pix.c	Sun Oct 12 15:38:02 2008
@@ -81,10 +81,12 @@
 
 /* Local Helper Functions */
 
-static gint32   load_image (const gchar     *filename);
+static gint32   load_image (const gchar     *filename,
+                            GError         **error);
 static gboolean save_image (const gchar     *filename,
 			    gint32           image_ID,
-			    gint32           drawable_ID);
+			    gint32           drawable_ID,
+                            GError         **error);
 
 static guint16  get_short  (FILE            *file);
 static void     put_short  (guint16          value,
@@ -188,6 +190,7 @@
   gint32            image_ID;
   gint32            drawable_ID;
   GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  GError           *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -201,7 +204,7 @@
   if (strcmp (name, LOAD_PROC) == 0)
     {
       /* Perform the image load */
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -242,7 +245,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID))
+	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID,
+                            &error))
 	    {
 	      status = GIMP_PDB_EXECUTION_ERROR;
 	    }
@@ -256,6 +260,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -306,7 +317,8 @@
  */
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint       i, j, tile_height, row;
   FILE      *file = NULL;
@@ -324,10 +336,12 @@
   PIX_DEBUG_PRINT ("Opening file: %s\n", filename);
 
   file = g_fopen (filename, "rb");
-  if (NULL == file)
+
+  if (! file)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -480,9 +494,10 @@
  */
 
 static gboolean
-save_image (const gchar *filename,
-	    gint32       image_ID,
-	    gint32       drawable_ID)
+save_image (const gchar  *filename,
+	    gint32        image_ID,
+	    gint32        drawable_ID,
+            GError      **error)
 {
   gint       depth, i, j, row, tile_height, writelen, rectHeight;
   gboolean   savingColor = TRUE;
@@ -503,10 +518,11 @@
 
   /* Open the output file. */
   file = g_fopen (filename, "wb");
-  if (!file)
+  if (! file)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-png.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-png.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-png.c	Sun Oct 12 15:38:02 2008
@@ -414,13 +414,6 @@
       else
         {
           status = GIMP_PDB_EXECUTION_ERROR;
-
-          if (error)
-            {
-              *nreturn_vals = 2;
-              values[1].type          = GIMP_PDB_STRING;
-              values[1].data.d_string = error->message;
-            }
         }
     }
   else if (strcmp (name, SAVE_PROC)  == 0 ||
@@ -544,13 +537,6 @@
           else
             {
               status = GIMP_PDB_EXECUTION_ERROR;
-
-              if (error)
-                {
-                  *nreturn_vals = 2;
-                  values[1].type          = GIMP_PDB_STRING;
-                  values[1].data.d_string = error->message;
-                }
             }
         }
 
@@ -597,11 +583,20 @@
           save_defaults ();
         }
       else
-        status = GIMP_PDB_CALLING_ERROR;
+        {
+          status = GIMP_PDB_CALLING_ERROR;
+        }
     }
   else
     {
-      status = GIMP_PDB_EXECUTION_ERROR;
+      status = GIMP_PDB_CALLING_ERROR;
+    }
+
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
     }
 
   values[0].data.d_status = status;
@@ -704,7 +699,7 @@
 
   if (setjmp (pp->jmpbuf))
     {
-      g_set_error (error, 0, 0,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Error while reading '%s'. File corrupted?"),
                    gimp_filename_to_utf8 (filename));
       return image;
@@ -1349,8 +1344,7 @@
       break;
 
     default:
-      g_set_error (error, 0, 0,
-                   "%s", _("Image type can't be saved as PNG"));
+      g_set_error (error, 0, 0, "Image type can't be saved as PNG");
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-pnm.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-pnm.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-pnm.c	Sun Oct 12 15:38:02 2008
@@ -125,11 +125,13 @@
                           const GimpParam  *param,
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
-static gint32 load_image (const gchar      *filename);
+static gint32 load_image (const gchar      *filename,
+                          GError          **error);
 static gint   save_image (const gchar      *filename,
                           gint32            image_ID,
                           gint32            drawable_ID,
-                          gboolean          pbm);
+                          gboolean          pbm,
+                          GError          **error);
 
 static gint   save_dialog              (void);
 
@@ -321,13 +323,14 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
-  gboolean          pbm = FALSE;  /* flag for PBM output */
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
+  gboolean           pbm    = FALSE;  /* flag for PBM output */
 
   run_mode = param[0].data.d_int32;
 
@@ -340,7 +343,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -437,7 +440,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID, pbm))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID, pbm,
+                          &error))
             {
               /*  Store psvals data  */
               gimp_set_data (name, &psvals, sizeof (PNMSaveVals));
@@ -456,11 +460,19 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   GimpPixelRgn    pixel_rgn;
   gint32 volatile image_ID = -1;
@@ -477,8 +489,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -916,10 +929,11 @@
 }
 
 static gboolean
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID,
-            gboolean     pbm)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            gboolean      pbm,
+            GError      **error)
 {
   GimpPixelRgn   pixel_rgn;
   GimpDrawable  *drawable;
@@ -955,8 +969,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-ps.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-ps.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-ps.c	Sun Oct 12 15:38:02 2008
@@ -194,10 +194,12 @@
                                 gint              *nreturn_vals,
                                 GimpParam        **return_vals);
 
-static gint32 load_image       (const gchar       *filename);
+static gint32 load_image       (const gchar       *filename,
+                                GError           **error);
 static gint   save_image       (const gchar       *filename,
                                 gint32             image_ID,
-                                gint32             drawable_ID);
+                                gint32             drawable_ID,
+                                GError           **error);
 
 static gint   save_gray        (FILE              *ofp,
                                 gint32             image_ID,
@@ -759,13 +761,14 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status        = GIMP_PDB_SUCCESS;
-  gint32            image_ID      = -1;
-  gint32            drawable_ID   = -1;
-  gint32            orig_image_ID = -1;
-  GimpExportReturn  export        = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status        = GIMP_PDB_SUCCESS;
+  gint32             image_ID      = -1;
+  gint32             drawable_ID   = -1;
+  gint32             orig_image_ID = -1;
+  GimpExportReturn   export        = GIMP_EXPORT_CANCEL;
+  GError            *error         = NULL;
 
   l_run_mode = run_mode = param[0].data.d_int32;
 
@@ -812,7 +815,7 @@
       if (status == GIMP_PDB_SUCCESS)
         {
           check_load_vals ();
-          image_ID = load_image (param[1].data.d_string);
+          image_ID = load_image (param[1].data.d_string, &error);
 
           if (image_ID != -1)
             {
@@ -851,7 +854,7 @@
           strcpy (plvals.pages, "1");
 
           check_load_vals ();
-          image_ID = load_image (param[0].data.d_string);
+          image_ID = load_image (param[0].data.d_string, &error);
 
           if (image_ID != -1)
             {
@@ -944,7 +947,8 @@
             ps_set_save_size (&psvals, orig_image_ID);
 
           check_save_vals ();
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
             {
               /*  Store psvals data  */
               gimp_set_data (name, &psvals, sizeof (PSSaveVals));
@@ -990,12 +994,20 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint32    image_ID = 0;
   gint32   *image_list, *nl;
@@ -1020,8 +1032,9 @@
   ifp = g_fopen (filename, "r");
   if (ifp == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
   fclose (ifp);
@@ -1033,8 +1046,9 @@
                  &ChildPid);
   if (!ifp)
     {
-      g_message (_("Could not interpret '%s'"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR,
+                   _("Could not interpret Postscript file '%s'"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -1156,9 +1170,10 @@
 
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   FILE* ofp;
   GimpImageType drawable_type;
@@ -1173,7 +1188,8 @@
   /*  Make sure we're not saving an image with an alpha channel  */
   if (gimp_drawable_has_alpha (drawable_ID))
     {
-      g_message (_("PostScript save cannot handle images with alpha channels"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("PostScript save cannot handle images with alpha channels"));
       return FALSE;
     }
 
@@ -1193,8 +1209,9 @@
   ofp = g_fopen (filename, "wb");
   if (!ofp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-psp.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-psp.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-psp.c	Sun Oct 12 15:38:02 2008
@@ -528,10 +528,12 @@
                           const GimpParam  *param,
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
-static gint32 load_image (const gchar      *filename);
+static gint32 load_image (const gchar      *filename,
+                          GError          **error);
 static gint   save_image (const gchar      *filename,
                           gint32            image_ID,
-                          gint32            drawable_ID);
+                          gint32            drawable_ID,
+                          GError          **error);
 
 /* Various local variables...
  */
@@ -607,7 +609,7 @@
                                     "",
                                     "0,string,Paint\\040Shop\\040Pro\\040Image\\040File\n\032");
 
-  /* Removed until Saving is implemented -- njl195 zepler org */
+  /* commented out until saving is implemented */
 #if 0
   gimp_install_procedure (SAVE_PROC,
                           "saves images in the Paint Shop Pro PSP file format",
@@ -679,10 +681,10 @@
 /* This helper method is used to get the name of the block for the known block
  * types. The enum PSPBlockID must cover the input values.
  */
-static gchar *
+static const gchar *
 block_name (gint id)
 {
-  static gchar *block_names[] =
+  static const gchar *block_names[] =
   {
     "IMAGE",
     "CREATOR",
@@ -857,8 +859,8 @@
                           guint     total_len,
                           PSPimage *ia)
 {
-  long data_start;
-  guchar buf[4];
+  long    data_start;
+  guchar  buf[4];
   guint16 keyword;
   guint32 length;
 
@@ -892,15 +894,15 @@
                     guint     total_len,
                     PSPimage *ia)
 {
-  long data_start;
-  guchar buf[4];
-  guint16 keyword;
-  guint32 length;
-  gchar *string;
-  gchar *title = NULL, *artist = NULL, *copyright = NULL, *description = NULL;
-  guint32 dword;
-  guint32 cdate = 0, mdate = 0, appid, appver;
-  GString *comment;
+  long          data_start;
+  guchar        buf[4];
+  guint16       keyword;
+  guint32       length;
+  gchar        *string;
+  gchar        *title = NULL, *artist = NULL, *copyright = NULL, *description = NULL;
+  guint32       dword;
+  guint32       cdate = 0, mdate = 0, appid, appver;
+  GString      *comment;
   GimpParasite *comment_parasite;
 
   data_start = ftell (f);
@@ -1080,10 +1082,10 @@
   return -1;
 }
 
-static gchar *
+static const gchar *
 blend_mode_name (PSPBlendModes mode)
 {
-  static gchar *blend_mode_names[] =
+  static const gchar *blend_mode_names[] =
   {
     "NORMAL",
     "DARKEN",
@@ -1115,10 +1117,10 @@
   return err_name;
 }
 
-static gchar *
+static const gchar *
 bitmap_type_name (gint type)
 {
-  static gchar *bitmap_type_names[] =
+  static const gchar *bitmap_type_names[] =
   {
     "IMAGE",
     "TRANS_MASK",
@@ -1138,10 +1140,10 @@
   return err_name;
 }
 
-static gchar *
+static const gchar *
 channel_type_name (gint type)
 {
-  static char *channel_type_names[] =
+  static const gchar *channel_type_names[] =
   {
     "COMPOSITE",
     "RED",
@@ -1636,14 +1638,14 @@
                  guint     total_len,
                  PSPimage *ia)
 {
-  guint16 version;
-  guchar name[514];
-  guint32 step_size, column_count, row_count, cell_count;
-  guint32 placement_mode, selection_mode;
-  gint i;
-  GimpPixPipeParams params;
-  GimpParasite *pipe_parasite;
-  gchar *parasite_text;
+  guint16            version;
+  guchar             name[514];
+  guint32            step_size, column_count, row_count, cell_count;
+  guint32            placement_mode, selection_mode;
+  gint               i;
+  GimpPixPipeParams  params;
+  GimpParasite      *pipe_parasite;
+  gchar             *parasite_text;
 
   gimp_pixpipe_params_init (&params);
 
@@ -1705,7 +1707,7 @@
   return 0;
 }
 
-static gchar *
+static const gchar *
 compression_name (gint compression)
 {
   switch (compression)
@@ -1725,7 +1727,8 @@
 /* The main function for loading PSP-images
  */
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   FILE *f;
   struct stat st;
@@ -1744,8 +1747,9 @@
   f = g_fopen (filename, "rb");
   if (f == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -1917,9 +1921,10 @@
 }
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   g_message ("Saving not implemented yet");
 
@@ -1933,12 +1938,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   INIT_I18N ();
 
@@ -1952,7 +1958,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -2028,7 +2034,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
             {
               gimp_set_data (SAVE_PROC, &psvals, sizeof (PSPSaveVals));
             }
@@ -2046,5 +2053,12 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }

Modified: branches/soc-2008-tagging/plug-ins/common/file-raw.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-raw.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-raw.c	Sun Oct 12 15:38:02 2008
@@ -113,10 +113,13 @@
                                             gint32            len,
                                             gint32            pos,
                                             gint              rowstride);
-static gint32            load_image        (const gchar      *filename);
+
+static gint32            load_image        (const gchar      *filename,
+                                            GError          **error);
 static GimpPDBStatusType save_image        (const gchar      *filename,
                                             gint32            image_id,
-                                            gint32            drawable_id);
+                                            gint32            drawable_id,
+                                            GError          **error);
 
 /* gui functions */
 static void              preview_update    (GimpPreviewArea   *preview);
@@ -207,11 +210,12 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_id;
-  gint32            drawable_id;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GError            *error  = NULL;
+  gint32             image_id;
+  gint32             drawable_id;
 
   run_mode = param[0].data.d_int32;
 
@@ -240,9 +244,12 @@
 
           if (preview_fd < 0)
             {
-              g_message (_("Could not open '%s' for reading: %s"),
-                         gimp_filename_to_utf8 (param[1].data.d_string),
-                         g_strerror (errno));
+              g_set_error (&error,
+                           G_FILE_ERROR, g_file_error_from_errno (errno),
+                           _("Could not open '%s' for reading: %s"),
+                           gimp_filename_to_utf8 (param[1].data.d_string),
+                           g_strerror (errno));
+
               status = GIMP_PDB_EXECUTION_ERROR;
             }
           else
@@ -265,7 +272,7 @@
       /* we are okay, and the user clicked OK in the load dialog */
       if (status == GIMP_PDB_SUCCESS)
         {
-          image_id = load_image (param[1].data.d_string);
+          image_id = load_image (param[1].data.d_string, &error);
 
           if (image_id != -1)
             {
@@ -310,12 +317,21 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          status = save_image (param[3].data.d_string, image_id, drawable_id);
+          status = save_image (param[3].data.d_string, image_id, drawable_id,
+                               &error);
         }
     }
 
-  values[0].data.d_status = status;
   g_free (runtime);
+
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
+  values[0].data.d_status = status;
 }
 
 
@@ -487,7 +503,8 @@
 static GimpPDBStatusType
 save_image (const gchar  *filename,
             gint32        image_id,
-            gint32        drawable_id)
+            gint32        drawable_id,
+            GError      **error)
 {
   GimpDrawable     *drawable;
   GimpPixelRgn      pixel_rgn;
@@ -525,8 +542,9 @@
 
   if (! fp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return GIMP_PDB_EXECUTION_ERROR;
     }
 
@@ -552,8 +570,9 @@
 
           if (! fp)
             {
-              g_message (_("Could not open '%s' for writing: %s"),
-                         gimp_filename_to_utf8 (newfile), g_strerror (errno));
+              g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                           _("Could not open '%s' for writing: %s"),
+                           gimp_filename_to_utf8 (newfile), g_strerror (errno));
               return GIMP_PDB_EXECUTION_ERROR;
             }
 
@@ -628,7 +647,8 @@
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   RawGimpData       *data;
   gint32             layer_id = -1;
@@ -642,8 +662,9 @@
   data->fp = g_fopen (filename, "rb");
   if (! data->fp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -949,10 +970,10 @@
   GtkWidget *combo;
   GtkWidget *button;
   GtkObject *adj;
-  gint32     size;
+  gint32     file_size;
   gboolean   run;
 
-  size = get_file_info (filename);
+  file_size = get_file_info (filename);
 
   gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
@@ -1020,7 +1041,7 @@
 
   adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
                               _("O_ffset:"), -1, 9,
-                              runtime->file_offset, 0, size, 1, 1000, 0,
+                              runtime->file_offset, 0, file_size, 1, 1000, 0,
                               TRUE, 0.0, 0.0,
                               NULL, NULL);
 
@@ -1033,7 +1054,7 @@
 
   adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
                               _("_Width:"), -1, 9,
-                              runtime->image_width, 1, 4096, 1, 10, 0,
+                              runtime->image_width, 1, file_size, 1, 10, 0,
                               TRUE, 0.0, 0.0,
                               NULL, NULL);
 
@@ -1046,7 +1067,7 @@
 
   adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
                               _("_Height:"), -1, 9,
-                              runtime->image_height, 1, 4096, 1, 10, 0,
+                              runtime->image_height, 1, file_size, 1, 10, 0,
                               TRUE, 0.0, 0.0,
                               NULL, NULL);
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-sunras.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-sunras.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-sunras.c	Sun Oct 12 15:38:02 2008
@@ -96,10 +96,12 @@
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
 
-static gint32 load_image (const gchar      *filename);
-static gint   save_image (const gchar      *filename,
-                          gint32            image_ID,
-                          gint32            drawable_ID);
+static gint32    load_image    (const gchar  *filename,
+                                GError      **error);
+static gboolean  save_image    (const gchar  *filename,
+                                gint32        image_ID,
+                                gint32        drawable_ID,
+                                GError      **error);
 
 static void   set_color_table  (gint32, L_SUNFILEHEADER *, const guchar *);
 static gint32 create_new_image (const gchar   *filename,
@@ -251,12 +253,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   l_run_mode = run_mode = param[0].data.d_int32;
 
@@ -269,7 +272,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
@@ -341,7 +344,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+	  if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
 	    {
 	      /*  Store psvals data  */
 	      gimp_set_data (SAVE_PROC, &psvals, sizeof (SUNRASSaveVals));
@@ -360,12 +364,20 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint32 image_ID;
   FILE *ifp;
@@ -375,8 +387,9 @@
   ifp = g_fopen (filename, "rb");
   if (!ifp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -385,15 +398,18 @@
   read_sun_header (ifp, &sunhdr);
   if (sunhdr.l_ras_magic != RAS_MAGIC)
     {
-      g_message (_("Could not open '%s' as SUN-raster-file"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not open '%s' as SUN-raster-file"),
+                   gimp_filename_to_utf8 (filename));
       fclose (ifp);
       return (-1);
     }
 
   if ((sunhdr.l_ras_type < 0) || (sunhdr.l_ras_type > 5))
     {
-      g_message (_("The type of this SUN-rasterfile is not supported"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s",
+                   _("The type of this SUN-rasterfile is not supported"));
       fclose (ifp);
       return (-1);
     }
@@ -507,21 +523,23 @@
 }
 
 
-static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+static gboolean
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
-  FILE* ofp;
+  FILE*         ofp;
   GimpImageType drawable_type;
-  gint retval;
+  gboolean      retval;
 
   drawable_type = gimp_drawable_type (drawable_ID);
 
   /*  Make sure we're not saving an image with an alpha channel  */
   if (gimp_drawable_has_alpha (drawable_ID))
     {
-      g_message (_("SUNRAS save cannot handle images with alpha channels"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("SUNRAS save cannot handle images with alpha channels"));
       return FALSE;
     }
 
@@ -541,8 +559,9 @@
   ofp = g_fopen (filename, "wb");
   if (!ofp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-svg.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-svg.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-svg.c	Sun Oct 12 15:38:02 2008
@@ -279,7 +279,7 @@
           load_vals.width      = - param[1].data.d_int32;
           load_vals.height     = - param[1].data.d_int32;
 
-          image_ID = load_image (filename, NULL);
+          image_ID = load_image (filename, &error);
 
           if (image_ID != -1)
             {
@@ -809,7 +809,7 @@
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (hbox);
 
-  spinbutton = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 1, 1, 2);
+  spinbutton = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
@@ -862,7 +862,7 @@
                           ratio_x,
                           (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_width,
                           (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_width,
-                          0.01, 0.1, 1,
+                          0.01, 0.1, 0,
                           0.01, 4);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 0, 1);
@@ -884,7 +884,7 @@
                           ratio_y,
                           (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_height,
                           (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_height,
-                          0.01, 0.1, 1,
+                          0.01, 0.1, 0,
                           0.01, 4);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 1, 2);

Modified: branches/soc-2008-tagging/plug-ins/common/file-tga.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-tga.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-tga.c	Sun Oct 12 15:38:02 2008
@@ -185,10 +185,12 @@
                                 gint             *nreturn_vals,
                                 GimpParam       **return_vals);
 
-static gint32    load_image    (const gchar      *filename);
+static gint32    load_image    (const gchar      *filename,
+                                GError          **error);
 static gint      save_image    (const gchar      *filename,
                                 gint32            image_ID,
-                                gint32            drawable_ID);
+                                gint32            drawable_ID,
+                                GError          **error);
 
 static gboolean  save_dialog   (void);
 
@@ -276,12 +278,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
 #ifdef PROFILE
   struct tms tbuf1, tbuf2;
@@ -303,7 +306,7 @@
       times (&tbuf1);
 #endif
 
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -381,7 +384,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
             {
               /*  Store psvals data  */
               gimp_set_data (SAVE_PROC, &tsvals, sizeof (tsvals));
@@ -400,6 +404,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 
 #ifdef PROFILE
@@ -411,7 +422,8 @@
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   FILE     *fp;
   tga_info  info;
@@ -423,10 +435,12 @@
   gint32 image_ID = -1;
 
   fp = g_fopen (filename, "rb");
-  if (!fp)
+
+  if (! fp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -1120,9 +1134,10 @@
 
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   GimpPixelRgn   pixel_rgn;
   GimpDrawable  *drawable;
@@ -1151,8 +1166,9 @@
 
   if ((fp = g_fopen (filename, "wb")) == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-tiff-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-tiff-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-tiff-load.c	Sun Oct 12 15:38:02 2008
@@ -107,12 +107,13 @@
                          gint             *nreturn_vals,
                          GimpParam       **return_vals);
 
-static gboolean  load_dialog   (TIFF              *tif,
-                                TiffSelectedPages *pages);
+static gboolean  load_dialog   (TIFF               *tif,
+                                TiffSelectedPages  *pages);
 
-static gint32    load_image    (const gchar       *filename,
-                                TIFF              *tif,
-                                TiffSelectedPages *pages);
+static gint32    load_image    (const gchar        *filename,
+                                TIFF               *tif,
+                                TiffSelectedPages  *pages,
+                                GError            **error);
 
 static void      load_rgba     (TIFF         *tif,
                                 channel_data *channel);
@@ -259,6 +260,7 @@
 {
   static GimpParam   values[2];
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GError            *error  = NULL;
   gint32             image;
   TiffSelectedPages  pages;
 
@@ -285,8 +287,10 @@
 
       if (fd == -1)
         {
-          g_message (_("Could not open '%s' for reading: %s"),
-                     gimp_filename_to_utf8 (filename), g_strerror (errno));
+          g_set_error (&error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for reading: %s"),
+                       gimp_filename_to_utf8 (filename), g_strerror (errno));
+
           status = GIMP_PDB_EXECUTION_ERROR;
         }
       else
@@ -302,8 +306,9 @@
 
           if (pages.n_pages == 0)
             {
-              g_message (_("TIFF '%s' does not contain any directories"),
-                         gimp_filename_to_utf8 (filename));
+              g_set_error (&error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                           _("TIFF '%s' does not contain any directories"),
+                           gimp_filename_to_utf8 (filename));
 
               status = GIMP_PDB_EXECUTION_ERROR;
             }
@@ -337,7 +342,8 @@
                 {
                   gimp_set_data (LOAD_PROC, &target, sizeof (target));
 
-                  image = load_image (param[1].data.d_string, tif, &pages);
+                  image = load_image (param[1].data.d_string, tif, &pages,
+                                      &error);
 
                   g_free (pages.pages);
 
@@ -372,6 +378,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -535,9 +548,10 @@
 }
 
 static gint32
-load_image (const gchar       *filename,
-            TIFF              *tif,
-            TiffSelectedPages *pages)
+load_image (const gchar        *filename,
+            TIFF               *tif,
+            TiffSelectedPages  *pages,
+            GError            **error)
 {
   gushort       bps, spp, photomet;
   guint16       orientation;
@@ -744,7 +758,8 @@
         {
           if ((image = gimp_image_new (cols, rows, image_type)) == -1)
             {
-              g_message ("Could not create a new image");
+              g_message ("Could not create a new image: %s",
+                         gimp_get_pdb_error ());
               return -1;
             }
 

Modified: branches/soc-2008-tagging/plug-ins/common/file-tiff-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-tiff-save.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-tiff-save.c	Sun Oct 12 15:38:02 2008
@@ -108,7 +108,8 @@
 static gboolean  save_image             (const gchar  *filename,
                                          gint32        image,
                                          gint32        drawable,
-                                         gint32        orig_image);
+                                         gint32        orig_image,
+                                         GError      **error);
 
 static gboolean  save_dialog            (gboolean      has_alpha,
                                          gboolean      is_monochrome);
@@ -218,6 +219,7 @@
   gint32             drawable;
   gint32             orig_image;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -341,7 +343,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image, drawable, orig_image))
+          if (save_image (param[3].data.d_string, image, drawable, orig_image,
+                          &error))
             {
               /*  Store mvals data  */
               gimp_set_data (SAVE_PROC, &tsvals, sizeof (TiffSaveVals));
@@ -360,6 +363,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -617,10 +627,11 @@
 */
 
 static gboolean
-save_image (const gchar *filename,
-            gint32       image,
-            gint32       layer,
-            gint32       orig_image)  /* the export function might have created a duplicate */
+save_image (const gchar  *filename,
+            gint32        image,
+            gint32        layer,
+            gint32        orig_image,  /* the export function might have */
+            GError      **error)       /* created a duplicate            */
 {
   TIFF          *tif;
   gushort        red[256];
@@ -668,8 +679,9 @@
 
   if (fd == -1)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 
@@ -769,7 +781,9 @@
       break;
 
     case GIMP_INDEXEDA_IMAGE:
-      g_message ("TIFF save cannot handle indexed images with alpha channel.");
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s",
+                   "TIFF save cannot handle indexed images with alpha channel.");
     default:
       return FALSE;
     }

Modified: branches/soc-2008-tagging/plug-ins/common/file-wmf.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-wmf.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-wmf.c	Sun Oct 12 15:38:02 2008
@@ -62,7 +62,8 @@
                                  const GimpParam   *param,
                                  gint              *nreturn_vals,
                                  GimpParam        **return_vals);
-static gint32    load_image     (const gchar       *filename);
+static gint32    load_image     (const gchar       *filename,
+                                 GError           **error);
 static gboolean  load_wmf_size  (const gchar       *filename,
                                  WmfLoadVals       *vals);
 static gboolean  load_dialog    (const gchar       *filename);
@@ -167,6 +168,7 @@
   GimpRunMode        run_mode;
   GimpPDBStatusType  status   = GIMP_PDB_SUCCESS;
   const gchar       *filename = NULL;
+  GError            *error    = NULL;
   gint32             image_ID = -1;
   gint               width    = 0;
   gint               height   = 0;
@@ -247,7 +249,7 @@
           load_vals.resolution = WMF_DEFAULT_RESOLUTION;
         }
 
-      image_ID = load_image (filename);
+      image_ID = load_image (filename, &error);
 
       if (image_ID != -1)
         {
@@ -277,6 +279,13 @@
         }
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -576,7 +585,7 @@
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (hbox);
 
-  spinbutton = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 1, 1, 2);
+  spinbutton = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
@@ -629,7 +638,7 @@
                           ratio_x,
                           (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_width,
                           (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_width,
-                          0.01, 0.1, 1,
+                          0.01, 0.1, 0,
                           0.01, 4);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 0, 1);
@@ -651,7 +660,7 @@
                           ratio_y,
                           (gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) wmf_height,
                           (gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) wmf_height,
-                          0.01, 0.1, 1,
+                          0.01, 0.1, 0,
                           0.01, 4);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
   gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 1, 2);
@@ -720,14 +729,14 @@
 }
 
 static guchar *
-pixbuf_gd_convert (gint *gd_pixels,
-                   gint  width,
-                   gint  height)
-{
-  gint    *gd_ptr = gd_pixels;
-  guchar  *pixels;
-  guchar  *px_ptr;
-  gint     i, j;
+pixbuf_gd_convert (const gint *gd_pixels,
+                   gint        width,
+                   gint        height)
+{
+  const gint *gd_ptr = gd_pixels;
+  guchar     *pixels;
+  guchar     *px_ptr;
+  gint        i, j;
 
   pixels = (guchar *) g_try_malloc (width * height * sizeof (guchar) * 4);
   if (! pixels)
@@ -949,6 +958,11 @@
 
   g_mapped_file_free (file);
 
+  /* FIXME: improve error message */
+  g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+               _("Could not open '%s' for reading"),
+               gimp_filename_to_utf8 (filename));
+
   return pixels;
 }
 
@@ -956,7 +970,8 @@
  * 'load_image()' - Load a WMF image into a new image window.
  */
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint32        image;
   gint32	layer;
@@ -967,27 +982,14 @@
   guint         rowstride;
   guint         count = 0;
   guint         done  = 0;
-  GError       *error = NULL;
   gpointer      pr;
 
-  pixels = wmf_load_file (filename, &width, &height, &error);
-  rowstride = width * 4;
+  pixels = wmf_load_file (filename, &width, &height, error);
 
-  if (!pixels)
-    {
-      if (error)
-        {
-          g_message (error->message);
-          g_error_free (error);
-        }
-      else
-        {
-          g_message (_("Could not open '%s' for reading"),
-                     gimp_filename_to_utf8 (filename));
-        }
+  if (! pixels)
+    return -1;
 
-      return -1;
-    }
+  rowstride = width * 4;
 
   gimp_progress_init_printf (_("Opening '%s'"),
                              gimp_filename_to_utf8 (filename));

Modified: branches/soc-2008-tagging/plug-ins/common/file-xbm.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-xbm.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-xbm.c	Sun Oct 12 15:38:02 2008
@@ -93,30 +93,33 @@
 
 /* Declare some local functions.
  */
-static void   query   (void);
-static void   run     (const gchar      *name,
-		       gint              nparams,
-		       const GimpParam  *param,
-		       gint             *nreturn_vals,
-		       GimpParam       **return_vals);
-
-static gint32    load_image              (const gchar *filename);
-static gint      save_image              (const gchar *filename,
-                                          const gchar *prefix,
-                                          const gchar *comment,
-                                          gboolean     save_mask,
-                                          gint32       image_ID,
-                                          gint32       drawable_ID);
-static gboolean  save_dialog             (gint32       drawable_ID);
+static void      query                   (void);
+static void      run                     (const gchar      *name,
+                                          gint              nparams,
+                                          const GimpParam  *param,
+                                          gint             *nreturn_vals,
+                                          GimpParam       **return_vals);
+
+static gint32    load_image              (const gchar      *filename,
+                                          GError          **error);
+static gint      save_image              (const gchar      *filename,
+                                          const gchar      *prefix,
+                                          const gchar      *comment,
+                                          gboolean          save_mask,
+                                          gint32            image_ID,
+                                          gint32            drawable_ID,
+                                          GError          **error);
+static gboolean  save_dialog             (gint32            drawable_ID);
 #if 0
 /* DISABLED - see http://bugzilla.gnome.org/show_bug.cgi?id=82763 */
-static void      comment_entry_callback  (GtkWidget   *widget,
-                                          gpointer     data);
+static void      comment_entry_callback  (GtkWidget        *widget,
+                                          gpointer          data);
 #endif
-static void      prefix_entry_callback   (GtkWidget   *widget,
-                                          gpointer     data);
-static void      mask_ext_entry_callback (GtkWidget   *widget,
-                                          gpointer     data);
+static void      prefix_entry_callback   (GtkWidget        *widget,
+                                          gpointer          data);
+static void      mask_ext_entry_callback (GtkWidget        *widget,
+                                          gpointer          data);
+
 
 const GimpPlugInInfo PLUG_IN_INFO =
 {
@@ -132,6 +135,7 @@
 static int verbose = VERBOSE;
 #endif
 
+
 static void
 query (void)
 {
@@ -232,12 +236,13 @@
 {
   static GimpParam   values[2];
   GimpRunMode        run_mode;
-  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GimpPDBStatusType  status        = GIMP_PDB_SUCCESS;
   gint32             image_ID;
   gint32             drawable_ID;
-  GimpParasite      *parasite = NULL;
+  GimpParasite      *parasite      = NULL;
   gchar             *mask_filename = NULL;
-  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error         = NULL;
+  GimpExportReturn   export        = GIMP_EXPORT_CANCEL;
 
   INIT_I18N ();
 
@@ -258,7 +263,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -441,12 +446,14 @@
 			  xsvals.prefix,
 			  xsvals.comment,
 			  FALSE,
-			  image_ID, drawable_ID)
-              && (!xsvals.write_mask || save_image (mask_filename,
-                                                    mask_prefix,
-                                                    xsvals.comment,
-                                                    TRUE,
-                                                    image_ID, drawable_ID)))
+			  image_ID, drawable_ID,
+                          &error)
+              && (! xsvals.write_mask || save_image (mask_filename,
+                                                     mask_prefix,
+                                                     xsvals.comment,
+                                                     TRUE,
+                                                     image_ID, drawable_ID,
+                                                     &error)))
 	    {
 	      /*  Store xsvals data  */
 	      gimp_set_data (SAVE_PROC, &xsvals, sizeof (xsvals));
@@ -468,6 +475,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -615,8 +629,8 @@
 
 /* Match a string with a file. */
 static gint
-match (FILE  *fp,
-       gchar *s)
+match (FILE        *fp,
+       const gchar *s)
 {
   gint c;
 
@@ -690,23 +704,24 @@
 }
 
 
-static gint
-load_image (const gchar *filename)
+static gint32
+load_image (const gchar  *filename,
+            GError      **error)
 {
-  FILE *fp;
-  gint32 image_ID, layer_ID;
-
   GimpPixelRgn  pixel_rgn;
   GimpDrawable *drawable;
-  guchar *data;
-  gint    intbits;
-  gint    width = 0;
-  gint    height = 0;
-  gint    x_hot = 0;
-  gint    y_hot = 0;
-  gint    c, i, j, k;
-  gint    tileheight, rowoffset;
-  gchar  *comment;
+  FILE         *fp;
+  gint32        image_ID;
+  gint32        layer_ID;
+  guchar       *data;
+  gint          intbits;
+  gint          width  = 0;
+  gint          height = 0;
+  gint          x_hot  = 0;
+  gint          y_hot  = 0;
+  gint          c, i, j, k;
+  gint          tileheight, rowoffset;
+  gchar        *comment;
 
   const guchar cmap[] =
   {
@@ -715,10 +730,11 @@
   };
 
   fp = g_fopen (filename, "rb");
-  if (!fp)
+  if (! fp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -941,26 +957,27 @@
 }
 
 static gboolean
-save_image (const gchar *filename,
-	    const gchar *prefix,
-	    const gchar *comment,
-	    gboolean     save_mask,
-	    gint32       image_ID,
-	    gint32       drawable_ID)
+save_image (const gchar  *filename,
+	    const gchar  *prefix,
+	    const gchar  *comment,
+	    gboolean      save_mask,
+	    gint32        image_ID,
+	    gint32        drawable_ID,
+            GError      **error)
 {
   GimpDrawable *drawable;
   GimpPixelRgn  pixel_rgn;
   FILE         *fp;
 
-  gint width, height, colors, dark;
-  gint intbits, lineints, need_comma, nints, rowoffset, tileheight;
-  gint c, i, j, k, thisbit;
+  gint          width, height, colors, dark;
+  gint          intbits, lineints, need_comma, nints, rowoffset, tileheight;
+  gint          c, i, j, k, thisbit;
 
-  gboolean has_alpha;
-  gint     bpp;
+  gboolean      has_alpha;
+  gint          bpp;
 
-  guchar *data, *cmap;
-  gchar  *intfmt;
+  guchar       *data, *cmap;
+  const gchar  *intfmt;
 
 #if 0
   if (save_mask)
@@ -986,7 +1003,7 @@
 
   has_alpha = gimp_drawable_has_alpha (drawable_ID);
 
-  if (!has_alpha && save_mask)
+  if (! has_alpha && save_mask)
     {
       g_message (_("You cannot save a cursor mask for an image\n"
 		   "which has no alpha channel."));
@@ -1011,10 +1028,11 @@
 
   /* Now actually save the data. */
   fp = g_fopen (filename, "w");
-  if (!fp)
+  if (! fp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 
@@ -1147,6 +1165,7 @@
   /* Write the trailer. */
   fprintf (fp, " };\n");
   fclose (fp);
+
   return TRUE;
 }
 
@@ -1252,7 +1271,7 @@
 
   spinbutton = gimp_spin_button_new (&adj, xsvals.x_hot, 0,
 				     gimp_drawable_width (drawable_ID) - 1,
-				     1, 1, 1, 0, 0);
+				     1, 10, 0, 0, 0);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
 			     _("Hot spot _X:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -1262,7 +1281,7 @@
 
   spinbutton = gimp_spin_button_new (&adj, xsvals.y_hot, 0,
 				     gimp_drawable_height (drawable_ID) - 1,
-				     1, 1, 1, 0, 0);
+				     1, 10, 0, 0, 0);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
 			     _("Hot spot _Y:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);

Modified: branches/soc-2008-tagging/plug-ins/common/file-xpm.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-xpm.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-xpm.c	Sun Oct 12 15:38:02 2008
@@ -105,15 +105,16 @@
                                        gint             *nreturn_vals,
                                        GimpParam       **return_vals);
 
-static gint32     load_image          (const gchar      *filename);
+static gint32     load_image          (const gchar      *filename,
+                                       GError          **error);
 static guchar   * parse_colors        (XpmImage         *xpm_image);
 static void       parse_image         (gint32            image_ID,
                                        XpmImage         *xpm_image,
                                        guchar           *cmap);
 static gboolean   save_image          (const gchar      *filename,
                                        gint32            image_ID,
-                                       gint32            drawable_ID);
-
+                                       gint32            drawable_ID,
+                                       GError          **error);
 static gboolean   save_dialog         (void);
 
 
@@ -212,12 +213,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -231,7 +233,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -311,8 +313,7 @@
       if (status == GIMP_PDB_SUCCESS)
         {
           if (save_image (param[3].data.d_string,
-                          image_ID,
-                          drawable_ID))
+                          image_ID, drawable_ID, &error))
             {
               gimp_set_data ("file_xpm_save", &xpmvals, sizeof (XpmSaveVals));
             }
@@ -330,11 +331,19 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   XpmImage  xpm_image;
   guchar   *cmap;
@@ -350,12 +359,14 @@
       break;
 
     case XpmOpenFailed:
-      g_message (_("Error opening file '%s'"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Error opening file '%s'"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
 
     case XpmFileInvalid:
-      g_message (_("XPM file invalid"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("XPM file invalid"));
       return -1;
 
     default:
@@ -559,7 +570,9 @@
     {
       array[index].g_color = NULL;
       array[index].c_color = colorstring;
-    } else {
+    }
+  else
+    {
       array[index].c_color = NULL;
       array[index].g_color = colorstring;
     }
@@ -578,9 +591,10 @@
 }
 
 static gboolean
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   GimpDrawable *drawable;
   GimpPixelRgn  pixel_rgn;
@@ -604,7 +618,7 @@
   gint       i, j, k;
   gint       threshold = xpmvals.threshold;
 
-  gboolean   rc = FALSE;
+  gboolean   success = FALSE;
 
   /* get some basic stats about the image */
   alpha   = gimp_drawable_has_alpha (drawable_ID);
@@ -690,6 +704,7 @@
           gimp_progress_update ((gdouble) (i+j) / (gdouble) height);
         }
     }
+
   g_free (buffer);
 
   if (indexed)
@@ -747,8 +762,26 @@
   image->data       = ibuff;
 
   /* do the save */
-  rc = (XpmWriteFileFromXpmImage ((char *) filename,
-                                  image, NULL) == XpmSuccess);
+  switch (XpmWriteFileFromXpmImage ((char *) filename, image, NULL))
+    {
+    case XpmSuccess:
+      success = TRUE;
+      break;
+
+    case XpmOpenFailed:
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Error opening file '%s'"),
+                   gimp_filename_to_utf8 (filename));
+      break;
+
+    case XpmFileInvalid:
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("XPM file invalid"));
+      break;
+
+    default:
+      break;
+    }
 
   /* clean up resources */
   gimp_drawable_detach (drawable);
@@ -758,7 +791,7 @@
   if (hash)
     g_hash_table_destroy (hash);
 
-  return rc;
+  return success;
 }
 
 static gboolean

Modified: branches/soc-2008-tagging/plug-ins/common/file-xwd.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/file-xwd.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/file-xwd.c	Sun Oct 12 15:38:02 2008
@@ -144,10 +144,12 @@
                                    gint             *nreturn_vals,
                                    GimpParam       **return_vals);
 
-static gint32 load_image          (const gchar      *filename);
+static gint32 load_image          (const gchar      *filename,
+                                   GError          **error);
 static gint   save_image          (const gchar      *filename,
                                    gint32            image_ID,
-                                   gint32            drawable_ID);
+                                   gint32            drawable_ID,
+                                   GError          **error);
 static gint32 create_new_image    (const gchar      *filename,
                                    guint             width,
                                    guint             height,
@@ -311,12 +313,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   l_run_mode = run_mode = param[0].data.d_int32;
 
@@ -330,7 +333,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -388,7 +391,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (! save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (! save_image (param[3].data.d_string, image_ID, drawable_ID,
+                            &error))
             {
               status = GIMP_PDB_EXECUTION_ERROR;
             }
@@ -402,11 +406,19 @@
       status = GIMP_PDB_CANCEL;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   FILE            *ifp;
   gint             depth, bpp;
@@ -417,16 +429,18 @@
   ifp = g_fopen (filename, "rb");
   if (!ifp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
   read_xwd_header (ifp, &xwdhdr);
   if (xwdhdr.l_file_version != 7)
     {
-      g_message (_("Could not read XWD header from '%s'"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not read XWD header from '%s'"),
+                   gimp_filename_to_utf8 (filename));
       fclose (ifp);
       return -1;
     }
@@ -552,19 +566,20 @@
     g_free (xwdcolmap);
 
   if (image_ID == -1)
-    g_message (_("XWD-file %s has format %d, depth %d and bits per pixel %d. "
-                 "Currently this is not supported."),
-               gimp_filename_to_utf8 (filename),
-               (gint) xwdhdr.l_pixmap_format, depth, bpp);
+    g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                 _("XWD-file %s has format %d, depth %d and bits per pixel %d. "
+                   "Currently this is not supported."),
+                 gimp_filename_to_utf8 (filename),
+                 (gint) xwdhdr.l_pixmap_format, depth, bpp);
 
   return image_ID;
 }
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
-
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   FILE          *ofp;
   GimpImageType  drawable_type;
@@ -593,10 +608,11 @@
 
   /* Open the output file. */
   ofp = g_fopen (filename, "wb");
-  if (!ofp)
+  if (! ofp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/filter-pack.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/filter-pack.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/filter-pack.c	Sun Oct 12 15:38:02 2008
@@ -1545,7 +1545,7 @@
 
     case GDK_MOTION_NOTIFY:
       mevent = (GdkEventMotion *) event;
-      gdk_window_get_pointer (widget->window, &x, NULL, NULL);
+      x = mevent->x;
 
       if (x >= 0 && x < 256)
         {
@@ -1556,6 +1556,8 @@
           update_range_labels ();
           fp_create_smoothness_graph (AW.aliasing_preview);
         }
+
+      gdk_event_request_motions (mevent);
       break;
 
     default:

Modified: branches/soc-2008-tagging/plug-ins/common/guillotine.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/guillotine.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/guillotine.c	Sun Oct 12 15:38:02 2008
@@ -34,14 +34,15 @@
 
 /* Declare local functions.
  */
-static void   query      (void);
-static void   run        (const gchar      *name,
-                          gint              nparams,
-                          const GimpParam  *param,
-                          gint             *nreturn_vals,
-                          GimpParam       **return_vals);
+static void    query      (void);
+static void    run        (const gchar      *name,
+                           gint              nparams,
+                           const GimpParam  *param,
+                           gint             *nreturn_vals,
+                           GimpParam       **return_vals);
 
-static void   guillotine (gint32            image_ID);
+static GList * guillotine (gint32            image_ID,
+                           gboolean          interactive);
 
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -60,22 +61,29 @@
 {
   static const GimpParamDef args[] =
   {
-    { GIMP_PDB_INT32,    "run-mode", "Interactive, non-interactive" },
-    { GIMP_PDB_IMAGE,    "image",    "Input image"                  },
-    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable (unused)"      }
+    { GIMP_PDB_INT32,      "run-mode", "Interactive, non-interactive" },
+    { GIMP_PDB_IMAGE,      "image",    "Input image"                  },
+    { GIMP_PDB_DRAWABLE,   "drawable", "Input drawable (unused)"      }
+  };
+  static const GimpParamDef return_vals[] =
+  {
+    { GIMP_PDB_INT32,      "image-count", "Number of images created"  },
+    { GIMP_PDB_INT32ARRAY, "image-ids",   "Output images"             }
   };
 
   gimp_install_procedure (PLUG_IN_PROC,
                           N_("Slice the image into subimages using guides"),
-                          "This function takes an image and blah blah.  Hooray!",
+                          "This function takes an image and slices it along "
+                          "its guides, creating new images. The original "
+                          "image is not modified.",
                           "Adam D. Moss (adam foxbox org)",
                           "Adam D. Moss (adam foxbox org)",
                           "1998",
                           N_("_Guillotine"),
                           "RGB*, INDEXED*, GRAY*",
                           GIMP_PLUGIN,
-                          G_N_ELEMENTS (args), 0,
-                          args, NULL);
+                          G_N_ELEMENTS (args), G_N_ELEMENTS (return_vals),
+                          args, return_vals);
 
   gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Image/Transform");
 }
@@ -87,25 +95,45 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[1];
-  gint32            image_ID;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
+  static GimpParam  values[3];
+  GimpRunMode       run_mode = param[0].data.d_int32;
+  GimpPDBStatusType status   = GIMP_PDB_SUCCESS;
 
-  *nreturn_vals = 1;
+  *nreturn_vals = 3;
   *return_vals  = values;
 
-  values[0].type          = GIMP_PDB_STATUS;
-  values[0].data.d_status = status;
+  values[0].type              = GIMP_PDB_STATUS;
+  values[0].data.d_status     = status;
+  values[1].type              = GIMP_PDB_INT32;
+  values[1].data.d_int32      = 0;
+  values[2].type              = GIMP_PDB_INT32ARRAY;
+  values[2].data.d_int32array = NULL;
 
   INIT_I18N();
 
-  image_ID = param[1].data.d_image;
-
   if (status == GIMP_PDB_SUCCESS)
     {
+      GList *images;
+      GList *list;
+      gint   i;
+
       gimp_progress_init (_("Guillotine"));
-      guillotine (image_ID);
-      gimp_displays_flush ();
+
+      images = guillotine (param[1].data.d_image,
+                           run_mode == GIMP_RUN_INTERACTIVE);
+
+      values[1].data.d_int32      = g_list_length (images);
+      values[2].data.d_int32array = g_new (gint32, values[1].data.d_int32);
+
+      for (list = images, i = 0; list; list = g_list_next (list), i++)
+        {
+          values[2].data.d_int32array[i] = GPOINTER_TO_INT (list->data);
+        }
+
+      g_list_free (images);
+
+      if (run_mode == GIMP_RUN_INTERACTIVE)
+        gimp_displays_flush ();
     }
 
   values[0].data.d_status = status;
@@ -119,9 +147,11 @@
   return GPOINTER_TO_INT (a) - GPOINTER_TO_INT (b);
 }
 
-static void
-guillotine (gint32 image_ID)
+static GList *
+guillotine (gint32   image_ID,
+            gboolean interactive)
 {
+  GList    *images = NULL;
   gint      guide;
   gint      image_width;
   gint      image_height;
@@ -181,7 +211,8 @@
       gchar *format;
 
       filename = gimp_image_get_filename (image_ID);
-      if (!filename)
+
+      if (! filename)
         filename = g_strdup (_("Untitled"));
 
       /* get the number horizontal and vertical slices */
@@ -212,7 +243,7 @@
               if (new_image == -1)
                 {
                   g_warning ("Couldn't create new image.");
-                  return;
+                  return images;
                 }
 
               gimp_image_undo_disable (new_image);
@@ -247,7 +278,10 @@
 
               gimp_image_undo_enable (new_image);
 
-              gimp_display_new (new_image);
+              if (interactive)
+                gimp_display_new (new_image);
+
+              images = g_list_prepend (images, GINT_TO_POINTER (new_image));
             }
         }
 
@@ -258,4 +292,6 @@
 
   g_list_free (hguides);
   g_list_free (vguides);
+
+  return g_list_reverse (images);
 }

Modified: branches/soc-2008-tagging/plug-ins/common/hot.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/hot.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/hot.c	Sun Oct 12 15:38:02 2008
@@ -142,19 +142,19 @@
 static glong	ichroma_lim2;        /* chroma limit squared (scaled integer) */
 static gint	icompos_lim;         /* composite amplitude limit (scaled integer) */
 
-static void query        (void);
-static void run          (const gchar      *name,
-			  gint              nparam,
-			  const GimpParam  *param,
-			  gint             *nretvals,
-			  GimpParam       **retvals);
-
-static gint pluginCore   (piArgs   *argp);
-static gint pluginCoreIA (piArgs   *argp);
-static gboolean hotp     (guint8  r,
-			  guint8  g,
-			  guint8  b);
-static void build_tab    (gint    m);
+static void       query         (void);
+static void       run           (const gchar      *name,
+                                 gint              nparam,
+                                 const GimpParam  *param,
+                                 gint             *nretvals,
+                                 GimpParam       **retvals);
+
+static gboolean   pluginCore    (piArgs           *argp);
+static gboolean   plugin_dialog (piArgs           *argp);
+static gboolean   hotp          (guint8            r,
+                                 guint8            g,
+                                 guint8            b);
+static void       build_tab     (gint              m);
 
 /*
  * gc: apply the gamma correction specified for this video standard.
@@ -164,8 +164,8 @@
  * Future standards may use more complex functions.
  * (e.g. SMPTE 240M's "electro-optic transfer characteristic").
  */
-#define gc(x,m) pow(x, 1.0 / mode[m].gamma)
-#define inv_gc(x,m) pow(x, mode[m].gamma)
+#define gc(x,m)     pow(x, 1.0 / mode[m].gamma)
+#define inv_gc(x,m) pow(x,       mode[m].gamma)
 
 /*
  * pix_decode: decode an integer pixel value into a floating-point
@@ -231,14 +231,14 @@
      GimpParam       **retvals)
 {
   static GimpParam rvals[1];
-  piArgs    args;
+  piArgs           args;
 
   *nretvals = 1;
   *retvals  = rvals;
 
   INIT_I18N ();
 
-  memset (&args, (int) 0, sizeof (args));
+  memset (&args, 0, sizeof (args));
   args.mode = -1;
 
   gimp_get_data (PLUG_IN_PROC, &args);
@@ -260,12 +260,19 @@
 	  args.new_layerp = 1;
 	}
 
-      if (pluginCoreIA(&args) == -1)
+      if (plugin_dialog (&args))
 	{
-	  rvals[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+          if (! pluginCore (&args))
+            {
+              rvals[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+            }
 	}
-      gimp_set_data (PLUG_IN_PROC, &args, sizeof (args));
+      else
+        {
+          rvals[0].data.d_status = GIMP_PDB_CANCEL;
+        }
 
+      gimp_set_data (PLUG_IN_PROC, &args, sizeof (args));
     break;
 
     case GIMP_RUN_NONINTERACTIVE:
@@ -279,7 +286,7 @@
       args.action     = param[4].data.d_int32;
       args.new_layerp = param[5].data.d_int32;
 
-      if (pluginCore(&args) == -1)
+      if (! pluginCore (&args))
 	{
 	  rvals[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
 	  break;
@@ -288,7 +295,7 @@
 
     case GIMP_RUN_WITH_LAST_VALS:
       /* XXX: add code here for last-values running */
-      if (pluginCore (&args) == -1)
+      if (! pluginCore (&args))
 	{
 	  rvals[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
 	}
@@ -296,40 +303,41 @@
   }
 }
 
-static gint
+static gboolean
 pluginCore (piArgs *argp)
 {
-  GimpDrawable *drw, *ndrw=NULL;
-  GimpPixelRgn srcPr, dstPr;
-  gint retval = 0;
-  gint nl=0;
-  gint y, x, i;
-  gint Y, I, Q;
-  guint width, height, bpp;
-  gint sel_x1, sel_x2, sel_y1, sel_y2;
-  gint prog_interval;
-  guchar *src, *s, *dst, *d;
-  guchar r, prev_r=0, new_r=0;
-  guchar g, prev_g=0, new_g=0;
-  guchar b, prev_b=0, new_b=0;
-  gdouble fy, fc, t, scale;
-  gdouble pr, pg, pb;
-  gdouble py;
+  GimpDrawable *drw, *ndrw = NULL;
+  GimpPixelRgn  srcPr, dstPr;
+  gboolean      success = TRUE;
+  gint          nl      = 0;
+  gint          y, i;
+  gint          Y, I, Q;
+  guint         width, height, bpp;
+  gint          sel_x1, sel_x2, sel_y1, sel_y2;
+  gint          prog_interval;
+  guchar       *src, *s, *dst, *d;
+  guchar        r, prev_r=0, new_r=0;
+  guchar        g, prev_g=0, new_g=0;
+  guchar        b, prev_b=0, new_b=0;
+  gdouble       fy, fc, t, scale;
+  gdouble       pr, pg, pb;
+  gdouble       py;
 
   drw = gimp_drawable_get (argp->drawable);
 
-  width = drw->width;
+  width  = drw->width;
   height = drw->height;
-  bpp = drw->bpp;
+  bpp    = drw->bpp;
+
   if (argp->new_layerp)
     {
-      gchar name[40];
-      gchar *mode_names[] =
+      gchar        name[40];
+      const gchar *mode_names[] =
       {
 	"ntsc",
 	"pal",
       };
-      gchar *action_names[] =
+      const gchar *action_names[] =
       {
 	"lum redux",
 	"sat redux",
@@ -350,7 +358,7 @@
   gimp_drawable_mask_bounds (drw->drawable_id,
 			     &sel_x1, &sel_y1, &sel_x2, &sel_y2);
 
-  width = sel_x2 - sel_x1;
+  width  = sel_x2 - sel_x1;
   height = sel_y2 - sel_y1;
 
   src = g_new (guchar, width * height * bpp);
@@ -381,6 +389,8 @@
 
   for (y = sel_y1; y < sel_y2; y++)
     {
+      gint x;
+
       if (y % prog_interval == 0)
 	gimp_progress_update ((double) y / (double) (sel_y2 - sel_y1));
 
@@ -497,9 +507,11 @@
 			  pr = gc (pr, argp->mode);
 			  pg = gc (pg, argp->mode);
 			  pb = gc (pb, argp->mode);
-			  py = pr * mode[argp->mode].code[0][0] + pg *
-			    mode[argp->mode].code[0][1] + pb *
-			    mode[argp->mode].code[0][2];
+
+			  py = pr * mode[argp->mode].code[0][0] +
+                               pg * mode[argp->mode].code[0][1] +
+                               pb * mode[argp->mode].code[0][2];
+
 			  r = pix_encode (inv_gc (py + scale * (pr - py),
 						  argp->mode));
 			  g = pix_encode (inv_gc (py + scale * (pg - py),
@@ -507,10 +519,13 @@
 			  b = pix_encode (inv_gc (py + scale * (pb - py),
 						  argp->mode));
 			}
+
 		      *d++ = new_r = r;
 		      *d++ = new_g = g;
 		      *d++ = new_b = b;
+
 		      s += 3;
+
 		      if (bpp == 4)
 			*d++ = *s++;
 		      else if (argp->new_layerp)
@@ -533,6 +548,7 @@
 	    }
 	}
     }
+
   gimp_pixel_rgn_set_rect (&dstPr, dst, sel_x1, sel_y1, width, height);
 
   g_free (src);
@@ -552,11 +568,11 @@
 
   gimp_displays_flush ();
 
-  return retval;
+  return success;
 }
 
-static gint
-pluginCoreIA (piArgs *argp)
+static gboolean
+plugin_dialog (piArgs *argp)
 {
   GtkWidget *dlg;
   GtkWidget *hbox;
@@ -632,10 +648,7 @@
 
   gtk_widget_destroy (dlg);
 
-  if (run)
-    return pluginCore (argp);
-  else
-    return -1;
+  return run;
 }
 
 /*

Modified: branches/soc-2008-tagging/plug-ins/common/lcms.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/lcms.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/lcms.c	Sun Oct 12 15:38:02 2008
@@ -482,6 +482,9 @@
     }
 
  done:
+  if (run_mode != GIMP_RUN_NONINTERACTIVE)
+    gimp_displays_flush ();
+
   if (config)
     g_object_unref (config);
 
@@ -867,6 +870,8 @@
 
   if (! lcms_image_set_profile (image, dest_profile, filename, FALSE))
     {
+      gimp_image_undo_group_end (image);
+
       return FALSE;
     }
 
@@ -914,7 +919,6 @@
     }
 
   gimp_progress_update (1.0);
-  gimp_displays_flush ();
 
   gimp_image_undo_group_end (image);
 

Modified: branches/soc-2008-tagging/plug-ins/common/mail.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/mail.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/mail.c	Sun Oct 12 15:38:02 2008
@@ -122,32 +122,32 @@
 } m_info;
 
 
-static void   query (void);
-static void   run   (const gchar      *name,
-		     gint              nparams,
-		     const GimpParam  *param,
-		     gint             *nreturn_vals,
-		     GimpParam       **return_vals);
-
-static GimpPDBStatusType  save_image   (const gchar *filename,
-                                        gint32       image_ID,
-                                        gint32       drawable_ID,
-                                        gint32       run_mode);
-
-static gboolean   save_dialog          (void);
-static void       mail_entry_callback  (GtkWidget     *widget,
-                                        gchar         *data);
-static void       mesg_body_callback   (GtkTextBuffer *buffer,
-                                        gpointer       data);
-
-static gboolean   valid_file     (const gchar  *filename);
-static void       create_headers (FILE         *mailpipe);
-static gchar    * find_extension (const gchar  *filename);
-static gboolean   to64           (const gchar  *filename,
-                                  FILE         *outfile,
-                                  GError      **error);
-static FILE     * sendmail_pipe  (gchar       **cmd,
-                                  GPid         *pid);
+static void               query                (void);
+static void               run                  (const gchar      *name,
+                                                gint              nparams,
+                                                const GimpParam  *param,
+                                                gint             *nreturn_vals,
+                                                GimpParam       **return_vals);
+
+static GimpPDBStatusType  save_image           (const gchar      *filename,
+                                                gint32            image_ID,
+                                                gint32            drawable_ID,
+                                                gint32            run_mode);
+
+static gboolean           save_dialog          (void);
+static void               mail_entry_callback  (GtkWidget        *widget,
+                                                gchar            *data);
+static void               mesg_body_callback   (GtkTextBuffer    *buffer,
+                                                gpointer          data);
+
+static gboolean           valid_file           (const gchar      *filename);
+static void               create_headers       (FILE             *mailpipe);
+static gchar            * find_extension       (const gchar      *filename);
+static gboolean           to64                 (const gchar      *filename,
+                                                FILE             *outfile,
+                                                GError          **error);
+static FILE             * sendmail_pipe        (gchar           **cmd,
+                                                GPid             *pid);
 
 
 const GimpPlugInInfo PLUG_IN_INFO =

Modified: branches/soc-2008-tagging/plug-ins/common/nova.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/nova.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/nova.c	Sun Oct 12 15:38:02 2008
@@ -661,12 +661,12 @@
 
         if (mevent->state & GDK_BUTTON1_MASK)
           {
-            GdkModifierType mask;
-            gint            x, y;
+            gboolean retval = nova_center_update (widget, center,
+                                                  mevent->x, mevent->y);
 
-            gdk_window_get_pointer (widget->window, &x, &y, &mask);
+            gdk_event_request_motions (mevent);
 
-            return nova_center_update (widget, center, x, y);
+            return retval;
           }
       }
       break;

Modified: branches/soc-2008-tagging/plug-ins/common/photocopy.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/photocopy.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/photocopy.c	Sun Oct 12 15:38:02 2008
@@ -171,7 +171,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpDrawable      *drawable;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -238,8 +238,10 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/pixelize.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/pixelize.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/pixelize.c	Sun Oct 12 15:38:02 2008
@@ -163,7 +163,7 @@
   gimp_install_procedure (PIXELIZE_PROC,
                           N_("Simplify image into an array of solid-colored squares"),
                           "Pixelize the contents of the specified drawable "
-                          "with speficied pixelizing width.",
+                          "with specified pixelizing width.",
                           "Spencer Kimball & Peter Mattis, Tracy Scott, "
                           "(ported to 1.0 by) Eiichi Takamori",
                           "Spencer Kimball & Peter Mattis, Tracy Scott",
@@ -198,7 +198,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpDrawable      *drawable;
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -287,8 +287,10 @@
         }
       else
         {
-          /* g_message ("pixelize: cannot operate on indexed color images"); */
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/plugin-defs.pl
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/plugin-defs.pl	(original)
+++ branches/soc-2008-tagging/plug-ins/common/plugin-defs.pl	Sun Oct 12 15:38:02 2008
@@ -23,7 +23,6 @@
     'colorify' => { ui => 1 },
     'colormap-remap' => { ui => 1 },
     'compose' => { ui => 1 },
-    'compressor' => {},
     'contrast-normalize' => {},
     'contrast-retinex' => { ui => 1 },
     'contrast-stretch' => {},
@@ -49,6 +48,7 @@
     'engrave' => { ui => 1 },
     'file-aa' => { ui => 1, optional => 1, libs => 'AA_LIBS' },
     'file-cel' => { ui => 1 },
+    'file-compressor' => {},
     'file-csource' => { ui => 1 },
     'file-desktop-link' => {},
     'file-dicom' => { ui => 1 },

Modified: branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/sample-colorize.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/sample-colorize.c	Sun Oct 12 15:38:02 2008
@@ -1133,7 +1133,8 @@
       if (g_Sdebug)
         printf ("EVENT: GDK_MOTION_NOTIFY\n");
       mevent = (GdkEventMotion *) event;
-      gdk_window_get_pointer (widget->window, &x, NULL, NULL);
+      x = mevent->x;
+      gdk_event_request_motions (mevent);
       update = TRUE;
       break;
 
@@ -1240,7 +1241,8 @@
       if (g_Sdebug)
         printf ("OUT_EVENT: GDK_MOTION_NOTIFY\n");
       mevent = (GdkEventMotion *) event;
-      gdk_window_get_pointer (widget->window, &x, NULL, NULL);
+      x = mevent->x;
+      gdk_event_request_motions (mevent);
       update = TRUE;
       break;
 

Modified: branches/soc-2008-tagging/plug-ins/common/screenshot.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/screenshot.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/screenshot.c	Sun Oct 12 15:38:02 2008
@@ -257,7 +257,7 @@
                           G_N_ELEMENTS (return_vals),
 			  args, return_vals);
 
-  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/New/Acquire");
+  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/Create/Acquire");
   gimp_plugin_icon_register (PLUG_IN_PROC, GIMP_ICON_TYPE_INLINE_PIXBUF,
                              screenshot_icon);
 }

Modified: branches/soc-2008-tagging/plug-ins/common/softglow.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/softglow.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/softglow.c	Sun Oct 12 15:38:02 2008
@@ -152,7 +152,7 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpDrawable      *drawable;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
@@ -218,8 +218,10 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
     }
 

Modified: branches/soc-2008-tagging/plug-ins/common/web-browser.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/web-browser.c	(original)
+++ branches/soc-2008-tagging/plug-ins/common/web-browser.c	Sun Oct 12 15:38:02 2008
@@ -42,7 +42,8 @@
                                   const GimpParam  *param,
                                   gint             *nreturn_vals,
                                   GimpParam       **return_vals);
-static gboolean browser_open_url (const gchar      *url);
+static gboolean browser_open_url (const gchar      *url,
+                                  GError          **error);
 
 #ifndef G_OS_WIN32
 static gchar*   strreplace       (const gchar      *string,
@@ -88,9 +89,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpPDBStatusType  status;
+  GError            *error = NULL;
+
+  *nreturn_vals = 1;
+  *return_vals  = values;
 
   run_mode = param[0].data.d_int32;
   status   = GIMP_PDB_SUCCESS;
@@ -101,31 +106,90 @@
       param[0].data.d_string != NULL &&
       strlen (param[0].data.d_string))
     {
-      if (! browser_open_url (param[0].data.d_string))
-        status = GIMP_PDB_EXECUTION_ERROR;
+      if (! browser_open_url (param[0].data.d_string, &error))
+        {
+          status                  = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals           = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = error->message;
+        }
     }
   else
     {
       status = GIMP_PDB_CALLING_ERROR;
     }
 
-  *nreturn_vals = 1;
-  *return_vals  = values;
-
   values[0].type          = GIMP_PDB_STATUS;
   values[0].data.d_status = status;
 }
 
 static gboolean
-browser_open_url (const gchar *url)
+browser_open_url (const gchar  *url,
+                  GError      **error)
 {
 #ifdef G_OS_WIN32
+  HINSTANCE hinst = ShellExecute (GetDesktopWindow(),
+                                  "open", url, NULL, NULL, SW_SHOW);
+
+  if ((gint) hinst <= 32)
+    {
+      const gchar *err;
+
+      /* FIXME: should be translated when 2.6 got it's own branch */
+      switch ((gint) hinst)
+        {
+	  case 0 :
+	    err = ("The operating system is out of memory or resources.");
+	    break;
+	  case ERROR_FILE_NOT_FOUND :
+	    err = ("The specified file was not found.");
+	    break;
+	  case ERROR_PATH_NOT_FOUND :
+	    err = ("The specified path was not found.");
+	    break;
+	  case ERROR_BAD_FORMAT	:
+	    err = ("The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image).");
+	    break;
+	  case SE_ERR_ACCESSDENIED :
+	    err = ("The operating system denied access to the specified file.");
+	    break;
+	  case SE_ERR_ASSOCINCOMPLETE :
+	    err = ("The file name association is incomplete or invalid.");
+	    break;
+	  case SE_ERR_DDEBUSY :
+	    err = ("DDE transaction busy");
+	    break;
+	  case SE_ERR_DDEFAIL :
+	    err = ("The DDE transaction failed.");
+	    break;
+	  case SE_ERR_DDETIMEOUT :
+	    err = ("The DDE transaction timed out.");
+	    break;
+	  case SE_ERR_DLLNOTFOUND :
+	    err = ("The specified DLL was not found.");
+	    break;
+	  case SE_ERR_NOASSOC :
+	    err = ("There is no application associated with the given file name extension.");
+	    break;
+	  case SE_ERR_OOM :
+	    err = ("There was not enough memory to complete the operation.");
+	    break;
+	  case SE_ERR_SHARE:
+	    err = ("A sharing violation occurred.");
+	    break;
+	  default :
+	    err = ("Unknown Windows error.");
+	}
 
-  return ((gint) ShellExecute (GetDesktopWindow(), "open", url, NULL, NULL, SW_SHOW) > 32);
+      g_set_error (error, 0, 0, ("Failed to open '%s': %s"), url, err);
 
+      return FALSE;
+    }
+
+  return TRUE;
 #else
 
-  GError    *error = NULL;
+  GError    *my_error = NULL;
   gchar     *browser;
   gchar     *argument;
   gchar     *cmd;
@@ -138,8 +202,9 @@
 
   if (browser == NULL || ! strlen (browser))
     {
-      g_message (_("Web browser not specified.\n"
-                   "Please specify a web browser using the Preferences dialog."));
+      g_set_error (error, 0, 0,
+                   _("Web browser not specified.\n"
+                     "Please specify a web browser using the Preferences dialog."));
       g_free (browser);
       return FALSE;
     }
@@ -153,33 +218,37 @@
   else
     cmd = g_strconcat (browser, " ", argument, NULL);
 
+  g_free (browser);
   g_free (argument);
 
   /* parse the cmd line */
-  if (! g_shell_parse_argv (cmd, NULL, &argv, &error))
+  if (! g_shell_parse_argv (cmd, NULL, &argv, &my_error))
     {
-      g_message (_("Could not parse the web browser command specified in the "
-                   "Preferences dialog:\n\n%s"),
-                 error->message);
-      g_error_free (error);
+      g_set_error (error, 0, 0,
+                   _("Could not parse the web browser command specified in the "
+                     "Preferences dialog:\n\n%s"),
+                   my_error->message);
+      g_error_free (my_error);
+      g_free (cmd);
       return FALSE;
     }
 
+  g_free (cmd);
+
   retval = g_spawn_async (NULL, argv, NULL,
                           G_SPAWN_SEARCH_PATH,
                           NULL, NULL,
-                          NULL, &error);
+                          NULL, &my_error);
 
   if (! retval)
     {
-      g_message (_("Could not execute the web browser specified in the "
-                   "Preferences dialog:\n\n%s"),
-                 error->message);
-      g_error_free (error);
+      g_set_error (error, 0, 0,
+                   _("Could not execute the web browser specified in the "
+                     "Preferences dialog:\n\n%s"),
+                   my_error->message);
+      g_error_free (my_error);
     }
 
-  g_free (browser);
-  g_free (cmd);
   g_strfreev (argv);
 
   return retval;

Modified: branches/soc-2008-tagging/plug-ins/file-bmp/bmp-read.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-bmp/bmp-read.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-bmp/bmp-read.c	Sun Oct 12 15:38:02 2008
@@ -42,16 +42,17 @@
 #define BI_BITFIELDS    3
 #endif
 
-static gint32 ReadImage (FILE     *fd,
-                         gint      width,
-                         gint      height,
-                         guchar    cmap[256][3],
-                         gint      ncols,
-                         gint      bpp,
-                         gint      compression,
-                         gint      rowbytes,
-                         gboolean  grey,
-                         const Bitmap_Channel *masks);
+static gint32 ReadImage (FILE                  *fd,
+                         gint                   width,
+                         gint                   height,
+                         guchar                 cmap[256][3],
+                         gint                   ncols,
+                         gint                   bpp,
+                         gint                   compression,
+                         gint                   rowbytes,
+                         gboolean               grey,
+                         const Bitmap_Channel  *masks,
+                         GError               **error);
 
 
 static gint32
@@ -93,6 +94,7 @@
       buffer[i][2] = rgb[0];
       *grey = ((*grey) && (rgb[0]==rgb[1]) && (rgb[1]==rgb[2]));
     }
+
   return TRUE;
 }
 
@@ -126,11 +128,13 @@
                i, masks[i].mask, masks[i].shiftin, (gint)masks[i].max_value);
 #endif
     }
+
   return TRUE;
 }
 
 gint32
-ReadBMP (const gchar *name)
+ReadBMP (const gchar  *name,
+         GError      **error)
 {
   FILE     *fd;
   guchar    buffer[64];
@@ -146,8 +150,9 @@
 
   if (!fd)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -161,8 +166,9 @@
      !strncmp (magick, "PI", 2) || !strncmp (magick, "CI", 2) ||
      !strncmp (magick, "CP", 2)))
     {
-      g_message (_("'%s' is not a valid BMP file"),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -170,22 +176,25 @@
     {
       if (!ReadOK (fd, buffer, 12))
         {
-          g_message (_("'%s' is not a valid BMP file"),
-                      gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("'%s' is not a valid BMP file"),
+                       gimp_filename_to_utf8 (filename));
           return -1;
         }
       if (!ReadOK (fd, magick, 2))
         {
-          g_message (_("'%s' is not a valid BMP file"),
-                      gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("'%s' is not a valid BMP file"),
+                       gimp_filename_to_utf8 (filename));
           return -1;
         }
     }
 
   if (!ReadOK (fd, buffer, 12))
     {
-      g_message (_("'%s' is not a valid BMP file"),
-                  gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -198,8 +207,9 @@
 
   if (!ReadOK (fd, buffer, 4))
     {
-      g_message (_("'%s' is not a valid BMP file"),
-                  gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -211,8 +221,9 @@
     {
       if (!ReadOK (fd, buffer, 8))
         {
-          g_message (_("Error reading BMP file header from '%s'"),
-                      gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Error reading BMP file header from '%s'"),
+                       gimp_filename_to_utf8 (filename));
           return -1;
         }
 
@@ -237,10 +248,12 @@
     {
       if (!ReadOK (fd, buffer, 36))
         {
-          g_message (_("Error reading BMP file header from '%s'"),
-                      gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Error reading BMP file header from '%s'"),
+                       gimp_filename_to_utf8 (filename));
           return -1;
         }
+
       Bitmap_Head.biWidth   = ToL (&buffer[0x00]);      /* 12 */
       Bitmap_Head.biHeight  = ToL (&buffer[0x04]);      /* 16 */
       Bitmap_Head.biPlanes  = ToS (&buffer[0x08]);       /* 1A */
@@ -260,22 +273,24 @@
       memset(masks, 0, sizeof(masks));
 
       if (Bitmap_Head.biCompr == BI_BITFIELDS)
-      {
-         if (!ReadOK (fd, buffer, 3 * sizeof (guint32)))
-         {
-            g_message (_("Error reading BMP file header from '%s'"),
-                       gimp_filename_to_utf8 (filename));
-            return -1;
-         }
-         Bitmap_Head.masks[0] = ToL(&buffer[0x00]);
-         Bitmap_Head.masks[1] = ToL(&buffer[0x04]);
-         Bitmap_Head.masks[2] = ToL(&buffer[0x08]);
+        {
+          if (!ReadOK (fd, buffer, 3 * sizeof (guint32)))
+            {
+              g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                           _("Error reading BMP file header from '%s'"),
+                           gimp_filename_to_utf8 (filename));
+              return -1;
+            }
+
+          Bitmap_Head.masks[0] = ToL(&buffer[0x00]);
+          Bitmap_Head.masks[1] = ToL(&buffer[0x04]);
+          Bitmap_Head.masks[2] = ToL(&buffer[0x08]);
          ReadChannelMasks (&Bitmap_Head.masks[0], masks, 3);
-      }
+        }
       else
-         switch (Bitmap_Head.biBitCnt)
-         {
-         case 32:
+        switch (Bitmap_Head.biBitCnt)
+          {
+          case 32:
             masks[0].mask     = 0x00ff0000;
             masks[0].shiftin  = 16;
             masks[0].max_value= (gfloat)255.0;
@@ -326,10 +341,12 @@
     {
       if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
         {
-          g_message (_("Error reading BMP file header from '%s'"),
-                      gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Error reading BMP file header from '%s'"),
+                       gimp_filename_to_utf8 (filename));
           return -1;
         }
+
       Bitmap_Head.biWidth   =ToL (&buffer[0x00]);       /* 12 */
       Bitmap_Head.biHeight  =ToL (&buffer[0x04]);       /* 16 */
       Bitmap_Head.biPlanes  =ToS (&buffer[0x08]);       /* 1A */
@@ -350,8 +367,9 @@
     }
   else
     {
-      g_message (_("Error reading BMP file header from '%s'"),
-                  gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Error reading BMP file header from '%s'"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
@@ -371,30 +389,37 @@
 
   /* Sanity checks */
 
-  if (Bitmap_Head.biHeight == 0 || Bitmap_Head.biWidth == 0) {
-      g_message (_("Error reading BMP file header from '%s'"),
-                  gimp_filename_to_utf8 (filename));
+  if (Bitmap_Head.biHeight == 0 || Bitmap_Head.biWidth == 0)
+    {
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
-  }
+    }
 
   if (Bitmap_Head.biWidth < 0)
     {
-      g_message (_("'%s' is not a valid BMP file"),
-                  gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     }
 
-  if (Bitmap_Head.biPlanes != 1) {
-      g_message (_("Error reading BMP file header from '%s'"),
-                  gimp_filename_to_utf8 (filename));
+  if (Bitmap_Head.biPlanes != 1)
+    {
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
-  }
+    }
 
-  if (Bitmap_Head.biClrUsed > 256) {
-      g_message (_("Error reading BMP file header from '%s'"),
-                  gimp_filename_to_utf8 (filename));
+  if (Bitmap_Head.biClrUsed > 256)
+    {
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("'%s' is not a valid BMP file"),
+                   gimp_filename_to_utf8 (filename));
       return -1;
-  }
+    }
 
   /* Windows and OS/2 declare filler so that rows are a multiple of
    * word length (32 bits == 4 bytes)
@@ -436,7 +461,8 @@
                         Bitmap_Head.biCompr,
                         rowbytes,
                         Grey,
-                        masks);
+                        masks,
+                        error);
 
   if (image_ID < 0)
     return -1;
@@ -465,16 +491,17 @@
 }
 
 static gint32
-ReadImage (FILE     *fd,
-           gint      width,
-           gint      height,
-           guchar    cmap[256][3],
-           gint      ncols,
-           gint      bpp,
-           gint      compression,
-           gint      rowbytes,
-           gboolean  grey,
-           const Bitmap_Channel *masks)
+ReadImage (FILE                  *fd,
+           gint                   width,
+           gint                   height,
+           guchar                 cmap[256][3],
+           gint                   ncols,
+           gint                   bpp,
+           gint                   compression,
+           gint                   rowbytes,
+           gboolean               grey,
+           const Bitmap_Channel  *masks,
+           GError               **error)
 {
   guchar             v, n;
   GimpPixelRgn       pixel_rgn;
@@ -499,7 +526,9 @@
       (bpp == 16 && compression == BI_BITFIELDS) ||
       (bpp == 32 && compression == BI_BITFIELDS)))
     {
-      g_message (_("Unrecognized or invalid BMP compression format."));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s",
+                   _("Unrecognized or invalid BMP compression format."));
       return -1;
     }
 
@@ -550,11 +579,13 @@
       g_message (_("Unsupported or invalid image width: %d"), width);
       return -1;
     }
+
   if ((height < 0) || (height > GIMP_MAX_IMAGE_SIZE))
     {
       g_message (_("Unsupported or invalid image height: %d"), height);
       return -1;
     }
+
   image = gimp_image_new (width, height, base_type);
   layer = gimp_layer_new (image, _("Background"),
                           width, height,

Modified: branches/soc-2008-tagging/plug-ins/file-bmp/bmp-write.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-bmp/bmp-write.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-bmp/bmp-write.c	Sun Oct 12 15:38:02 2008
@@ -138,9 +138,10 @@
 }
 
 GimpPDBStatusType
-WriteBMP (const gchar *filename,
-          gint32       image,
-          gint32       drawable_ID)
+WriteBMP (const gchar  *filename,
+          gint32        image,
+          gint32        drawable_ID,
+          GError      **error)
 {
   FILE          *outfile;
   gint           Red[MAXCOLORS];
@@ -291,8 +292,9 @@
   outfile = g_fopen (filename, "wb");
   if (!outfile)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                  gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return GIMP_PDB_EXECUTION_ERROR;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/file-bmp/bmp.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-bmp/bmp.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-bmp/bmp.c	Sun Oct 12 15:38:02 2008
@@ -157,12 +157,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -193,7 +194,7 @@
 
        if (status == GIMP_PDB_SUCCESS)
          {
-           image_ID = ReadBMP (param[1].data.d_string);
+           image_ID = ReadBMP (param[1].data.d_string, &error);
 
            if (image_ID != -1)
              {
@@ -246,7 +247,8 @@
         }
 
       if (status == GIMP_PDB_SUCCESS)
-        status = WriteBMP (param[3].data.d_string, image_ID, drawable_ID);
+        status = WriteBMP (param[3].data.d_string, image_ID, drawable_ID,
+                           &error);
 
       if (export == GIMP_EXPORT_EXPORT)
         gimp_image_delete (image_ID);
@@ -256,5 +258,12 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }

Modified: branches/soc-2008-tagging/plug-ins/file-bmp/bmp.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-bmp/bmp.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-bmp/bmp.h	Sun Oct 12 15:38:02 2008
@@ -32,10 +32,14 @@
 #define Write(file,buffer,len)   fwrite(buffer, len, 1, file)
 #define WriteOK(file,buffer,len) (Write(buffer, len, file) != 0)
 
-gint32             ReadBMP   (const gchar *filename);
-GimpPDBStatusType  WriteBMP  (const gchar *filename,
-                              gint32       image,
-                              gint32       drawable_ID);
+
+gint32             ReadBMP   (const gchar  *filename,
+                              GError      **error);
+GimpPDBStatusType  WriteBMP  (const gchar  *filename,
+                              gint32        image,
+                              gint32        drawable_ID,
+                              GError      **error);
+
 
 extern       gboolean  interactive;
 extern       gboolean  lastvals;

Modified: branches/soc-2008-tagging/plug-ins/file-faxg3/faxg3.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-faxg3/faxg3.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-faxg3/faxg3.c	Sun Oct 12 15:38:02 2008
@@ -61,7 +61,8 @@
 			  gint             *nreturn_vals,
 			  GimpParam       **return_vals);
 
-static gint32 load_image (const gchar      *filename);
+static gint32 load_image (const gchar      *filename,
+                          GError          **error);
 
 static gint32 emitgimp   (gint              hcol,
                           gint              row,
@@ -120,14 +121,16 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam values[2];
-  GimpRunMode      run_mode;
-  gint32           image_ID;
+  static GimpParam  values[2];
+  GimpRunMode       run_mode;
+  gint32            image_ID;
+  GError           *error = NULL;
 
   run_mode = param[0].data.d_int32;
 
   *nreturn_vals = 1;
   *return_vals = values;
+
   values[0].type = GIMP_PDB_STATUS;
   values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
 
@@ -135,19 +138,27 @@
     {
       INIT_I18N();
 
-      *nreturn_vals = 2;
-      image_ID = load_image (param[1].data.d_string);
-      values[1].type = GIMP_PDB_IMAGE;
-      values[1].data.d_image = image_ID;
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
 	{
+          *nreturn_vals = 2;
+
 	  values[0].data.d_status = GIMP_PDB_SUCCESS;
+          values[1].type = GIMP_PDB_IMAGE;
+          values[1].data.d_image = image_ID;
 	}
       else
 	{
 	  values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
-	}
+
+          if (error)
+            {
+              *nreturn_vals = 2;
+              values[1].type          = GIMP_PDB_STRING;
+              values[1].data.d_string = error->message;
+            }
+        }
     }
 }
 
@@ -181,8 +192,10 @@
 #define MAX_ROWS 4300
 #define MAX_COLS 1728		/* !! FIXME - command line parameter */
 
+
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   int data;
   int hibit;
@@ -216,8 +229,9 @@
 
   if (fd < 0)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -289,7 +303,7 @@
 	if ( p == NULL )	/* invalid code */
 	{
 	    g_printerr ("invalid code, row=%d, col=%d, file offset=%lx, skip to eol\n",
-		     row, col, (unsigned long) lseek( fd, 0, 1 ) - rs + rp );
+                        row, col, (unsigned long) lseek( fd, 0, 1 ) - rs + rp );
 	    while ( ( data & 0x03f ) != 0 )
 	    {
 		data >>= 1; hibit--;

Modified: branches/soc-2008-tagging/plug-ins/file-fits/fits-io.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-fits/fits-io.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-fits/fits-io.c	Sun Oct 12 15:38:02 2008
@@ -104,7 +104,7 @@
 static void fits_delete_hdulist (FITS_HDU_LIST *hl);
 static int  fits_nan_32 (unsigned char *value);
 static int  fits_nan_64 (unsigned char *value);
-static void fits_set_error (char *errmsg);
+static void fits_set_error (const char *errmsg);
 static void fits_drop_error (void);
 static FITS_RECORD_LIST *fits_read_header (FILE *fp, int *nrec);
 static FITS_HDU_LIST *fits_decode_header (FITS_RECORD_LIST *hdr,
@@ -496,7 +496,7 @@
 /* #END-PAR                                                                  */
 /*****************************************************************************/
 
-static void fits_set_error (char *errmsg)
+static void fits_set_error (const char *errmsg)
 
 {
   if (fits_n_error < FITS_MAX_ERROR)
@@ -724,7 +724,7 @@
 /* #END-PAR                                                                  */
 /*****************************************************************************/
 
-int fits_add_card (FITS_HDU_LIST *hdulist, char *card)
+int fits_add_card (FITS_HDU_LIST *hdulist, const char *card)
 
 {int k;
 

Modified: branches/soc-2008-tagging/plug-ins/file-fits/fits-io.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-fits/fits-io.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-fits/fits-io.h	Sun Oct 12 15:38:02 2008
@@ -136,7 +136,7 @@
 FITS_FILE     *fits_open (const char *filename, const char *openmode);
 void           fits_close (FITS_FILE *ff);
 FITS_HDU_LIST *fits_add_hdu (FITS_FILE *ff);
-int            fits_add_card (FITS_HDU_LIST *hdulist, char *card);
+int            fits_add_card (FITS_HDU_LIST *hdulist, const char *card);
 int            fits_write_header (FITS_FILE *ff, FITS_HDU_LIST *hdulist);
 FITS_HDU_LIST *fits_image_info (FITS_FILE *ff, int picind, int *hdupicind);
 FITS_HDU_LIST *fits_seek_image (FITS_FILE *ff, int picind);

Modified: branches/soc-2008-tagging/plug-ins/file-fits/fits.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-fits/fits.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-fits/fits.c	Sun Oct 12 15:38:02 2008
@@ -73,10 +73,12 @@
                           gint             *nreturn_vals,
                           GimpParam       **return_vals);
 
-static gint32 load_image (const gchar  *filename);
-static gint   save_image (const gchar  *filename,
-                          gint32        image_ID,
-                          gint32        drawable_ID);
+static gint32 load_image (const gchar      *filename,
+                          GError          **error);
+static gint   save_image (const gchar      *filename,
+                          gint32            image_ID,
+                          gint32            drawable_ID,
+                          GError          **error);
 
 static FITS_HDU_LIST *create_fits_header (FITS_FILE *ofp,
 					  guint width,
@@ -207,6 +209,7 @@
   gint32             image_ID;
   gint32             drawable_ID;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   l_run_mode = run_mode = (GimpRunMode)param[0].data.d_int32;
 
@@ -246,7 +249,7 @@
       if (status == GIMP_PDB_SUCCESS)
 	{
 	  check_load_vals ();
-	  image_ID = load_image (param[1].data.d_string);
+	  image_ID = load_image (param[1].data.d_string, &error);
 
 	  /* Write out error messages of FITS-Library */
 	  show_fits_errors ();
@@ -312,7 +315,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID))
+	  if (! save_image (param[3].data.d_string, image_ID, drawable_ID,
+                            &error))
 	    status = GIMP_PDB_EXECUTION_ERROR;
 	}
 
@@ -324,12 +328,20 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 
 static gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **error)
 {
   gint32 image_ID, *image_list, *nl;
   guint  picnum;
@@ -342,23 +354,26 @@
   fp = g_fopen (filename, "rb");
   if (!fp)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
-      return (-1);
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
+      return -1;
     }
   fclose (fp);
 
   ifp = fits_open (filename, "r");
   if (ifp == NULL)
     {
-      g_message (_("Error during open of FITS file"));
-      return (-1);
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("Error during open of FITS file"));
+      return -1;
     }
   if (ifp->n_pic <= 0)
     {
-      g_message (_("FITS file keeps no displayable images"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("FITS file keeps no displayable images"));
       fits_close (ifp);
-      return (-1);
+      return -1;
     }
 
   image_list = g_new (gint32, 10);
@@ -421,9 +436,10 @@
 
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   FITS_FILE* ofp;
   GimpImageType drawable_type;
@@ -434,7 +450,9 @@
   /*  Make sure we're not saving an image with an alpha channel  */
   if (gimp_drawable_has_alpha (drawable_ID))
     {
-      g_message (_("FITS save cannot handle images with alpha channels"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s",
+                   _("FITS save cannot handle images with alpha channels"));
       return FALSE;
     }
 
@@ -454,8 +472,9 @@
   ofp = fits_open (filename, "w");
   if (!ofp)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return (FALSE);
     }
 
@@ -691,7 +710,7 @@
 {
   FITS_HDU_LIST *hdulist;
   int print_ctype3 = 0;   /* The CTYPE3-card may not be FITS-conforming */
-  static char *ctype3_card[] =
+  static const char *ctype3_card[] =
   {
     NULL, NULL, NULL,  /* bpp = 0: no additional card */
     "COMMENT Image type within GIMP: GIMP_GRAY_IMAGE",

Modified: branches/soc-2008-tagging/plug-ins/file-fli/fli-gimp.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-fli/fli-gimp.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-fli/fli-gimp.c	Sun Oct 12 15:38:02 2008
@@ -79,21 +79,24 @@
                               GimpParam       **return_vals);
 
 /* return the image-ID of the new image, or -1 in case of an error */
-static gint32    load_image  (const  gchar *filename,
-                              gint32        from_frame,
-                              gint32        to_frame);
-static gboolean  load_dialog (const gchar  *name);
-
-static gboolean  save_image  (const gchar  *filename,
-                              gint32        image_id,
-                              gint32        from_frame,
-                              gint32        to_frame);
-static gboolean  save_dialog (gint32        image_id);
-
-static gboolean  get_info    (const gchar  *filename,
-                              gint32       *width,
-                              gint32       *height,
-                              gint32       *frames);
+static gint32    load_image  (const  gchar  *filename,
+                              gint32         from_frame,
+                              gint32         to_frame,
+                              GError       **error);
+static gboolean  load_dialog (const gchar   *filename);
+
+static gboolean  save_image  (const gchar   *filename,
+                              gint32         image_id,
+                              gint32         from_frame,
+                              gint32         to_frame,
+                              GError       **error);
+static gboolean  save_dialog (gint32         image_id);
+
+static gboolean  get_info    (const gchar   *filename,
+                              gint32        *width,
+                              gint32        *height,
+                              gint32        *frames,
+                              GError       **error);
 
 /*
  * GIMP interface
@@ -218,13 +221,14 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  GimpRunMode       run_mode;
-  gint32            pc;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  gint32            orig_image_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  GimpRunMode        run_mode;
+  gint32             pc;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  gint32             orig_image_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -274,7 +278,7 @@
                         -1 : param[4].data.d_int32);
 
           image_ID = load_image (param[1].data.d_string,
-				 from_frame, to_frame);
+                                 from_frame, to_frame, &error);
 
 	  if (image_ID != -1)
 	    {
@@ -283,14 +287,16 @@
 	      values[1].data.d_image = image_ID;
 	    }
 	  else
-	    status = GIMP_PDB_EXECUTION_ERROR;
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+            }
 	  break;
 
 	case GIMP_RUN_INTERACTIVE:
 	  if (load_dialog (param[1].data.d_string))
 	    {
 	      image_ID = load_image (param[1].data.d_string,
-				     from_frame, to_frame);
+                                     from_frame, to_frame, &error);
 
 	      if (image_ID != -1)
 		{
@@ -299,10 +305,14 @@
 		  values[1].data.d_image = image_ID;
 		}
 	      else
-		status = GIMP_PDB_EXECUTION_ERROR;
-	    }
+                {
+                  status = GIMP_PDB_EXECUTION_ERROR;
+                }
+            }
 	  else
-	    status = GIMP_PDB_CANCEL;
+            {
+              status = GIMP_PDB_CANCEL;
+            }
 	  break;
 
 	case GIMP_RUN_WITH_LAST_VALS:
@@ -333,8 +343,10 @@
 	    }
 	  if (! save_image (param[3].data.d_string, image_ID,
 			    param[5].data.d_int32,
-			    param[6].data.d_int32))
-	    status = GIMP_PDB_EXECUTION_ERROR;
+			    param[6].data.d_int32, &error))
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+            }
 	  break;
 
 	case GIMP_RUN_INTERACTIVE:
@@ -353,11 +365,16 @@
 
 	  if (save_dialog (param[1].data.d_image))
 	    {
-	      if (! save_image (param[3].data.d_string, image_ID, from_frame, to_frame))
-		status = GIMP_PDB_EXECUTION_ERROR;
-	    }
+	      if (! save_image (param[3].data.d_string,
+                                image_ID, from_frame, to_frame, &error))
+                {
+                  status = GIMP_PDB_EXECUTION_ERROR;
+                }
+            }
 	  else
-	    status = GIMP_PDB_CANCEL;
+            {
+              status = GIMP_PDB_CANCEL;
+            }
 	  break;
 	}
 
@@ -388,7 +405,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
 	{
-	  if (get_info (param[0].data.d_string, &width, &height, &frames))
+	  if (get_info (param[0].data.d_string,
+                        &width, &height, &frames, &error))
 	    {
 	      *nreturn_vals = 4;
 	      values[1].type = GIMP_PDB_INT32;
@@ -399,11 +417,22 @@
 	      values[3].data.d_int32 = frames;
 	    }
 	  else
-	    status = GIMP_PDB_EXECUTION_ERROR;
-	}
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+            }
+        }
     }
   else
-    status = GIMP_PDB_CALLING_ERROR;
+    {
+      status = GIMP_PDB_CALLING_ERROR;
+    }
+
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
 
   values[0].data.d_status = status;
 }
@@ -412,10 +441,11 @@
  * Open FLI animation and return header-info
  */
 static gboolean
-get_info (const gchar *filename,
-	  gint32      *width,
-	  gint32      *height,
-	  gint32      *frames)
+get_info (const gchar  *filename,
+	  gint32       *width,
+	  gint32       *height,
+	  gint32       *frames,
+          GError      **error)
 {
   FILE *file;
   s_fli_header fli_header;
@@ -426,13 +456,16 @@
 
   if (!file)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                  gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
+
   fli_read_header (file, &fli_header);
   fclose (file);
-  *width = fli_header.width;
+
+  *width  = fli_header.width;
   *height = fli_header.height;
   *frames = fli_header.frames;
 
@@ -443,26 +476,26 @@
  * load fli animation and store as framestack
  */
 static gint32
-load_image (const gchar *filename,
-	    gint32       from_frame,
-	    gint32       to_frame)
+load_image (const gchar  *filename,
+	    gint32        from_frame,
+	    gint32        to_frame,
+            GError      **error)
 {
-  FILE *file;
+  FILE         *file;
   GimpDrawable *drawable;
-  gint32 image_id, layer_ID;
-
-  guchar *fb, *ofb, *fb_x;
-  guchar cm[768], ocm[768];
-  GimpPixelRgn pixel_rgn;
-  s_fli_header fli_header;
-
-  gint cnt;
+  gint32        image_id, layer_ID;
+  guchar       *fb, *ofb, *fb_x;
+  guchar        cm[768], ocm[768];
+  GimpPixelRgn  pixel_rgn;
+  s_fli_header  fli_header;
+  gint          cnt;
 
   file = g_fopen (filename ,"rb");
   if (!file)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                  gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -578,10 +611,11 @@
  * (some code was taken from the GIF plugin.)
  */
 static gboolean
-save_image (const gchar *filename,
-	    gint32       image_id,
-	    gint32       from_frame,
-	    gint32       to_frame)
+save_image (const gchar  *filename,
+	    gint32        image_id,
+	    gint32        from_frame,
+	    gint32        to_frame,
+            GError      **error)
 {
   FILE *file;
   GimpDrawable *drawable;
@@ -712,8 +746,9 @@
   file = g_fopen (filename ,"wb");
   if (!file)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                  gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
   fseek (file, 128, SEEK_SET);
@@ -792,7 +827,7 @@
  * Dialogs for interactive usage
  */
 static gboolean
-load_dialog (const gchar *name)
+load_dialog (const gchar *filename)
 {
   GtkWidget *dialog;
   GtkWidget *table;
@@ -801,7 +836,7 @@
   gint32     width, height, nframes;
   gboolean   run;
 
-  get_info (name, &width, &height, &nframes);
+  get_info (filename, &width, &height, &nframes, NULL);
 
   from_frame = 1;
   to_frame   = nframes;

Modified: branches/soc-2008-tagging/plug-ins/file-ico/ico-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-ico/ico-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-ico/ico-load.c	Sun Oct 12 15:38:02 2008
@@ -157,10 +157,10 @@
     {
       png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL,
                                         NULL);
-      if ( !png_ptr )
+      if (! png_ptr )
         return FALSE;
       info_ptr = png_create_info_struct (png_ptr);
-      if ( !info_ptr )
+      if (! info_ptr )
         {
           png_destroy_read_struct (&png_ptr, NULL, NULL);
           return FALSE;
@@ -257,10 +257,10 @@
   gint          i;
 
   png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-  if ( !png_ptr )
+  if (! png_ptr )
     return FALSE;
   info = png_create_info_struct (png_ptr);
-  if ( !info )
+  if (! info )
     {
       png_destroy_read_struct (&png_ptr, NULL, NULL);
       return FALSE;
@@ -630,7 +630,8 @@
 
 
 gint32
-ico_load_image (const gchar *filename)
+ico_load_image (const gchar  *filename,
+                GError      **error)
 {
   FILE        *fp;
   IcoLoadInfo *info;
@@ -646,10 +647,11 @@
                              gimp_filename_to_utf8 (filename));
 
   fp = g_fopen (filename, "rb");
-  if ( !fp )
+  if (! fp )
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -704,9 +706,10 @@
 }
 
 gint32
-ico_load_thumbnail_image (const gchar *filename,
-                          gint        *width,
-                          gint        *height)
+ico_load_thumbnail_image (const gchar  *filename,
+                          gint         *width,
+                          gint         *height,
+                          GError      **error)
 {
   FILE        *fp;
   IcoLoadInfo *info;
@@ -723,15 +726,16 @@
                              gimp_filename_to_utf8 (filename));
 
   fp = g_fopen (filename, "rb");
-  if ( !fp )
+  if (! fp )
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
   icon_count = ico_read_init (fp);
-  if ( !icon_count )
+  if (! icon_count )
     {
       fclose (fp);
       return -1;
@@ -741,7 +745,7 @@
      filename, icon_count));
 
   info = ico_read_info (fp, icon_count);
-  if ( !info )
+  if (! info )
     {
       fclose (fp);
       return -1;

Modified: branches/soc-2008-tagging/plug-ins/file-ico/ico-load.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-ico/ico-load.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-ico/ico-load.h	Sun Oct 12 15:38:02 2008
@@ -22,19 +22,23 @@
 #ifndef __ICO_LOAD_H__
 #define __ICO_LOAD_H__
 
-gint32 ico_load_image           (const gchar  *filename);
-gint32 ico_load_thumbnail_image (const gchar  *filename,
-                                 gint         *width,
-                                 gint         *height);
-gint   ico_get_bit_from_data    (const guint8 *data,
-                                 gint          line_width,
-                                 gint          bit);
-gint   ico_get_nibble_from_data (const guint8 *data,
-                                 gint          line_width,
-                                 gint          nibble);
-gint   ico_get_byte_from_data   (const guint8 *data,
-                                 gint          line_width,
-                                 gint          byte);
+
+gint32 ico_load_image           (const gchar   *filename,
+                                 GError       **error);
+gint32 ico_load_thumbnail_image (const gchar   *filename,
+                                 gint          *width,
+                                 gint          *height,
+                                 GError       **error);
+
+gint   ico_get_bit_from_data    (const guint8  *data,
+                                 gint           line_width,
+                                 gint           bit);
+gint   ico_get_nibble_from_data (const guint8  *data,
+                                 gint           line_width,
+                                 gint           nibble);
+gint   ico_get_byte_from_data   (const guint8  *data,
+                                 gint           line_width,
+                                 gint           byte);
 
 
 #endif /* __ICO_LOAD_H__ */

Modified: branches/soc-2008-tagging/plug-ins/file-ico/ico-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-ico/ico-save.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-ico/ico-save.c	Sun Oct 12 15:38:02 2008
@@ -324,10 +324,10 @@
 
 /* Create a colormap from the given buffer data */
 static guint32 *
-ico_create_palette(guchar *cmap,
-                   gint    num_colors,
-                   gint    num_colors_used,
-                   gint   *black_slot)
+ico_create_palette (const guchar *cmap,
+                    gint          num_colors,
+                    gint          num_colors_used,
+                    gint         *black_slot)
 {
   guchar *palette;
   gint    i;
@@ -374,18 +374,21 @@
 
 
 static GHashTable *
-ico_create_color_to_palette_map (guint32 *palette,
-                                 gint     num_colors)
+ico_create_color_to_palette_map (const guint32 *palette,
+                                 gint           num_colors)
 {
   GHashTable *hash;
-  gint i;
+  gint        i;
 
-  hash = g_hash_table_new (g_int_hash, g_int_equal);
+  hash = g_hash_table_new_full (g_int_hash, g_int_equal,
+                                (GDestroyNotify) g_free,
+                                (GDestroyNotify) g_free);
 
   for (i = 0; i < num_colors; i++)
     {
-      gint *color, *slot;
-      guint8 *pixel = (guint8 *) &palette[i];
+      const guint8 *pixel = (const guint8 *) &palette[i];
+      gint         *color;
+      gint         *slot;
 
       color = g_new (gint, 1);
       slot = g_new (gint, 1);
@@ -399,20 +402,6 @@
   return hash;
 }
 
-
-static void
-ico_free_hash_item (gpointer data1,
-                    gpointer data2,
-                    gpointer data3)
-{
-  g_free (data1);
-  g_free (data2);
-
-  /* Shut up warnings: */
-  data3 = NULL;
-}
-
-
 static gint
 ico_get_palette_index (GHashTable *hash,
                        gint        red,
@@ -526,8 +515,8 @@
 }
 
 gboolean
-ico_cmap_contains_black (guchar *cmap,
-                         gint    num_colors)
+ico_cmap_contains_black (const guchar *cmap,
+                         gint          num_colors)
 {
   gint i;
 
@@ -808,7 +797,7 @@
                              &palette, &buffer);
   buffer32 = (guint32 *) buffer;
 
-  /* Set up colormap and andmap when necessary: */
+  /* Set up colormap and and_map when necessary: */
   if (header.bpp <= 8)
     {
       /* Create a colormap */
@@ -952,10 +941,7 @@
      and_len, xor_len));
 
   if (color_to_slot)
-    {
-      g_hash_table_foreach (color_to_slot, ico_free_hash_item, NULL);
-      g_hash_table_destroy (color_to_slot);
-    }
+    g_hash_table_destroy (color_to_slot);
 
   g_free (palette);
   g_free (buffer);
@@ -988,9 +974,10 @@
 }
 
 GimpPDBStatusType
-ico_save_image (const gchar *filename,
-                gint32       image,
-                gint32       run_mode)
+ico_save_image (const gchar  *filename,
+                gint32        image,
+                gint32        run_mode,
+                GError      **error)
 {
   FILE *fp;
 
@@ -1017,8 +1004,9 @@
 
   if (! (fp = g_fopen (filename, "wb")))
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return GIMP_PDB_EXECUTION_ERROR;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/file-ico/ico-save.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-ico/ico-save.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-ico/ico-save.h	Sun Oct 12 15:38:02 2008
@@ -23,12 +23,13 @@
 #define __ICO_SAVE_H__
 
 
-GimpPDBStatusType ico_save_image (const gchar *file_name,
-                                  gint32       image_ID,
-                                  gint32       run_mode);
+GimpPDBStatusType ico_save_image          (const gchar   *file_name,
+                                           gint32         image_ID,
+                                           gint32         run_mode,
+                                           GError       **error);
 
-gboolean ico_cmap_contains_black (guchar *cmap,
-                                  gint    num_colors);
+gboolean          ico_cmap_contains_black (const guchar  *cmap,
+                                           gint           num_colors);
 
 
 #endif /* __ICO_SAVE_H__ */

Modified: branches/soc-2008-tagging/plug-ins/file-ico/ico.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-ico/ico.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-ico/ico.c	Sun Oct 12 15:38:02 2008
@@ -157,6 +157,7 @@
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   INIT_I18N ();
 
@@ -185,7 +186,7 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          image_ID = ico_load_image (param[1].data.d_string);
+          image_ID = ico_load_image (param[1].data.d_string, &error);
 
           if (image_ID != -1)
             {
@@ -212,7 +213,8 @@
           gint         height   = param[1].data.d_int32;
           gint32       image_ID;
 
-          image_ID = ico_load_thumbnail_image (filename, &width, &height);
+          image_ID = ico_load_thumbnail_image (filename,
+                                               &width, &height, &error);
 
           if (image_ID != -1)
             {
@@ -259,7 +261,7 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          status = ico_save_image (file_name, image_ID, run_mode);
+          status = ico_save_image (file_name, image_ID, run_mode, &error);
         }
 
       if (export == GIMP_EXPORT_EXPORT)
@@ -270,7 +272,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
-  values[0].type          = GIMP_PDB_STATUS;
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.c	Sun Oct 12 15:38:02 2008
@@ -66,9 +66,10 @@
 
 
 gint32
-load_image (const gchar *filename,
-            GimpRunMode  runmode,
-            gboolean     preview)
+load_image (const gchar  *filename,
+            GimpRunMode   runmode,
+            gboolean      preview,
+            GError      **error)
 {
   GimpPixelRgn     pixel_rgn;
   GimpDrawable    *drawable;
@@ -104,8 +105,9 @@
 
   if ((infile = g_fopen (filename, "rb")) == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -590,9 +592,10 @@
 }
 
 gint32
-load_thumbnail_image (const gchar *filename,
-                      gint        *width,
-                      gint        *height)
+load_thumbnail_image (const gchar  *filename,
+                      gint         *width,
+                      gint         *height,
+                      GError      **error)
 {
   gint32 volatile  image_ID;
   ExifData        *exif_data;
@@ -821,8 +824,9 @@
 
   if ((infile = g_fopen (filename, "rb")) == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
 
       if (exif_data)
         {

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-load.h	Sun Oct 12 15:38:02 2008
@@ -16,15 +16,17 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-gint32 load_image           (const gchar *filename,
-                             GimpRunMode  runmode,
-                             gboolean     preview);
+gint32 load_image           (const gchar  *filename,
+                             GimpRunMode   runmode,
+                             gboolean      preview,
+                             GError      **error);
 
 
 #ifdef HAVE_EXIF
 
-gint32 load_thumbnail_image (const gchar *filename,
-                             gint        *width,
-                             gint        *height);
+gint32 load_thumbnail_image (const gchar  *filename,
+                             gint         *width,
+                             gint         *height,
+                             GError      **error);
 
 #endif /* HAVE_EXIF */

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.c	Sun Oct 12 15:38:02 2008
@@ -44,20 +44,22 @@
 #include "libgimp/stdplugins-intl.h"
 
 #include "jpeg.h"
-#include "jpeg-settings.h"
 #include "jpeg-icc.h"
+#include "jpeg-load.h"
 #include "jpeg-save.h"
+#include "jpeg-settings.h"
 
 
 #define SCALE_WIDTH         125
 
+
 /* See bugs #63610 and #61088 for a discussion about the quality settings */
 #define DEFAULT_QUALITY          85.0
 #define DEFAULT_SMOOTHING        0.0
 #define DEFAULT_OPTIMIZE         TRUE
 #define DEFAULT_PROGRESSIVE      FALSE
 #define DEFAULT_BASELINE         TRUE
-#define DEFAULT_SUBSMP           0
+#define DEFAULT_SUBSMP           JPEG_SUPSAMPLING_2x2_1x1_1x1
 #define DEFAULT_RESTART          0
 #define DEFAULT_DCT              0
 #define DEFAULT_PREVIEW          FALSE
@@ -200,7 +202,7 @@
           gtk_label_set_text (GTK_LABEL (preview_size), temp);
 
           /* and load the preview */
-          load_image (pp->file_name, GIMP_RUN_NONINTERACTIVE, TRUE);
+          load_image (pp->file_name, GIMP_RUN_NONINTERACTIVE, TRUE, NULL);
         }
 
       /* we cleanup here (load_image doesn't run in the background) */
@@ -249,11 +251,12 @@
 }
 
 gboolean
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID,
-            gint32       orig_image_ID,
-            gboolean     preview)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            gint32        orig_image_ID,
+            gboolean      preview,
+            GError      **error)
 {
   GimpPixelRgn   pixel_rgn;
   GimpDrawable  *drawable;
@@ -261,6 +264,7 @@
   GimpParasite  *parasite;
   struct jpeg_compress_struct cinfo;
   struct my_error_mgr         jerr;
+  JpegSubsampling             subsampling;
   FILE     * volatile outfile;
   guchar   *temp, *t;
   guchar   *data;
@@ -317,8 +321,9 @@
    */
   if ((outfile = g_fopen (filename, "wb")) == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 
@@ -390,18 +395,24 @@
 
   cinfo.optimize_coding = jsvals.optimize;
 
+  subsampling = (gimp_drawable_is_rgb (drawable_ID) ?
+                 jsvals.subsmp : JPEG_SUPSAMPLING_1x1_1x1_1x1);
+
   /*  smoothing is not supported with nonstandard sampling ratios  */
-  if (jsvals.subsmp != 1 && jsvals.subsmp != 3)
-    cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
+  if (subsampling != JPEG_SUPSAMPLING_2x1_1x1_1x1 &&
+      subsampling != JPEG_SUPSAMPLING_1x2_1x1_1x1)
+    {
+      cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
+    }
 
   if (jsvals.progressive)
     {
       jpeg_simple_progression (&cinfo);
     }
 
-  switch (jsvals.subsmp)
+  switch (subsampling)
     {
-    case 0:
+    case JPEG_SUPSAMPLING_2x2_1x1_1x1:
     default:
       cinfo.comp_info[0].h_samp_factor = 2;
       cinfo.comp_info[0].v_samp_factor = 2;
@@ -411,7 +422,7 @@
       cinfo.comp_info[2].v_samp_factor = 1;
       break;
 
-    case 1:
+    case JPEG_SUPSAMPLING_2x1_1x1_1x1:
       cinfo.comp_info[0].h_samp_factor = 2;
       cinfo.comp_info[0].v_samp_factor = 1;
       cinfo.comp_info[1].h_samp_factor = 1;
@@ -420,7 +431,7 @@
       cinfo.comp_info[2].v_samp_factor = 1;
       break;
 
-    case 2:
+    case JPEG_SUPSAMPLING_1x1_1x1_1x1:
       cinfo.comp_info[0].h_samp_factor = 1;
       cinfo.comp_info[0].v_samp_factor = 1;
       cinfo.comp_info[1].h_samp_factor = 1;
@@ -429,7 +440,7 @@
       cinfo.comp_info[2].v_samp_factor = 1;
       break;
 
-    case 3:
+    case JPEG_SUPSAMPLING_1x2_1x1_1x1:
       cinfo.comp_info[0].h_samp_factor = 1;
       cinfo.comp_info[0].v_samp_factor = 2;
       cinfo.comp_info[1].h_samp_factor = 1;
@@ -752,7 +763,7 @@
                   preview_image_ID,
                   drawable_ID_global,
                   orig_image_ID_global,
-                  TRUE);
+                  TRUE, NULL);
 
       if (display_ID == -1)
         display_ID = gimp_display_new (preview_image_ID);
@@ -809,8 +820,6 @@
   GtkTextBuffer *text_buffer;
   GtkWidget     *scrolled_window;
   GtkWidget     *button;
-
-  GimpImageType  dtype;
   gchar         *text;
 
 
@@ -939,7 +948,7 @@
   pg.restart = restart_markers_scale = spinbutton =
     gimp_spin_button_new (&pg.scale_data,
                           (jsvals.restart == 0) ? 1 : jsvals.restart,
-                          1.0, 64.0, 1.0, 1.0, 64.0, 1.0, 0);
+                          1.0, 64.0, 1.0, 1.0, 0, 1.0, 0);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 5, 6, 1, 2,
                     GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -1077,10 +1086,14 @@
   gtk_widget_show (label);
 
   pg.subsmp =
-    combo = gimp_int_combo_box_new (_("1x1,1x1,1x1 (best quality)"),  2,
-                                    _("2x1,1x1,1x1 (4:2:2)"),         1,
-                                    _("1x2,1x1,1x1"),                 3,
-                                    _("2x2,1x1,1x1 (smallest file)"), 0,
+    combo = gimp_int_combo_box_new (_("1x1,1x1,1x1 (best quality)"),
+                                    JPEG_SUPSAMPLING_1x1_1x1_1x1,
+                                    _("2x1,1x1,1x1 (4:2:2)"),
+                                    JPEG_SUPSAMPLING_2x1_1x1_1x1,
+                                    _("1x2,1x1,1x1"),
+                                    JPEG_SUPSAMPLING_1x2_1x1_1x1,
+                                    _("2x2,1x1,1x1 (smallest file)"),
+                                    JPEG_SUPSAMPLING_2x2_1x1_1x1,
                                     NULL);
   gtk_table_attach (GTK_TABLE (table), combo, 3, 6, 2, 3,
                     GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
@@ -1088,19 +1101,22 @@
 
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
 
-  gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), jsvals.subsmp,
-                              G_CALLBACK (subsampling_changed),
-                              entry);
-
-  dtype = gimp_drawable_type (drawable_ID_global);
-  if (dtype == GIMP_RGB_IMAGE || dtype == GIMP_RGBA_IMAGE)
+  if (gimp_drawable_is_rgb (drawable_ID_global))
     {
+      gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
+                                  jsvals.subsmp,
+                                  G_CALLBACK (subsampling_changed),
+                                  entry);
+
       g_signal_connect (pg.use_orig_quality, "toggled",
                         G_CALLBACK (use_orig_qual_changed2),
                         pg.subsmp);
     }
   else
     {
+      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
+                                     JPEG_SUPSAMPLING_1x1_1x1_1x1);
+
       gtk_widget_set_sensitive (combo, FALSE);
     }
 
@@ -1230,6 +1246,7 @@
   gchar        *def_str;
   JpegSaveVals  tmpvals;
   gint          num_fields;
+  gint          subsampling;
 
   jsvals.quality          = DEFAULT_QUALITY;
   jsvals.smoothing        = DEFAULT_SMOOTHING;
@@ -1265,7 +1282,7 @@
                        &tmpvals.smoothing,
                        &tmpvals.optimize,
                        &tmpvals.progressive,
-                       &tmpvals.subsmp,
+                       &subsampling,
                        &tmpvals.baseline,
                        &tmpvals.restart,
                        &tmpvals.dct,
@@ -1274,6 +1291,8 @@
                        &tmpvals.save_thumbnail,
                        &tmpvals.save_xmp);
 
+  tmpvals.subsmp = subsampling;
+
   if (num_fields == 12)
     memcpy (&jsvals, &tmpvals, sizeof (tmpvals));
 }
@@ -1289,7 +1308,7 @@
                              jsvals.smoothing,
                              jsvals.optimize,
                              jsvals.progressive,
-                             jsvals.subsmp,
+                             (gint) jsvals.subsmp,
                              jsvals.baseline,
                              jsvals.restart,
                              jsvals.dct,
@@ -1343,8 +1362,12 @@
   gtk_adjustment_set_value (GTK_ADJUSTMENT (pg->smoothing),
                             jsvals.smoothing);
 
-  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (pg->subsmp),
-                                 jsvals.subsmp);
+  if (gimp_drawable_is_rgb (drawable_ID_global))
+    {
+      gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (pg->subsmp),
+                                     jsvals.subsmp);
+    }
+
   gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (pg->dct),
                                  jsvals.dct);
 }
@@ -1368,11 +1391,16 @@
 subsampling_changed (GtkWidget *combo,
                      GtkObject *entry)
 {
-  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &jsvals.subsmp);
+  gint value;
+
+  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &value);
+
+  jsvals.subsmp = value;
 
   /*  smoothing is not supported with nonstandard sampling ratios  */
   gimp_scale_entry_set_sensitive (entry,
-                                  jsvals.subsmp != 1 && jsvals.subsmp != 3);
+                                  jsvals.subsmp != JPEG_SUPSAMPLING_2x1_1x1_1x1 &&
+                                  jsvals.subsmp != JPEG_SUPSAMPLING_1x2_1x1_1x1);
 
   make_preview ();
 }

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-save.h	Sun Oct 12 15:38:02 2008
@@ -18,19 +18,19 @@
 
 typedef struct
 {
-  gdouble  quality;
-  gdouble  smoothing;
-  gboolean optimize;
-  gboolean progressive;
-  gboolean baseline;
-  gint     subsmp;
-  gint     restart;
-  gint     dct;
-  gboolean preview;
-  gboolean save_exif;
-  gboolean save_thumbnail;
-  gboolean save_xmp;
-  gboolean use_orig_quality;
+  gdouble          quality;
+  gdouble          smoothing;
+  gboolean         optimize;
+  gboolean         progressive;
+  gboolean         baseline;
+  JpegSubsampling  subsmp;
+  gint             restart;
+  gint             dct;
+  gboolean         preview;
+  gboolean         save_exif;
+  gboolean         save_thumbnail;
+  gboolean         save_xmp;
+  gboolean         use_orig_quality;
 } JpegSaveVals;
 
 extern JpegSaveVals     jsvals;
@@ -39,10 +39,11 @@
 extern gint32           drawable_ID_global;
 
 
-gboolean    save_image         (const gchar *filename,
-                                gint32       image_ID,
-                                gint32       drawable_ID,
-                                gint32       orig_image_ID,
-                                gboolean     preview);
+gboolean    save_image         (const gchar  *filename,
+                                gint32        image_ID,
+                                gint32        drawable_ID,
+                                gint32        orig_image_ID,
+                                gboolean      preview,
+                                GError      **error);
 gboolean    save_dialog        (void);
 void        load_save_defaults (void);

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.c	Sun Oct 12 15:38:02 2008
@@ -45,15 +45,21 @@
 #include "config.h"
 
 #include <string.h>
+#include <setjmp.h>
 
 #include <glib/gstdio.h>
 
 #include <jpeglib.h>
 
+#ifdef HAVE_EXIF
+#include <libexif/exif-data.h>
+#endif /* HAVE_EXIF */
+
 #include <libgimp/gimp.h>
 
 #include "libgimp/stdplugins-intl.h"
 
+#include "jpeg.h"
 #include "jpeg-quality.h"
 #include "jpeg-settings.h"
 
@@ -163,10 +169,10 @@
  * Return Value: TRUE if a valid parasite was attached to the image
  */
 gboolean
-jpeg_restore_original_settings (gint32  image_ID,
-                                gint   *quality,
-                                gint   *subsmp,
-                                gint   *num_quant_tables)
+jpeg_restore_original_settings (gint32           image_ID,
+                                gint            *quality,
+                                JpegSubsampling *subsmp,
+                                gint            *num_quant_tables)
 {
   GimpParasite *parasite;
   const guchar *src;
@@ -219,24 +225,28 @@
                   if (h[1] == 1 && v[1] == 1 && h[2] == 1 && v[2] == 1)
                     {
                       if (h[0] == 1 && v[0] == 1)
-                        *subsmp = 2;
+                        *subsmp = JPEG_SUPSAMPLING_1x1_1x1_1x1;
                       else if (h[0] == 2 && v[0] == 1)
-                        *subsmp = 1;
+                        *subsmp = JPEG_SUPSAMPLING_2x1_1x1_1x1;
                       else if (h[0] == 1 && v[0] == 2)
-                        *subsmp = 3;
+                        *subsmp = JPEG_SUPSAMPLING_1x2_1x1_1x1;
                       else if (h[0] == 2 && v[0] == 2)
-                        *subsmp = 0;
+                        *subsmp = JPEG_SUPSAMPLING_2x2_1x1_1x1;
                     }
                 }
+
               gimp_parasite_free (parasite);
               return TRUE;
             }
         }
+
       gimp_parasite_free (parasite);
     }
+
   *quality = -1;
   *subsmp = -1;
   *num_quant_tables = 0;
+
   return FALSE;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg-settings.h	Sun Oct 12 15:38:02 2008
@@ -20,14 +20,14 @@
  */
 
 gboolean  jpeg_detect_original_settings  (struct jpeg_decompress_struct *cinfo,
-                                          gint32    image_ID);
+                                          gint32           image_ID);
 
-gboolean  jpeg_restore_original_settings (gint32    image_ID,
-                                          gint     *quality,
-                                          gint     *subsmp,
-                                          gint     *num_quant_tables);
+gboolean  jpeg_restore_original_settings (gint32           image_ID,
+                                          gint            *quality,
+                                          JpegSubsampling *subsmp,
+                                          gint            *num_quant_tables);
 
-guint   **jpeg_restore_original_tables   (gint32    image_ID,
-                                          gint      num_quant_tables);
+guint   **jpeg_restore_original_tables   (gint32           image_ID,
+                                          gint             num_quant_tables);
 
-void      jpeg_swap_original_settings    (gint32    image_ID);
+void      jpeg_swap_original_settings    (gint32           image_ID);

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.c	Sun Oct 12 15:38:02 2008
@@ -51,21 +51,21 @@
                     gint             *nreturn_vals,
                     GimpParam       **return_vals);
 
-gboolean      undo_touched;
-gboolean      load_interactive;
-gchar        *image_comment;
-gint32        display_ID;
-JpegSaveVals  jsvals;
-gint32        orig_image_ID_global;
-gint32        drawable_ID_global;
-gboolean      has_metadata;
-gint          orig_quality;
-gint          orig_subsmp;
-gint          num_quant_tables;
+gboolean         undo_touched;
+gboolean         load_interactive;
+gchar           *image_comment;
+gint32           display_ID;
+JpegSaveVals     jsvals;
+gint32           orig_image_ID_global;
+gint32           drawable_ID_global;
+gboolean         has_metadata;
+gint             orig_quality;
+JpegSubsampling  orig_subsmp;
+gint             num_quant_tables;
 
 
 #ifdef HAVE_EXIF
-ExifData     *exif_data = NULL;
+ExifData        *exif_data = NULL;
 #endif
 
 const GimpPlugInInfo PLUG_IN_INFO =
@@ -196,8 +196,8 @@
   gint32             drawable_ID;
   gint32             orig_image_ID;
   GimpParasite      *parasite;
-  gboolean           err;
   GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -213,7 +213,7 @@
 
   has_metadata = FALSE;
   orig_quality = 0;
-  orig_subsmp = 0;
+  orig_subsmp = JPEG_SUPSAMPLING_2x2_1x1_1x1;
   num_quant_tables = 0;
 
   if (strcmp (name, LOAD_PROC) == 0)
@@ -230,7 +230,7 @@
           break;
         }
 
-      image_ID = load_image (param[1].data.d_string, run_mode, FALSE);
+      image_ID = load_image (param[1].data.d_string, run_mode, FALSE, &error);
 
       if (image_ID != -1)
         {
@@ -259,7 +259,7 @@
           gint         width    = 0;
           gint         height   = 0;
 
-          image_ID = load_thumbnail_image (filename, &width, &height);
+          image_ID = load_thumbnail_image (filename, &width, &height, &error);
 
           if (image_ID != -1)
             {
@@ -430,6 +430,7 @@
                * over the JPEG encoding parameters.
                */
               run_mode = GIMP_RUN_INTERACTIVE;
+
               /* If this image was loaded from a JPEG file and has not been
                * saved yet, try to use some of the settings from the
                * original file if they are better than the default values.
@@ -439,8 +440,13 @@
                   jsvals.quality = orig_quality;
                   jsvals.use_orig_quality = TRUE;
                 }
-              if (orig_subsmp == 2 || (orig_subsmp > 0 && jsvals.subsmp == 0))
-                jsvals.subsmp = orig_subsmp;
+
+              if (orig_subsmp == JPEG_SUPSAMPLING_1x1_1x1_1x1 ||
+                  ((gint) orig_subsmp > 0 &&
+                   jsvals.subsmp == JPEG_SUPSAMPLING_1x1_1x1_1x1))
+                {
+                  jsvals.subsmp = orig_subsmp;
+                }
             }
           break;
         }
@@ -462,7 +468,7 @@
           drawable_ID_global = drawable_ID;
 
           /*  First acquire information with a dialog  */
-          err = save_dialog ();
+          status = (save_dialog () ? GIMP_PDB_SUCCESS : GIMP_PDB_CANCEL);
 
           if (undo_touched)
             {
@@ -471,18 +477,13 @@
               gimp_image_undo_thaw (image_ID);
               gimp_displays_flush ();
             }
-
-          if (!err)
-            status = GIMP_PDB_CANCEL;
         }
 
       if (status == GIMP_PDB_SUCCESS)
         {
           if (! save_image (param[3].data.d_string,
-                            image_ID,
-                            drawable_ID,
-                            orig_image_ID,
-                            FALSE))
+                            image_ID, drawable_ID, orig_image_ID, FALSE,
+                            &error))
             {
               status = GIMP_PDB_EXECUTION_ERROR;
             }
@@ -525,6 +526,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-jpeg/jpeg.h	Sun Oct 12 15:38:02 2008
@@ -40,6 +40,13 @@
   jmp_buf               setjmp_buffer;  /* for return to caller */
 } *my_error_ptr;
 
+typedef enum
+{
+  JPEG_SUPSAMPLING_2x2_1x1_1x1 = 0,  /* smallest file */
+  JPEG_SUPSAMPLING_2x1_1x1_1x1 = 1,  /* 4:2:2         */
+  JPEG_SUPSAMPLING_1x1_1x1_1x1 = 2,
+  JPEG_SUPSAMPLING_1x2_1x1_1x1 = 3
+} JpegSubsampling;
 
 extern gint32 volatile  preview_image_ID;
 extern gint32           preview_layer_ID;
@@ -50,12 +57,9 @@
 extern gchar           *image_comment;
 extern gboolean         has_metadata;
 extern gint             orig_quality;
-extern gint             orig_subsmp;
+extern JpegSubsampling  orig_subsmp;
 extern gint             num_quant_tables;
 
-gint32    load_image                    (const gchar   *filename,
-                                         GimpRunMode    runmode,
-                                         gboolean       preview);
 
 void      destroy_preview               (void);
 
@@ -68,10 +72,6 @@
 
 extern ExifData *exif_data;
 
-gint32    load_thumbnail_image          (const gchar   *filename,
-                                         gint          *width,
-                                         gint          *height);
-
 ExifData * jpeg_exif_data_new_from_file (const gchar   *filename,
                                          GError       **error);
 

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd-load.c	Sun Oct 12 15:38:02 2008
@@ -35,6 +35,10 @@
 
 #include "libgimp/stdplugins-intl.h"
 
+
+#define COMP_MODE_SIZE sizeof(guint16)
+
+
 /*  Local function prototypes  */
 static gint             read_header_block          (PSDimage     *img_a,
                                                     FILE         *f,
@@ -105,7 +109,8 @@
 
 /* Main file load function */
 gint32
-load_image (const gchar *filename)
+load_image (const gchar  *filename,
+            GError      **load_error)
 {
   FILE                 *f;
   struct stat           st;
@@ -122,8 +127,9 @@
   f = g_fopen (filename, "rb");
   if (f == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (load_error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -205,7 +211,8 @@
  load_error:
   if (error)
     {
-      g_message (_("Error loading PSD file:\n\n%s"), error->message);
+      g_set_error (load_error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Error loading PSD file: %s"), error->message);
       g_error_free (error);
     }
 
@@ -955,7 +962,6 @@
 {
   PSDchannel          **lyr_chn;
   guchar               *pixels;
-  guint16               comp_mode;
   guint16               alpha_chn;
   guint16               user_mask_chn;
   guint16               layer_channels;
@@ -1049,6 +1055,8 @@
           lyr_chn = g_new (PSDchannel *, lyr_a[lidx]->num_channels);
           for (cidx = 0; cidx < lyr_a[lidx]->num_channels; ++cidx)
             {
+              guint16 comp_mode = PSD_COMP_RAW;
+
               /* Allocate channel record */
               lyr_chn[cidx] = g_malloc (sizeof (PSDchannel) );
 
@@ -1086,15 +1094,21 @@
                                 lyr_chn[cidx]->columns,
                                 lyr_chn[cidx]->rows);
 
-              if (fread (&comp_mode, 2, 1, f) < 1)
+              /* Only read channel data if there is any channel
+               * data. Note that the channel data can contain a
+               * compression method but no actual data.
+               */
+              if (lyr_a[lidx]->chn_info[cidx].data_len >= COMP_MODE_SIZE)
                 {
-                  psd_set_error (feof (f), errno, error);
-                  return -1;
+                  if (fread (&comp_mode, COMP_MODE_SIZE, 1, f) < 1)
+                    {
+                      psd_set_error (feof (f), errno, error);
+                      return -1;
+                    }
+                  comp_mode = GUINT16_FROM_BE (comp_mode);
+                  IFDBG(3) g_debug ("Compression mode: %d", comp_mode);
                 }
-              comp_mode = GUINT16_FROM_BE (comp_mode);
-              IFDBG(3) g_debug ("Compression mode: %d", comp_mode);
-
-              if (lyr_a[lidx]->chn_info[cidx].data_len - 2 > 0)
+              if (lyr_a[lidx]->chn_info[cidx].data_len > COMP_MODE_SIZE)
                 {
                   switch (comp_mode)
                     {
@@ -1134,6 +1148,7 @@
 
                       case PSD_COMP_ZIP:                 /* ? */
                       case PSD_COMP_ZIP_PRED:
+                      default:
                         g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                                     _("Unsupported compression mode: %d"), comp_mode);
                         return -1;
@@ -1428,7 +1443,7 @@
       block_end = block_start + block_len;
       fseek (f, block_start, SEEK_SET);
 
-      if (fread (&comp_mode, 2, 1, f) < 1)
+      if (fread (&comp_mode, COMP_MODE_SIZE, 1, f) < 1)
         {
           psd_set_error (feof (f), errno, error);
           return -1;
@@ -1542,10 +1557,14 @@
       if (img_a->transparency)
         {
           offset = 1;
+
           /* Free "Transparency" channel name */
-          alpha_name = g_ptr_array_index (img_a->alpha_names, 0);
-          if (alpha_name)
-            g_free (alpha_name);
+          if (img_a->alpha_names)
+            {
+              alpha_name = g_ptr_array_index (img_a->alpha_names, 0);
+              if (alpha_name)
+                g_free (alpha_name);
+            }
         }
       else
         offset = 0;

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd-load.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd-load.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd-load.h	Sun Oct 12 15:38:02 2008
@@ -23,7 +23,8 @@
 #define __PSD_LOAD_H__
 
 
-gint32  load_image (const gchar *filename);
+gint32  load_image (const gchar  *filename,
+                    GError      **error);
 
 
 #endif /* __PSD_LOAD_H__ */

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd-save.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd-save.c	Sun Oct 12 15:38:02 2008
@@ -120,6 +120,9 @@
 
   GimpImageBaseType    baseType;
 
+  gint32               merged_layer;/* Merged image,
+                                       to be used for the image data section */
+
   gint                 nChannels;   /* Number of user channels in the image */
   gint32              *lChannels;   /* User channels in the image */
 
@@ -156,7 +159,8 @@
 static void   save_data            (FILE          *fd,
                                     gint32         image_id);
 static gint   save_image           (const gchar   *filename,
-                                    gint32         image_id);
+                                    gint32         image_id,
+                                    GError       **error);
 static void   xfwrite              (FILE          *fd,
                                     gconstpointer  buf,
                                     glong          len,
@@ -186,6 +190,8 @@
                                     glong         *ChanLenPosition,
                                     gint32         rowlenOffset);
 
+static gint32 create_merged_image  (gint32         imageID);
+
 
 const GimpPlugInInfo PLUG_IN_INFO =
 {
@@ -237,8 +243,9 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam values[2];
-  GimpRunMode      run_mode;
+  static GimpParam  values[2];
+  GimpRunMode       run_mode;
+  GError           *error = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -284,10 +291,21 @@
           break;
         }
 
-      if (save_image (param[3].data.d_string, image_id))
-        values[0].data.d_status = GIMP_PDB_SUCCESS;
+      if (save_image (param[3].data.d_string, image_id, &error))
+        {
+          values[0].data.d_status = GIMP_PDB_SUCCESS;
+        }
       else
-        values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+        {
+          values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
+
+          if (error)
+            {
+              *nreturn_vals = 2;
+              values[1].type          = GIMP_PDB_STRING;
+              values[1].data.d_string = error->message;
+            }
+        }
 
       if (export == GIMP_EXPORT_EXPORT)
         gimp_image_delete (image_id);
@@ -395,7 +413,9 @@
       xfwrite (fd, val, len, why);
     }
   else
-    write_gint16 (fd, 0, why);
+    {
+      write_gint16 (fd, 0, why);
+    }
 
   /* If total length (length byte + content) is not a multiple of PADDING,
      add zeros to pad it.  */
@@ -677,7 +697,8 @@
   write_gint32 (fd, 0, "reserved 1");      /* 6 for the 'reserved' field + 4 bytes for a long */
   write_gint16 (fd, 0, "reserved 1");      /* and 2 bytes for a short */
   write_gint16 (fd, (PSDImageData.nChannels +
-                     nChansLayer (PSDImageData.baseType, 0, 0)),
+                     nChansLayer (PSDImageData.baseType,
+                     gimp_drawable_has_alpha (PSDImageData.merged_layer), 0)),
                 "channels");
   write_gint32 (fd, PSDImageData.image_height, "rows");
   write_gint32 (fd, PSDImageData.image_width, "columns");
@@ -805,7 +826,8 @@
 
   /* --------------- Write Channel names --------------- */
 
-  if (PSDImageData.nChannels > 0)
+  if (PSDImageData.nChannels > 0 ||
+      gimp_drawable_has_alpha (PSDImageData.merged_layer))
     {
       xfwrite (fd, "8BIM", 4, "imageresources signature");
       write_gint16 (fd, 0x03EE, "0x03EE Id"); /* 1006 */
@@ -819,6 +841,10 @@
 
     /* Write all strings */
 
+    /* if the merged_image contains transparency, write a name for it first */
+    if (gimp_drawable_has_alpha (PSDImageData.merged_layer))
+      write_string (fd, "Transparency", "channel name");
+
     for (i = PSDImageData.nChannels - 1; i >= 0; i--)
     {
       char *chName = gimp_drawable_get_name (PSDImageData.lChannels[i]);
@@ -1032,7 +1058,10 @@
 
   /* Layer structure section */
 
-  write_gint16 (fd, PSDImageData.nLayers, "Layer structure count");
+  if (gimp_drawable_has_alpha (PSDImageData.merged_layer))
+    write_gint16 (fd, -PSDImageData.nLayers, "Layer structure count");
+  else
+    write_gint16 (fd, PSDImageData.nLayers, "Layer structure count");
 
   /* Layer records section */
   /* GIMP layers must be written in reverse order */
@@ -1239,6 +1268,7 @@
   if ( gimp_drawable_has_alpha  (drawableID) &&
       !gimp_drawable_is_indexed (drawableID))
     colors -= 1;
+
   gimp_tile_cache_ntiles (2* (drawable->width / gimp_tile_width () + 1));
 
   LengthsTable = g_new (gint16, height);
@@ -1252,21 +1282,26 @@
 
   for (i = 0; i < bytes; i++)
     {
-      int chan;
+      gint chan;
+
       len = 0;
-      if (bytes != colors) /* Need to write alpha channel first */
+
+      if (bytes != colors && ltable_offset == 0) /* Need to write alpha channel first, except in image data section */
         {
           if (i == 0)
             {
-              if (ltable_offset > 0)
-                continue;
               chan = bytes - 1;
             }
           else
-            chan = i - 1;
+            {
+              chan = i - 1;
+            }
         }
       else
-        chan = i;
+        {
+          chan = i;
+        }
+
       if (ChanLenPosition)
         {
           write_gint16 (fd, 1, "Compression type (RLE)");
@@ -1408,25 +1443,19 @@
 {
   gint ChanCount;
   gint i, j;
-  gint nChannel;
   gint32 imageHeight;                   /* Height of image */
   glong offset;                         /* offset in file of rle lengths */
   gint chan;
-  gint32 bottom_layer;
 
   IFDBG printf (" Function: save_data\n");
 
   ChanCount = (PSDImageData.nChannels +
-               nChansLayer (PSDImageData.baseType, 0, 0));
-
-  i = PSDImageData.nLayers - 1;  /* Layers to be written */
-  IFDBG printf ("\tProcessing %d layers\n", i);
+               nChansLayer (PSDImageData.baseType,
+                            gimp_drawable_has_alpha (PSDImageData.merged_layer),
+                            0));
 
   imageHeight = gimp_image_height (image_id);
 
-  nChannel = 0;
-
-
   write_gint16 (fd, 1, "RLE compression");
 
   /* All line lengths go before the rle pixel data */
@@ -1437,37 +1466,12 @@
     for (j = 0; j < imageHeight; j++)
       write_gint16 (fd, 0, "junk line lengths");
 
-  bottom_layer = PSDImageData.lLayers[PSDImageData.nLayers - 1];
-
-  if (PSDImageData.nLayers != 1 ||
-      gimp_drawable_width  (bottom_layer) != gimp_image_width  (image_id) ||
-      gimp_drawable_height (bottom_layer) != gimp_image_height (image_id))
-    {
-      gint32 flat_image;
-      gint32 flat_drawable;
+  IFDBG printf ("\t\tWriting compressed image data\n");
+  write_pixel_data (fd, PSDImageData.merged_layer,
+                    NULL, offset);
 
-      IFDBG printf ("\t\tCreating flattened image\n");
-      flat_image = gimp_image_duplicate (image_id);
-      gimp_image_undo_disable (flat_image);
-      flat_drawable = gimp_image_flatten (flat_image);
-
-      /* gimp_image_flatten() may fail if there are no visible layers */
-      if (flat_drawable != -1)
-        {
-          IFDBG printf ("\t\tWriting compressed flattened image data\n");
-          write_pixel_data (fd, flat_drawable, NULL, offset);
-        }
-
-      gimp_image_delete (flat_image);
-    }
-  else
-    {
-      IFDBG printf ("\t\tWriting compressed image data\n");
-      write_pixel_data (fd, PSDImageData.lLayers[PSDImageData.nLayers - 1],
-                        NULL, offset);
-    }
-
-  chan = nChansLayer (PSDImageData.baseType, 0, 0);
+  chan = nChansLayer (PSDImageData.baseType,
+                      gimp_drawable_has_alpha(PSDImageData.merged_layer), 0);
 
   for (i = PSDImageData.nChannels - 1; i >= 0; i--)
     {
@@ -1479,7 +1483,66 @@
     }
 }
 
+static gint32
+create_merged_image (gint32 image_id)
+{
+  gint32  projection;
+
+  projection = gimp_layer_new_from_visible (image_id, image_id, SAVE_PROC);
+
+  if (gimp_image_base_type (image_id) != GIMP_INDEXED)
+    {
+      GimpDrawable *drawable = gimp_drawable_get (projection);
+      GimpPixelRgn  region;
+      gboolean      transparency_found = FALSE;
+      gpointer      pr;
+
+      gimp_pixel_rgn_init (&region, drawable,
+                           0, 0, drawable->width, drawable->height,
+                           TRUE, FALSE);
+
+      for (pr = gimp_pixel_rgns_register (1, &region);
+           pr != NULL;
+           pr = gimp_pixel_rgns_process (pr))
+        {
+          guchar *data = region.data;
+          gint    y;
+
+          for (y = 0; y < region.h; y++)
+            {
+              guchar *d = data;
+              gint    x;
+
+              for (x = 0; x < region.w; x++)
+                {
+                  guint32 alpha = d[region.bpp - 1];
+
+                  if (alpha < 255)
+                    {
+                      gint i;
+
+                      transparency_found = TRUE;
+
+                      /* blend against white, photoshop does this. */
+                      for (i = 0; i < region.bpp - 1; i++)
+                        d[i] = ((guint32) d[i] * alpha) / 255 + 255 - alpha;
+                    }
+
+                  d += region.bpp;
+                }
 
+              data += region.rowstride;
+            }
+        }
+
+      gimp_drawable_detach (drawable);
+
+      if (! transparency_found)
+        gimp_layer_flatten (projection);
+    }
+
+  return projection;
+}
 
 static void
 get_image_data (FILE   *fd,
@@ -1498,18 +1561,14 @@
   PSDImageData.baseType = gimp_image_base_type (image_id);
   IFDBG printf ("\tGot base type: %d\n", PSDImageData.baseType);
 
-  /* PSD format does not support indexed layered images */
+  PSDImageData.merged_layer = create_merged_image (image_id);
 
-  if (PSDImageData.baseType == GIMP_INDEXED)
-    {
-      IFDBG printf ("\tFlattening indexed image\n");
-      gimp_image_flatten (image_id);
-    }
-
-  PSDImageData.lChannels = gimp_image_get_channels (image_id, &PSDImageData.nChannels);
+  PSDImageData.lChannels = gimp_image_get_channels (image_id,
+                                                    &PSDImageData.nChannels);
   IFDBG printf ("\tGot number of channels: %d\n", PSDImageData.nChannels);
 
-  PSDImageData.lLayers = gimp_image_get_layers (image_id, &PSDImageData.nLayers);
+  PSDImageData.lLayers = gimp_image_get_layers (image_id,
+                                                &PSDImageData.nLayers);
   IFDBG printf ("\tGot number of layers: %d\n", PSDImageData.nLayers);
 
   PSDImageData.layersDim = g_new (PSD_Layer_Dimension, PSDImageData.nLayers);
@@ -1518,8 +1577,9 @@
 
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_id)
+save_image (const gchar  *filename,
+            gint32        image_id,
+            GError      **error)
 {
   FILE   *fd;
   gint32 *layers;
@@ -1531,9 +1591,12 @@
 
   if (gimp_image_width (image_id) > 30000 ||
       gimp_image_height (image_id) > 30000)
-  {
-      g_message (_("Unable to save '%s'.  The PSD file format does not support images that are more than 30,000 pixels wide or tall."),
-                 gimp_filename_to_utf8 (filename));
+    {
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Unable to save '%s'.  The PSD file format does not "
+                     "support images that are more than 30,000 pixels wide "
+                     "or tall."),
+                   gimp_filename_to_utf8 (filename));
       return FALSE;
     }
 
@@ -1544,8 +1607,11 @@
       drawable = gimp_drawable_get (layers[i]);
       if (drawable->width > 30000 || drawable->height > 30000)
         {
-          g_message (_("Unable to save '%s'.  The PSD file format does not support images with layers that are more than 30,000 pixels wide or tall."),
-                     gimp_filename_to_utf8 (filename));
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Unable to save '%s'.  The PSD file format does not "
+                         "support images with layers that are more than 30,000 "
+                         "pixels wide or tall."),
+                       gimp_filename_to_utf8 (filename));
           g_free (layers);
           return FALSE;
         }
@@ -1556,8 +1622,9 @@
   fd = g_fopen (filename, "wb");
   if (fd == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return FALSE;
     }
 
@@ -1583,6 +1650,10 @@
 
   save_data (fd, image_id);
 
+  /* Delete merged image now */
+
+  gimp_drawable_delete (PSDImageData.merged_layer);
+
   IFDBG printf ("----- Closing PSD file, done -----\n\n");
 
   fclose (fd);

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.c	Sun Oct 12 15:38:02 2008
@@ -35,37 +35,38 @@
 #include "libgimp/stdplugins-intl.h"
 
 /*  Local function prototypes  */
-static gint             read_header_block          (PSDimage     *img_a,
-                                                    FILE         *f,
-                                                    GError      **error);
-
-static gint             read_color_mode_block      (PSDimage     *img_a,
-                                                    FILE         *f,
-                                                    GError      **error);
-
-static gint             read_image_resource_block  (PSDimage     *img_a,
-                                                    FILE         *f,
-                                                    GError      **error);
-
-static gint32           create_gimp_image          (PSDimage     *img_a,
-                                                    const gchar  *filename);
-
-static gint             add_image_resources        (const gint32  image_id,
-                                                    PSDimage     *img_a,
-                                                    FILE         *f,
-                                                    GError      **error);
+static gint    read_header_block          (PSDimage     *img_a,
+                                           FILE         *f,
+                                           GError      **error);
+
+static gint    read_color_mode_block      (PSDimage     *img_a,
+                                           FILE         *f,
+                                           GError      **error);
+
+static gint    read_image_resource_block  (PSDimage     *img_a,
+                                           FILE         *f,
+                                           GError      **error);
+
+static gint32  create_gimp_image          (PSDimage     *img_a,
+                                           const gchar  *filename);
+
+static gint    add_image_resources        (const gint32  image_id,
+                                           PSDimage     *img_a,
+                                           FILE         *f,
+                                           GError      **error);
 
 /* Main file load function */
 gint32
-load_thumbnail_image (const gchar *filename,
-                      gint        *width,
-                      gint        *height)
+load_thumbnail_image (const gchar  *filename,
+                      gint         *width,
+                      gint         *height,
+                      GError      **load_error)
 {
-  FILE                 *f;
-  struct stat           st;
-  PSDimage              img_a;
-  gint32                image_id = -1;
-  GError               *error = NULL;
+  FILE        *f;
+  struct stat  st;
+  PSDimage     img_a;
+  gint32       image_id = -1;
+  GError      *error    = NULL;
 
   /* ----- Open PSD file ----- */
   if (g_stat (filename, &st) == -1)
@@ -75,8 +76,9 @@
   f = g_fopen (filename, "rb");
   if (f == NULL)
     {
-      g_message (_("Could not open '%s' for reading: %s"),
-                 gimp_filename_to_utf8 (filename), g_strerror (errno));
+      g_set_error (load_error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for reading: %s"),
+                   gimp_filename_to_utf8 (filename), g_strerror (errno));
       return -1;
     }
 
@@ -123,6 +125,13 @@
 
   /* ----- Process load errors ----- */
  load_error:
+  if (error)
+    {
+      g_set_error (load_error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Error loading PSD file: %s"), error->message);
+      g_error_free (error);
+    }
+
   /* Delete partially loaded image */
   if (image_id > 0)
     gimp_image_delete (image_id);

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd-thumb-load.h	Sun Oct 12 15:38:02 2008
@@ -23,9 +23,10 @@
 #define __PSD_THUMB_LOAD_H__
 
 
-gint32 load_thumbnail_image (const gchar *filename,
-                             gint        *width,
-                             gint        *height);
+gint32 load_thumbnail_image (const gchar  *filename,
+                             gint         *width,
+                             gint         *height,
+                             GError      **error);
 
 
 #endif /* __PSD_THUMB_LOAD_H__ */

Modified: branches/soc-2008-tagging/plug-ins/file-psd/psd.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-psd/psd.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-psd/psd.c	Sun Oct 12 15:38:02 2008
@@ -172,6 +172,7 @@
   GimpRunMode       run_mode;
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
   gint32            image_ID;
+  GError           *error  = NULL;
 #ifdef PSD_SAVE
   gint32            drawable_ID;
   GimpExportReturn  export = GIMP_EXPORT_CANCEL;
@@ -190,7 +191,7 @@
   /* File load */
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -217,7 +218,7 @@
           gint         width    = 0;
           gint         height   = 0;
 
-          image_ID = load_thumbnail_image (filename, &width, &height);
+          image_ID = load_thumbnail_image (filename, &width, &height, &error);
 
           if (image_ID != -1)
             {
@@ -267,7 +268,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
             {
             }
           else
@@ -287,5 +289,12 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }

Modified: branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.c	Sun Oct 12 15:38:02 2008
@@ -246,13 +246,13 @@
  */
 
 sgi_t *
-sgiOpen(char *filename,	/* I - File to open */
-        int  mode,	/* I - Open mode (SGI_READ or SGI_WRITE) */
-        int  comp,	/* I - Type of compression */
-        int  bpp,	/* I - Bytes per pixel */
-        int  xsize,	/* I - Width of image in pixels */
-        int  ysize,	/* I - Height of image in pixels */
-        int  zsize)	/* I - Number of channels */
+sgiOpen(const char *filename,	/* I - File to open */
+        int         mode,	/* I - Open mode (SGI_READ or SGI_WRITE) */
+        int         comp,	/* I - Type of compression */
+        int         bpp,	/* I - Bytes per pixel */
+        int         xsize,	/* I - Width of image in pixels */
+        int         ysize,	/* I - Height of image in pixels */
+        int         zsize)	/* I - Number of channels */
 {
   sgi_t	*sgip;		/* New SGI image file */
   FILE	*file;		/* Image file pointer */

Modified: branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.h	(original)
+++ branches/soc-2008-tagging/plug-ins/file-sgi/sgi-lib.h	Sun Oct 12 15:38:02 2008
@@ -70,7 +70,7 @@
                               unsigned short *row,
                               int y,
                               int z);
-extern sgi_t	*sgiOpen     (char *filename,
+extern sgi_t	*sgiOpen     (const char *filename,
                               int mode,
                               int comp,
                               int bpp,

Modified: branches/soc-2008-tagging/plug-ins/file-sgi/sgi.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-sgi/sgi.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-sgi/sgi.c	Sun Oct 12 15:38:02 2008
@@ -62,10 +62,12 @@
                              gint             *nreturn_vals,
                              GimpParam       **return_vals);
 
-static gint32   load_image  (const gchar      *filename);
+static gint32   load_image  (const gchar      *filename,
+                             GError          **error);
 static gint     save_image  (const gchar      *filename,
                              gint32            image_ID,
-                             gint32            drawable_ID);
+                             gint32            drawable_ID,
+                             GError          **error);
 
 static gboolean save_dialog (void);
 
@@ -155,12 +157,13 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32            image_ID;
-  gint32            drawable_ID;
-  GimpExportReturn  export = GIMP_EXPORT_CANCEL;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  gint32             drawable_ID;
+  GimpExportReturn   export = GIMP_EXPORT_CANCEL;
+  GError            *error  = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -173,7 +176,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_image (param[1].data.d_string);
+      image_ID = load_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -256,7 +259,8 @@
 
       if (status == GIMP_PDB_SUCCESS)
         {
-          if (save_image (param[3].data.d_string, image_ID, drawable_ID))
+          if (save_image (param[3].data.d_string, image_ID, drawable_ID,
+                          &error))
             {
               gimp_set_data (SAVE_PROC, &compression, sizeof (compression));
             }
@@ -274,6 +278,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -283,9 +294,10 @@
  */
 
 static gint32
-load_image (const gchar *filename)  /* I - File to load */
+load_image (const gchar  *filename,
+            GError      **error)
 {
-  int            i,           /* Looping var */
+  gint           i,           /* Looping var */
                  x,           /* Current X coordinate */
                  y,           /* Current Y coordinate */
                  image_type,  /* Type of image */
@@ -307,11 +319,12 @@
   * Open the file for reading...
   */
 
-  sgip = sgiOpen ((char *) filename, SGI_READ, 0, 0, 0, 0, 0);
+  sgip = sgiOpen (filename, SGI_READ, 0, 0, 0, 0, 0);
   if (sgip == NULL)
     {
-      g_message (_("Could not open '%s' for reading."),
-                 gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not open '%s' for reading."),
+                   gimp_filename_to_utf8 (filename));
       return -1;
     };
 
@@ -356,7 +369,9 @@
   image = gimp_image_new (sgip->xsize, sgip->ysize, image_type);
   if (image == -1)
     {
-      g_message ("Could not allocate new image");
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "Could not allocate new image: %s",
+                   gimp_get_pdb_error());
       return -1;
     }
 
@@ -474,9 +489,10 @@
  */
 
 static gint
-save_image (const gchar *filename,
-            gint32       image_ID,
-            gint32       drawable_ID)
+save_image (const gchar  *filename,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            GError      **error)
 {
   gint        i, j,        /* Looping var */
               x,           /* Current X coordinate */
@@ -525,12 +541,13 @@
    * Open the file for writing...
    */
 
-  sgip = sgiOpen ((char *) filename, SGI_WRITE, compression, 1,
+  sgip = sgiOpen (filename, SGI_WRITE, compression, 1,
                   drawable->width, drawable->height, zsize);
   if (sgip == NULL)
     {
-      g_message (_("Could not open '%s' for writing."),
-                  gimp_filename_to_utf8 (filename));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   _("Could not open '%s' for writing."),
+                   gimp_filename_to_utf8 (filename));
       return FALSE;
     };
 

Modified: branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gnomevfs.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gnomevfs.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gnomevfs.c	Sun Oct 12 15:38:02 2008
@@ -78,7 +78,8 @@
 {
   if (! gnome_vfs_init ())
     {
-      g_set_error (error, 0, 0, "Could not initialize GnomeVFS");
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", "Could not initialize GnomeVFS");
       return FALSE;
     }
 
@@ -267,7 +268,7 @@
 
   if (result != GNOME_VFS_OK)
     {
-      g_set_error (error, 0, 0,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Could not open '%s' for reading: %s"),
                    src_uri, gnome_vfs_result_to_string (result));
       return FALSE;
@@ -278,7 +279,7 @@
 
   if (result != GNOME_VFS_OK)
     {
-      g_set_error (error, 0, 0,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Could not open '%s' for writing: %s"),
                    dest_uri, gnome_vfs_result_to_string (result));
       gnome_vfs_close (read_handle);
@@ -307,7 +308,7 @@
           if (result != GNOME_VFS_ERROR_EOF)
             {
               memsize = g_format_size_for_display (sizeof (buffer));
-              g_set_error (error, 0, 0,
+              g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                            _("Failed to read %s from '%s': %s"),
                            memsize, src_uri,
                            gnome_vfs_result_to_string (result));
@@ -356,7 +357,7 @@
       if (chunk_written < chunk_read)
         {
           memsize = g_format_size_for_display (chunk_read);
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("Failed to write %s to '%s': %s"),
                        memsize, dest_uri,
                        gnome_vfs_result_to_string (result));

Modified: branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gvfs.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gvfs.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-gvfs.c	Sun Oct 12 15:38:02 2008
@@ -286,7 +286,8 @@
 
   if (! g_vfs_is_active (vfs))
     {
-      g_set_error (error, 0, 0, "Initialization of GVfs failed");
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "Initialization of GVfs failed");
       return FALSE;
     }
 

Modified: branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-libcurl.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-libcurl.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-libcurl.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,8 @@
 
 #include "config.h"
 
+#include <errno.h>
+
 #include <curl/curl.h>
 #include <curl/types.h>
 #include <curl/easy.h>
@@ -54,7 +56,8 @@
 
   if (curl_global_init (CURL_GLOBAL_ALL))
     {
-      g_set_error (error, 0, 0, _("Could not initialize libcurl"));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", _("Could not initialize libcurl"));
       return FALSE;
     }
 
@@ -156,8 +159,9 @@
 
   if ((out_file = g_fopen (tmpname, "wb")) == NULL)
     {
-      g_set_error (error, 0, 0,
-                   _("Could not open output file for writing"));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (tmpname),  g_strerror (errno));
       return FALSE;
     }
 
@@ -182,7 +186,7 @@
   if ((result = curl_easy_perform (curl_handle)) != 0)
     {
       fclose (out_file);
-      g_set_error (error, 0, 0,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Could not open '%s' for reading: %s"),
                    uri, curl_easy_strerror (result));
       curl_easy_cleanup (curl_handle);
@@ -194,7 +198,7 @@
   if (response_code != 200)
     {
       fclose (out_file);
-      g_set_error (error, 0, 0,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    _("Opening '%s' for reading resulted in HTTP "
                      "response code: %d"),
                    uri, response_code);
@@ -216,8 +220,7 @@
                         GimpRunMode   run_mode,
                         GError      **error)
 {
-  g_set_error (error, 0, 0,
-               "EEK! uri_backend_save_image() should not have been called!");
+  g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, "not implemented");
 
   return FALSE;
 }

Modified: branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-wget.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-wget.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-uri/uri-backend-wget.c	Sun Oct 12 15:38:02 2008
@@ -91,7 +91,8 @@
 
   if (pipe (p) != 0)
     {
-      g_set_error (error, 0, 0, "pipe() failed: %s", g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "pipe() failed: %s", g_strerror (errno));
       return FALSE;
     }
 
@@ -100,7 +101,8 @@
 
   if ((pid = fork()) < 0)
     {
-      g_set_error (error, 0, 0, "fork() failed: %s", g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "fork() failed: %s", g_strerror (errno));
       return FALSE;
     }
   else if (pid == 0)
@@ -122,7 +124,6 @@
       execlp ("wget",
               "wget", "-v", "-e", "server-response=off", "-T", timeout_str,
               uri, "-O", tmpname, NULL);
-      g_set_error (error, 0, 0, "exec() failed: wget: %s", g_strerror (errno));
       _exit (127);
     }
   else
@@ -157,7 +158,7 @@
       /* Eat any Location lines */
       if (redirect && fgets (buf, sizeof (buf), input) == NULL)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("wget exited abnormally on URI '%s'"), uri);
           return FALSE;
         }
@@ -177,7 +178,7 @@
       /*  The second line is the local copy of the file  */
       if (fgets (buf, sizeof (buf), input) == NULL)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("wget exited abnormally on URI '%s'"), uri);
           return FALSE;
         }
@@ -196,7 +197,7 @@
     read_connect:
       if (fgets (buf, sizeof (buf), input) == NULL)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("wget exited abnormally on URI '%s'"), uri);
           return FALSE;
         }
@@ -219,13 +220,13 @@
 
       if (fgets (buf, sizeof (buf), input) == NULL)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("wget exited abnormally on URI '%s'"), uri);
           return FALSE;
         }
       else if (! connected)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("A network error occurred: %s"), buf);
 
           DEBUG (buf);
@@ -248,7 +249,7 @@
       /*  The fifth line is either the length of the file or an error  */
       if (fgets (buf, sizeof (buf), input) == NULL)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("wget exited abnormally on URI '%s'"), uri);
           return FALSE;
         }
@@ -258,7 +259,7 @@
         }
       else
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        _("A network error occurred: %s"), buf);
 
           DEBUG (buf);
@@ -270,7 +271,7 @@
 
       if (sscanf (buf, "Length: %37s", sizestr) != 1)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        "Could not parse wget's file length message");
           return FALSE;
         }
@@ -315,7 +316,7 @@
 
       /*  Switch to byte parsing wget's output...  */
 
-      while (1)
+      while (TRUE)
         {
           dot = fgetc (input);
 
@@ -366,7 +367,7 @@
 
       if (! finished)
         {
-          g_set_error (error, 0, 0,
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                        "wget exited before finishing downloading URI\n'%s'",
                        uri);
           return FALSE;
@@ -382,7 +383,7 @@
                         GimpRunMode   run_mode,
                         GError      **error)
 {
-  g_set_error (error, 0, 0, "EEK");
+  g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, "not implemented");
 
   return FALSE;
 }

Modified: branches/soc-2008-tagging/plug-ins/file-uri/uri.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-uri/uri.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-uri/uri.c	Sun Oct 12 15:38:02 2008
@@ -51,11 +51,13 @@
                                           GimpParam       **return_vals);
 
 static gint32              load_image    (const gchar      *uri,
-                                          GimpRunMode       run_mode);
+                                          GimpRunMode       run_mode,
+                                          GError          **error);
 static GimpPDBStatusType   save_image    (const gchar      *uri,
                                           gint32            image_ID,
                                           gint32            drawable_ID,
-                                          gint32            run_mode);
+                                          gint32            run_mode,
+                                          GError          **error);
 
 static gchar             * get_temp_name (const gchar      *uri,
                                           gboolean         *name_image);
@@ -173,15 +175,24 @@
 
   if (! uri_backend_init (PLUG_IN_BINARY, TRUE, run_mode, &error))
     {
-      g_message (error->message);
-      g_clear_error (&error);
+      if (error)
+        {
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = error->message;
+        }
 
       return;
     }
 
+  /*  We handle PDB errors by forwarding them to the caller in
+   *  our return values.
+   */
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
+
   if (! strcmp (name, LOAD_PROC) && uri_backend_get_load_protocols ())
     {
-      image_ID = load_image (param[2].data.d_string, run_mode);
+      image_ID = load_image (param[2].data.d_string, run_mode, &error);
 
       if (image_ID != -1)
         {
@@ -197,7 +208,7 @@
       status = save_image (param[3].data.d_string,
                            param[1].data.d_int32,
                            param[2].data.d_int32,
-                           run_mode);
+                           run_mode, &error);
     }
   else
     {
@@ -206,21 +217,28 @@
 
   uri_backend_shutdown ();
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static gint32
-load_image (const gchar *uri,
-            GimpRunMode  run_mode)
+load_image (const gchar  *uri,
+            GimpRunMode   run_mode,
+            GError      **error)
 {
   gchar    *tmpname    = NULL;
   gint32    image_ID   = -1;
   gboolean  name_image = FALSE;
-  GError   *error      = NULL;
 
   tmpname = get_temp_name (uri, &name_image);
 
-  if (uri_backend_load_image (uri, tmpname, run_mode, &error))
+  if (uri_backend_load_image (uri, tmpname, run_mode, error))
     {
       image_ID = gimp_file_load (run_mode, tmpname, tmpname);
 
@@ -231,11 +249,11 @@
           else
             gimp_image_set_filename (image_ID, "");
         }
-    }
-  else if (error)
-    {
-      g_message ("%s", error->message);
-      g_clear_error (&error);
+      else
+        {
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       "%s", gimp_get_pdb_error ());
+        }
     }
 
   g_unlink (tmpname);
@@ -245,43 +263,38 @@
 }
 
 static GimpPDBStatusType
-save_image (const gchar *uri,
-            gint32       image_ID,
-            gint32       drawable_ID,
-            gint32       run_mode)
+save_image (const gchar  *uri,
+            gint32        image_ID,
+            gint32        drawable_ID,
+            gint32        run_mode,
+            GError      **error)
 {
-  gchar  *tmpname;
-  GError *error = NULL;
+  GimpPDBStatusType  status = GIMP_PDB_EXECUTION_ERROR;
+  gchar             *tmpname;
 
   tmpname = get_temp_name (uri, NULL);
 
-  if (! (gimp_file_save (run_mode,
-                         image_ID,
-                         drawable_ID,
-                         tmpname,
-                         tmpname) && valid_file (tmpname)))
+  if (gimp_file_save (run_mode,
+                      image_ID,
+                      drawable_ID,
+                      tmpname,
+                      tmpname) && valid_file (tmpname))
     {
-      g_unlink (tmpname);
-      g_free (tmpname);
-
-      return GIMP_PDB_EXECUTION_ERROR;
+      if (uri_backend_save_image (uri, tmpname, run_mode, error))
+        {
+          status = GIMP_PDB_SUCCESS;
+        }
     }
-
-  if (! uri_backend_save_image (uri, tmpname, run_mode, &error))
+  else
     {
-      g_message ("%s", error->message);
-      g_clear_error (&error);
-
-      g_unlink (tmpname);
-      g_free (tmpname);
-
-      return GIMP_PDB_EXECUTION_ERROR;
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                   "%s", gimp_get_pdb_error ());
     }
 
   g_unlink (tmpname);
   g_free (tmpname);
 
-  return GIMP_PDB_SUCCESS;
+  return status;
 }
 
 static gchar *

Modified: branches/soc-2008-tagging/plug-ins/file-xjt/xjt.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/file-xjt/xjt.c	(original)
+++ branches/soc-2008-tagging/plug-ins/file-xjt/xjt.c	Sun Oct 12 15:38:02 2008
@@ -399,10 +399,12 @@
                                    gint             *nreturn_vals,
                                    GimpParam       **return_vals);
 
-static gint32    load_xjt_image   (const gchar      *filename);
+static gint32    load_xjt_image   (const gchar      *filename,
+                                   GError          **error);
 static gint      save_xjt_image   (const gchar      *filename,
                                    gint32            image_ID,
-                                   gint32            drawable_ID);
+                                   gint32            drawable_ID,
+                                   GError          **error);
 
 static gboolean  save_dialog      (void);
 
@@ -517,18 +519,19 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam values[2];
-  GimpRunMode  run_mode;
-  GimpPDBStatusType   status = GIMP_PDB_SUCCESS;
-  gint32        image_ID;
-  gchar        *l_env;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  gint32             image_ID;
+  const gchar       *l_env;
+  GError            *error  = NULL;
 
   g_pid = getpid ();
   xjt_debug = FALSE;
 
   INIT_I18N ();
 
-  l_env = getenv("XJT_DEBUG");
+  l_env = getenv ("XJT_DEBUG");
   if(l_env != NULL)
     {
       if((*l_env != 'n') && (*l_env != 'N')) xjt_debug = TRUE;
@@ -543,7 +546,7 @@
 
   if (strcmp (name, LOAD_PROC) == 0)
     {
-      image_ID = load_xjt_image (param[1].data.d_string);
+      image_ID = load_xjt_image (param[1].data.d_string, &error);
 
       if (image_ID != -1)
         {
@@ -608,7 +611,8 @@
         {
           if (save_xjt_image (param[3].data.d_string,
                               param[1].data.d_int32,
-                              param[2].data.d_int32) <0)
+                              param[2].data.d_int32,
+                              &error) < 0)
             {
               status = GIMP_PDB_EXECUTION_ERROR;
             }
@@ -624,6 +628,13 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
@@ -1635,9 +1646,10 @@
 /* ---------------------- SAVE  -------------------------- */
 
 static gint
-save_xjt_image (const gchar *filename,
-                gint32       image_id,
-                gint32       drawable_id)
+save_xjt_image (const gchar  *filename,
+                gint32        image_id,
+                gint32        drawable_id,
+                GError      **error)
 {
   int     l_rc;
   int     l_len;
@@ -1703,8 +1715,9 @@
   l_prop_file = g_strdup_printf ("%s%cPRP", l_dirname, G_DIR_SEPARATOR);
   if (g_mkdir (l_dirname, 0777) != 0)
     {
-      g_message (_("Could not create working folder '%s': %s"),
-                 gimp_filename_to_utf8 (l_dirname), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not create working folder '%s': %s"),
+                   gimp_filename_to_utf8 (l_dirname), g_strerror (errno));
       goto cleanup;
     }
 
@@ -1712,8 +1725,9 @@
   l_fp_prp = g_fopen (l_prop_file, "wb");
   if (l_fp_prp == NULL)
     {
-      g_message (_("Could not open '%s' for writing: %s"),
-                 gimp_filename_to_utf8 (l_prop_file), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not open '%s' for writing: %s"),
+                   gimp_filename_to_utf8 (l_prop_file), g_strerror (errno));
       goto cleanup;
     }
 
@@ -3050,7 +3064,7 @@
     }
   l_ptr = scan_ptr + strlen ("PATH");
 
-  while (1)
+  while (TRUE)
     {
       l_ptr = p_skip_blanks (l_ptr);
       l_ptr = p_scann_token (l_ptr, &l_param, &l_prop_id);
@@ -3202,7 +3216,8 @@
  */
 
 static t_image_props *
-p_load_prop_file (const gchar *prop_filename)
+p_load_prop_file (const gchar  *prop_filename,
+                  GError      **error)
 {
   gint32 l_filesize;
   gint32 l_line_idx;
@@ -3220,14 +3235,16 @@
   l_file_buff = p_load_linefile(prop_filename, &l_filesize);
   if(l_file_buff == NULL)
   {
-    g_message(_("Error: Could not read XJT property file '%s'."),
-               gimp_filename_to_utf8 (prop_filename));
+    g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                 _("Error: Could not read XJT property file '%s'."),
+                 gimp_filename_to_utf8 (prop_filename));
     goto cleanup;
   }
   if(l_filesize == 0)
   {
-    g_message(_("Error: XJT property file '%s' is empty."),
-               gimp_filename_to_utf8 (prop_filename));
+    g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                 _("Error: XJT property file '%s' is empty."),
+                 gimp_filename_to_utf8 (prop_filename));
     goto cleanup;
   }
 
@@ -3306,7 +3323,8 @@
 /* ---------------------- LOAD  -------------------------- */
 
 static gint32
-load_xjt_image (const gchar *filename)
+load_xjt_image (const gchar  *filename,
+                GError      **error)
 {
   int     l_rc;
   int     l_len;
@@ -3349,10 +3367,11 @@
   l_dirname = gimp_temp_name (".tmpdir");
   l_prop_file = g_strdup_printf("%s%cPRP", l_dirname, G_DIR_SEPARATOR);
 
-  if(g_mkdir(l_dirname, 0777) != 0)
+  if (g_mkdir (l_dirname, 0777) != 0)
     {
-      g_message (_("Could not create working folder '%s': %s"),
-                  gimp_filename_to_utf8 (l_dirname), g_strerror (errno));
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not create working folder '%s': %s"),
+                   gimp_filename_to_utf8 (l_dirname), g_strerror (errno));
       goto cleanup;
     }
 
@@ -3411,10 +3430,11 @@
     goto cleanup;
 
   /* check and read Property file (PRP must exist in each xjt archive) */
-  l_image_prp_ptr = p_load_prop_file(l_prop_file);
+  l_image_prp_ptr = p_load_prop_file(l_prop_file, error);
   if (l_image_prp_ptr == NULL)
-    {  l_rc = -1;
-    goto cleanup;
+    {
+      l_rc = -1;
+      goto cleanup;
     }
 
 
@@ -3423,8 +3443,9 @@
                                l_image_prp_ptr->image_height,
                                l_image_prp_ptr->image_type);
   if(l_image_id < 0)
-    { l_rc = -1;
-    goto cleanup;
+    {
+      l_rc = -1;
+      goto cleanup;
     }
 
   gimp_image_set_filename (l_image_id, filename);

Modified: branches/soc-2008-tagging/plug-ins/flame/rect.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/flame/rect.c	(original)
+++ branches/soc-2008-tagging/plug-ins/flame/rect.c	Sun Oct 12 15:38:02 2008
@@ -274,21 +274,30 @@
               int k, color_index;
               double *p = points[j];
               bucket *b;
-              if (p[0] < bounds[0] ||
-                  p[1] < bounds[1] ||
-                  p[0] > bounds[2] ||
-                  p[1] > bounds[3])
-                continue;
-              color_index = (int) (p[2] * CMAP_SIZE);
-              if (color_index < 0)
-                color_index = 0;
-              else if (color_index > (CMAP_SIZE-1))
-                color_index = CMAP_SIZE-1;
-              b = buckets +
-                  (int) (width * (p[0] - bounds[0]) * size[0]) +
-                  width * (int) (height * (p[1] - bounds[1]) * size[1]);
-              for (k = 0; k < 4; k++)
-                bump_no_overflow(b[0][k], cmap[color_index][k], short);
+
+              /* Note that we must test if p[0] and p[1] is "within"
+               * the valid bounds rather than "not outside", because
+               * p[0] and p[1] might be NaN.
+               */
+              if (p[0] >= bounds[0] &&
+                  p[1] >= bounds[1] &&
+                  p[0] <= bounds[2] &&
+                  p[1] <= bounds[3])
+                {
+                  color_index = (int) (p[2] * CMAP_SIZE);
+
+                  if (color_index < 0)
+                    color_index = 0;
+                  else if (color_index > CMAP_SIZE - 1)
+                    color_index = CMAP_SIZE - 1;
+
+                  b = buckets +
+                      (int) (width * (p[0] - bounds[0]) * size[0]) +
+                      width * (int) (height * (p[1] - bounds[1]) * size[1]);
+
+                  for (k = 0; k < 4; k++)
+                    bump_no_overflow(b[0][k], cmap[color_index][k], short);
+                }
             }
         }
 

Modified: branches/soc-2008-tagging/plug-ins/gfig/gfig-dobject.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gfig/gfig-dobject.h	(original)
+++ branches/soc-2008-tagging/plug-ins/gfig/gfig-dobject.h	Sun Oct 12 15:38:02 2008
@@ -41,7 +41,7 @@
 typedef struct
 {
   DobjType      type;       /* the object type for this class */
-  gchar        *name;
+  const gchar  *name;
 
   /* virtuals */
   DobjFunc      drawfunc;   /* How do I draw myself */

Modified: branches/soc-2008-tagging/plug-ins/gfig/gfig-preview.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gfig/gfig-preview.c	(original)
+++ branches/soc-2008-tagging/plug-ins/gfig/gfig-preview.c	Sun Oct 12 15:38:02 2008
@@ -99,7 +99,7 @@
                     GTK_FILL , GTK_FILL , 0, 0);
   gtk_container_add (GTK_CONTAINER (frame), table);
 
-  ruler = gimp_hruler_new ();
+  ruler = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL);
   gimp_ruler_set_range (GIMP_RULER (ruler), 0, preview_width, PREVIEW_SIZE);
   g_signal_connect_swapped (gfig_context->preview, "motion-notify-event",
                             G_CALLBACK (GTK_WIDGET_CLASS (G_OBJECT_GET_CLASS (ruler))->motion_notify_event),
@@ -108,7 +108,7 @@
                     GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (ruler);
 
-  ruler = gimp_vruler_new ();
+  ruler = gimp_ruler_new (GTK_ORIENTATION_VERTICAL);
   gimp_ruler_set_range (GIMP_RULER (ruler), 0, preview_height, PREVIEW_SIZE);
   g_signal_connect_swapped (gfig_context->preview, "motion-notify-event",
                             G_CALLBACK (GTK_WIDGET_CLASS (G_OBJECT_GET_CLASS (ruler))->motion_notify_event),

Modified: branches/soc-2008-tagging/plug-ins/gfig/gfig-style.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gfig/gfig-style.c	(original)
+++ branches/soc-2008-tagging/plug-ins/gfig/gfig-style.c	Sun Oct 12 15:38:02 2008
@@ -38,32 +38,31 @@
 #include "gfig-style.h"
 
 
-static void gfig_read_parameter_string   (gchar **text,
-                                          gint    nitems,
-                                          gchar  *name,
-                                          gchar **style_entry);
-
-
-static void gfig_read_parameter_int      (gchar **text,
-                                          gint    nitems,
-                                          gchar  *name,
-                                          gint   *style_entry);
-
-static void gfig_read_parameter_double   (gchar  **text,
-                                          gint     nitems,
-                                          gchar   *name,
-                                          gdouble *style_entry);
-
-static void gfig_read_parameter_gimp_rgb (gchar  **text,
-                                          gint     nitems,
-                                          gchar   *name,
-                                          GimpRGB *style_entry);
+static void gfig_read_parameter_string   (gchar       **text,
+                                          gint          nitems,
+                                          const gchar  *name,
+                                          gchar       **style_entry);
+
+static void gfig_read_parameter_int      (gchar       **text,
+                                          gint          nitems,
+                                          const gchar  *name,
+                                          gint         *style_entry);
+
+static void gfig_read_parameter_double   (gchar        **text,
+                                          gint           nitems,
+                                          const gchar   *name,
+                                          gdouble       *style_entry);
+
+static void gfig_read_parameter_gimp_rgb (gchar        **text,
+                                          gint           nitems,
+                                          const gchar   *name,
+                                          GimpRGB       *style_entry);
 
 static void
-gfig_read_parameter_string (gchar **text,
-                            gint    nitems,
-                            gchar  *name,
-                            gchar  **style_entry)
+gfig_read_parameter_string (gchar       **text,
+                            gint          nitems,
+                            const gchar  *name,
+                            gchar        **style_entry)
 {
   gint  n = 0;
   gchar *ptr;
@@ -94,10 +93,10 @@
 
 
 static void
-gfig_read_parameter_int (gchar **text,
-                         gint    nitems,
-                         gchar  *name,
-                         gint   *style_entry)
+gfig_read_parameter_int (gchar       **text,
+                         gint          nitems,
+                         const gchar  *name,
+                         gint         *style_entry)
 {
   gint  n = 0;
   gchar *ptr;
@@ -125,10 +124,10 @@
 }
 
 static void
-gfig_read_parameter_double (gchar  **text,
-                            gint     nitems,
-                            gchar   *name,
-                            gdouble *style_entry)
+gfig_read_parameter_double (gchar        **text,
+                            gint           nitems,
+                            const gchar   *name,
+                            gdouble       *style_entry)
 {
   gint   n = 0;
   gchar *ptr;
@@ -157,10 +156,10 @@
 }
 
 static void
-gfig_read_parameter_gimp_rgb (gchar  **text,
-                              gint     nitems,
-                              gchar   *name,
-                              GimpRGB *style_entry)
+gfig_read_parameter_gimp_rgb (gchar        **text,
+                              gint           nitems,
+                              const gchar   *name,
+                              GimpRGB       *style_entry)
 {
   gint   n = 0;
   gchar *ptr;

Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/gimpressionist.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/gimpressionist.h	(original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/gimpressionist.h	Sun Oct 12 15:38:02 2008
@@ -136,11 +136,13 @@
 
 void unselectall (GtkWidget *list);
 void reselect (GtkWidget *list, char *fname);
-void readdirintolist (char *subdir, GtkWidget *view, char *selected);
-void readdirintolist_extended (char *subdir, GtkWidget *view, char *selected,
+void readdirintolist (const char *subdir, GtkWidget *view, char *selected);
+void readdirintolist_extended (const char *subdir,
+                               GtkWidget *view, char *selected,
                                gboolean with_filename_column,
-                               gchar *(*get_object_name_cb)
-                               (gchar *dir, gchar *filename, void *context),
+                               gchar *(*get_object_name_cb) (const gchar *dir,
+                                                             gchar *filename,
+                                                             void *context),
                                void * context);
 
 GtkWidget *create_one_column_list (GtkWidget *parent,

Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/presets.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/presets.c	(original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/presets.c	Sun Oct 12 15:38:02 2008
@@ -99,7 +99,7 @@
 
 static char presetdesc[4096] = "";
 
-static char *factory_defaults = "<Factory defaults>";
+static const char *factory_defaults = "<Factory defaults>";
 
 static gchar *
 get_early_line_from_preset (gchar *full_path, const gchar *prefix)
@@ -134,7 +134,9 @@
 }
 
 static gchar *
-get_object_name (gchar *dir, gchar *filename, void *context)
+get_object_name (const gchar *dir,
+                 gchar       *filename,
+                 void        *context)
 {
   gchar *ret = NULL, *unprocessed_line = NULL;
   gchar *full_path = NULL;

Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c	(original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c	Sun Oct 12 15:38:02 2008
@@ -250,14 +250,14 @@
 }
 
 static void
-readdirintolist_real(char         *subdir,
-                     GtkWidget    *view,
-                     char         *selected,
-                     gboolean      with_filename_column,
-                     gchar      *(*get_object_name_cb) (gchar *dir,
-                                                        gchar *filename,
-                                                        void  *context),
-                     void         *context)
+readdirintolist_real (const char   *subdir,
+                      GtkWidget    *view,
+                      char         *selected,
+                      gboolean      with_filename_column,
+                      gchar      *(*get_object_name_cb) (const gchar *dir,
+                                                         gchar       *filename,
+                                                         void        *context),
+                      void         *context)
 {
   gchar           *fpath;
   const gchar     *de;
@@ -353,14 +353,14 @@
 }
 
 void
-readdirintolist_extended (char         *subdir,
+readdirintolist_extended (const char   *subdir,
                           GtkWidget    *view,
                           char         *selected,
                           gboolean      with_filename_column,
-                          gchar      *(*get_object_name_cb) (gchar *dir,
-                                                             gchar *filename,
-                                                             void *context),
-                          void * context)
+                          gchar      *(*get_object_name_cb) (const gchar *dir,
+                                                             gchar       *filename,
+                                                             void        *context),
+                          void         *context)
 {
   char *tmpdir;
   GList *thispath = parsepath ();
@@ -376,7 +376,9 @@
 }
 
 void
-readdirintolist (char *subdir, GtkWidget *view, char *selected)
+readdirintolist (const char *subdir,
+                 GtkWidget  *view,
+                 char       *selected)
 {
   readdirintolist_extended (subdir, view, selected, FALSE, NULL, NULL);
 }

Modified: branches/soc-2008-tagging/plug-ins/gradient-flare/gradient-flare.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gradient-flare/gradient-flare.c	(original)
+++ branches/soc-2008-tagging/plug-ins/gradient-flare/gradient-flare.c	Sun Oct 12 15:38:02 2008
@@ -572,11 +572,10 @@
 static gint                gradient_cache_count = 0;
 
 
-static gchar *internal_gradients[] =
+static const gchar *internal_gradients[] =
 {
   "%white", "%white_grad", "%red_grad", "%blue_grad", "%yellow_grad", "%random"
 };
-static int internal_ngradients = G_N_ELEMENTS (internal_gradients);
 
 #ifdef DEBUG
 static gint     get_values_external_count = 0;
@@ -827,7 +826,7 @@
             gint             *nreturn_vals,
             GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
+  static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   gchar             *path;
@@ -961,8 +960,10 @@
         }
       else
         {
-          g_message (_("Cannot operate on indexed color images."));
-          status = GIMP_PDB_EXECUTION_ERROR;
+          status        = GIMP_PDB_EXECUTION_ERROR;
+          *nreturn_vals = 2;
+          values[1].type          = GIMP_PDB_STRING;
+          values[1].data.d_string = _("Cannot operate on indexed color images.");
         }
     }
 
@@ -4710,11 +4711,11 @@
   gradient_cache_flush ();
   external_gradients = gimp_gradients_get_list (NULL, &external_ngradients);
 
-  *num_gradients = internal_ngradients + external_ngradients;
+  *num_gradients = G_N_ELEMENTS (internal_gradients) + external_ngradients;
   gradients = g_new (gchar *, *num_gradients);
 
   n = 0;
-  for (i = 0; i < internal_ngradients; i++)
+  for (i = 0; i < G_N_ELEMENTS (internal_gradients); i++)
     {
       gradients[n++] = g_strdup (internal_gradients[i]);
     }

Modified: branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/dialog.c	(original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/dialog.c	Sun Oct 12 15:38:02 2008
@@ -92,6 +92,8 @@
                                            gpointer           data);
 static void       copy_location_callback  (GtkAction         *action,
                                            gpointer           data);
+static void       copy_selection_callback (GtkAction         *action,
+                                           gpointer           data);
 static void       show_index_callback     (GtkAction         *action,
                                            gpointer           data);
 static void       zoom_in_callback        (GtkAction         *action,
@@ -591,6 +593,11 @@
       G_CALLBACK (copy_location_callback)
     },
     {
+      "copy-selection", GTK_STOCK_COPY,
+      NULL, "<control>C", NULL,
+      G_CALLBACK (copy_selection_callback)
+    },
+    {
       "zoom-in", GTK_STOCK_ZOOM_IN,
       NULL, "<control>plus", NULL,
       G_CALLBACK (zoom_in_callback)
@@ -715,6 +722,20 @@
       g_clear_error (&error);
     }
 
+  gtk_ui_manager_add_ui_from_string (ui_manager,
+                                     "<ui>"
+                                     "  <popup name=\"help-browser-copy-popup\">"
+                                     "    <menuitem action=\"copy-selection\" />"
+                                     "  </popup>"
+                                     "</ui>",
+                                     -1, &error);
+
+  if (error)
+    {
+      g_warning ("error parsing ui: %s", error->message);
+      g_clear_error (&error);
+    }
+
   return ui_manager;
 }
 
@@ -809,6 +830,16 @@
 }
 
 static void
+copy_selection_callback (GtkAction *action,
+                         gpointer   data)
+{
+  if (webkit_web_view_can_copy_clipboard (WEBKIT_WEB_VIEW (view)))
+    {
+      webkit_web_view_copy_clipboard (WEBKIT_WEB_VIEW (view));
+    }
+}
+
+static void
 show_index_callback (GtkAction *action,
                      gpointer   data)
 {
@@ -1043,8 +1074,15 @@
 view_popup_menu (GtkWidget      *widget,
                  GdkEventButton *event)
 {
-  GtkWidget *menu = gtk_ui_manager_get_widget (ui_manager,
-                                               "/help-browser-popup");
+  GtkWidget   *menu;
+  const gchar *path;
+
+  if (webkit_web_view_can_copy_clipboard (WEBKIT_WEB_VIEW (view)))
+    path = "/help-browser-copy-popup";
+  else
+    path = "/help-browser-popup";
+
+  menu = gtk_ui_manager_get_widget (ui_manager, path);
 
   gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
   gtk_menu_popup (GTK_MENU (menu),

Modified: branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose-storage.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose-storage.c	(original)
+++ branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose-storage.c	Sun Oct 12 15:38:02 2008
@@ -60,33 +60,33 @@
 
 static struct
 {
-  gchar *name;
-  gint token;
+  const gchar *name;
+  gint        token;
 } symbols[] = {
-  { "iterations", TOKEN_ITERATIONS },
-  { "max_memory", TOKEN_MAX_MEMORY },
-  { "subdivide", TOKEN_SUBDIVIDE },
-  { "radius", TOKEN_RADIUS },
+  { "iterations",   TOKEN_ITERATIONS },
+  { "max_memory",   TOKEN_MAX_MEMORY },
+  { "subdivide",    TOKEN_SUBDIVIDE },
+  { "radius",       TOKEN_RADIUS },
   { "aspect_ratio", TOKEN_ASPECT_RATIO },
-  { "center_x", TOKEN_CENTER_X },
-  { "center_y", TOKEN_CENTER_Y },
-  { "element", TOKEN_ELEMENT },
-  { "x", TOKEN_X },
-  { "y", TOKEN_Y },
-  { "theta", TOKEN_THETA },
-  { "scale", TOKEN_SCALE },
-  { "asym", TOKEN_ASYM },
-  { "shear", TOKEN_SHEAR },
-  { "flip", TOKEN_FLIP },
-  { "red_color", TOKEN_RED_COLOR },
-  { "green_color", TOKEN_GREEN_COLOR },
-  { "blue_color", TOKEN_BLUE_COLOR },
-  { "black_color", TOKEN_BLACK_COLOR },
+  { "center_x",     TOKEN_CENTER_X },
+  { "center_y",     TOKEN_CENTER_Y },
+  { "element",      TOKEN_ELEMENT },
+  { "x",            TOKEN_X },
+  { "y",            TOKEN_Y },
+  { "theta",        TOKEN_THETA },
+  { "scale",        TOKEN_SCALE },
+  { "asym",         TOKEN_ASYM },
+  { "shear",        TOKEN_SHEAR },
+  { "flip",         TOKEN_FLIP },
+  { "red_color",    TOKEN_RED_COLOR },
+  { "green_color",  TOKEN_GREEN_COLOR },
+  { "blue_color",   TOKEN_BLUE_COLOR },
+  { "black_color",  TOKEN_BLACK_COLOR },
   { "target_color", TOKEN_TARGET_COLOR },
-  { "hue_scale", TOKEN_HUE_SCALE },
-  { "value_scale", TOKEN_VALUE_SCALE },
+  { "hue_scale",    TOKEN_HUE_SCALE },
+  { "value_scale",  TOKEN_VALUE_SCALE },
   { "simple_color", TOKEN_SIMPLE_COLOR },
-  { "prob", TOKEN_PROB }
+  { "prob",         TOKEN_PROB }
 };
 
 static GTokenType

Modified: branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c	(original)
+++ branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c	Sun Oct 12 15:38:02 2008
@@ -1694,25 +1694,18 @@
 design_area_motion (GtkWidget      *widget,
                     GdkEventMotion *event)
 {
-  gint i;
+  gint    i;
   gdouble xo;
   gdouble yo;
   gdouble xn;
   gdouble yn;
-  gint px, py;
-  gdouble width = ifsDesign->area->allocation.width;
+  gdouble width  = ifsDesign->area->allocation.width;
   gdouble height = ifsDesign->area->allocation.height;
 
   Aff2 trans, t1, t2, t3;
 
-  if (!(ifsDesign->button_state & GDK_BUTTON1_MASK)) return FALSE;
-
-  if (event->is_hint)
-    {
-      gtk_widget_get_pointer (ifsDesign->area, &px, &py);
-      event->x = px;
-      event->y = py;
-    }
+  if (! (ifsDesign->button_state & GDK_BUTTON1_MASK))
+    return FALSE;
 
   xo = (ifsDesign->op_x - ifsDesign->op_xcenter);
   yo = (ifsDesign->op_y - ifsDesign->op_ycenter);
@@ -1722,36 +1715,32 @@
   switch (ifsDesign->op)
     {
     case OP_ROTATE:
-      {
-        aff2_translate (&t1,-ifsDesign->op_xcenter*width,
-                       -ifsDesign->op_ycenter*width);
-        aff2_scale (&t2,
-                   sqrt((SQR(xn)+SQR(yn))/(SQR(xo)+SQR(yo))),
-                   0);
-        aff2_compose (&t3, &t2, &t1);
-        aff2_rotate (&t1, - atan2(yn, xn) + atan2(yo, xo));
-        aff2_compose (&t2, &t1, &t3);
-        aff2_translate (&t3, ifsDesign->op_xcenter*width,
-                       ifsDesign->op_ycenter*width);
-        aff2_compose (&trans, &t3, &t2);
-        break;
-      }
+      aff2_translate (&t1,-ifsDesign->op_xcenter*width,
+                      -ifsDesign->op_ycenter*width);
+      aff2_scale (&t2,
+                  sqrt((SQR(xn)+SQR(yn))/(SQR(xo)+SQR(yo))),
+                  0);
+      aff2_compose (&t3, &t2, &t1);
+      aff2_rotate (&t1, - atan2(yn, xn) + atan2(yo, xo));
+      aff2_compose (&t2, &t1, &t3);
+      aff2_translate (&t3, ifsDesign->op_xcenter*width,
+                      ifsDesign->op_ycenter*width);
+      aff2_compose (&trans, &t3, &t2);
+      break;
+
     case OP_STRETCH:
-      {
-        aff2_translate (&t1,-ifsDesign->op_xcenter*width,
-                       -ifsDesign->op_ycenter*width);
-        aff2_compute_stretch (&t2, xo, yo, xn, yn);
-        aff2_compose (&t3, &t2, &t1);
-        aff2_translate (&t1, ifsDesign->op_xcenter*width,
-                       ifsDesign->op_ycenter*width);
-        aff2_compose (&trans, &t1, &t3);
-        break;
-      }
+      aff2_translate (&t1,-ifsDesign->op_xcenter*width,
+                      -ifsDesign->op_ycenter*width);
+      aff2_compute_stretch (&t2, xo, yo, xn, yn);
+      aff2_compose (&t3, &t2, &t1);
+      aff2_translate (&t1, ifsDesign->op_xcenter*width,
+                      ifsDesign->op_ycenter*width);
+      aff2_compose (&trans, &t1, &t3);
+      break;
+
     case OP_TRANSLATE:
-      {
-        aff2_translate (&trans,(xn-xo)*width,(yn-yo)*width);
-        break;
-      }
+      aff2_translate (&trans,(xn-xo)*width,(yn-yo)*width);
+      break;
     }
 
   for (i = 0; i < ifsvals.num_elements; i++)
@@ -1775,16 +1764,20 @@
             aff2_compose (&elements[i]->trans, &trans,
                          &ifsD->selected_orig[i].trans);
           }
+
         aff_element_decompose_trans (elements[i],&elements[i]->trans,
                                     width, height, ifsvals.center_x,
                                     ifsvals.center_y);
         aff_element_compute_trans (elements[i],width, height,
-                              ifsvals.center_x, ifsvals.center_y);
+                                   ifsvals.center_x, ifsvals.center_y);
       }
 
   update_values ();
   design_area_redraw ();
 
+  /* Ask for more motion events in case the event was a hint */
+  gdk_event_request_motions (event);
+
   return FALSE;
 }
 

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_lex.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_lex.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_lex.c	Sun Oct 12 15:38:02 2008
@@ -52,7 +52,7 @@
 #if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -179,7 +179,7 @@
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -246,7 +246,7 @@
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -621,7 +621,7 @@
 #endif
 
     static void yyunput (int c,char *buf_ptr  );
-    
+
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
@@ -742,7 +742,7 @@
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-    
+
 #line 45 "imap_cern.l"
 
 
@@ -1194,7 +1194,7 @@
 {
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-    
+
 	yy_current_state = (yy_start);
 
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1248,7 +1248,7 @@
     static void yyunput (int c, register char * yy_bp )
 {
 	register char *yy_cp;
-    
+
     yy_cp = (yy_c_buf_p);
 
 	/* undo effects of setting up cern_text */
@@ -1291,7 +1291,7 @@
 
 {
 	int c;
-    
+
 	*(yy_c_buf_p) = (yy_hold_char);
 
 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1358,12 +1358,12 @@
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- * 
+ *
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void cern_restart  (FILE * input_file )
 {
-    
+
 	if ( ! YY_CURRENT_BUFFER ){
         cern_ensure_buffer_stack ();
 		YY_CURRENT_BUFFER_LVALUE =
@@ -1376,11 +1376,11 @@
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- * 
+ *
  */
     void cern__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-    
+
 	/* TODO. We should be able to replace this entire function body
 	 * with
 	 *		cern_pop_buffer_state();
@@ -1420,13 +1420,13 @@
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
+ *
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE cern__create_buffer  (FILE * file, int  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	b = (YY_BUFFER_STATE) cern_alloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in cern__create_buffer()" );
@@ -1449,11 +1449,11 @@
 
 /** Destroy the buffer.
  * @param b a buffer created with cern__create_buffer()
- * 
+ *
  */
     void cern__delete_buffer (YY_BUFFER_STATE  b )
 {
-    
+
 	if ( ! b )
 		return;
 
@@ -1469,7 +1469,7 @@
 #ifndef __cplusplus
 extern int isatty (int );
 #endif /* __cplusplus */
-    
+
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a cern_restart() or at EOF.
@@ -1478,7 +1478,7 @@
 
 {
 	int oerrno = errno;
-    
+
 	cern__flush_buffer(b );
 
 	b->yy_input_file = file;
@@ -1494,13 +1494,13 @@
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
+
 	errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
+ *
  */
     void cern__flush_buffer (YY_BUFFER_STATE  b )
 {
@@ -1529,7 +1529,7 @@
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *  
+ *
  */
 void cern_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
@@ -1559,7 +1559,7 @@
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *  
+ *
  */
 void cern_pop_buffer_state (void)
 {
@@ -1583,7 +1583,7 @@
 static void cern_ensure_buffer_stack (void)
 {
 	int num_to_alloc;
-    
+
 	if (!(yy_buffer_stack)) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
@@ -1594,9 +1594,9 @@
 		(yy_buffer_stack) = (struct yy_buffer_state**)cern_alloc
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
 								);
-		
+
 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
+
 		(yy_buffer_stack_max) = num_to_alloc;
 		(yy_buffer_stack_top) = 0;
 		return;
@@ -1622,13 +1622,13 @@
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
+ *
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE cern__scan_buffer  (char * base, yy_size_t  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1657,14 +1657,14 @@
 /** Setup the input buffer state to scan a string. The next call to cern_lex() will
  * scan from a @e copy of @a str.
  * @param str a NUL-terminated string to scan
- * 
+ *
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       cern__scan_bytes() instead.
  */
 YY_BUFFER_STATE cern__scan_string (yyconst char * yystr )
 {
-    
+
 	return cern__scan_bytes(yystr,strlen(yystr) );
 }
 
@@ -1672,7 +1672,7 @@
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
+ *
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE cern__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
@@ -1681,7 +1681,7 @@
 	char *buf;
 	yy_size_t n;
 	int i;
-    
+
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) cern_alloc(n  );
@@ -1735,16 +1735,16 @@
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- * 
+ *
  */
 int cern_get_lineno  (void)
 {
-        
+
     return cern_lineno;
 }
 
 /** Get the input stream.
- * 
+ *
  */
 FILE *cern_get_in  (void)
 {
@@ -1752,7 +1752,7 @@
 }
 
 /** Get the output stream.
- * 
+ *
  */
 FILE *cern_get_out  (void)
 {
@@ -1760,7 +1760,7 @@
 }
 
 /** Get the length of the current token.
- * 
+ *
  */
 int cern_get_leng  (void)
 {
@@ -1768,7 +1768,7 @@
 }
 
 /** Get the current token.
- * 
+ *
  */
 
 char *cern_get_text  (void)
@@ -1778,18 +1778,18 @@
 
 /** Set the current line number.
  * @param line_number
- * 
+ *
  */
 void cern_set_lineno (int  line_number )
 {
-    
+
     cern_lineno = line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param in_str A readable stream.
- * 
+ *
  * @see cern__switch_to_buffer
  */
 void cern_set_in (FILE *  in_str )
@@ -1843,7 +1843,7 @@
 /* cern_lex_destroy is for both reentrant and non-reentrant scanners. */
 int cern_lex_destroy  (void)
 {
-    
+
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		cern__delete_buffer(YY_CURRENT_BUFFER  );

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_parse.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_parse.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_cern_parse.c	Sun Oct 12 15:38:02 2008
@@ -1165,7 +1165,7 @@
 #endif
 #endif
 {
-  
+
   int yystate;
   int yyn;
   int yyresult;
@@ -1470,7 +1470,7 @@
     {
 		   Polygon_t *polygon = ObjectToPolygon(current_object);
 		   GdkPoint *point = new_point((gint) (yyvsp[(2) - (5)].value), (gint) (yyvsp[(4) - (5)].value));
-		   polygon->points = g_list_append(polygon->points, 
+		   polygon->points = g_list_append(polygon->points,
 						   (gpointer) point);
 		}
     break;
@@ -1497,7 +1497,7 @@
 		   MapInfo_t *info = get_map_info();
 		   gchar *description;
 
-		   description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n", 
+		   description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
 					     NULL);
 		   g_strreplace(&info->description, description);
 		   g_free ((yyvsp[(2) - (2)].id));
@@ -1723,7 +1723,7 @@
 #line 163 "imap_cern.y"
 
 
-static void 
+static void
 cern_error(char* s)
 {
    extern FILE *cern_in;

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_lex.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_lex.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_lex.c	Sun Oct 12 15:38:02 2008
@@ -52,7 +52,7 @@
 #if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -179,7 +179,7 @@
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -246,7 +246,7 @@
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -641,7 +641,7 @@
 #endif
 
     static void yyunput (int c,char *buf_ptr  );
-    
+
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
@@ -762,7 +762,7 @@
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-    
+
 #line 46 "imap_csim.l"
 
 
@@ -1311,7 +1311,7 @@
 {
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-    
+
 	yy_current_state = (yy_start);
 
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1365,7 +1365,7 @@
     static void yyunput (int c, register char * yy_bp )
 {
 	register char *yy_cp;
-    
+
     yy_cp = (yy_c_buf_p);
 
 	/* undo effects of setting up csim_text */
@@ -1408,7 +1408,7 @@
 
 {
 	int c;
-    
+
 	*(yy_c_buf_p) = (yy_hold_char);
 
 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1475,12 +1475,12 @@
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- * 
+ *
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void csim_restart  (FILE * input_file )
 {
-    
+
 	if ( ! YY_CURRENT_BUFFER ){
         csim_ensure_buffer_stack ();
 		YY_CURRENT_BUFFER_LVALUE =
@@ -1493,11 +1493,11 @@
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- * 
+ *
  */
     void csim__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-    
+
 	/* TODO. We should be able to replace this entire function body
 	 * with
 	 *		csim_pop_buffer_state();
@@ -1537,13 +1537,13 @@
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
+ *
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE csim__create_buffer  (FILE * file, int  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	b = (YY_BUFFER_STATE) csim_alloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in csim__create_buffer()" );
@@ -1566,11 +1566,11 @@
 
 /** Destroy the buffer.
  * @param b a buffer created with csim__create_buffer()
- * 
+ *
  */
     void csim__delete_buffer (YY_BUFFER_STATE  b )
 {
-    
+
 	if ( ! b )
 		return;
 
@@ -1586,7 +1586,7 @@
 #ifndef __cplusplus
 extern int isatty (int );
 #endif /* __cplusplus */
-    
+
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a csim_restart() or at EOF.
@@ -1595,7 +1595,7 @@
 
 {
 	int oerrno = errno;
-    
+
 	csim__flush_buffer(b );
 
 	b->yy_input_file = file;
@@ -1611,13 +1611,13 @@
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
+
 	errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
+ *
  */
     void csim__flush_buffer (YY_BUFFER_STATE  b )
 {
@@ -1646,7 +1646,7 @@
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *  
+ *
  */
 void csim_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
@@ -1676,7 +1676,7 @@
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *  
+ *
  */
 void csim_pop_buffer_state (void)
 {
@@ -1700,7 +1700,7 @@
 static void csim_ensure_buffer_stack (void)
 {
 	int num_to_alloc;
-    
+
 	if (!(yy_buffer_stack)) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
@@ -1711,9 +1711,9 @@
 		(yy_buffer_stack) = (struct yy_buffer_state**)csim_alloc
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
 								);
-		
+
 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
+
 		(yy_buffer_stack_max) = num_to_alloc;
 		(yy_buffer_stack_top) = 0;
 		return;
@@ -1739,13 +1739,13 @@
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
+ *
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE csim__scan_buffer  (char * base, yy_size_t  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1774,14 +1774,14 @@
 /** Setup the input buffer state to scan a string. The next call to csim_lex() will
  * scan from a @e copy of @a str.
  * @param str a NUL-terminated string to scan
- * 
+ *
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       csim__scan_bytes() instead.
  */
 YY_BUFFER_STATE csim__scan_string (yyconst char * yystr )
 {
-    
+
 	return csim__scan_bytes(yystr,strlen(yystr) );
 }
 
@@ -1789,7 +1789,7 @@
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
+ *
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE csim__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
@@ -1798,7 +1798,7 @@
 	char *buf;
 	yy_size_t n;
 	int i;
-    
+
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) csim_alloc(n  );
@@ -1852,16 +1852,16 @@
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- * 
+ *
  */
 int csim_get_lineno  (void)
 {
-        
+
     return csim_lineno;
 }
 
 /** Get the input stream.
- * 
+ *
  */
 FILE *csim_get_in  (void)
 {
@@ -1869,7 +1869,7 @@
 }
 
 /** Get the output stream.
- * 
+ *
  */
 FILE *csim_get_out  (void)
 {
@@ -1877,7 +1877,7 @@
 }
 
 /** Get the length of the current token.
- * 
+ *
  */
 int csim_get_leng  (void)
 {
@@ -1885,7 +1885,7 @@
 }
 
 /** Get the current token.
- * 
+ *
  */
 
 char *csim_get_text  (void)
@@ -1895,18 +1895,18 @@
 
 /** Set the current line number.
  * @param line_number
- * 
+ *
  */
 void csim_set_lineno (int  line_number )
 {
-    
+
     csim_lineno = line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param in_str A readable stream.
- * 
+ *
  * @see csim__switch_to_buffer
  */
 void csim_set_in (FILE *  in_str )
@@ -1960,7 +1960,7 @@
 /* csim_lex_destroy is for both reentrant and non-reentrant scanners. */
 int csim_lex_destroy  (void)
 {
-    
+
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		csim__delete_buffer(YY_CURRENT_BUFFER  );

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_parse.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_parse.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_csim_parse.c	Sun Oct 12 15:38:02 2008
@@ -1260,7 +1260,7 @@
 #endif
 #endif
 {
-  
+
   int yystate;
   int yyn;
   int yyresult;

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.c	Sun Oct 12 15:38:02 2008
@@ -160,7 +160,7 @@
 }
 
 void
-default_dialog_set_label(DefaultDialog_t *dialog, gchar *text)
+default_dialog_set_label(DefaultDialog_t *dialog, const gchar *text)
 {
    GtkWidget *label = gtk_label_new(text);
 

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.h	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_default_dialog.h	Sun Oct 12 15:38:02 2008
@@ -53,7 +53,7 @@
 void default_dialog_hide_apply_button(DefaultDialog_t *dialog);
 void default_dialog_hide_help_button(DefaultDialog_t *dialog);
 void default_dialog_set_title(DefaultDialog_t *dialog, const gchar *title);
-void default_dialog_set_label(DefaultDialog_t *dialog, gchar *text);
+void default_dialog_set_label(DefaultDialog_t *dialog, const gchar *text);
 GtkWidget *default_dialog_add_table(DefaultDialog_t *dialog, gint rows,
 				    gint cols);
 

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_lex.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_lex.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_lex.c	Sun Oct 12 15:38:02 2008
@@ -52,7 +52,7 @@
 #if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -179,7 +179,7 @@
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -246,7 +246,7 @@
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -593,7 +593,7 @@
 #endif
 
     static void yyunput (int c,char *buf_ptr  );
-    
+
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
@@ -714,7 +714,7 @@
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-    
+
 #line 46 "imap_ncsa.l"
 
 
@@ -1179,7 +1179,7 @@
 {
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-    
+
 	yy_current_state = (yy_start);
 
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1233,7 +1233,7 @@
     static void yyunput (int c, register char * yy_bp )
 {
 	register char *yy_cp;
-    
+
     yy_cp = (yy_c_buf_p);
 
 	/* undo effects of setting up ncsa_text */
@@ -1276,7 +1276,7 @@
 
 {
 	int c;
-    
+
 	*(yy_c_buf_p) = (yy_hold_char);
 
 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1343,12 +1343,12 @@
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- * 
+ *
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void ncsa_restart  (FILE * input_file )
 {
-    
+
 	if ( ! YY_CURRENT_BUFFER ){
         ncsa_ensure_buffer_stack ();
 		YY_CURRENT_BUFFER_LVALUE =
@@ -1361,11 +1361,11 @@
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- * 
+ *
  */
     void ncsa__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-    
+
 	/* TODO. We should be able to replace this entire function body
 	 * with
 	 *		ncsa_pop_buffer_state();
@@ -1405,13 +1405,13 @@
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
+ *
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE ncsa__create_buffer  (FILE * file, int  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	b = (YY_BUFFER_STATE) ncsa_alloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in ncsa__create_buffer()" );
@@ -1434,11 +1434,11 @@
 
 /** Destroy the buffer.
  * @param b a buffer created with ncsa__create_buffer()
- * 
+ *
  */
     void ncsa__delete_buffer (YY_BUFFER_STATE  b )
 {
-    
+
 	if ( ! b )
 		return;
 
@@ -1454,7 +1454,7 @@
 #ifndef __cplusplus
 extern int isatty (int );
 #endif /* __cplusplus */
-    
+
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a ncsa_restart() or at EOF.
@@ -1463,7 +1463,7 @@
 
 {
 	int oerrno = errno;
-    
+
 	ncsa__flush_buffer(b );
 
 	b->yy_input_file = file;
@@ -1479,13 +1479,13 @@
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
+
 	errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
+ *
  */
     void ncsa__flush_buffer (YY_BUFFER_STATE  b )
 {
@@ -1514,7 +1514,7 @@
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *  
+ *
  */
 void ncsa_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
@@ -1544,7 +1544,7 @@
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *  
+ *
  */
 void ncsa_pop_buffer_state (void)
 {
@@ -1568,7 +1568,7 @@
 static void ncsa_ensure_buffer_stack (void)
 {
 	int num_to_alloc;
-    
+
 	if (!(yy_buffer_stack)) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
@@ -1579,9 +1579,9 @@
 		(yy_buffer_stack) = (struct yy_buffer_state**)ncsa_alloc
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
 								);
-		
+
 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
+
 		(yy_buffer_stack_max) = num_to_alloc;
 		(yy_buffer_stack_top) = 0;
 		return;
@@ -1607,13 +1607,13 @@
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
+ *
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE ncsa__scan_buffer  (char * base, yy_size_t  size )
 {
 	YY_BUFFER_STATE b;
-    
+
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1642,14 +1642,14 @@
 /** Setup the input buffer state to scan a string. The next call to ncsa_lex() will
  * scan from a @e copy of @a str.
  * @param str a NUL-terminated string to scan
- * 
+ *
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       ncsa__scan_bytes() instead.
  */
 YY_BUFFER_STATE ncsa__scan_string (yyconst char * yystr )
 {
-    
+
 	return ncsa__scan_bytes(yystr,strlen(yystr) );
 }
 
@@ -1657,7 +1657,7 @@
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
+ *
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE ncsa__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
@@ -1666,7 +1666,7 @@
 	char *buf;
 	yy_size_t n;
 	int i;
-    
+
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) ncsa_alloc(n  );
@@ -1720,16 +1720,16 @@
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- * 
+ *
  */
 int ncsa_get_lineno  (void)
 {
-        
+
     return ncsa_lineno;
 }
 
 /** Get the input stream.
- * 
+ *
  */
 FILE *ncsa_get_in  (void)
 {
@@ -1737,7 +1737,7 @@
 }
 
 /** Get the output stream.
- * 
+ *
  */
 FILE *ncsa_get_out  (void)
 {
@@ -1745,7 +1745,7 @@
 }
 
 /** Get the length of the current token.
- * 
+ *
  */
 int ncsa_get_leng  (void)
 {
@@ -1753,7 +1753,7 @@
 }
 
 /** Get the current token.
- * 
+ *
  */
 
 char *ncsa_get_text  (void)
@@ -1763,18 +1763,18 @@
 
 /** Set the current line number.
  * @param line_number
- * 
+ *
  */
 void ncsa_set_lineno (int  line_number )
 {
-    
+
     ncsa_lineno = line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param in_str A readable stream.
- * 
+ *
  * @see ncsa__switch_to_buffer
  */
 void ncsa_set_in (FILE *  in_str )
@@ -1828,7 +1828,7 @@
 /* ncsa_lex_destroy is for both reentrant and non-reentrant scanners. */
 int ncsa_lex_destroy  (void)
 {
-    
+
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		ncsa__delete_buffer(YY_CURRENT_BUFFER  );

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_parse.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_parse.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_ncsa_parse.c	Sun Oct 12 15:38:02 2008
@@ -1164,7 +1164,7 @@
 #endif
 #endif
 {
-  
+
   int yystate;
   int yyn;
   int yyresult;
@@ -1439,7 +1439,7 @@
 		   MapInfo_t *info = get_map_info();
 		   gchar *description;
 
-		   description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n", 
+		   description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
 					     NULL);
 		   g_strreplace(&info->description, description);
 		   g_free ((yyvsp[(2) - (2)].id));
@@ -1449,7 +1449,7 @@
   case 20:
 #line 118 "imap_ncsa.y"
     {
-		   MapInfo_t *info = get_map_info();		      
+		   MapInfo_t *info = get_map_info();
 		   g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
 		   g_free ((yyvsp[(2) - (2)].id));
 		}
@@ -1507,7 +1507,7 @@
     {
 		   Polygon_t *polygon = ObjectToPolygon(current_object);
 		   GdkPoint *point = new_point((gint) (yyvsp[(1) - (3)].value), (gint) (yyvsp[(3) - (3)].value));
-		   polygon->points = g_list_append(polygon->points, 
+		   polygon->points = g_list_append(polygon->points,
 						   (gpointer) point);
 		}
     break;
@@ -1731,7 +1731,7 @@
 #line 174 "imap_ncsa.y"
 
 
-static void 
+static void
 ncsa_error(char* s)
 {
    extern FILE *ncsa_in;

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_object.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_object.h	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_object.h	Sun Oct 12 15:38:02 2008
@@ -52,7 +52,7 @@
 struct AreaInfoDialog_t;
 
 struct ObjectClass_t {
-   gchar		*name;
+   const gchar		*name;
    AreaInfoDialog_t 	*info_dialog;
    GdkPixmap 		*icon;
    GdkBitmap 		*mask;

Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_preview.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_preview.c	(original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_preview.c	Sun Oct 12 15:38:02 2008
@@ -473,7 +473,7 @@
    gtk_widget_show(arrow);
 
    /* Create horizontal ruler */
-   data->hruler = ruler = gimp_hruler_new();
+   data->hruler = ruler = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL);
    g_signal_connect_swapped(preview, "motion-notify-event",
 			    G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
 			    ruler);
@@ -483,7 +483,7 @@
    gtk_widget_show(ruler);
 
    /* Create vertical ruler */
-   data->vruler = ruler = gimp_vruler_new();
+   data->vruler = ruler = gimp_ruler_new (GTK_ORIENTATION_VERTICAL);
    g_signal_connect_swapped(preview, "motion-notify-event",
 			    G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
 			    ruler);

Modified: branches/soc-2008-tagging/plug-ins/lighting/lighting-ui.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/lighting/lighting-ui.c	(original)
+++ branches/soc-2008-tagging/plug-ins/lighting/lighting-ui.c	Sun Oct 12 15:38:02 2008
@@ -451,7 +451,7 @@
   spin_intensity = gimp_spin_button_new (&adj,
                                          mapvals.lightsource[k].intensity,
                                          0.0, 100.0,
-                                         0.01, 0.1, 1.0, 0.0, 2);
+                                         0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
                                  _("_Intensity:"), 0.0, 0.5,
                                  spin_intensity, 1, TRUE);
@@ -472,7 +472,7 @@
   spin_pos_x = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].position.x,
                                      -100.0, 100.0,
-                                     0.1, 1.0, 1.0, 0.0, 2);
+                                     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 1,
                                  _("_X:"), 0.0, 0.5,
                                  spin_pos_x, 1, TRUE);
@@ -487,7 +487,7 @@
   spin_pos_y = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].position.y,
                                      -100.0, 100.0,
-                                     0.1, 1.0, 1.0, 0.0, 2);
+                                     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 2,
                              _("_Y:"), 0.0, 0.5,
                              spin_pos_y, 1, TRUE);
@@ -502,7 +502,7 @@
   spin_pos_z = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].position.z,
                                      -100.0, 100.0,
-                                     0.1, 1.0, 1.0, 0.0, 2);
+                                     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 3,
                              _("_Z:"), 0.0, 0.5,
                              spin_pos_z, 1, TRUE);
@@ -522,7 +522,7 @@
 
   spin_dir_x = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].direction.x,
-                                     -100.0, 100.0, 0.1, 1.0, 1.0, 0.0, 2);
+                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 1,
                              _("X:"), 0.0, 0.5,
                              spin_dir_x, 1, TRUE);
@@ -536,7 +536,7 @@
 
   spin_dir_y = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].direction.y,
-                                     -100.0, 100.0, 0.1, 1.0, 1.0, 0.0, 2);
+                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 2,
                              _("Y:"), 0.0, 0.5,
                                  spin_dir_y, 1, TRUE);
@@ -550,7 +550,7 @@
 
   spin_dir_z = gimp_spin_button_new (&adj,
                                      mapvals.lightsource[k].direction.z,
-                                     -100.0, 100.0, 0.1, 1.0, 1.0, 0.0, 2);
+                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 3,
                              _("Z:"), 0.0, 0.5,
                              spin_dir_z, 1, TRUE);
@@ -641,7 +641,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
+                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -674,7 +674,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
+                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -707,7 +707,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
+                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -739,7 +739,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
+                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 3, 4,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -855,7 +855,7 @@
                              _("Cu_rve:"), 0.0, 0.5, combo, 1, FALSE);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.bumpmax,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 1.0, 0.0, 2);
+                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
                              _("Ma_ximum height:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);

Modified: branches/soc-2008-tagging/plug-ins/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/plug-ins/makefile.msc	(original)
+++ branches/soc-2008-tagging/plug-ins/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -32,24 +32,25 @@
 # List plug-ins. We must use several lists to work around nmake's limits
 
 # The COMMON* ones are in the common subdirectory
-COMMON0 = plugin_browser procedure_browser #gnomeprint
-COMMON1 = antialias AlienMap2 ccanalyze CEL channel_mixer CML_explorer align_layers animationplay animoptimize apply_lens autocrop autostretch_hsv blinds blur borderaverage bumpmap c_astretch cartoon checkerboard color_enhance colorify colormap_remap colortoalpha compose compressor convmatrix csource cubism curve_bend
-COMMON2 = decompose deinterlace depthmerge despeckle destripe dicom diffraction displace dog edge emboss engrave exchange film flarefx fp fractaltrace
-COMMON3 = gauss gbr gee gee_zoom gif_load gif_save gih glasstile glob gqbist gradmap grid gtm guillotine header hot illusion iwarp jigsaw laplace lcms lens lic
-COMMON4 = mapcolor max_rgb mblur mosaic neon newsprint nlfilt noisify normalize nova oilify papertile pat pcx photocopy pix pixelize plasma png pnm polar postscript psd_load psd_save psp randomize raw redeye retinex ripple rotate
-COMMON5 = sample_colorize scatter_hsv screenshot sel_gauss semiflatten sharpen shift sinus smooth_palette snoise sobel softglow sparkle spheredesigner spread struc sunras svg tga threshold_alpha 
-COMMON6 = tiff_load tiff_save tile tileit tiler uniteditor unsharp video vinvert vpropagate warp waves webbrowser whirlpinch wind xbm xwd zealouscrop
-COMMON7 = winprint winclipboard wiredebug 
-
-NOTNOW = wmf 
+COMMON0 = alien-map align-layers animation-optimize animation-play antialias apply-canvas 
+COMMON1 = blinds blur-gauss-selective blur-gauss blur-motion blur border-average bump-map 
+COMMON2 = cartoon channel-mixer checkerboard cml-explorer color-cube-analyze color-enhance color-exchange color-to-alpha colorify colormap-remap compose contrast-normalize contrast-retinex contrast-stretch-hsv contrast-stretch convolution-matrix crop-auto crop-zealous cubism curve-bend 
+COMMON3 = decompose deinterlace depth-merge despeckle destripe diffraction displace edge-dog edge-laplace edge-neon edge-sobel edge emboss engrave 
+## file-aa file-mng file-pdf file-wmf file-xpm 
+COMMON4 = file-cel file-compressor file-csource file-desktop-link file-dicom file-gbr file-gif-load file-gif-save file-gih file-glob file-header file-html-table file-pat file-pcx file-pix file-png file-pnm file-ps file-psp file-raw file-sunras file-svg file-tga file-tiff-load file-tiff-save file-xbm file-xwd film filter-pack fractal-trace 
+## mail 
+COMMON5 = gee-zoom gee gradient-map grid guillotine hot illusion iwarp jigsaw lcms lens-apply lens-distortion lens-flare max-rgb mosaic newsprint nl-filter noise-hsv noise-randomize noise-rgb noise-solid noise-spread nova oilify photocopy pixelize plasma plugin-browser polar-coords procedure-browser qbist red-eye-removal ripple rotate 
+COMMON6 = sample-colorize screenshot semi-flatten sharpen shift sinus smooth-palette softglow sparkle sphere-designer 
+COMMON7 = threshold-alpha tile-glass tile-paper tile-seamless tile-small tile unit-editor unsharp-mask value-invert value-propagate van-gogh-lic video warp waves web-browser whirl-pinch wind 
 
 # These have own subdirectories each
-SEPARATE = FractalExplorer Lighting MapObject bmp faxg3 fits flame gfig gflare gfli gimpressionist ifscompose imagemap jpeg maze metadata pagecurl rcm sel2path sgi twain winicon winsnap xjt print help helpbrowser
+SEPARATE = lighting gfig gimpressionist imagemap maze metadata pagecurl twain print help
+## help-browser 
+SEPARATE_DASH = color-rotate file-bmp file-faxg3 file-fits file-fli file-ico file-jpeg file-psd file-sgi file-uri file-xjt fractal-explorer gradient-flare ifs-compose map-object selection-to-path win-snap
 
 # These are unofficial, ie not in the CVS. To build these, you should
 # get tml's source snapshot and copy this makefile to the
-# ..\unofficial-plug-ins directory, go there, and do "nmake -f
-# makefile.msc unofficial".
+# ..\unofficial-plug-ins directory, go there, and do "nmake -f makefile.msc unofficial".
 
 UNOFFICIAL = Anamorphose DigitalSignature RGB_Displace gimp_ace guash sel_gauss magiceye user_filter
 
@@ -81,11 +82,6 @@
 	nmake -nologo -f ..\..\makefile.msc GIMPTOP=..\..\.. EXTRACFLAGS="-DWIN32 -DUSE_MATH -DUSE_INTERFACE -DSTANDALONE=0" \
 		MODULE=tinyscheme OBJECTS="dynload.obj scheme.obj" $(TARGET)
 	cd ..\..
-	cd script-fu\re
-	nmake -nologo -f ..\..\makefile.msc GIMPTOP=..\..\.. EXTRACFLAGS="-DWIN32 -I.. -DUSE_INTERFACE" \
-		MODULE=re OBJECTS="debug.obj regcomp.obj regerror.obj regexec.obj re.obj regfree.obj" \
-		$(TARGET)
-	cd ..\..
 	cd script-fu\ftx
 	nmake -nologo -f ..\..\makefile.msc GIMPTOP=..\..\.. EXTRACFLAGS="-DWIN32 -I.. -DUSE_INTERFACE" \
 		MODULE=ftx OBJECTS="ftx.obj" EXTRA_EXPORT=/export:init_ftx $(TARGET)
@@ -110,11 +106,11 @@
 	for %d in ($(COMMON4)) do nmake -nologo -f makefile.msc sub-one-common DIR=%d TARGET=$(TARGET)
 	for %d in ($(COMMON5)) do nmake -nologo -f makefile.msc sub-one-common DIR=%d TARGET=$(TARGET)
 	for %d in ($(COMMON6)) do nmake -nologo -f makefile.msc sub-one-common DIR=%d TARGET=$(TARGET)
-#	for %d in ($(COMMON7)) do nmake -nologo -f makefile.msc sub-one-common DIR=%d TARGET=$(TARGET)
+	for %d in ($(COMMON7)) do nmake -nologo -f makefile.msc sub-one-common DIR=%d TARGET=$(TARGET)
 
 sub-one-common :
 	@cd common
-	@nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. PLUGIN=$(DIR) EXTRA_$(DIR)=1 $(TARGET)
+	@nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. PLUGIN=$(DIR) $(TARGET)
 
 
 
@@ -130,17 +126,17 @@
 
 
 sub-separate-plugins :
-# We must handle script-fu separately because of the dash, sigh
-	@cd script-fu
-	@nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. PLUGIN=script-fu EXTRA_script_fu=1 $(TARGET)
-	@cd ..
 	for %d in ($(SEPARATE)) do nmake -nologo -f makefile.msc sub-one-separate DIR=%d TARGET=$(TARGET)
+	for %d in ($(SEPARATE_DASH)) do nmake -nologo -f makefile.msc sub-one-separate-dash DIR=%d TARGET=$(TARGET)
 
 
 sub-one-separate :
 	cd $(DIR)
 	nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. PLUGIN=$(DIR) EXTRA_$(DIR)=1 $(TARGET)
 
+sub-one-separate-dash :
+	cd $(DIR)
+	nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. PLUGIN=$(DIR) $(TARGET)
 
 data-install : gimpressionist-data-install guash-data-install
 	-md $(GIMP)\scripts
@@ -175,13 +171,41 @@
 # If a plug-in has several object files, or needs extra libraries or
 # compiler flags, these are in an EXTRA_xxx part.
 
-!IFDEF EXTRA_FractalExplorer
+!IF "$(DIR)"=="color-rotate"
+STOCK_IMAGES = \
+	images/color-rotate-360.png \
+	images/color-rotate-a-b.png \
+	images/color-rotate-ccw.png \
+	images/color-rotate-cw.png \
+
+STOCK_VARS = \
+	color_rotate_360 images/color-rotate-360.png \
+	color_rotate_a_b images/color-rotate-a-b.png \
+	color_rotate_ccw images/color-rotate-ccw.png \
+	color_rotate_cw images/color-rotate-cw.png \
+
+images/color-rotate-stock-pixbufs.h: $(STOCK_IMAGES)
+	gdk-pixbuf-csource --rle --build-list $(STOCK_VARS) > images/color-rotate-stock-pixbufs.h
+
+EXTRA_DEPS = images/color-rotate-stock-pixbufs.h
+
+OBJECTS = \
+	color-rotate-callbacks.obj \
+	color-rotate-dialog.obj \
+	color-rotate-draw.obj \
+	color-rotate-stock.obj \
+	color-rotate-utils.obj \
+	color-rotate.obj \
+
+!ENDIF
+
+!IF "$(DIR)"=="fractal-explorer"
 OBJECTS = \
-	Dialogs.obj \
-	FractalExplorer.obj
+	fractal-explorer-dialogs.obj \
+	fractal-explorer.obj
 !ENDIF
 
-!IFDEF EXTRA_Lighting
+!IFDEF EXTRA_lighting
 STOCK_VARS = \
 	stock_intensity_ambient_high images/stock-intensity-ambient-high.png	\
 	stock_intensity_ambient_low images/stock-intensity-ambient-low.png		\
@@ -212,47 +236,32 @@
 EXTRA_DEPS = images/stock-pixbufs.h
 
 OBJECTS = \
-	lighting_apply.obj \
-	lighting_image.obj \
-	lighting_main.obj \
-	lighting_preview.obj \
-	lighting_shade.obj \
-	lighting_stock.obj \
-	lighting_ui.obj
+	lighting-apply.obj \
+	lighting-image.obj \
+	lighting-main.obj \
+	lighting-preview.obj \
+	lighting-shade.obj \
+	lighting-stock.obj \
+	lighting-ui.obj
 !ENDIF
 
-!IFDEF EXTRA_MapObject
+!IF "$(DIR)"=="map-object"
 OBJECTS = \
 	arcball.obj \
-	mapobject_apply.obj \
-	mapobject_image.obj \
-	mapobject_main.obj \
-	mapobject_preview.obj \
-	mapobject_shade.obj \
-	mapobject_ui.obj
+	map-object-apply.obj \
+	map-object-image.obj \
+	map-object-main.obj \
+	map-object-preview.obj \
+	map-object-shade.obj \
+	map-object-ui.obj
 OPTIMIZE =
 !ENDIF
 
-!IFDEF EXTRA_bmp
+!IF "$(DIR)"=="file-bmp"
 OBJECTS = \
 	bmp.obj \
-	bmpread.obj \
-	bmpwrite.obj
-!ENDIF
-
-!IFDEF EXTRA_colormap_remap 
-OBJECTS = \
-	colormap-remap.obj
-!ENDIF
-
-!IFDEF EXTRA_plugin_browser
-OBJECTS = \
-	plugin-browser.obj
-!ENDIF
-
-!IFDEF EXTRA_procedure_browser
-OBJECTS = \
-	procedure-browser.obj
+	bmp-read.obj \
+	bmp-write.obj
 !ENDIF
 
 !IFDEF EXTRA_plugindetails
@@ -263,16 +272,16 @@
 	plugin-browser.obj
 !ENDIF
 
-!IFDEF EXTRA_faxg3
+!IF "$(DIR)"=="file-faxg3"
 OBJECTS = \
 	faxg3.obj \
 	g3.obj
 !ENDIF
 
-!IFDEF EXTRA_fits
+!IF "$(DIR)"=="file-fits"
 OBJECTS = \
 	fits.obj \
-	fitsrw.obj
+	fits-io.obj
 !ENDIF
 
 !IFDEF EXTRA_flame
@@ -283,10 +292,10 @@
 	rect.obj
 !ENDIF
 
-!IFDEF EXTRA_gfli
+!IF "$(DIR)"=="file-fli"
 OBJECTS = \
 	fli.obj \
-	gfli.obj
+	fli-gimp.obj
 !ENDIF
 
 !IFDEF EXTRA_gfig
@@ -346,19 +355,11 @@
 	gfig-stock.obj
 !ENDIF
 
-!IFDEF EXTRA_gif_load
-OBJECTS = gif-load.obj
-!ENDIF
-
-!IFDEF EXTRA_gif_save
-OBJECTS = gif-save.obj
-!ENDIF
-
-!IFDEF EXTRA_ifscompose
+!IF "$(DIR)"=="ifs-compose"
 OBJECTS = \
-	ifscompose.obj \
-	ifscompose_storage.obj \
-	ifscompose_utils.obj
+	ifs-compose.obj \
+	ifs-compose-storage.obj \
+	ifs-compose-utils.obj
 !ENDIF
 
 !IFDEF EXTRA_imagemap
@@ -460,7 +461,17 @@
 OPTIMIZE =
 !ENDIF
 
-!IFDEF EXTRA_jpeg
+!IF "$(DIR)"=="file-ico"
+EXTRACFLAGS = $(PNG_CFLAGS)
+EXTRALIBS = $(PNG_LIBS)
+OBJECTS = \
+	ico-dialog.obj \
+	ico-load.obj \
+	ico-save.obj \
+	ico.obj
+!ENDIF
+
+!IF "$(DIR)"=="file-jpeg"
 EXTRACFLAGS = -I$(JPEG) \
 !IFDEF EXIF
 	$(EXIF_CFLAGS) -DHAVE_EXIF -DHAVE_EXIF_0_6
@@ -486,17 +497,28 @@
 
 !ENDIF
 
-!IFDEF EXTRA_lcms 
+!IF "$(DIR)"=="file-uri"
+OBJECTS = \
+	gimpmountoperation.obj \
+#	uri-backend-gnomevfs.obj \
+	uri-backend-gvfs.obj \
+#	uri-backend-libcurl.obj \
+#	uri-backend-wget.obj \
+	uri.obj
+!ENDIF
+
+!IF "$(DIR)"=="lcms"
 EXTRACFLAGS = $(LCMS_CFLAGS)
 EXTRALIBS = $(LCMS_LIBS)
 !ENDIF
 
 !IFDEF EXTRA_maze
 OBJECTS = \
-	algorithms.obj \
-	handy.obj \
+	maze-algorithms.obj \
+	maze-dialog.obj \
+	maze-utils.obj \
 	maze.obj \
-	maze_face.obj
+
 !ENDIF
 
 !IFDEF EXTRA_mpeg
@@ -543,68 +565,47 @@
 
 !ENDIF
 
-!IFDEF EXTRA_png
+!IF "$(DIR)"=="file-png"
 EXTRACFLAGS = $(PNG_CFLAGS)
 EXTRALIBS = $(PNG_LIBS)
 !ENDIF
 
-!IFDEF EXTRA_psd_load
-OBJECTS = psd-load.obj
-!ENDIF
-
-!IFDEF EXTRA_psd_save
-OBJECTS = psd-save.obj
-!ENDIF
-
 !IFDEF EXTRA_print
 OBJECTS = \
 	print.obj \
 	print-draw-page.obj \
 	print-page-layout.obj \
 	print-preview.obj \
-	print-settings.obj
-EXTRALIBS = $(CAIRO_LIBS) $(GTHREAD_LIBS)
-!ENDIF
+	print-settings.obj \
+	print-page-setup.obj \
+	print-utils.obj \
 
-!IFDEF EXTRA_gnomeprint
-EXTRACFLAGS = $(GNOMEPRINT_CFLAGS) $(LIBART_CFLAGS) $(GNOMECANVAS_CFLAGS) $(GNOMEPRINTUI_CFLAGS)
-EXTRALIBS = $(GNOMEPRINT_LIBS) $(GNOMEPRINTUI_LIBS)
+EXTRALIBS = $(CAIRO_LIBS) $(GTHREAD_LIBS)
 !ENDIF
 
-!IFDEF EXTRA_psp
+!IF "$(DIR)"=="file-psp"
 EXTRACFLAGS = $(ZLIB_CFLAGS)
 EXTRALIBS = $(ZLIB_LIBS)
 !ENDIF
 
-!IFDEF EXTRA_rcm
-STOCK_VARS = \
-        rcm_360         images/rcm-360.png     \
-        rcm_a_b         images/rcm-a-b.png     \
-        rcm_ccw         images/rcm-ccw.png     \
-        rcm_cw          images/rcm-cw.png      \
-
-STOCK_IMAGES = \
-        images/rcm-360.png     \
-        images/rcm-a-b.png     \
-        images/rcm-ccw.png     \
-        images/rcm-cw.png      \
-
-images/rcm-stock-pixbufs.h: $(STOCK_IMAGES)
-	gdk-pixbuf-csource --rle --build-list $(STOCK_VARS) > images/rcm-stock-pixbufs.h
-
-EXTRA_DEPS = images/rcm-stock-pixbufs.h
-
+!IF "$(DIR)"=="file-psd"
+EXTRACFLAGS = $(TIFF_CFLAGS) $(JPEG_CFLAGS)
+EXTRALIBS = $(TIFF_LIBS) $(JPEG)\libjpeg.lib $(ZLIB_LIBS) user32.lib
 OBJECTS = \
-	rcm.obj \
-	rcm_callback.obj \
-	rcm_dialog.obj \
-	rcm_gdk.obj \
-	rcm_misc.obj \
-	rcm_stock.obj
-OPTIMIZE = 
+	psd-image-res-load.obj \
+	psd-layer-res-load.obj \
+	psd-load.obj \
+#2nd!	psd-save.obj \
+	psd-thumb-load.obj \
+	psd-util.obj \
+	psd.obj
 !ENDIF
 
-!IFDEF EXTRA_script_fu
+!IF "$(DIR)"=="screenshot"
+EXTRALIBS = user32.lib
+!ENDIF
+
+!IF "$(DIR)"=="script-fu"
 OBJECTS = \
 	scheme-wrapper.obj \
 	script-fu.obj \
@@ -612,48 +613,44 @@
 	script-fu-scripts.obj \
 	script-fu-text-console.obj \
 	script-fu-interface.obj \
-	script-fu-server.obj
+	script-fu-server.obj \
+	script-fu-eval.obj \
+	script-fu-regex.obj \
+	script-fu-script.obj \
+	script-fu-utils.obj \
 
-EXTRALIBS = tinyscheme\tinyscheme.lib re\re.lib ftx\ftx.lib kernel32.lib wsock32.lib
+EXTRALIBS = tinyscheme\tinyscheme.lib ftx\ftx.lib kernel32.lib wsock32.lib
 EXTRACFLAGS = -DREGEX_MALLOC -DUSE_INTERFACE -DSTANDALONE=0
 #HAVE_RESOURCE = YES
 !ENDIF
 
-!IFDEF EXTRA_sel2path
+!IF "$(DIR)"=="selection-to-path"
 OBJECTS = \
 	curve.obj \
 	edge.obj \
 	fit.obj \
 	math.obj \
 	pxl-outline.obj \
-	sel2path.obj \
-	sel2path_adv_dialog.obj \
 	spline.obj \
-	vector.obj
+	selection-to-path-dialog.obj \
+	selection-to-path.obj \
+	spline.obj \
+	vector.obj \
+
 !ENDIF
 
-!IFDEF EXTRA_sgi
+!IF "$(DIR)"=="file-sgi"
 OBJECTS = \
 	sgi.obj \
-	sgilib.obj
+	sgi-lib.obj
 !ENDIF
 
-!IFDEF EXTRA_svg
+!IF "$(DIR)"=="file-svg"
 EXTRACFLAGS = $(RSVG_CFLAGS)
 EXTRALIBS = $(RSVG_LIBS)
 !ENDIF
 
-!IFDEF EXTRA_tiff_load
-OBJECTS = tiff-load.obj
-EXTRA_tiff=1
-!ENDIF
-
-!IFDEF EXTRA_tiff_save
-OBJECTS = tiff-save.obj
-EXTRA_tiff=1
-!ENDIF
-
-!IFDEF EXTRA_tiff
+!IF "$(DIR)"=="file-tiff-load" || "$(DIR)"=="file-tiff-save"
 EXTRACFLAGS = $(TIFF_CFLAGS)
 EXTRALIBS = $(TIFF_LIBS) $(JPEG)\libjpeg.lib $(ZLIB_LIBS) user32.lib
 !ENDIF
@@ -697,7 +694,9 @@
 	gimphelpdomain.obj \
 	gimphelpitem.obj \
 	gimphelplocale.obj \
-	help.obj
+	gimphelpprogress.obj \
+	help.obj \
+
 TEST_OBJECTS = \
 	gimp-help-lookup.obj
 !ENDIF
@@ -767,7 +766,7 @@
 EXTRALIBS = user32.lib
 !ENDIF
 
-!IFDEF EXTRA_webbrowser
+!IF "$(DIR)"=="web-browser"
 EXTRALIBS = shell32.lib user32.lib
 !ENDIF
 
@@ -789,12 +788,14 @@
 	main.obj
 !ENDIF
 
-!IFDEF EXTRA_winsnap
-HAVE_RESOURCE = YES
+!IF "$(DIR)"=="win-snap"
+OBJECTS = winsnap.obj
+#HAVE_RESOURCE = YES
+RESOURCE = winsnap.res
 EXTRALIBS = user32.lib gdi32.lib
 !ENDIF
 
-!IFDEF EXTRA_xjt
+!IF "$(DIR)"=="file-xjt"
 OBJECTS = \
 	xjt.obj \
 	xjpeg.obj

Modified: branches/soc-2008-tagging/plug-ins/map-object/map-object-ui.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/map-object/map-object-ui.c	(original)
+++ branches/soc-2008-tagging/plug-ins/map-object/map-object-ui.c	Sun Oct 12 15:38:02 2008
@@ -580,7 +580,7 @@
                     &mapvals.maxdepth);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.pixeltreshold,
-				     0.001, 1000, 0.1, 1, 1, 0, 3);
+				     0.001, 1000, 0.1, 1, 0, 0, 3);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
 			     _("_Threshold:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -670,7 +670,7 @@
 
   spinbutton = gimp_spin_button_new (&xadj, mapvals.lightsource.position.x,
 				     -G_MAXFLOAT, G_MAXFLOAT,
-				     0.1, 1.0, 1.0, 0.0, 2);
+				     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
 			     _("X:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -684,7 +684,7 @@
 
   spinbutton = gimp_spin_button_new (&yadj, mapvals.lightsource.position.y,
 				     -G_MAXFLOAT, G_MAXFLOAT,
-				     0.1, 1.0, 1.0, 0.0, 2);
+				     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
 			     _("Y:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -698,7 +698,7 @@
 
   spinbutton = gimp_spin_button_new (&zadj, mapvals.lightsource.position.z,
 				     -G_MAXFLOAT, G_MAXFLOAT,
-				     0.1, 1.0, 1.0, 0.0, 2);
+				     0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
 			     _("Z:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -724,7 +724,7 @@
   gtk_widget_show (table);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.x,
-				     -1.0, 1.0, 0.01, 0.1, 1.0, 0.0, 2);
+				     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
 			     _("X:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -737,7 +737,7 @@
 			   _("Light source X direction in XYZ space"), NULL);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.y,
-				     -1.0, 1.0, 0.01, 0.1, 1.0, 0.0, 2);
+				     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
 			     _("Y:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -750,7 +750,7 @@
 			   _("Light source Y direction in XYZ space"), NULL);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.z,
-				     -1.0, 1.0, 0.01, 0.1, 1.0, 0.0, 2);
+				     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
 			     _("Z:"), 0.0, 0.5,
 			     spinbutton, 1, TRUE);
@@ -811,7 +811,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
-				     0, G_MAXFLOAT, 0.1, 1.0, 1.0, 0.0, 2);
+				     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
 		    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -840,7 +840,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
-				     0, G_MAXFLOAT, 0.1, 1.0, 1.0, 0.0, 2);
+				     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
 		    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -883,7 +883,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_ref,
-				     0, G_MAXFLOAT, 0.1, 1.0, 1.0, 0.0, 2);
+				     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
 		    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -912,7 +912,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
-				     0, G_MAXFLOAT, 0.1, 1.0, 1.0, 0.0, 2);
+				     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
 		    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -941,7 +941,7 @@
   gtk_size_group_add_widget (group, label);
 
   spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
-				     0, G_MAXFLOAT, 0.1, 1.0, 1.0, 0.0, 2);
+				     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
 		    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -1190,7 +1190,7 @@
   GtkObject    *adj;
   gint          i;
 
-  static gchar *labels[] = { N_("_Top:"), N_("_Bottom:") };
+  static const gchar *labels[] = { N_("_Top:"), N_("_Bottom:") };
 
   page = gtk_vbox_new (FALSE, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);

Modified: branches/soc-2008-tagging/plug-ins/print/print-draw-page.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/print/print-draw-page.c	(original)
+++ branches/soc-2008-tagging/plug-ins/print/print-draw-page.c	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,8 @@
 
 #include "config.h"
 
+#include <string.h>
+
 #include <libgimp/gimp.h>
 #include <libgimp/gimpui.h>
 
@@ -30,13 +32,44 @@
 static cairo_surface_t * print_cairo_surface_from_drawable (gint32 drawable_ID);
 
 static inline void
+convert_from_rgb (const guchar *src,
+                  guchar       *dest,
+                  gint          pixels)
+{
+  while (pixels--)
+    {
+      GIMP_CAIRO_RGB24_SET_PIXEL (dest,
+                                  src[0], src[1], src[2]);
+
+      src  += 3;
+      dest += 4;
+    }
+}
+
+static inline void
+convert_from_rgba (const guchar *src,
+                   guchar       *dest,
+                   gint          pixels)
+{
+  while (pixels--)
+    {
+      GIMP_CAIRO_ARGB32_SET_PIXEL (dest,
+                                   src[0], src[1], src[2], src[3]);
+
+      src  += 4;
+      dest += 4;
+    }
+}
+
+static inline void
 convert_from_gray (const guchar *src,
                    guchar       *dest,
                    gint          pixels)
 {
   while (pixels--)
     {
-      GIMP_CAIRO_RGB24_SET_PIXEL (dest, src[0], src[0], src[0]);
+      GIMP_CAIRO_RGB24_SET_PIXEL (dest,
+                                  src[0], src[0], src[0]);
 
       src  += 1;
       dest += 4;
@@ -50,7 +83,8 @@
 {
   while (pixels--)
     {
-      GIMP_CAIRO_ARGB32_SET_PIXEL (dest, src[0], src[0], src[0], src[1]);
+      GIMP_CAIRO_ARGB32_SET_PIXEL (dest,
+                                   src[0], src[0], src[0], src[1]);
 
       src  += 2;
       dest += 4;
@@ -58,29 +92,37 @@
 }
 
 static inline void
-convert_from_rgb (const guchar *src,
-                  guchar       *dest,
-                  gint          pixels)
+convert_from_indexed (const guchar *src,
+                      guchar       *dest,
+                      gint          pixels,
+                      const guchar *cmap)
 {
   while (pixels--)
     {
-      GIMP_CAIRO_RGB24_SET_PIXEL (dest, src[0], src[1], src[2]);
+      const gint i = 3 * src[0];
 
-      src  += 3;
+      GIMP_CAIRO_RGB24_SET_PIXEL (dest,
+                                  cmap[i], cmap[i + 1], cmap[i + 2]);
+
+      src  += 1;
       dest += 4;
     }
 }
 
 static inline void
-convert_from_rgba (const guchar *src,
-                   guchar       *dest,
-                   gint          pixels)
+convert_from_indexeda (const guchar *src,
+                       guchar       *dest,
+                       gint          pixels,
+                       const guchar *cmap)
 {
   while (pixels--)
     {
-      GIMP_CAIRO_ARGB32_SET_PIXEL (dest, src[0], src[1], src[2], src[3]);
+      const gint i = 3 * src[0];
 
-      src  += 4;
+      GIMP_CAIRO_ARGB32_SET_PIXEL (dest,
+                                   cmap[i], cmap[i + 1], cmap[i + 2], src[1]);
+
+      src  += 2;
       dest += 4;
     }
 }
@@ -125,17 +167,30 @@
 static cairo_surface_t *
 print_cairo_surface_from_drawable (gint32 drawable_ID)
 {
-  GimpDrawable    *drawable = gimp_drawable_get (drawable_ID);
+  GimpDrawable    *drawable      = gimp_drawable_get (drawable_ID);
   GimpPixelRgn     region;
+  GimpImageType    image_type    = gimp_drawable_type (drawable_ID);
   cairo_surface_t *surface;
-  const gint       width    = drawable->width;
-  const gint       height   = drawable->height;
+  const gint       width         = drawable->width;
+  const gint       height        = drawable->height;
+  guchar           cmap[3 * 256] = { 0, };
   guchar          *pixels;
   gint             stride;
-  guint            count    = 0;
-  guint            done     = 0;
+  guint            count         = 0;
+  guint            done          = 0;
   gpointer         pr;
 
+  if (gimp_drawable_is_indexed (drawable_ID))
+    {
+      guchar *colors;
+      gint    num_colors;
+
+      colors = gimp_image_get_colormap (gimp_drawable_get_image (drawable_ID),
+                                        &num_colors);
+      memcpy (cmap, colors, 3 * num_colors);
+      g_free (colors);
+    }
+
   surface = cairo_image_surface_create (gimp_drawable_has_alpha (drawable_ID) ?
                                         CAIRO_FORMAT_ARGB32 :
                                         CAIRO_FORMAT_RGB24,
@@ -156,22 +211,30 @@
 
       for (y = 0; y < region.h; y++)
         {
-          switch (region.bpp)
+          switch (image_type)
             {
-            case 1:
+            case GIMP_RGB_IMAGE:
+              convert_from_rgb (src, dest, region.w);
+              break;
+
+            case GIMP_RGBA_IMAGE:
+              convert_from_rgba (src, dest, region.w);
+              break;
+
+            case GIMP_GRAY_IMAGE:
               convert_from_gray (src, dest, region.w);
               break;
 
-            case 2:
+            case GIMP_GRAYA_IMAGE:
               convert_from_graya (src, dest, region.w);
               break;
 
-            case 3:
-              convert_from_rgb (src, dest, region.w);
+            case GIMP_INDEXED_IMAGE:
+              convert_from_indexed (src, dest, region.w, cmap);
               break;
 
-            case 4:
-              convert_from_rgba (src, dest, region.w);
+            case GIMP_INDEXEDA_IMAGE:
+              convert_from_indexeda (src, dest, region.w, cmap);
               break;
             }
 

Modified: branches/soc-2008-tagging/plug-ins/print/print.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/print/print.c	(original)
+++ branches/soc-2008-tagging/plug-ins/print/print.c	Sun Oct 12 15:38:02 2008
@@ -47,11 +47,11 @@
                           GimpParam        **return_vals);
 
 static GimpPDBStatusType  print_image       (gint32             image_ID,
-                                             gboolean           interactive);
+                                             gboolean           interactive,
+                                             GError           **error);
 static GimpPDBStatusType  page_setup        (gint32             image_ID);
 
-static void        print_show_error         (const gchar       *message,
-                                             gboolean           interactive);
+static void        print_show_error         (const gchar       *message);
 static void        print_operation_set_name (GtkPrintOperation *operation,
                                              gint               image_ID);
 
@@ -142,10 +142,11 @@
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  static GimpParam  values[2];
-  GimpRunMode       run_mode;
-  GimpPDBStatusType status;
-  gint32            image_ID;
+  static GimpParam   values[2];
+  GimpRunMode        run_mode;
+  GimpPDBStatusType  status;
+  gint32             image_ID;
+  GError            *error = NULL;
 
   run_mode = param[0].data.d_int32;
 
@@ -163,7 +164,13 @@
 
   if (strcmp (name, PRINT_PROC_NAME) == 0)
     {
-      status = print_image (image_ID, run_mode == GIMP_RUN_INTERACTIVE);
+      status = print_image (image_ID, run_mode == GIMP_RUN_INTERACTIVE, &error);
+
+      if (error && run_mode == GIMP_RUN_INTERACTIVE)
+        {
+          print_show_error (error->message);
+          g_clear_error (&error);
+        }
     }
   else if (strcmp (name, PAGE_SETUP_PROC_NAME) == 0)
     {
@@ -181,18 +188,26 @@
       status = GIMP_PDB_CALLING_ERROR;
     }
 
+  if (status != GIMP_PDB_SUCCESS && error)
+    {
+      *nreturn_vals = 2;
+      values[1].type          = GIMP_PDB_STRING;
+      values[1].data.d_string = error->message;
+    }
+
   values[0].data.d_status = status;
 }
 
 static GimpPDBStatusType
-print_image (gint32    image_ID,
-             gboolean  interactive)
-{
-  GtkPrintOperation *operation;
-  gchar             *temp_proc;
-  GError            *error = NULL;
-  gint32             layer;
-  PrintData          data;
+print_image (gint32     image_ID,
+             gboolean   interactive,
+             GError   **error)
+{
+  GtkPrintOperation       *operation;
+  GtkPrintOperationResult  result;
+  gchar                   *temp_proc;
+  gint32                   layer;
+  PrintData                data;
 
   /*  create a print layer from the projection  */
   layer = gimp_layer_new_from_visible (image_ID, image_ID, PRINT_PROC_NAME);
@@ -249,15 +264,15 @@
 
       gtk_print_operation_set_custom_tab_label (operation, _("Image Settings"));
 
-      gtk_print_operation_run (operation,
-                               GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
-                               NULL, &error);
+      result = gtk_print_operation_run (operation,
+                                        GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
+                                        NULL, error);
     }
   else
     {
-      gtk_print_operation_run (operation,
-                               GTK_PRINT_OPERATION_ACTION_PRINT,
-                               NULL, &error);
+      result = gtk_print_operation_run (operation,
+                                        GTK_PRINT_OPERATION_ACTION_PRINT,
+                                        NULL, error);
     }
 
   gimp_uninstall_temp_proc (temp_proc);
@@ -269,20 +284,29 @@
   if (gimp_drawable_is_valid (layer))
     gimp_drawable_delete (layer);
 
-  if (error)
+  switch (result)
     {
-      print_show_error (error->message, interactive);
-      g_error_free (error);
+    case GTK_PRINT_OPERATION_RESULT_APPLY:
+    case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS:
+      return GIMP_PDB_SUCCESS;
+
+    case GTK_PRINT_OPERATION_RESULT_CANCEL:
+      return GIMP_PDB_CANCEL;
+
+    case GTK_PRINT_OPERATION_RESULT_ERROR:
+      return GIMP_PDB_EXECUTION_ERROR;
     }
 
-  return GIMP_PDB_SUCCESS;
+  return GIMP_PDB_EXECUTION_ERROR;
 }
 
 static GimpPDBStatusType
 page_setup (gint32 image_ID)
 {
   GtkPrintOperation  *operation;
+  GimpParam          *return_vals;
   gchar              *name;
+  gint                n_return_vals;
 
   gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
@@ -297,21 +321,16 @@
   /* now notify a running print procedure about this change */
   name = print_temp_proc_name (image_ID);
 
-  /* FIXME: This code has a race condition. The best solution
-   *        would be to catch the error somehow (see bug #344818).
+  /* we don't want the core to show an error message if the
+   * temporary procedure does not exist
    */
-  if (gimp_procedural_db_proc_exists (name))
-    {
-      GimpParam *return_vals;
-      gint       n_return_vals;
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
 
-      return_vals = gimp_run_procedure (name,
-                                        &n_return_vals,
-                                        GIMP_PDB_IMAGE, image_ID,
-                                        GIMP_PDB_END);
-
-      gimp_destroy_params (return_vals, n_return_vals);
-    }
+  return_vals = gimp_run_procedure (name,
+                                    &n_return_vals,
+                                    GIMP_PDB_IMAGE, image_ID,
+                                    GIMP_PDB_END);
+  gimp_destroy_params (return_vals, n_return_vals);
 
   g_free (name);
 
@@ -319,27 +338,20 @@
 }
 
 static void
-print_show_error (const gchar *message,
-                  gboolean     interactive)
+print_show_error (const gchar *message)
 {
-  g_printerr ("Print: %s\n", message);
+  GtkWidget *dialog;
 
-  if (interactive)
-    {
-      GtkWidget *dialog;
+  dialog = gtk_message_dialog_new (NULL, 0,
+                                   GTK_MESSAGE_ERROR,
+                                   GTK_BUTTONS_OK,
+                                   _("An error occurred while trying to print:"));
 
-      dialog = gtk_message_dialog_new (NULL, 0,
-                                       GTK_MESSAGE_ERROR,
-                                       GTK_BUTTONS_OK,
-                                       _("An error occurred "
-                                         "while trying to print:"));
+  gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                            message);
 
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                                message);
-
-      gtk_dialog_run (GTK_DIALOG (dialog));
-      gtk_widget_destroy (dialog);
-    }
+  gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_destroy (dialog);
 }
 
 static void

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpfu.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpfu.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpfu.py	Sun Oct 12 15:38:02 2008
@@ -385,7 +385,7 @@
         exc_str = exc_only_str = _('Missing exception information')
 
         try:
-            etype, value, tb = sys.exc_info()        
+            etype, value, tb = sys.exc_info()
             exc_str = ''.join(traceback.format_exception(etype, value, tb))
             exc_only_str = ''.join(traceback.format_exception_only(etype, value))
         finally:
@@ -414,7 +414,7 @@
         expander.add(scrolled)
         scrolled.show()
 
-        
+
         label = gtk.Label(exc_str)
         label.set_alignment(0.0, 0.0)
         label.set_padding(6, 6)
@@ -442,7 +442,7 @@
         def __init__ (self, default=''):
             gtk.ScrolledWindow.__init__(self)
             self.set_shadow_type(gtk.SHADOW_IN)
-            
+
             self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
             self.set_size_request(100, -1)
 
@@ -453,7 +453,7 @@
             self.buffer = self.view.get_buffer()
 
             self.set_value(str(default))
-            
+
         def set_value(self, text):
             self.buffer.set_text(text)
 
@@ -551,7 +551,7 @@
 
     class ComboEntry(gtk.ComboBox):
         def __init__(self, default=0, items=()):
-            store = gtk.ListStore(str)    
+            store = gtk.ListStore(str)
             for item in items:
                 store.append([item])
 
@@ -715,10 +715,10 @@
         table.attach(wid, 2,3, i,i+1, yoptions=0)
 
         if pf_type != PF_TEXT:
-            tooltips.set_tip(wid, desc, None)         
+            tooltips.set_tip(wid, desc, None)
         else:
             #Attach tip to TextView, not to ScrolledWindow
-            tooltips.set_tip(wid.view, desc, None)         
+            tooltips.set_tip(wid.view, desc, None)
         wid.show()
 
         wid.desc = desc
@@ -763,7 +763,7 @@
     if run_mode == RUN_NONINTERACTIVE:
         return apply(func, params[1:])
 
-    script_params = _registered_plugins_[proc_name][8] 
+    script_params = _registered_plugins_[proc_name][8]
 
     min_args = 0
     if len(params) > 1:

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c	Sun Oct 12 15:38:02 2008
@@ -1811,7 +1811,6 @@
         return;
 
     PyGimpDisplay_Type.ob_type = &PyType_Type;
-    PyGimpDisplay_Type.ob_type = &PyType_Type;
     PyGimpDisplay_Type.tp_alloc = PyType_GenericAlloc;
     PyGimpDisplay_Type.tp_new = PyType_GenericNew;
     if (PyType_Ready(&PyGimpDisplay_Type) < 0)
@@ -1831,13 +1830,11 @@
 
     PyGimpTile_Type.ob_type = &PyType_Type;
     PyGimpTile_Type.tp_alloc = PyType_GenericAlloc;
-    PyGimpTile_Type.tp_new = PyType_GenericNew;
     if (PyType_Ready(&PyGimpTile_Type) < 0)
         return;
 
     PyGimpPixelRgn_Type.ob_type = &PyType_Type;
     PyGimpPixelRgn_Type.tp_alloc = PyType_GenericAlloc;
-    PyGimpPixelRgn_Type.tp_new = PyType_GenericNew;
     if (PyType_Ready(&PyGimpPixelRgn_Type) < 0)
         return;
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpshelf.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpshelf.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpshelf.py	Sun Oct 12 15:38:02 2008
@@ -69,7 +69,7 @@
             return 1
         except gimp.error:
             return 0
-                
+
     def __getitem__(self, key):
         try:
             s = gimp.get_data(key)

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpthumbmodule.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpthumbmodule.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpthumbmodule.c	Sun Oct 12 15:38:02 2008
@@ -33,12 +33,12 @@
 #include "pygimp-util.h"
 
 
-void gimpthumb_register_classes(PyObject *d); 
+void gimpthumb_register_classes(PyObject *d);
 void gimpthumb_add_constants(PyObject *module, const gchar *strip_prefix);
 extern PyMethodDef gimpthumb_functions[];
 
 
-static char gimpthumb_doc[] = 
+static char gimpthumb_doc[] =
 "This module provides interfaces to allow you to write gimp plugins"
 ;
 
@@ -48,7 +48,7 @@
 initgimpthumb(void)
 {
     PyObject *m, *d;
-    
+
     pygimp_init_pygobject();
 
     m = Py_InitModule3("gimpthumb", gimpthumb_functions, gimpthumb_doc);

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpui.defs
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpui.defs	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpui.defs	Sun Oct 12 15:38:02 2008
@@ -70,6 +70,20 @@
   (gtype-id "GIMP_TYPE_COLOR_HEX_ENTRY")
 )
 
+(define-object ColorProfileComboBox
+  (in-module "Gimp")
+  (parent "GtkComboBox")
+  (c-name "GimpColorProfileComboBox")
+  (gtype-id "GIMP_TYPE_COLOR_PROFILE_COMBO_BOX")
+)
+
+(define-object ColorProfileStore
+  (in-module "Gimp")
+  (parent "GtkListStore")
+  (c-name "GimpColorProfileStore")
+  (gtype-id "GIMP_TYPE_COLOR_PROFILE_STORE")
+)
+
 (define-object ColorScale
   (in-module "Gimp")
   (parent "GtkScale")
@@ -77,6 +91,13 @@
   (gtype-id "GIMP_TYPE_COLOR_SCALE")
 )
 
+(define-object ColorScales
+  (in-module "Gimp")
+  (parent "GimpColorSelector")
+  (c-name "GimpColorScales")
+  (gtype-id "GIMP_TYPE_COLOR_SCALES")
+)
+
 (define-object ColorSelection
   (in-module "Gimp")
   (parent "GtkVBox")
@@ -133,6 +154,13 @@
   (gtype-id "GIMP_TYPE_INT_COMBO_BOX")
 )
 
+(define-object ImageComboBox
+  (in-module "Gimp")
+  (parent "GimpIntComboBox")
+  (c-name "GimpImageComboBox")
+  (gtype-id "GIMP_TYPE_IMAGE_COMBO_BOX")
+)
+
 (define-object EnumComboBox
   (in-module "Gimp")
   (parent "GimpIntComboBox")
@@ -140,6 +168,20 @@
   (gtype-id "GIMP_TYPE_ENUM_COMBO_BOX")
 )
 
+(define-object DrawableComboBox
+  (in-module "Gimp")
+  (parent "GimpIntComboBox")
+  (c-name "GimpDrawableComboBox")
+  (gtype-id "GIMP_TYPE_DRAWABLE_COMBO_BOX")
+)
+
+(define-object ChannelComboBox
+  (in-module "Gimp")
+  (parent "GimpIntComboBox")
+  (c-name "GimpChannelComboBox")
+  (gtype-id "GIMP_TYPE_CHANNEL_COMBO_BOX")
+)
+
 (define-object IntStore
   (in-module "Gimp")
   (parent "GtkListStore")
@@ -154,6 +196,13 @@
   (gtype-id "GIMP_TYPE_ENUM_STORE")
 )
 
+(define-object LayerComboBox
+  (in-module "Gimp")
+  (parent "GimpIntComboBox")
+  (c-name "GimpLayerComboBox")
+  (gtype-id "GIMP_TYPE_LAYER_COMBO_BOX")
+)
+
 (define-object MemsizeEntry
   (in-module "Gimp")
   (parent "GtkHBox")
@@ -161,6 +210,13 @@
   (gtype-id "GIMP_TYPE_MEMSIZE_ENTRY")
 )
 
+(define-object NumberPairEntry
+  (in-module "Gimp")
+  (parent "GtkEntry")
+  (c-name "GimpNumberPairEntry")
+  (gtype-id "GIMP_TYPE_NUMBER_PAIR_ENTRY")
+)
+
 (define-object OffsetArea
   (in-module "Gimp")
   (parent "GtkDrawingArea")
@@ -280,6 +336,13 @@
   (gtype-id "GIMP_TYPE_BRUSH_SELECT_BUTTON")
 )
 
+(define-object Ruler
+  (in-module "Gimp")
+  (parent "GtkWidget")
+  (c-name "GimpRuler")
+  (gtype-id "GIMP_TYPE_RULER")
+)
+
 (define-object SizeEntry
   (in-module "Gimp")
   (parent "GtkTable")
@@ -287,6 +350,13 @@
   (gtype-id "GIMP_TYPE_SIZE_ENTRY")
 )
 
+(define-object StringComboBox
+  (in-module "Gimp")
+  (parent "GtkComboBox")
+  (c-name "GimpStringComboBox")
+  (gtype-id "GIMP_TYPE_STRING_COMBO_BOX")
+)
+
 (define-object UnitMenu
   (in-module "Gimp")
   (parent "GtkOptionMenu")
@@ -294,6 +364,13 @@
   (gtype-id "GIMP_TYPE_UNIT_MENU")
 )
 
+(define-object VectorsComboBox
+  (in-module "Gimp")
+  (parent "GimpIntComboBox")
+  (c-name "GimpVectorsComboBox")
+  (gtype-id "GIMP_TYPE_VECTORS_COMBO_BOX")
+)
+
 (define-object ZoomModel
   (in-module "Gimp")
   (parent "GObject")
@@ -308,43 +385,33 @@
   (gtype-id "GIMP_TYPE_ZOOM_PREVIEW")
 )
 
-(define-object DrawableComboBox
-  (in-module "Gimp")
-  (parent "GimpIntComboBox")
-  (c-name "GimpDrawableComboBox")
-  (gtype-id "GIMP_TYPE_DRAWABLE_COMBO_BOX")
-)
-
-(define-object ChannelComboBox
-  (in-module "Gimp")
-  (parent "GimpIntComboBox")
-  (c-name "GimpChannelComboBox")
-  (gtype-id "GIMP_TYPE_CHANNEL_COMBO_BOX")
-)
-
-(define-object LayerComboBox
-  (in-module "Gimp")
-  (parent "GimpIntComboBox")
-  (c-name "GimpLayerComboBox")
-  (gtype-id "GIMP_TYPE_LAYER_COMBO_BOX")
-)
+;; Enumerations and flags ...
 
-(define-object VectorsComboBox
+(define-enum IntStoreColumns
   (in-module "Gimp")
-  (parent "GimpIntComboBox")
-  (c-name "GimpVectorsComboBox")
-  (gtype-id "GIMP_TYPE_VECTORS_COMBO_BOX")
+  (c-name "GimpIntStoreColumns")
+  (gtype-id "GIMP_TYPE_INT_STORE_COLUMNS")
+  (values
+    '("value" "GIMP_INT_STORE_VALUE")
+    '("label" "GIMP_INT_STORE_LABEL")
+    '("stock-id" "GIMP_INT_STORE_STOCK_ID")
+    '("pixbuf" "GIMP_INT_STORE_PIXBUF")
+    '("user-data" "GIMP_INT_STORE_USER_DATA")
+    '("num-columns" "GIMP_INT_STORE_NUM_COLUMNS")
+  )
 )
 
-(define-object ImageComboBox
+(define-enum AspectType
   (in-module "Gimp")
-  (parent "GimpIntComboBox")
-  (c-name "GimpImageComboBox")
-  (gtype-id "GIMP_TYPE_IMAGE_COMBO_BOX")
+  (c-name "GimpAspectType")
+  (gtype-id "GIMP_TYPE_ASPECT_TYPE")
+  (values
+    '("square" "GIMP_ASPECT_SQUARE")
+    '("portrait" "GIMP_ASPECT_PORTRAIT")
+    '("landscape" "GIMP_ASPECT_LANDSCAPE")
+  )
 )
 
-;; Enumerations and flags ...
-
 (define-enum ChainPosition
   (in-module "Gimp")
   (c-name "GimpChainPosition")
@@ -420,7 +487,7 @@
 )
 
 
-;; From ../../libgimpwidgets/gimpbrowser.h
+;; From gimpbrowser.h
 
 (define-function gimp_browser_get_type
   (c-name "gimp_browser_get_type")
@@ -464,7 +531,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpbutton.h
+;; From gimpbutton.h
 
 (define-function gimp_button_get_type
   (c-name "gimp_button_get_type")
@@ -488,7 +555,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcellrenderercolor.h
+;; From gimpcellrenderercolor.h
 
 (define-function gimp_cell_renderer_color_get_type
   (c-name "gimp_cell_renderer_color_get_type")
@@ -503,7 +570,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcellrenderertoggle.h
+;; From gimpcellrenderertoggle.h
 
 (define-function gimp_cell_renderer_toggle_get_type
   (c-name "gimp_cell_renderer_toggle_get_type")
@@ -531,7 +598,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpchainbutton.h
+;; From gimpchainbutton.h
 
 (define-function gimp_chain_button_get_type
   (c-name "gimp_chain_button_get_type")
@@ -564,7 +631,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorarea.h
+;; From gimpcolorarea.h
 
 (define-function gimp_color_area_get_type
   (c-name "gimp_color_area_get_type")
@@ -576,8 +643,8 @@
   (is-constructor-of "GimpColorArea")
   (return-type "GtkWidget*")
   (properties
-    '("color" (argname "color") (optional))
-    '("type" (argname "type") (optional))
+    '("color" (optional))
+    '("type" (optional))
     '("drag-mask" (argname "drag_mask") (optional))
   )
 )
@@ -626,7 +693,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorbutton.h
+;; From gimpcolorbutton.h
 
 (define-function gimp_color_button_get_type
   (c-name "gimp_color_button_get_type")
@@ -696,7 +763,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolordisplay.h
+;; From gimpcolordisplay.h
 
 (define-function gimp_color_display_get_type
   (c-name "gimp_color_display_get_type")
@@ -770,9 +837,21 @@
   (return-type "gboolean")
 )
 
+(define-method get_config
+  (of-object "GimpColorDisplay")
+  (c-name "gimp_color_display_get_config")
+  (return-type "GimpColorConfig*")
+)
+
+(define-method get_managed
+  (of-object "GimpColorDisplay")
+  (c-name "gimp_color_display_get_managed")
+  (return-type "GimpColorManaged*")
+)
+
 
 
-;; From ../../libgimpwidgets/gimpcolordisplaystack.h
+;; From gimpcolordisplaystack.h
 
 (define-function gimp_color_display_stack_get_type
   (c-name "gimp_color_display_stack_get_type")
@@ -848,7 +927,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorhexentry.h
+;; From gimpcolorhexentry.h
 
 (define-function gimp_color_hex_entry_get_type
   (c-name "gimp_color_hex_entry_get_type")
@@ -881,7 +960,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolornotebook.h
+;; From gimpcolornotebook.h
 
 (define-function gimp_color_notebook_get_type
   (c-name "gimp_color_notebook_get_type")
@@ -900,7 +979,80 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorscale.h
+;; From gimpcolorprofilecombobox.h
+
+(define-function gimp_color_profile_combo_box_get_type
+  (c-name "gimp_color_profile_combo_box_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_color_profile_combo_box_new_with_model
+  (c-name "gimp_color_profile_combo_box_new_with_model")
+  (is-constructor-of "GimpColorProfileComboBox")
+  (return-type "GtkWidget*")
+  (properties
+    '("dialog")
+    '("model")
+  )
+)
+
+(define-method add
+  (of-object "GimpColorProfileComboBox")
+  (c-name "gimp_color_profile_combo_box_add")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "filename")
+    '("const-gchar*" "label")
+  )
+)
+
+(define-method set_active
+  (of-object "GimpColorProfileComboBox")
+  (c-name "gimp_color_profile_combo_box_set_active")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "filename")
+    '("const-gchar*" "label")
+  )
+)
+
+(define-method get_active
+  (of-object "GimpColorProfileComboBox")
+  (c-name "gimp_color_profile_combo_box_get_active")
+  (return-type "gchar*")
+)
+
+
+
+;; From gimpcolorprofilestore.h
+
+(define-function gimp_color_profile_store_get_type
+  (c-name "gimp_color_profile_store_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_color_profile_store_new
+  (c-name "gimp_color_profile_store_new")
+  (is-constructor-of "GimpColorProfileStore")
+  (return-type "GtkListStore*")
+  (properties
+    '("history")
+  )
+)
+
+(define-method add
+  (of-object "GimpColorProfileStore")
+  (c-name "gimp_color_profile_store_add")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "filename")
+    '("const-gchar*" "label")
+  )
+)
+
+
+
+;; From gimpcolorscale.h
 
 (define-function gimp_color_scale_get_type
   (c-name "gimp_color_scale_get_type")
@@ -938,7 +1090,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorscales.h
+;; From gimpcolorscales.h
 
 (define-function gimp_color_scales_get_type
   (c-name "gimp_color_scales_get_type")
@@ -947,7 +1099,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorselect.h
+;; From gimpcolorselect.h
 
 (define-function gimp_color_select_get_type
   (c-name "gimp_color_select_get_type")
@@ -956,7 +1108,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpcolorselection.h
+;; From gimpcolorselection.h
 
 (define-function gimp_color_selection_get_type
   (c-name "gimp_color_selection_get_type")
@@ -1032,9 +1184,18 @@
   (return-type "none")
 )
 
+(define-method set_config
+  (of-object "GimpColorSelection")
+  (c-name "gimp_color_selection_set_config")
+  (return-type "none")
+  (parameters
+    '("GimpColorConfig*" "config")
+  )
+)
+
 
 
-;; From ../../libgimpwidgets/gimpcolorselector.h
+;; From gimpcolorselector.h
 
 (define-function gimp_color_selector_get_type
   (c-name "gimp_color_selector_get_type")
@@ -1111,9 +1272,18 @@
   (return-type "none")
 )
 
+(define-method set_config
+  (of-object "GimpColorSelector")
+  (c-name "gimp_color_selector_set_config")
+  (return-type "none")
+  (parameters
+    '("GimpColorConfig*" "config")
+  )
+)
+
 
 
-;; From ../../libgimpwidgets/gimpdialog.h
+;; From gimpdialog.h
 
 (define-function gimp_dialog_get_type
   (c-name "gimp_dialog_get_type")
@@ -1137,7 +1307,6 @@
 
 (define-function gimp_dialog_new_valist
   (c-name "gimp_dialog_new_valist")
-  (is-constructor-of "GimpDialog")
   (return-type "GtkWidget*")
   (parameters
     '("const-gchar*" "title")
@@ -1164,6 +1333,8 @@
   (of-object "GimpDialog")
   (c-name "gimp_dialog_add_buttons")
   (return-type "none")
+  (parameters
+  )
   (varargs #t)
 )
 
@@ -1182,7 +1353,7 @@
   (return-type "gint")
 )
 
-(define-function gimp_dialogs_show_help_button
+(function gimp_dialogs_show_help_button
   (c-name "gimp_dialogs_show_help_button")
   (return-type "none")
   (parameters
@@ -1190,9 +1361,16 @@
   )
 )
 
+;; from gimpui.h
+
+(define-method set_transient
+  (of-object "GimpDialog")
+  (c-name "gimp_window_set_transient")
+  (return-type "none")
+)
 
 
-;; From ../../libgimpwidgets/gimpenumcombobox.h
+;; From gimpenumcombobox.h
 
 (define-function gimp_enum_combo_box_get_type
   (c-name "gimp_enum_combo_box_get_type")
@@ -1210,7 +1388,6 @@
 
 (define-function gimp_enum_combo_box_new_with_model
   (c-name "gimp_enum_combo_box_new_with_model")
-  (is-constructor-of "GimpEnumComboBox")
   (return-type "GtkWidget*")
   (parameters
     '("GimpEnumStore*" "enum_store")
@@ -1228,7 +1405,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpenumlabel.h
+;; From gimpenumlabel.h
 
 (define-function gimp_enum_label_get_type
   (c-name "gimp_enum_label_get_type")
@@ -1256,7 +1433,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpenumstore.h
+;; From gimpenumstore.h
 
 (define-function gimp_enum_store_get_type
   (c-name "gimp_enum_store_get_type")
@@ -1274,7 +1451,6 @@
 
 (define-function gimp_enum_store_new_with_range
   (c-name "gimp_enum_store_new_with_range")
-  (is-constructor-of "GimpEnumStore")
   (return-type "GtkListStore*")
   (parameters
     '("GType" "enum_type")
@@ -1285,7 +1461,6 @@
 
 (define-function gimp_enum_store_new_with_values
   (c-name "gimp_enum_store_new_with_values")
-  (is-constructor-of "GimpEnumStore")
   (return-type "GtkListStore*")
   (parameters
     '("GType" "enum_type")
@@ -1296,7 +1471,6 @@
 
 (define-function gimp_enum_store_new_with_values_valist
   (c-name "gimp_enum_store_new_with_values_valist")
-  (is-constructor-of "GimpEnumStore")
   (return-type "GtkListStore*")
   (parameters
     '("GType" "enum_type")
@@ -1316,120 +1490,44 @@
 
 
 
-;; From ../../libgimpwidgets/gimpenumwidgets.h
-
-(define-function gimp_enum_radio_box_new
-  (c-name "gimp_enum_radio_box_new")
-  (is-constructor-of "GimpEnumRadioBox")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
-)
-
-(define-function gimp_enum_radio_box_new_with_range
-  (c-name "gimp_enum_radio_box_new_with_range")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("gint" "minimum")
-    '("gint" "maximum")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
-)
-
-(define-function gimp_enum_radio_frame_new
-  (c-name "gimp_enum_radio_frame_new")
-  (is-constructor-of "GimpEnumRadioFrame")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("GtkWidget*" "label_widget")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
-)
-
-(define-function gimp_enum_radio_frame_new_with_range
-  (c-name "gimp_enum_radio_frame_new_with_range")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("gint" "minimum")
-    '("gint" "maximum")
-    '("GtkWidget*" "label_widget")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
-)
+;; From gimpframe.h
 
-(define-function gimp_enum_stock_box_new
-  (c-name "gimp_enum_stock_box_new")
-  (is-constructor-of "GimpEnumStockBox")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("const-gchar*" "stock_prefix")
-    '("GtkIconSize" "icon_size")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
+(define-function gimp_frame_get_type
+  (c-name "gimp_frame_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_enum_stock_box_new_with_range
-  (c-name "gimp_enum_stock_box_new_with_range")
+(define-function gimp_frame_new
+  (c-name "gimp_frame_new")
+  (is-constructor-of "GimpFrame")
   (return-type "GtkWidget*")
-  (parameters
-    '("GType" "enum_type")
-    '("gint" "minimum")
-    '("gint" "maximum")
-    '("const-gchar*" "stock_prefix")
-    '("GtkIconSize" "icon_size")
-    '("GCallback" "callback")
-    '("gpointer" "callback_data")
-    '("GtkWidget**" "first_button")
-  )
-)
-
-(define-function gimp_enum_stock_box_set_child_padding
-  (c-name "gimp_enum_stock_box_set_child_padding")
-  (return-type "none")
-  (parameters
-    '("GtkWidget*" "stock_box")
-    '("gint" "xpad")
-    '("gint" "ypad")
+  (properties
+    '("label")
   )
 )
 
 
 
-;; From ../../libgimpwidgets/gimpframe.h
+;; From gimphintbox.h
 
-(define-function gimp_frame_get_type
-  (c-name "gimp_frame_get_type")
+(define-function gimp_hint_box_get_type
+  (c-name "gimp_hint_box_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_frame_new
-  (c-name "gimp_frame_new")
-  (is-constructor-of "GimpFrame")
+(define-function gimp_hint_box_new
+  (c-name "gimp_hint_box_new")
+  (is-constructor-of "GimpHintBox")
   (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "label")
+  (properties
+    '("hint")
+    '("stock-id" (optional))
   )
 )
 
 
 
-;; From ../../libgimpwidgets/gimpintcombobox.h
+;; From gimpintcombobox.h
 
 (define-function gimp_int_combo_box_get_type
   (c-name "gimp_int_combo_box_get_type")
@@ -1526,28 +1624,10 @@
 
 
 
-;; From ../../libgimpwidgets/gimphintbox.h
+;; From gimpintstore.h
 
-(define-function gimp_hint_box_get_type
-  (c-name "gimp_hint_box_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_hint_box_new
-  (c-name "gimp_hint_box_new")
-  (is-constructor-of "GimpHintBox")
-  (return-type "GtkWidget*")
-  (properties
-    '("hint") ("stock-id" (optional))
-  )
-)
-
-
-
-;; From ../../libgimpwidgets/gimpintstore.h
-
-(define-function gimp_int_store_get_type
-  (c-name "gimp_int_store_get_type")
+(define-function gimp_int_store_get_type
+  (c-name "gimp_int_store_get_type")
   (return-type "GType")
 )
 
@@ -1557,11 +1637,11 @@
   (return-type "GtkListStore*")
 )
 
-(define-function gimp_int_store_lookup_by_value
+(define-method lookup_by_value
+  (of-object "GimpIntStore")
   (c-name "gimp_int_store_lookup_by_value")
   (return-type "gboolean")
   (parameters
-    '("GtkTreeModel*" "model")
     '("gint" "value")
     '("GtkTreeIter*" "iter")
   )
@@ -1569,7 +1649,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimpmemsizeentry.h
+;; From gimpmemsizeentry.h
 
 (define-function gimp_memsize_entry_get_type
   (c-name "gimp_memsize_entry_get_type")
@@ -1604,7 +1684,128 @@
 
 
 
-;; From ../../libgimpwidgets/gimpoffsetarea.h
+;; From gimpnumberpairentry.h
+
+(define-function gimp_number_pair_entry_get_type
+  (c-name "gimp_number_pair_entry_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_number_pair_entry_new
+  (c-name "gimp_number_pair_entry_new")
+  (is-constructor-of "GimpNumberPairEntry")
+  (return-type "GtkWidget*")
+  (properties
+    '("separators")
+    '("allow-simplification" (argname "allow_simplification"))
+    '("min-valid-value" (argname "min_valid_value"))
+    '("max-valid-value" (argname "max_valid_value"))
+  )
+)
+
+(define-method set_default_values
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_default_values")
+  (return-type "none")
+  (parameters
+    '("gdouble" "left")
+    '("gdouble" "right")
+  )
+)
+
+(define-method get_default_values
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_default_values")
+  (return-type "none")
+  (parameters
+    '("gdouble*" "left")
+    '("gdouble*" "right")
+  )
+)
+
+(define-method set_values
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_values")
+  (return-type "none")
+  (parameters
+    '("gdouble" "left")
+    '("gdouble" "right")
+  )
+)
+
+(define-method get_values
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_values")
+  (return-type "none")
+  (parameters
+    '("gdouble*" "left")
+    '("gdouble*" "right")
+  )
+)
+
+(define-method set_default_text
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_default_text")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "string")
+  )
+)
+
+(define-method get_default_text
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_default_text")
+  (return-type "const-gchar*")
+)
+
+(define-method set_ratio
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_ratio")
+  (return-type "none")
+  (parameters
+    '("gdouble" "ratio")
+  )
+)
+
+(define-method get_ratio
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_ratio")
+  (return-type "gdouble")
+)
+
+(define-method set_aspect
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_aspect")
+  (return-type "none")
+  (parameters
+    '("GimpAspectType" "aspect")
+  )
+)
+
+(define-method get_aspect
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_aspect")
+  (return-type "GimpAspectType")
+)
+
+(define-method set_user_override
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_set_user_override")
+  (return-type "none")
+  (parameters
+    '("gboolean" "user_override")
+  )
+)
+
+(define-method get_user_override
+  (of-object "GimpNumberPairEntry")
+  (c-name "gimp_number_pair_entry_get_user_override")
+  (return-type "gboolean")
+)
+
+
+
+;; From gimpoffsetarea.h
 
 (define-function gimp_offset_area_get_type
   (c-name "gimp_offset_area_get_type")
@@ -1652,7 +1853,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimppageselector.h
+;; From gimppageselector.h
 
 (define-function gimp_page_selector_get_type
   (c-name "gimp_page_selector_get_type")
@@ -1798,7 +1999,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimppatheditor.h
+;; From gimppatheditor.h
 
 (define-function gimp_path_editor_get_type
   (c-name "gimp_path_editor_get_type")
@@ -1808,11 +2009,11 @@
 (define-function gimp_path_editor_new
   (c-name "gimp_path_editor_new")
   (is-constructor-of "GimpPathEditor")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("const-gchar*" "path")
+  (properties
+    '("title")
+    '("path" (optional))
   )
+  (return-type "GtkWidget*")
 )
 
 (define-method get_path
@@ -1866,7 +2067,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimppickbutton.h
+;; From gimppickbutton.h
 
 (define-function gimp_pick_button_get_type
   (c-name "gimp_pick_button_get_type")
@@ -1881,7 +2082,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimppreview.h
+;; From gimppreview.h
 
 (define-function gimp_preview_get_type
   (c-name "gimp_preview_get_type")
@@ -1935,6 +2136,30 @@
   )
 )
 
+(define-method transform
+  (of-object "GimpPreview")
+  (c-name "gimp_preview_transform")
+  (return-type "none")
+  (parameters
+    '("gint" "src_x")
+    '("gint" "src_y")
+    '("gint*" "dest_x")
+    '("gint*" "dest_y")
+  )
+)
+
+(define-method untransform
+  (of-object "GimpPreview")
+  (c-name "gimp_preview_untransform")
+  (return-type "none")
+  (parameters
+    '("gint" "src_x")
+    '("gint" "src_y")
+    '("gint*" "dest_x")
+    '("gint*" "dest_y")
+  )
+)
+
 (define-method get_area
   (of-object "GimpPreview")
   (c-name "gimp_preview_get_area")
@@ -1980,7 +2205,7 @@
 
 
 
-;; From ../../libgimpwidgets/gimppreviewarea.h
+;; From gimppreviewarea.h
 
 (define-function gimp_preview_area_get_type
   (c-name "gimp_preview_area_get_type")
@@ -2101,701 +2326,279 @@
 
 
 
-;; From ../../libgimpwidgets/gimppropwidgets.h
+;; From gimpscrolledpreview.h
 
-(define-function gimp_prop_check_button_new
-  (c-name "gimp_prop_check_button_new")
-  (is-constructor-of "GimpPropCheckButton")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "label")
-  )
+(define-function gimp_scrolled_preview_get_type
+  (c-name "gimp_scrolled_preview_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_prop_boolean_combo_box_new
-  (c-name "gimp_prop_boolean_combo_box_new")
-  (is-constructor-of "GimpPropBooleanComboBox")
-  (return-type "GtkWidget*")
+(define-method set_position
+  (of-object "GimpScrolledPreview")
+  (c-name "gimp_scrolled_preview_set_position")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "true_text")
-    '("const-gchar*" "false_text")
+    '("gint" "x")
+    '("gint" "y")
   )
 )
 
-(define-function gimp_prop_boolean_radio_frame_new
-  (c-name "gimp_prop_boolean_radio_frame_new")
-  (is-constructor-of "GimpPropBooleanRadioFrame")
-  (return-type "GtkWidget*")
+(define-method set_policy
+  (of-object "GimpScrolledPreview")
+  (c-name "gimp_scrolled_preview_set_policy")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "title")
-    '("const-gchar*" "true_text")
-    '("const-gchar*" "false_text")
+    '("GtkPolicyType" "hscrollbar_policy")
+    '("GtkPolicyType" "vscrollbar_policy")
   )
 )
 
-(define-function gimp_prop_expander_new
-  (c-name "gimp_prop_expander_new")
-  (is-constructor-of "GimpPropExpander")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "label")
-  )
+(define-method freeze
+  (of-object "GimpScrolledPreview")
+  (c-name "gimp_scrolled_preview_freeze")
+  (return-type "none")
+)
+
+(define-method thaw
+  (of-object "GimpScrolledPreview")
+  (c-name "gimp_scrolled_preview_thaw")
+  (return-type "none")
+)
+
+
+
+;; From gimpsizeentry.h
+
+(define-function gimp_size_entry_get_type
+  (c-name "gimp_size_entry_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_prop_int_combo_box_new
-  (c-name "gimp_prop_int_combo_box_new")
-  (is-constructor-of "GimpPropIntComboBox")
+(define-function gimp_size_entry_new
+  (c-name "gimp_size_entry_new")
+  (is-constructor-of "GimpSizeEntry")
   (return-type "GtkWidget*")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("GimpIntStore*" "store")
+    '("gint" "number_of_fields")
+    '("GimpUnit" "unit")
+    '("const-gchar*" "unit_format")
+    '("gboolean" "menu_show_pixels")
+    '("gboolean" "menu_show_percent")
+    '("gboolean" "show_refval")
+    '("gint" "spinbutton_width")
+    '("GimpSizeEntryUpdatePolicy" "update_policy")
   )
 )
 
-(define-function gimp_prop_enum_combo_box_new
-  (c-name "gimp_prop_enum_combo_box_new")
-  (is-constructor-of "GimpPropEnumComboBox")
-  (return-type "GtkWidget*")
+(define-method add_field
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_add_field")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gint" "minimum")
-    '("gint" "maximum")
+    '("GtkSpinButton*" "value_spinbutton")
+    '("GtkSpinButton*" "refval_spinbutton")
   )
 )
 
-(define-function gimp_prop_enum_check_button_new
-  (c-name "gimp_prop_enum_check_button_new")
-  (is-constructor-of "GimpPropEnumCheckButton")
+(define-method attach_label
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_attach_label")
   (return-type "GtkWidget*")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "label")
-    '("gint" "false_value")
-    '("gint" "true_value")
+    '("const-gchar*" "text")
+    '("gint" "row")
+    '("gint" "column")
+    '("gfloat" "alignment")
   )
 )
 
-(define-function gimp_prop_enum_radio_frame_new
-  (c-name "gimp_prop_enum_radio_frame_new")
-  (is-constructor-of "GimpPropEnumRadioFrame")
-  (return-type "GtkWidget*")
+(define-method set_resolution
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_resolution")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "title")
-    '("gint" "minimum")
-    '("gint" "maximum")
+    '("gint" "field")
+    '("gdouble" "resolution")
+    '("gboolean" "keep_size")
   )
 )
 
-(define-function gimp_prop_enum_radio_box_new
-  (c-name "gimp_prop_enum_radio_box_new")
-  (is-constructor-of "GimpPropEnumRadioBox")
-  (return-type "GtkWidget*")
+(define-method set_size
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_size")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gint" "minimum")
-    '("gint" "maximum")
+    '("gint" "field")
+    '("gdouble" "lower")
+    '("gdouble" "upper")
   )
 )
 
-(define-function gimp_prop_enum_stock_box_new
-  (c-name "gimp_prop_enum_stock_box_new")
-  (is-constructor-of "GimpPropEnumStockBox")
-  (return-type "GtkWidget*")
+(define-method set_value_boundaries
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_value_boundaries")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "stock_prefix")
-    '("gint" "minimum")
-    '("gint" "maximum")
+    '("gint" "field")
+    '("gdouble" "lower")
+    '("gdouble" "upper")
   )
 )
 
-(define-function gimp_prop_enum_label_new
-  (c-name "gimp_prop_enum_label_new")
-  (is-constructor-of "GimpPropEnumLabel")
-  (return-type "GtkWidget*")
+(define-method get_value
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_get_value")
+  (return-type "gdouble")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
+    '("gint" "field")
   )
 )
 
-(define-function gimp_prop_spin_button_new
-  (c-name "gimp_prop_spin_button_new")
-  (is-constructor-of "GimpPropSpinButton")
-  (return-type "GtkWidget*")
+(define-method set_value
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_value")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
-    '("gint" "digits")
+    '("gint" "field")
+    '("gdouble" "value")
   )
 )
 
-(define-function gimp_prop_hscale_new
-  (c-name "gimp_prop_hscale_new")
-  (is-constructor-of "GimpPropHscale")
-  (return-type "GtkWidget*")
+(define-method set_refval_boundaries
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_refval_boundaries")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
-    '("gint" "digits")
+    '("gint" "field")
+    '("gdouble" "lower")
+    '("gdouble" "upper")
   )
 )
 
-(define-function gimp_prop_scale_entry_new
-  (c-name "gimp_prop_scale_entry_new")
-  (is-constructor-of "GimpPropScaleEntry")
-  (return-type "GtkObject*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("GtkTable*" "table")
-    '("gint" "column")
-    '("gint" "row")
-    '("const-gchar*" "label")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
+(define-method set_refval_digits
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_refval_digits")
+  (return-type "none")
+  (parameters
+    '("gint" "field")
     '("gint" "digits")
-    '("gboolean" "limit_scale")
-    '("gdouble" "lower_limit")
-    '("gdouble" "upper_limit")
   )
 )
 
-(define-function gimp_prop_opacity_entry_new
-  (c-name "gimp_prop_opacity_entry_new")
-  (is-constructor-of "GimpPropOpacityEntry")
-  (return-type "GtkObject*")
+(define-method get_refval
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_get_refval")
+  (return-type "gdouble")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("GtkTable*" "table")
-    '("gint" "column")
-    '("gint" "row")
-    '("const-gchar*" "label")
+    '("gint" "field")
   )
 )
 
-(define-function gimp_prop_memsize_entry_new
-  (c-name "gimp_prop_memsize_entry_new")
-  (is-constructor-of "GimpPropMemsizeEntry")
-  (return-type "GtkWidget*")
+(define-method set_refval
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_refval")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
+    '("gint" "field")
+    '("gdouble" "refval")
   )
 )
 
-(define-function gimp_prop_label_new
-  (c-name "gimp_prop_label_new")
-  (is-constructor-of "GimpPropLabel")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-  )
+(define-method get_unit
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_get_unit")
+  (return-type "GimpUnit")
 )
 
-(define-function gimp_prop_entry_new
-  (c-name "gimp_prop_entry_new")
-  (is-constructor-of "GimpPropEntry")
-  (return-type "GtkWidget*")
+(define-method set_unit
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_set_unit")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gint" "max_len")
+    '("GimpUnit" "unit")
   )
 )
 
-(define-function gimp_prop_text_buffer_new
-  (c-name "gimp_prop_text_buffer_new")
-  (is-constructor-of "GimpPropTextBuffer")
-  (return-type "GtkTextBuffer*")
+(define-method show_unit_menu
+  (of-object "GimpSizeEntry")
+  (c-name "gimp_size_entry_show_unit_menu")
+  (return-type "none")
   (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gint" "max_len")
+    '("gboolean" "show")
   )
 )
 
-(define-function gimp_prop_file_entry_new
-  (c-name "gimp_prop_file_entry_new")
-  (is-constructor-of "GimpPropFileEntry")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "filesel_title")
-    '("gboolean" "dir_only")
-    '("gboolean" "check_valid")
-  )
-)
-
-(define-function gimp_prop_path_editor_new
-  (c-name "gimp_prop_path_editor_new")
-  (is-constructor-of "GimpPropPathEditor")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "path_property_name")
-    '("const-gchar*" "writable_property_name")
-    '("const-gchar*" "filesel_title")
-  )
-)
-
-(define-function gimp_prop_file_chooser_button_new
-  (c-name "gimp_prop_file_chooser_button_new")
-  (is-constructor-of "GimpPropFileChooserButton")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "title")
-    '("GtkFileChooserAction" "action")
-  )
-)
-
-(define-function gimp_prop_size_entry_new
-  (c-name "gimp_prop_size_entry_new")
-  (is-constructor-of "GimpPropSizeEntry")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "unit_property_name")
-    '("const-gchar*" "unit_format")
-    '("GimpSizeEntryUpdatePolicy" "update_policy")
-    '("gdouble" "resolution")
-  )
-)
-
-(define-function gimp_prop_coordinates_new
-  (c-name "gimp_prop_coordinates_new")
-  (is-constructor-of "GimpPropCoordinates")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "x_property_name")
-    '("const-gchar*" "y_property_name")
-    '("const-gchar*" "unit_property_name")
-    '("const-gchar*" "unit_format")
-    '("GimpSizeEntryUpdatePolicy" "update_policy")
-    '("gdouble" "xresolution")
-    '("gdouble" "yresolution")
-    '("gboolean" "has_chainbutton")
-  )
-)
-
-(define-function gimp_prop_coordinates_connect
-  (c-name "gimp_prop_coordinates_connect")
-  (return-type "gboolean")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "x_property_name")
-    '("const-gchar*" "y_property_name")
-    '("const-gchar*" "unit_property_name")
-    '("GtkWidget*" "sizeentry")
-    '("GtkWidget*" "chainbutton")
-    '("gdouble" "xresolution")
-    '("gdouble" "yresolution")
-  )
-)
-
-(define-function gimp_prop_color_area_new
-  (c-name "gimp_prop_color_area_new")
-  (is-constructor-of "GimpPropColorArea")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("gint" "width")
-    '("gint" "height")
-    '("GimpColorAreaType" "type")
-  )
-)
-
-(define-function gimp_prop_unit_menu_new
-  (c-name "gimp_prop_unit_menu_new")
-  (is-constructor-of "GimpPropUnitMenu")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("const-gchar*" "unit_format")
-  )
-)
-
-(define-function gimp_prop_stock_image_new
-  (c-name "gimp_prop_stock_image_new")
-  (is-constructor-of "GimpPropStockImage")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GObject*" "config")
-    '("const-gchar*" "property_name")
-    '("GtkIconSize" "icon_size")
-  )
-)
-
-
-
-;; From ../../libgimpwidgets/gimpquerybox.h
-
-(define-function gimp_query_string_box
-  (c-name "gimp_query_string_box")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("GtkWidget*" "parent")
-    '("GimpHelpFunc" "help_func")
-    '("const-gchar*" "help_id")
-    '("const-gchar*" "message")
-    '("const-gchar*" "initial")
-    '("GObject*" "object")
-    '("const-gchar*" "signal")
-    '("GimpQueryStringCallback" "callback")
-    '("gpointer" "data")
-  )
-)
-
-(define-function gimp_query_int_box
-  (c-name "gimp_query_int_box")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("GtkWidget*" "parent")
-    '("GimpHelpFunc" "help_func")
-    '("const-gchar*" "help_id")
-    '("const-gchar*" "message")
-    '("gint" "initial")
-    '("gint" "lower")
-    '("gint" "upper")
-    '("GObject*" "object")
-    '("const-gchar*" "signal")
-    '("GimpQueryIntCallback" "callback")
-    '("gpointer" "data")
-  )
-)
-
-(define-function gimp_query_double_box
-  (c-name "gimp_query_double_box")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("GtkWidget*" "parent")
-    '("GimpHelpFunc" "help_func")
-    '("const-gchar*" "help_id")
-    '("const-gchar*" "message")
-    '("gdouble" "initial")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-    '("gint" "digits")
-    '("GObject*" "object")
-    '("const-gchar*" "signal")
-    '("GimpQueryDoubleCallback" "callback")
-    '("gpointer" "data")
-  )
-)
-
-(define-function gimp_query_size_box
-  (c-name "gimp_query_size_box")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("GtkWidget*" "parent")
-    '("GimpHelpFunc" "help_func")
-    '("const-gchar*" "help_id")
-    '("const-gchar*" "message")
-    '("gdouble" "initial")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-    '("gint" "digits")
-    '("GimpUnit" "unit")
-    '("gdouble" "resolution")
-    '("gboolean" "dot_for_dot")
-    '("GObject*" "object")
-    '("const-gchar*" "signal")
-    '("GimpQuerySizeCallback" "callback")
-    '("gpointer" "data")
-  )
-)
-
-(define-function gimp_query_boolean_box
-  (c-name "gimp_query_boolean_box")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "title")
-    '("GtkWidget*" "parent")
-    '("GimpHelpFunc" "help_func")
-    '("const-gchar*" "help_id")
-    '("const-gchar*" "stock_id")
-    '("const-gchar*" "message")
-    '("const-gchar*" "true_button")
-    '("const-gchar*" "false_button")
-    '("GObject*" "object")
-    '("const-gchar*" "signal")
-    '("GimpQueryBooleanCallback" "callback")
-    '("gpointer" "data")
-  )
-)
-
-
-
-;; From ../../libgimpwidgets/gimpscrolledpreview.h
-
-(define-function gimp_scrolled_preview_get_type
-  (c-name "gimp_scrolled_preview_get_type")
-  (return-type "GType")
-)
-
-(define-method set_position
-  (of-object "GimpScrolledPreview")
-  (c-name "gimp_scrolled_preview_set_position")
-  (return-type "none")
-  (parameters
-    '("gint" "x")
-    '("gint" "y")
-  )
-)
-
-(define-method set_policy
-  (of-object "GimpScrolledPreview")
-  (c-name "gimp_scrolled_preview_set_policy")
-  (return-type "none")
-  (parameters
-    '("GtkPolicyType" "hscrollbar_policy")
-    '("GtkPolicyType" "vscrollbar_policy")
-  )
-)
-
-(define-method freeze
-  (of-object "GimpScrolledPreview")
-  (c-name "gimp_scrolled_preview_freeze")
-  (return-type "none")
-)
-
-(define-method thaw
-  (of-object "GimpScrolledPreview")
-  (c-name "gimp_scrolled_preview_thaw")
-  (return-type "none")
-)
-
-
-
-;; From ../../libgimpwidgets/gimpsizeentry.h
-
-(define-function gimp_size_entry_get_type
-  (c-name "gimp_size_entry_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_size_entry_new
-  (c-name "gimp_size_entry_new")
-  (is-constructor-of "GimpSizeEntry")
-  (return-type "GtkWidget*")
-  (parameters
-    '("gint" "number_of_fields")
-    '("GimpUnit" "unit")
-    '("const-gchar*" "unit_format")
-    '("gboolean" "menu_show_pixels")
-    '("gboolean" "menu_show_percent")
-    '("gboolean" "show_refval")
-    '("gint" "spinbutton_width")
-    '("GimpSizeEntryUpdatePolicy" "update_policy")
-  )
-)
-
-(define-method add_field
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_add_field")
-  (return-type "none")
-  (parameters
-    '("GtkSpinButton*" "value_spinbutton")
-    '("GtkSpinButton*" "refval_spinbutton")
-  )
-)
-
-(define-method attach_label
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_attach_label")
-  (return-type "GtkWidget*")
-  (parameters
-    '("const-gchar*" "text")
-    '("gint" "row")
-    '("gint" "column")
-    '("gfloat" "alignment")
-  )
-)
-
-(define-method set_resolution
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_resolution")
-  (return-type "none")
-  (parameters
-    '("gint" "field")
-    '("gdouble" "resolution")
-    '("gboolean" "keep_size")
-  )
-)
-
-(define-method set_size
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_size")
-  (return-type "none")
-  (parameters
-    '("gint" "field")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-  )
-)
-
-(define-method set_value_boundaries
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_value_boundaries")
-  (return-type "none")
-  (parameters
-    '("gint" "field")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-  )
-)
-
-(define-method get_value
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_get_value")
-  (return-type "gdouble")
-  (parameters
-    '("gint" "field")
-  )
-)
-
-(define-method set_value
+(define-method set_pixel_digits
   (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_value")
+  (c-name "gimp_size_entry_set_pixel_digits")
   (return-type "none")
   (parameters
-    '("gint" "field")
-    '("gdouble" "value")
+    '("gint" "digits")
   )
 )
 
-(define-method set_refval_boundaries
+(define-method grab_focus
   (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_refval_boundaries")
+  (c-name "gimp_size_entry_grab_focus")
   (return-type "none")
-  (parameters
-    '("gint" "field")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-  )
 )
 
-(define-method set_refval_digits
+(define-method set_activates_default
   (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_refval_digits")
+  (c-name "gimp_size_entry_set_activates_default")
   (return-type "none")
   (parameters
-    '("gint" "field")
-    '("gint" "digits")
-  )
-)
-
-(define-method get_refval
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_get_refval")
-  (return-type "gdouble")
-  (parameters
-    '("gint" "field")
+    '("gboolean" "setting")
   )
 )
 
-(define-method set_refval
+(define-method get_help_widget
   (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_refval")
-  (return-type "none")
+  (c-name "gimp_size_entry_get_help_widget")
+  (return-type "GtkWidget*")
   (parameters
     '("gint" "field")
-    '("gdouble" "refval")
   )
 )
 
-(define-method get_unit
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_get_unit")
-  (return-type "GimpUnit")
-)
-
-(define-method set_unit
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_unit")
-  (return-type "none")
-  (parameters
-    '("GimpUnit" "unit")
-  )
-)
 
-(define-method show_unit_menu
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_show_unit_menu")
-  (return-type "none")
-  (parameters
-    '("gboolean" "show")
-  )
-)
 
-(define-method set_pixel_digits
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_pixel_digits")
-  (return-type "none")
-  (parameters
-    '("gint" "digits")
-  )
-)
+;; From gimpstringcombobox.h
 
-(define-method grab_focus
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_grab_focus")
-  (return-type "none")
+(define-function gimp_string_combo_box_get_type
+  (c-name "gimp_string_combo_box_get_type")
+  (return-type "GType")
 )
 
-(define-method set_activates_default
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_set_activates_default")
-  (return-type "none")
-  (parameters
-    '("gboolean" "setting")
+(define-function gimp_string_combo_box_new
+  (c-name "gimp_string_combo_box_new")
+  (is-constructor-of "GimpStringComboBox")
+  (return-type "GtkWidget*")
+  (properties
+    '("model")
+    '("id-column" (argname "id_column"))
+    '("label-column" (argname "label_column"))
   )
 )
 
-(define-method get_help_widget
-  (of-object "GimpSizeEntry")
-  (c-name "gimp_size_entry_get_help_widget")
-  (return-type "GtkWidget*")
+(define-method set_active
+  (of-object "GimpStringComboBox")
+  (c-name "gimp_string_combo_box_set_active")
+  (return-type "gboolean")
   (parameters
-    '("gint" "field")
+    '("const-gchar*" "id")
   )
 )
 
+(define-method get_active
+  (of-object "GimpStringComboBox")
+  (c-name "gimp_string_combo_box_get_active")
+  (return-type "gchar*")
+)
+
 
 
-;; From ../../libgimpwidgets/gimpunitmenu.h
+;; From gimpunitmenu.h
 
 (define-function gimp_unit_menu_get_type
   (c-name "gimp_unit_menu_get_type")
@@ -2847,448 +2650,237 @@
 
 
 
-;; From ../../libgimpwidgets/gimpwidgets.h
+;; From gimpzoommodel.h
 
-(define-function gimp_int_radio_group_new
-  (c-name "gimp_int_radio_group_new")
-  (is-constructor-of "GimpIntRadioGroup")
-  (return-type "GtkWidget*")
-  (parameters
-    '("gboolean" "in_frame")
-    '("const-gchar*" "frame_title")
-    '("GCallback" "radio_button_callback")
-    '("gpointer" "radio_button_callback_data")
-    '("gint" "initial")
-  )
-  (varargs #t)
+(define-function gimp_zoom_model_get_type
+  (c-name "gimp_zoom_model_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_zoom_model_new
+  (c-name "gimp_zoom_model_new")
+  (is-constructor-of "GimpZoomModel")
+  (return-type "GimpZoomModel*")
 )
 
-(define-function gimp_int_radio_group_set_active
-  (c-name "gimp_int_radio_group_set_active")
+(define-method set_range
+  (of-object "GimpZoomModel")
+  (c-name "gimp_zoom_model_set_range")
   (return-type "none")
   (parameters
-    '("GtkRadioButton*" "radio_button")
-    '("gint" "item_data")
+    '("gdouble" "min")
+    '("gdouble" "max")
   )
 )
 
-(define-function gimp_radio_group_new
-  (c-name "gimp_radio_group_new")
-  (is-constructor-of "GimpRadioGroup")
-  (return-type "GtkWidget*")
+(define-method zoom
+  (of-object "GimpZoomModel")
+  (c-name "gimp_zoom_model_zoom")
+  (return-type "none")
   (parameters
-    '("gboolean" "in_frame")
-    '("const-gchar*" "frame_title")
+    '("GimpZoomType" "zoom_type")
+    '("gdouble" "scale")
   )
-  (varargs #t)
 )
 
-(define-function gimp_radio_group_new2
-  (c-name "gimp_radio_group_new2")
-  (return-type "GtkWidget*")
-  (parameters
-    '("gboolean" "in_frame")
-    '("const-gchar*" "frame_title")
-    '("GCallback" "radio_button_callback")
-    '("gpointer" "radio_button_callback_data")
-    '("gpointer" "initial")
-  )
-  (varargs #t)
+(define-method get_factor
+  (of-object "GimpZoomModel")
+  (c-name "gimp_zoom_model_get_factor")
+  (return-type "gdouble")
 )
 
-(define-function gimp_radio_group_set_active
-  (c-name "gimp_radio_group_set_active")
+(define-method get_fraction
+  (of-object "GimpZoomModel")
+  (c-name "gimp_zoom_model_get_fraction")
   (return-type "none")
   (parameters
-    '("GtkRadioButton*" "radio_button")
-    '("gpointer" "item_data")
+    '("gint*" "numerator")
+    '("gint*" "denominator")
   )
 )
 
-(define-function gimp_spin_button_new
-  (c-name "gimp_spin_button_new")
-  (is-constructor-of "GimpSpinButton")
+(define-function gimp_zoom_button_new
+  (c-name "gimp_zoom_button_new")
+  (is-constructor-of "GimpZoomButton")
   (return-type "GtkWidget*")
   (parameters
-    '("GtkObject**" "adjustment")
-    '("gdouble" "value")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
-    '("gdouble" "page_size")
-    '("gdouble" "climb_rate")
-    '("guint" "digits")
+    '("GimpZoomModel*" "model")
+    '("GimpZoomType" "zoom_type")
+    '("GtkIconSize" "icon_size")
   )
 )
 
-(define-function gimp_scale_entry_new
-  (c-name "gimp_scale_entry_new")
-  (is-constructor-of "GimpScaleEntry")
-  (return-type "GtkObject*")
+(define-function gimp_zoom_model_zoom_step
+  (c-name "gimp_zoom_model_zoom_step")
+  (return-type "gdouble")
   (parameters
-    '("GtkTable*" "table")
-    '("gint" "column")
-    '("gint" "row")
-    '("const-gchar*" "text")
-    '("gint" "scale_width")
-    '("gint" "spinbutton_width")
-    '("gdouble" "value")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
-    '("guint" "digits")
-    '("gboolean" "constrain")
-    '("gdouble" "unconstrained_lower")
-    '("gdouble" "unconstrained_upper")
-    '("const-gchar*" "tooltip")
-    '("const-gchar*" "help_id")
+    '("GimpZoomType" "zoom_type")
+    '("gdouble" "scale")
   )
 )
 
-(define-function gimp_color_scale_entry_new
-  (c-name "gimp_color_scale_entry_new")
-  (is-constructor-of "GimpColorScaleEntry")
-  (return-type "GtkObject*")
-  (parameters
-    '("GtkTable*" "table")
-    '("gint" "column")
-    '("gint" "row")
-    '("const-gchar*" "text")
-    '("gint" "scale_width")
-    '("gint" "spinbutton_width")
-    '("gdouble" "value")
-    '("gdouble" "lower")
-    '("gdouble" "upper")
-    '("gdouble" "step_increment")
-    '("gdouble" "page_increment")
-    '("guint" "digits")
-    '("const-gchar*" "tooltip")
-    '("const-gchar*" "help_id")
-  )
-)
 
-(define-function gimp_scale_entry_set_sensitive
-  (c-name "gimp_scale_entry_set_sensitive")
-  (return-type "none")
-  (parameters
-    '("GtkObject*" "adjustment")
-    '("gboolean" "sensitive")
-  )
-)
 
-(define-function gimp_scale_entry_set_logarithmic
-  (c-name "gimp_scale_entry_set_logarithmic")
-  (return-type "none")
-  (parameters
-    '("GtkObject*" "adjustment")
-    '("gboolean" "logarithmic")
-  )
-)
+;; From gimpaspectpreview.h
 
-(define-function gimp_scale_entry_get_logarithmic
-  (c-name "gimp_scale_entry_get_logarithmic")
-  (return-type "gboolean")
-  (parameters
-    '("GtkObject*" "adjustment")
-  )
+(define-function gimp_aspect_preview_get_type
+  (c-name "gimp_aspect_preview_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_random_seed_new
-  (c-name "gimp_random_seed_new")
-  (is-constructor-of "GimpRandomSeed")
+(define-function gimp_aspect_preview_new
+  (c-name "gimp_aspect_preview_new")
+  (is-constructor-of "GimpAspectPreview")
   (return-type "GtkWidget*")
-  (parameters
-    '("guint32*" "seed")
-    '("gboolean*" "random_seed")
+  (properties
+    '("drawable")
+    '("update" (optional))
   )
 )
 
-(define-function gimp_coordinates_new
-  (c-name "gimp_coordinates_new")
-  (is-constructor-of "GimpCoordinates")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GimpUnit" "unit")
-    '("const-gchar*" "unit_format")
-    '("gboolean" "menu_show_pixels")
-    '("gboolean" "menu_show_percent")
-    '("gint" "spinbutton_width")
-    '("GimpSizeEntryUpdatePolicy" "update_policy")
-    '("gboolean" "chainbutton_active")
-    '("gboolean" "chain_constrains_ratio")
-    '("const-gchar*" "xlabel")
-    '("gdouble" "x")
-    '("gdouble" "xres")
-    '("gdouble" "lower_boundary_x")
-    '("gdouble" "upper_boundary_x")
-    '("gdouble" "xsize_0")
-    '("gdouble" "xsize_100")
-    '("const-gchar*" "ylabel")
-    '("gdouble" "y")
-    '("gdouble" "yres")
-    '("gdouble" "lower_boundary_y")
-    '("gdouble" "upper_boundary_y")
-    '("gdouble" "ysize_0")
-  )
-)
 
-(define-function gimp_toggle_button_sensitive_update
-  (c-name "gimp_toggle_button_sensitive_update")
-  (return-type "none")
-  (parameters
-    '("GtkToggleButton*" "toggle_button")
-  )
-)
 
-(define-function gimp_toggle_button_update
-  (c-name "gimp_toggle_button_update")
-  (return-type "none")
-  (parameters
-    '("GtkWidget*" "widget")
-    '("gpointer" "data")
-  )
-)
+;; From gimpdrawablepreview.h
 
-(define-function gimp_radio_button_update
-  (c-name "gimp_radio_button_update")
-  (return-type "none")
-  (parameters
-    '("GtkWidget*" "widget")
-    '("gpointer" "data")
-  )
+(define-function gimp_drawable_preview_get_type
+  (c-name "gimp_drawable_preview_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_int_adjustment_update
-  (c-name "gimp_int_adjustment_update")
-  (return-type "none")
-  (parameters
-    '("GtkAdjustment*" "adjustment")
-    '("gpointer" "data")
+(define-function gimp_drawable_preview_new
+  (c-name "gimp_drawable_preview_new")
+  (is-constructor-of "GimpDrawablePreview")
+  (return-type "GtkWidget*")
+  (properties
+    '("drawable")
   )
 )
 
-(define-function gimp_uint_adjustment_update
-  (c-name "gimp_uint_adjustment_update")
-  (return-type "none")
-  (parameters
-    '("GtkAdjustment*" "adjustment")
-    '("gpointer" "data")
-  )
+(define-method get_drawable
+  (of-object "GimpDrawablePreview")
+  (c-name "gimp_drawable_preview_get_drawable")
+  (return-type "GimpDrawable*")
 )
 
-(define-function gimp_float_adjustment_update
-  (c-name "gimp_float_adjustment_update")
+(define-method draw_region
+  (of-object "GimpDrawablePreview")
+  (c-name "gimp_drawable_preview_draw_region")
   (return-type "none")
   (parameters
-    '("GtkAdjustment*" "adjustment")
-    '("gpointer" "data")
+    '("const-GimpPixelRgn*" "region")
   )
 )
 
-(define-function gimp_double_adjustment_update
-  (c-name "gimp_double_adjustment_update")
-  (return-type "none")
-  (parameters
-    '("GtkAdjustment*" "adjustment")
-    '("gpointer" "data")
-  )
-)
 
-(define-function gimp_unit_menu_update
-  (c-name "gimp_unit_menu_update")
-  (return-type "none")
-  (parameters
-    '("GtkWidget*" "widget")
-    '("gpointer" "data")
-  )
-)
 
-(define-function gimp_table_attach_aligned
-  (c-name "gimp_table_attach_aligned")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GtkTable*" "table")
-    '("gint" "column")
-    '("gint" "row")
-    '("const-gchar*" "label_text")
-    '("gfloat" "xalign")
-    '("gfloat" "yalign")
-    '("GtkWidget*" "widget")
-    '("gint" "colspan")
-    '("gboolean" "left_align")
-  )
+;; From gimpimagecombobox.h
+
+(define-function gimp_image_combo_box_get_type
+  (c-name "gimp_image_combo_box_get_type")
+  (return-type "GType")
 )
 
-(define-function gimp_label_set_attributes
-  (c-name "gimp_label_set_attributes")
-  (return-type "none")
+(define-function gimp_image_combo_box_new
+  (c-name "gimp_image_combo_box_new")
+  (is-constructor-of "GimpImageComboBox")
+  (return-type "GtkWidget*")
   (parameters
-    '("GtkLabel*" "label")
+    '("GimpImageConstraintFunc" "constraint")
+    '("gpointer" "data")
   )
-  (varargs #t)
-)
-
-
-
-;; From ../../libgimpwidgets/gimpwidgetsenums.h
-
-(define-function gimp_chain_position_get_type
-  (c-name "gimp_chain_position_get_type")
-  (return-type "GType")
 )
 
-(define-function gimp_color_area_type_get_type
-  (c-name "gimp_color_area_type_get_type")
-  (return-type "GType")
-)
 
-(define-function gimp_color_selector_channel_get_type
-  (c-name "gimp_color_selector_channel_get_type")
-  (return-type "GType")
-)
 
-(define-function gimp_page_selector_target_get_type
-  (c-name "gimp_page_selector_target_get_type")
-  (return-type "GType")
-)
+;; From gimpitemcombobox.h
 
-(define-function gimp_size_entry_update_policy_get_type
-  (c-name "gimp_size_entry_update_policy_get_type")
+(define-function gimp_drawable_combo_box_get_type
+  (c-name "gimp_drawable_combo_box_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_zoom_type_get_type
-  (c-name "gimp_zoom_type_get_type")
+(define-function gimp_channel_combo_box_get_type
+  (c-name "gimp_channel_combo_box_get_type")
   (return-type "GType")
 )
 
-
-
-;; From ../../libgimpwidgets/gimpzoommodel.h
-
-(define-function gimp_zoom_model_get_type
-  (c-name "gimp_zoom_model_get_type")
+(define-function gimp_layer_combo_box_get_type
+  (c-name "gimp_layer_combo_box_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_zoom_model_new
-  (c-name "gimp_zoom_model_new")
-  (is-constructor-of "GimpZoomModel")
-  (return-type "GimpZoomModel*")
-)
-
-(define-method set_range
-  (of-object "GimpZoomModel")
-  (c-name "gimp_zoom_model_set_range")
-  (return-type "none")
-  (parameters
-    '("gdouble" "min")
-    '("gdouble" "max")
-  )
-)
-
-(define-method zoom
-  (of-object "GimpZoomModel")
-  (c-name "gimp_zoom_model_zoom")
-  (return-type "none")
-  (parameters
-    '("GimpZoomType" "zoom_type")
-    '("gdouble" "scale")
-  )
-)
-
-(define-method get_factor
-  (of-object "GimpZoomModel")
-  (c-name "gimp_zoom_model_get_factor")
-  (return-type "gdouble")
-)
-
-(define-method get_fraction
-  (of-object "GimpZoomModel")
-  (c-name "gimp_zoom_model_get_fraction")
-  (return-type "none")
-  (parameters
-    '("gint*" "numerator")
-    '("gint*" "denominator")
-  )
-)
-
-(define-function gimp_zoom_button_new
-  (c-name "gimp_zoom_button_new")
-  (is-constructor-of "GimpZoomButton")
+(define-function gimp_vectors_combo_box_get_type
+  (c-name "gimp_vectors_combo_box_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_drawable_combo_box_new
+  (c-name "gimp_drawable_combo_box_new")
+  (is-constructor-of "GimpDrawableComboBox")
   (return-type "GtkWidget*")
   (parameters
-    '("GimpZoomModel*" "model")
-    '("GimpZoomType" "zoom_type")
-    '("GtkIconSize" "icon_size")
+    '("GimpDrawableConstraintFunc" "constraint")
+    '("gpointer" "data")
   )
 )
 
-(define-function gimp_zoom_model_zoom_step
-  (c-name "gimp_zoom_model_zoom_step")
-  (return-type "gdouble")
+(define-function gimp_channel_combo_box_new
+  (c-name "gimp_channel_combo_box_new")
+  (is-constructor-of "GimpChannelComboBox")
+  (return-type "GtkWidget*")
   (parameters
-    '("GimpZoomType" "zoom_type")
-    '("gdouble" "scale")
+    '("GimpDrawableConstraintFunc" "constraint")
+    '("gpointer" "data")
   )
 )
 
-
-
-;; From ../../libgimp/gimpaspectpreview.h
-
-(define-function gimp_aspect_preview_get_type
-  (c-name "gimp_aspect_preview_get_type")
-  (return-type "GType")
+(define-function gimp_layer_combo_box_new
+  (c-name "gimp_layer_combo_box_new")
+  (is-constructor-of "GimpLayerComboBox")
+  (return-type "GtkWidget*")
+  (parameters
+    '("GimpDrawableConstraintFunc" "constraint")
+    '("gpointer" "data")
+  )
 )
 
-(define-function gimp_aspect_preview_new
-  (c-name "gimp_aspect_preview_new")
-  (is-constructor-of "GimpAspectPreview")
+(define-function gimp_vectors_combo_box_new
+  (c-name "gimp_vectors_combo_box_new")
+  (is-constructor-of "GimpVectorsComboBox")
   (return-type "GtkWidget*")
-  (properties
-    '("drawable")
+  (parameters
+    '("GimpVectorsConstraintFunc" "constraint")
+    '("gpointer" "data")
   )
 )
 
 
 
-;; From ../../libgimp/gimpdrawablepreview.h
-
-(define-function gimp_drawable_preview_get_type
-  (c-name "gimp_drawable_preview_get_type")
-  (return-type "GType")
-)
+;; From gimppatternselect.h
 
-(define-function gimp_drawable_preview_new
-  (c-name "gimp_drawable_preview_new")
-  (is-constructor-of "GimpDrawablePreview")
-  (return-type "GtkWidget*")
-  (properties
-    '("drawable")
+(define-function gimp_pattern_select_new
+  (c-name "gimp_pattern_select_new")
+  (is-constructor-of "GimpPatternSelect")
+  (return-type "const-gchar*")
+  (parameters
+    '("const-gchar*" "title")
+    '("const-gchar*" "pattern_name")
+    '("GimpRunPatternCallback" "callback")
+    '("gpointer" "data")
   )
 )
 
-(define-method get_drawable
-  (of-object "GimpDrawablePreview")
-  (c-name "gimp_drawable_preview_get_drawable")
-  (return-type "GimpDrawable*")
-)
-
-(define-method draw_region
-  (of-object "GimpDrawablePreview")
-  (c-name "gimp_drawable_preview_draw_region")
+(define-function gimp_pattern_select_destroy
+  (c-name "gimp_pattern_select_destroy")
   (return-type "none")
   (parameters
-    '("const-GimpPixelRgn*" "region")
+    '("const-gchar*" "pattern_callback")
   )
 )
 
 
 
-;; From ../../libgimp/gimpprocbrowserdialog.h
+;; From gimpprocbrowserdialog.h
 
 (define-function gimp_proc_browser_dialog_get_type
   (c-name "gimp_proc_browser_dialog_get_type")
@@ -3316,7 +2908,7 @@
 
 
 
-;; From ../../libgimp/gimpprocview.h
+;; From gimpprocview.h
 
 (define-function gimp_proc_view_new
   (c-name "gimp_proc_view_new")
@@ -3340,105 +2932,70 @@
 
 
 
-;; From ../../libgimp/gimpprogressbar.h
+;; From gimpzoompreview.h
 
-(define-function gimp_progress_bar_get_type
-  (c-name "gimp_progress_bar_get_type")
+(define-function gimp_zoom_preview_get_type
+  (c-name "gimp_zoom_preview_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_progress_bar_new
-  (c-name "gimp_progress_bar_new")
-  (is-constructor-of "GimpProgressBar")
+(define-function gimp_zoom_preview_new_with_model
+  (c-name "gimp_zoom_preview_new_with_model")
+  (is-constructor-of "GimpZoomPreview")
   (return-type "GtkWidget*")
+  (properties
+    '("drawable")
+    '("model" (optional))
+  )
 )
 
-
-
-;; From ../../libgimp/gimpdrawablecombobox.h
-
-(define-function gimp_drawable_combo_box_get_type
-  (c-name "gimp_drawable_combo_box_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_channel_combo_box_get_type
-  (c-name "gimp_channel_combo_box_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_layer_combo_box_get_type
-  (c-name "gimp_layer_combo_box_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_vectors_combo_box_get_type
-  (c-name "gimp_vectors_combo_box_get_type")
-  (return-type "GType")
-)
-
-(define-function gimp_drawable_combo_box_new
-  (c-name "gimp_drawable_combo_box_new")
-  (is-constructor-of "GimpDrawableComboBox")
-  (return-type "GtkWidget*")
+(define-method get_source
+  (of-object "GimpZoomPreview")
+  (c-name "gimp_zoom_preview_get_source")
+  (return-type "guchar*")
   (parameters
-    '("GimpDrawableConstraintFunc" "constraint")
-    '("gpointer" "data")
+    '("gint*" "width")
+    '("gint*" "height")
+    '("gint*" "bpp")
   )
 )
 
-(define-function gimp_channel_combo_box_new
-  (c-name "gimp_channel_combo_box_new")
-  (is-constructor-of "GimpChannelComboBox")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GimpDrawableConstraintFunc" "constraint")
-    '("gpointer" "data")
-  )
+(define-method get_drawable
+  (of-object "GimpZoomPreview")
+  (c-name "gimp_zoom_preview_get_drawable")
+  (return-type "GimpDrawable*")
 )
 
-(define-function gimp_layer_combo_box_new
-  (c-name "gimp_layer_combo_box_new")
-  (is-constructor-of "GimpLayerComboBox")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GimpDrawableConstraintFunc" "constraint")
-    '("gpointer" "data")
-  )
+(define-method get_model
+  (of-object "GimpZoomPreview")
+  (c-name "gimp_zoom_preview_get_model")
+  (return-type "GimpZoomModel*")
 )
 
-(define-function gimp_vectors_combo_box_new
-  (c-name "gimp_vectors_combo_box_new")
-  (is-constructor-of "GimpVectorsComboBox")
-  (return-type "GtkWidget*")
-  (parameters
-    '("GimpVectorsConstraintFunc" "constraint")
-    '("gpointer" "data")
-  )
+(define-method get_factor
+  (of-object "GimpZoomPreview")
+  (c-name "gimp_zoom_preview_get_factor")
+  (return-type "gdouble")
 )
 
 
 
-;; From ../../libgimp/gimpimagecombobox.h
+;; From gimpprogressbar.h
 
-(define-function gimp_image_combo_box_get_type
-  (c-name "gimp_image_combo_box_get_type")
+(define-function gimp_progress_bar_get_type
+  (c-name "gimp_progress_bar_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_image_combo_box_new
-  (c-name "gimp_image_combo_box_new")
-  (is-constructor-of "GimpImageComboBox")
+(define-function gimp_progress_bar_new
+  (c-name "gimp_progress_bar_new")
+  (is-constructor-of "GimpProgressBar")
   (return-type "GtkWidget*")
-  (parameters
-    '("GimpImageConstraintFunc" "constraint")
-    '("gpointer" "data")
-  )
 )
 
 
 
-;; From ../../libgimp/gimpbrushselectbutton.h
+;; From gimpbrushselectbutton.h
 
 (define-function gimp_brush_select_button_get_type
   (c-name "gimp_brush_select_button_get_type")
@@ -3450,7 +3007,7 @@
   (is-constructor-of "GimpBrushSelectButton")
   (return-type "GtkWidget*")
   (properties
-    '("title" (argname "title") (optional))
+    '("title" (optional))
     '("brush-name" (argname "brush_name") (optional))
     '("brush-opacity" (argname "opacity") (optional))
     '("brush-spacing" (argname "spacing") (optional))
@@ -3483,7 +3040,7 @@
 
 
 
-;; From ../../libgimp/gimpfontselectbutton.h
+;; From gimpfontselectbutton.h
 
 (define-function gimp_font_select_button_get_type
   (c-name "gimp_font_select_button_get_type")
@@ -3495,7 +3052,7 @@
   (is-constructor-of "GimpFontSelectButton")
   (return-type "GtkWidget*")
   (properties
-    '("title" (argname "title") (optional))
+    '("title" (optional))
     '("font-name" (argname "font_name") (optional))
   )
 )
@@ -3517,7 +3074,7 @@
 
 
 
-;; From ../../libgimp/gimpgradientselectbutton.h
+;; From gimpgradientselectbutton.h
 
 (define-function gimp_gradient_select_button_get_type
   (c-name "gimp_gradient_select_button_get_type")
@@ -3529,7 +3086,7 @@
   (is-constructor-of "GimpGradientSelectButton")
   (return-type "GtkWidget*")
   (properties
-    '("title" (argname "title") (optional))
+    '("title" (optional))
     '("gradient-name" (argname "gradient_name") (optional))
   )
 )
@@ -3551,7 +3108,7 @@
 
 
 
-;; From ../../libgimp/gimppaletteselectbutton.h
+;; From gimppaletteselectbutton.h
 
 (define-function gimp_palette_select_button_get_type
   (c-name "gimp_palette_select_button_get_type")
@@ -3563,7 +3120,7 @@
   (is-constructor-of "GimpPaletteSelectButton")
   (return-type "GtkWidget*")
   (properties
-    '("title" (argname "title") (optional))
+    '("title")
     '("palette-name" (argname "palette_name") (optional))
   )
 )
@@ -3585,7 +3142,7 @@
 
 
 
-;; From ../../libgimp/gimppatternselectbutton.h
+;; From gimppatternselectbutton.h
 
 (define-function gimp_pattern_select_button_get_type
   (c-name "gimp_pattern_select_button_get_type")
@@ -3597,7 +3154,7 @@
   (is-constructor-of "GimpPatternSelectButton")
   (return-type "GtkWidget*")
   (properties
-    '("title" (argname "title") (optional))
+    '("title" (optional))
     '("pattern-name" (argname "pattern_name") (optional))
   )
 )
@@ -3619,7 +3176,7 @@
 
 
 
-;; From ../../libgimp/gimpselectbutton.h
+;; From gimpselectbutton.h
 
 (define-function gimp_select_button_get_type
   (c-name "gimp_select_button_get_type")
@@ -3634,53 +3191,114 @@
 
 
 
-;; From ../../libgimp/gimpui.h
+;; From gimpwidgetsenums.h
 
-(define-method set_transient
-  (of-object "GimpDialog")
-  (c-name "gimp_window_set_transient")
-  (return-type "none")
+(define-function gimp_aspect_type_get_type
+  (c-name "gimp_aspect_type_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_chain_position_get_type
+  (c-name "gimp_chain_position_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_color_area_type_get_type
+  (c-name "gimp_color_area_type_get_type")
+  (return-type "GType")
 )
 
+(define-function gimp_color_selector_channel_get_type
+  (c-name "gimp_color_selector_channel_get_type")
+  (return-type "GType")
+)
 
+(define-function gimp_page_selector_target_get_type
+  (c-name "gimp_page_selector_target_get_type")
+  (return-type "GType")
+)
 
-;; From ../../libgimp/gimpzoompreview.h
+(define-function gimp_size_entry_update_policy_get_type
+  (c-name "gimp_size_entry_update_policy_get_type")
+  (return-type "GType")
+)
 
-(define-function gimp_zoom_preview_get_type
-  (c-name "gimp_zoom_preview_get_type")
+(define-function gimp_zoom_type_get_type
+  (c-name "gimp_zoom_type_get_type")
   (return-type "GType")
 )
 
-(define-function gimp_zoom_preview_new
-  (c-name "gimp_zoom_preview_new")
-  (is-constructor-of "GimpZoomPreview")
+
+
+;; From gimpruler.h
+
+(define-function gimp_ruler_get_type
+  (c-name "gimp_ruler_get_type")
+  (return-type "GType")
+)
+
+(define-function gimp_ruler_new
+  (c-name "gimp_ruler_new")
+  (is-constructor-of "GimpRuler")
   (return-type "GtkWidget*")
   (properties
-    '("drawable")
+    '("orientation")
+    '("lower" (optional))
+    '("upper" (optional))
+    '("max-size" (argname "max_size") (optional))
   )
 )
 
-(define-method get_source
-  (of-object "GimpZoomPreview")
-  (c-name "gimp_zoom_preview_get_source")
-  (return-type "guchar*")
+(define-method set_unit
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_set_unit")
+  (return-type "none")
   (parameters
-    '("gint*" "width")
-    '("gint*" "height")
-    '("gint*" "bpp")
+    '("GimpUnit" "unit")
   )
 )
 
-(define-method get_drawable
-  (of-object "GimpZoomPreview")
-  (c-name "gimp_zoom_preview_get_drawable")
-  (return-type "GimpDrawable*")
+(define-method get_unit
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_get_unit")
+  (return-type "GimpUnit")
 )
 
-(define-method get_factor
-  (of-object "GimpZoomPreview")
-  (c-name "gimp_zoom_preview_get_factor")
+(define-method set_position
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_set_position")
+  (return-type "none")
+  (parameters
+    '("gdouble" "position")
+  )
+)
+
+(define-method get_position
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_get_position")
   (return-type "gdouble")
 )
 
+(define-method set_range
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_set_range")
+  (return-type "none")
+  (parameters
+    '("gdouble" "lower")
+    '("gdouble" "upper")
+    '("gdouble" "max_size")
+  )
+)
+
+(define-method get_range
+  (of-object "GimpRuler")
+  (c-name "gimp_ruler_get_range")
+  (return-type "none")
+  (parameters
+    '("gdouble*" "lower")
+    '("gdouble*" "upper")
+    '("gdouble*" "max_size")
+  )
+)
+
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpui.override
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpui.override	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpui.override	Sun Oct 12 15:38:02 2008
@@ -1,4 +1,3 @@
-%%
 headers
 #include <Python.h>
 
@@ -18,6 +17,17 @@
     PyObject *constraint;
     PyObject *user_data;
 } PyGimpConstraintData;
+
+typedef struct {
+    PyObject *sensitivity_func;
+    PyObject *user_data;
+} PyGimpIntSensitivityData;
+
+static void
+pygimp_decref_callback(PyObject* obj) {
+    Py_XDECREF (obj);
+}
+
 %%
 modulename gimpui
 %%
@@ -48,15 +58,23 @@
 import gtk.TreeModel as PyGtkTreeModel_Type
 import gtk.CellRenderer as PyGtkCellRenderer_Type
 import gtk.CellRendererToggle as PyGtkCellRendererToggle_Type
+import gimp.Parasite as PyGimpParasite_Type
 %%
 ignore
   gimp_dialog_add_buttons
+  gimp_int_combo_box_connect
+  gimp_color_profile_combo_box_new
+  gimp_enum_store_new_with_values
+  gimp_int_combo_box_new_array
 %%
 ignore-glob
   *_get_type
   *_valist
   gimp_resolution_*
 %%
+ignore-type
+  GimpIntStoreColumns 
+%%
 override gimp_drawable_combo_box_new kwargs
 static gboolean
 pygimp_drawable_constraint_marshal(gint32 image_id, gint32 drawable_id,
@@ -150,7 +168,8 @@
 %%
 define GimpDrawableComboBox.set_active_drawable kwargs
 static PyObject *
-_wrap_gimp_drawable_combo_box_set_active_drawable(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_drawable_combo_box_set_active_drawable(PyGObject *self, PyObject *args,
+                                                  PyObject *kwargs)
 {
     PyGimpDrawable *drw;
 
@@ -279,16 +298,17 @@
 %%
 define GimpChannelComboBox.set_active_channel kwargs
 static PyObject *
-_wrap_gimp_channel_combo_box_set_active_channel(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_channel_combo_box_set_active_channel(PyGObject *self, PyObject *args,
+                                                PyObject *kwargs)
 {
     PyGimpChannel *chn;
 
     static char *kwlist[] = { "channel", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
-                                     "O!:GimpChannelComboBox.set_active_channel",
-                                     kwlist,
-                                     PyGimpChannel_Type, &chn))
+                                    "O!:GimpChannelComboBox.set_active_channel",
+                                    kwlist,
+                                    PyGimpChannel_Type, &chn))
         return NULL;
 
     if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), chn->ID)) {
@@ -408,7 +428,8 @@
 %%
 define GimpLayerComboBox.set_active_layer kwargs
 static PyObject *
-_wrap_gimp_layer_combo_box_set_active_layer(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_layer_combo_box_set_active_layer(PyGObject *self, PyObject *args,
+                                            PyObject *kwargs)
 {
     PyGimpLayer *lay;
 
@@ -537,16 +558,17 @@
 %%
 define GimpVectorsComboBox.set_active_vectors kwargs
 static PyObject *
-_wrap_gimp_vectors_combo_box_set_active_vectors(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_vectors_combo_box_set_active_vectors(PyGObject *self, PyObject *args,
+                                                PyObject *kwargs)
 {
     PyGimpVectors *vect;
 
     static char *kwlist[] = { "vectors", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
-                                     "O!:GimpVectorsComboBox.set_active_vectors",
-                                     kwlist,
-                                     PyGimpVectors_Type, &vect))
+                                   "O!:GimpVectorsComboBox.set_active_vectors",
+                                   kwlist,
+                                   PyGimpVectors_Type, &vect))
         return NULL;
 
     if (!gimp_int_combo_box_set_active(GIMP_INT_COMBO_BOX(self->obj), vect->ID)) {
@@ -657,7 +679,8 @@
 %%
 define GimpImageComboBox.set_active_image kwargs
 static PyObject *
-_wrap_gimp_image_combo_box_set_active_image(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_image_combo_box_set_active_image(PyGObject *self, PyObject *args,
+                                            PyObject *kwargs)
 {
     PyGimpImage *img;
 
@@ -770,27 +793,6 @@
     if (pyg_flags_get_value(GTK_TYPE_DIALOG_FLAGS, py_flags, (gint *)&flags))
         return -1;
 
-    if (help_func) {
-        if (help_func != Py_None) {
-            if (!PyCallable_Check(help_func)) {
-                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
-                return -1;
-            }
-
-            func = pygimp_help_func_marshal;
-
-            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
-
-            Py_INCREF(help_func);
-            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
-                                   help_func, pygimp_help_func_destroy);
-        } else {
-            func = gimp_standard_help_func;
-        }
-    } else {
-        func = gimp_standard_help_func;
-    }
-
     if (py_buttons == Py_None)
         len = 0;
     else if (PyTuple_Check(py_buttons))
@@ -806,6 +808,22 @@
         return -1;
     }
 
+    if (help_func) {
+        if (help_func != Py_None) {
+            if (!PyCallable_Check(help_func)) {
+                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
+                return -1;
+            }
+
+            func = pygimp_help_func_marshal;
+
+       } else {
+            func = gimp_standard_help_func;
+        }
+    } else {
+        func = gimp_standard_help_func;
+    }
+
     pygobject_construct(self,
                         "title",     title,
                         "role",      role,
@@ -820,7 +838,7 @@
         return -1;
     }
 
-    if (parent) {
+   if (parent) {
         if (GTK_IS_WINDOW(parent))
             gtk_window_set_transient_for(GTK_WINDOW(self->obj),
                                          GTK_WINDOW(parent));
@@ -858,6 +876,14 @@
                                PyInt_AsLong(id));
     }
 
+    if (help_func && help_func != Py_None) {
+        g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
+
+        Py_INCREF(help_func);
+        g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
+                               help_func, pygimp_help_func_destroy);
+    }
+
     return 0;
 }
 %%
@@ -932,7 +958,8 @@
 
     if (py_type == NULL || (PyObject*)py_type == Py_None)
        type = GIMP_COLOR_AREA_FLAT;
-    else if (pyg_enum_get_value(GIMP_TYPE_COLOR_AREA_TYPE, py_type, (gint*)&type))
+    else if (pyg_enum_get_value(GIMP_TYPE_COLOR_AREA_TYPE, py_type,
+                                (gint*)&type))
        return -1;
 
     if (pygobject_construct(self,
@@ -1082,7 +1109,9 @@
         }
 
         gimp_int_combo_box_append(GIMP_INT_COMBO_BOX(self->obj),
+                                  GIMP_INT_STORE_LABEL,
                                   PyString_AsString(label),
+                                  GIMP_INT_STORE_VALUE,
                                   PyInt_AsLong(value),
                                   -1);
     }
@@ -1092,6 +1121,89 @@
 %%
 new-constructor GIMP_TYPE_INT_COMBO_BOX
 %%
+override gimp_int_combo_box_set_sensitivity kwargs
+static gboolean
+pygimp_int_combo_box_sensitivity_marshal(gint value, gpointer user_data)
+{
+    PyObject *py_value;
+    PyGimpIntSensitivityData *data;
+    PyObject *ret;
+    gboolean res;
+
+    data = user_data;
+
+    py_value = PyInt_FromLong(value);
+
+    ret = PyObject_CallFunctionObjArgs(data->sensitivity_func, py_value,
+                                       data->user_data, NULL);
+    
+    if (!ret) {
+        PyErr_Print();
+        res = FALSE;
+    } else {
+        res = PyObject_IsTrue(ret);
+        Py_DECREF(ret);
+    }
+
+    Py_DECREF(py_value);
+
+    return res;
+}
+
+static void
+pygimp_int_combo_box_sensitivity_data_destroy(gpointer user_data)
+{
+    PyGimpIntSensitivityData *data;
+    data = user_data;
+
+    Py_DECREF(data->sensitivity_func);
+    Py_XDECREF(data->user_data);
+
+    g_free(data);
+}
+
+static PyObject *
+_wrap_gimp_int_combo_box_set_sensitivity(PyGObject *self, PyObject *args,
+                                         PyObject *kwargs)
+{
+    PyObject *py_sensitivity_func;
+    PyObject *py_user_data = NULL;
+    PyGimpIntSensitivityData *data;
+
+    static char *kwlist[] = { "sensitivity_func", "user_data", NULL };
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
+                                     "O|O:GimpIntComboBox.set_sensitivity",
+                                     kwlist, &py_sensitivity_func,
+                                     &py_user_data))
+        return NULL;
+
+    if (!PyCallable_Check(py_sensitivity_func)) {
+        PyErr_SetString(PyExc_TypeError, "first argument must be callable.");
+        return NULL;
+    }
+
+    data = g_new(PyGimpIntSensitivityData, 1);
+
+    data->sensitivity_func = py_sensitivity_func;
+    Py_INCREF(data->sensitivity_func);
+    
+   if (py_user_data == NULL || py_user_data == Py_None)
+        data->user_data = NULL;
+    else {
+       data->user_data = py_user_data;
+       Py_INCREF(data->user_data);
+    }
+
+    gimp_int_combo_box_set_sensitivity(GIMP_INT_COMBO_BOX(self->obj),
+                                pygimp_int_combo_box_sensitivity_marshal,
+                                data,
+                                pygimp_int_combo_box_sensitivity_data_destroy);
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
 override gimp_int_combo_box_get_active noargs
 static PyObject *
 _wrap_gimp_int_combo_box_get_active(PyGObject *self)
@@ -1107,7 +1219,8 @@
 %%
 override gimp_int_combo_box_set_active kwargs
 static PyObject *
-_wrap_gimp_int_combo_box_set_active(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_int_combo_box_set_active(PyGObject *self, PyObject *args,
+                                    PyObject *kwargs)
 {
     int value;
 
@@ -1129,58 +1242,155 @@
     return Py_None;
 }
 %%
-override gimp_browser_add_search_types kwargs
+override gimp_int_combo_box_append kwargs
 static PyObject *
-_wrap_gimp_browser_add_search_types(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_int_combo_box_append(PyGObject *self, PyObject *args,
+                                PyObject *kwargs)
 {
-    PyObject *py_types = NULL;
-    int len, i;
+    PyObject *py_items;
+    int i, len;
 
-    static char *kwlist[] = { "search_types", NULL };
+    static char *kwlist[] = { "items", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                     "O:GimpBrowser.add_search_types",
+                                     "O:gimpui.IntComboBox.append",
                                      kwlist,
-                                     &py_types))
+                                     &py_items))
+        return NULL; 
+
+    if (py_items == NULL || py_items == Py_None)
+        len = 0;
+    else if (PyTuple_Check(py_items))
+        len = PyTuple_Size(py_items);
+    else {
+        PyErr_SetString(PyExc_TypeError,
+                        "items must be a tuple containing label/value pairs "
+                        "or None");
         return NULL;
+    }
+
+    if (len % 2) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "items tuple must contain label/value pairs");
+        return NULL;
+    }
 
-    if (PyTuple_Check(py_types))
-        len = PyTuple_Size(py_types);
+    for (i = 0; i < len; i += 2) {
+        PyObject *label = PyTuple_GetItem(py_items, i);
+        PyObject *value = PyTuple_GetItem(py_items, i + 1);
+
+        if (!PyString_Check(label)) {
+            PyErr_SetString(PyExc_RuntimeError,
+                            "first member of each label/value pair "
+                            "must be a string");
+            return NULL;
+        }
+
+        if (!PyInt_Check(value)) {
+            PyErr_SetString(PyExc_RuntimeError,
+                            "second member of each label/value pair "
+                            "must be a number");
+            return NULL;
+        }
+
+        gimp_int_combo_box_append(GIMP_INT_COMBO_BOX(self->obj),
+                                  GIMP_INT_STORE_LABEL,
+                                  PyString_AsString(label),
+                                  GIMP_INT_STORE_VALUE,
+                                  PyInt_AsLong(value),
+                                  -1);
+    }
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_int_combo_box_prepend kwargs
+static PyObject *
+_wrap_gimp_int_combo_box_prepend(PyGObject *self, PyObject *args,
+                                 PyObject *kwargs)
+{
+    PyObject *py_items;
+    int i, len;
+
+    static char *kwlist[] = { "items", NULL };
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O:gimpui.IntComboBox.prepend",
+                                     kwlist,
+                                     &py_items))
+        return NULL; 
+
+    if (py_items == NULL || py_items == Py_None)
+        len = 0;
+    else if (PyTuple_Check(py_items))
+        len = PyTuple_Size(py_items);
     else {
         PyErr_SetString(PyExc_TypeError,
-                        "search_types must be a tuple containing label/id "
-                        "pairs");
+                        "items must be a tuple containing label/value pairs "
+                        "or None");
         return NULL;
     }
 
     if (len % 2) {
         PyErr_SetString(PyExc_RuntimeError,
-                        "search_types tuple must contain label/id pairs");
+                        "items tuple must contain label/value pairs");
         return NULL;
     }
 
     for (i = 0; i < len; i += 2) {
-        PyObject *label = PyTuple_GetItem(py_types, i);
-        PyObject *id = PyTuple_GetItem(py_types, i + 1);
+        PyObject *label = PyTuple_GetItem(py_items, i);
+        PyObject *value = PyTuple_GetItem(py_items, i + 1);
 
         if (!PyString_Check(label)) {
             PyErr_SetString(PyExc_RuntimeError,
-                            "first member of each label/id pair "
+                            "first member of each label/value pair "
                             "must be a string");
             return NULL;
         }
 
-        if (!PyInt_Check(id)) {
+        if (!PyInt_Check(value)) {
             PyErr_SetString(PyExc_RuntimeError,
-                            "second member of each label/id pair "
+                            "second member of each label/value pair "
                             "must be a number");
             return NULL;
         }
 
-        gimp_browser_add_search_types(GIMP_BROWSER(self->obj),
-                                      PyString_AsString(label),
-                                      PyInt_AsLong(id),
-                                      NULL);
+        gimp_int_combo_box_prepend(GIMP_INT_COMBO_BOX(self->obj),
+                                  GIMP_INT_STORE_LABEL,
+                                  PyString_AsString(label),
+                                  GIMP_INT_STORE_VALUE,
+                                  PyInt_AsLong(value),
+                                  -1);
+    }
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_browser_add_search_types args
+static PyObject *
+_wrap_gimp_browser_add_search_types(PyGObject *self, PyObject *args)
+{
+    GimpBrowser *browser;
+    int len, i;
+    PyObject *element;
+    gchar *label;
+    gint id;
+
+    browser = GIMP_BROWSER(self->obj);
+
+    len = PyTuple_Size(args);
+
+    for (i = 0; i < len; ++i) {
+        element = PyTuple_GetItem(args, i);
+        if (!PyTuple_Check(element)) {
+            PyErr_SetString(PyExc_TypeError, "GimpBrowser.add_search_types: Arguments must be tuples");
+            return NULL;
+        }
+        if (!PyArg_ParseTuple(element, "si",  &label, &id))
+            return NULL;
+        gimp_browser_add_search_types(browser, label, id, NULL);
     }
 
     Py_INCREF(Py_None);
@@ -1189,7 +1399,8 @@
 %%
 override gimp_proc_browser_dialog_new kwargs
 static int
-_wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+_wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args,
+                                   PyObject *kwargs)
 {
     gchar *title, *role;
     PyObject *py_buttons = Py_None;
@@ -1208,6 +1419,23 @@
                                      &py_buttons))
         return -1;
 
+    if (py_buttons == Py_None)
+        len = 0;
+    else if (PyTuple_Check(py_buttons))
+        len = PyTuple_Size(py_buttons);
+    else {
+        PyErr_SetString(PyExc_TypeError,
+                        "buttons must be a tuple containing text/response "
+                        "pairs or None");
+        return -1;
+    }
+
+    if (len % 2) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "buttons tuple must contain text/response id pairs");
+        return -1;
+    }
+
     if (help_func) {
         if (help_func != Py_None) {
             if (!PyCallable_Check(help_func)) {
@@ -1217,33 +1445,13 @@
 
             func = pygimp_help_func_marshal;
 
-            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
-
-            Py_INCREF(help_func);
-            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
-                                   help_func, pygimp_help_func_destroy);
-        } else {
+       } else {
             func = gimp_standard_help_func;
         }
     } else {
         func = gimp_standard_help_func;
     }
 
-    if (py_buttons == Py_None)
-        len = 0;
-    else if (PyTuple_Check(py_buttons))
-        len = PyTuple_Size(py_buttons);
-    else {
-        PyErr_SetString(PyExc_TypeError, "buttons must be a tuple containing text/response pairs or None");
-        return -1;
-    }
-
-    if (len % 2) {
-        PyErr_SetString(PyExc_RuntimeError,
-                        "buttons tuple must contain text/response id pairs");
-        return -1;
-    }
-
     pygobject_construct(self,
                         "title",     title,
                         "role",      role,
@@ -1281,9 +1489,502 @@
                                PyInt_AsLong(id));
     }
 
+    if (help_func && help_func != Py_None) {
+        g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
+
+        Py_INCREF(help_func);
+        g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
+                               help_func, pygimp_help_func_destroy);
+    }
+
     g_signal_emit_by_name(GIMP_PROC_BROWSER_DIALOG(self->obj)->browser,
                           "search", "", 0, self->obj);
     return 0;
 }
 %%
 new-constructor GIMP_TYPE_PROC_BROWSER_DIALOG
+%%
+override gimp_number_pair_entry_get_values noargs
+static PyObject *
+_wrap_gimp_number_pair_entry_get_values(PyGObject *self)
+{
+    gdouble left, right;
+
+    gimp_number_pair_entry_get_values(GIMP_NUMBER_PAIR_ENTRY(self->obj),
+                                      &left, &right);
+
+    return Py_BuildValue("(dd)", left, right);   
+}
+%%
+override gimp_number_pair_entry_get_default_values noargs
+static PyObject *
+_wrap_gimp_number_pair_entry_get_default_values(PyGObject *self)
+{
+    gdouble left, right;
+
+    gimp_number_pair_entry_get_default_values(
+                                             GIMP_NUMBER_PAIR_ENTRY(self->obj),
+                                             &left, &right);
+
+    return Py_BuildValue("(dd)", left, right);
+}
+%%
+override gimp_number_pair_entry_get_aspect noargs
+static PyObject *
+_wrap_gimp_number_pair_entry_get_aspect(PyGObject *self)
+{
+    GimpAspectType aspect;
+
+    aspect =
+          gimp_number_pair_entry_get_aspect(GIMP_NUMBER_PAIR_ENTRY(self->obj));
+
+    return pyg_enum_from_gtype(GIMP_TYPE_ASPECT_TYPE, aspect);
+}
+%%
+override gimp_number_pair_entry_set_aspect kwargs
+static PyObject *
+_wrap_gimp_number_pair_entry_set_aspect(PyGObject *self, PyObject *args,
+                                        PyObject *kwargs)
+{
+    PyObject *py_aspect;
+    GimpAspectType aspect;
+
+    static char *kwlist[] = {"aspect", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                    "O:GimpNumberPairEntry.set_aspect",
+                                    kwlist, &py_aspect))
+        return NULL;
+
+    if (pyg_enum_get_value(GIMP_TYPE_ASPECT_TYPE, py_aspect, (gint*)&aspect))
+    {
+        Py_XDECREF(py_aspect);
+        return NULL;
+    }
+
+    gimp_number_pair_entry_set_aspect(GIMP_NUMBER_PAIR_ENTRY(self->obj),
+                                      aspect);
+
+    Py_DECREF(py_aspect);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_page_selector_get_selected_pages noargs
+static PyObject *
+_wrap_gimp_page_selector_get_selected_pages(PyGObject *self)
+{
+    gint *selected_pages;
+    gint n_selected_pages;
+    PyObject *py_selected_pages;
+    int i;
+
+    selected_pages = gimp_page_selector_get_selected_pages(
+                                                GIMP_PAGE_SELECTOR (self->obj),
+                                                &n_selected_pages);
+    
+    py_selected_pages = PyTuple_New(n_selected_pages);
+    for (i = 0; i < n_selected_pages; ++i)
+        PyTuple_SetItem(py_selected_pages, i,
+                        PyInt_FromLong(selected_pages[i]));
+
+    g_free(selected_pages);
+
+    return py_selected_pages;
+}
+%%
+override gimp_preview_get_position noargs
+static PyObject *
+_wrap_gimp_preview_get_position(PyGObject *self)
+{
+    gint x;
+    gint y;
+  
+    gimp_preview_get_position(GIMP_PREVIEW(self->obj), &x, &y);
+
+    return Py_BuildValue("(ii)", x, y);
+}
+%%
+override gimp_preview_get_size noargs
+static PyObject *
+_wrap_gimp_preview_get_size(PyGObject *self)
+{
+    gint width;
+    gint height;
+  
+    gimp_preview_get_size(GIMP_PREVIEW(self->obj), &width, &height);
+
+    return Py_BuildValue("(ii)", width, height);
+}
+%%
+override gimp_preview_transform kwargs
+static PyObject *
+_wrap_gimp_preview_transform(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    gint src_x;
+    gint src_y;
+    gint dest_x;
+    gint dest_y;
+
+    static char *kwlist[] = {"x", "y", NULL};
+    
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:GimpPreview.transform",
+                                     kwlist, &src_x, &src_y))
+        return NULL;
+
+    gimp_preview_transform(GIMP_PREVIEW(self->obj), src_x, src_y, &dest_x,
+                           &dest_y);
+
+    return Py_BuildValue("(ii)", dest_x, dest_y);
+}
+%%
+override gimp_preview_untransform kwargs
+static PyObject *
+_wrap_gimp_preview_untransform(PyGObject *self, PyObject *args,
+                               PyObject *kwargs)
+{
+    gint src_x;
+    gint src_y;
+    gint dest_x;
+    gint dest_y;
+
+    static char *kwlist[] = {"x", "y", NULL};
+    
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "ii:GimpPreview.untransform",
+                                     kwlist, &src_x, &src_y))
+        return NULL;
+
+    gimp_preview_untransform(GIMP_PREVIEW(self->obj), src_x, src_y, &dest_x,
+                             &dest_y);
+
+    return Py_BuildValue("(ii)", dest_x, dest_y);
+}
+%%
+override gimp_zoom_model_get_fraction noargs
+static PyObject *
+_wrap_gimp_zoom_model_get_fraction(PyGObject *self)
+{
+    gint numerator;
+    gint denominator;
+
+    gimp_zoom_model_get_fraction(GIMP_ZOOM_MODEL(self->obj), &numerator,
+                                 &denominator);
+
+    return Py_BuildValue("(ii)", numerator, denominator);
+}
+%%
+override gimp_drawable_preview_get_drawable noargs
+static PyObject *
+_wrap_gimp_drawable_preview_get_drawable(PyGObject *self)
+{
+    PyObject *drawable;
+    
+    drawable = g_object_get_data(self->obj, 
+                                 "pygimp-drawable-preview-pydrawable");
+    Py_INCREF(drawable);
+    return drawable;
+}
+%%
+override gimp_zoom_preview_get_drawable noargs
+static PyObject *
+_wrap_gimp_zoom_preview_get_drawable(PyGObject *self)
+{
+    PyObject *drawable;
+    
+    drawable = g_object_get_data(self->obj,
+                                 "pygimp-zoom-preview-pydrawable");
+    Py_INCREF(drawable);
+    return drawable;
+}
+%%
+override gimp_drawable_preview_draw_region kwargs
+static PyObject *
+_wrap_gimp_drawable_preview_draw_region(PyGObject *self, PyObject *args,
+                                        PyObject *kwargs)
+{
+/*    PyGimpPixelRgn *pypixelrgn;
+
+    static char *kwlist[] = {"drawable", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                    "O!:GimpDrawablePreview.draw_region",
+                                    kwlist, PyGimpPixelRgn_Type, &pypixelrgn))
+        return NULL;
+
+    gimp_drawable_preview_draw_region(GIMP_DRAWABLE_PREVIEW(self->obj),
+                                      &pypixelrgn->pr);
+*/
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_int_store_lookup_by_value
+static PyObject *
+_wrap_gimp_int_store_lookup_by_value(PyGObject *self, PyObject *args,
+                                     PyObject *kwargs)
+{
+    static char *kwlist[] = { "value", NULL };
+    int value, ret;
+    GtkTreeIter iter;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                               "i:GimpIntStore.gimp_int_store_lookup_by_value",
+                               kwlist, &value))
+        return NULL;
+
+    ret = gimp_int_store_lookup_by_value(GTK_TREE_MODEL(self->obj), value,
+                                         &iter);
+    if (ret)
+        pyg_boxed_new(GTK_TYPE_TREE_ITER, &iter, TRUE, TRUE);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_memsize_entry_new
+static int
+_wrap_gimp_memsize_entry_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "value", "lower", "upper", NULL };
+    guint64 value, lower, upper;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "LLL:GimpMemsizeEntry.__init__",
+                                     kwlist, &value, &lower, &upper))
+        return -1;
+    
+    self->obj = (GObject *)gimp_memsize_entry_new(value, lower, upper);
+
+    if (!self->obj) {
+        PyErr_SetString(PyExc_RuntimeError,
+                        "could not create GimpMemsizeEntry object");
+        return -1;
+    }
+    pygobject_register_wrapper((PyObject *)self);
+    return 0;
+}
+%%
+override gimp_memsize_entry_set_value
+static PyObject *
+_wrap_gimp_memsize_entry_set_value(PyGObject *self, PyObject *args,
+                                   PyObject *kwargs)
+{
+    static char *kwlist[] = { "value", NULL };
+    guint64 value;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
+                                     "L:GimpMemsizeEntry.set_value",
+                                     kwlist, &value))
+        return NULL;
+
+    gimp_memsize_entry_set_value(GIMP_MEMSIZE_ENTRY(self->obj), value);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+%%
+override gimp_color_area_get_color noargs
+static PyObject *
+_wrap_gimp_color_area_get_color(PyGObject *self)
+{
+    GimpRGB rgb;
+
+    gimp_color_area_get_color(GIMP_COLOR_AREA(self->obj), &rgb);
+
+    return pygimp_rgb_new(&rgb);
+}
+%%
+override gimp_color_hex_entry_get_color noargs
+static PyObject *
+_wrap_gimp_color_hex_entry_get_color(PyGObject *self)
+{
+    GimpRGB rgb;
+
+    gimp_color_hex_entry_get_color(GIMP_COLOR_HEX_ENTRY(self->obj), &rgb);
+
+    return pygimp_rgb_new(&rgb);
+}
+%%
+override gimp_color_notebook_get_color noargs
+static PyObject *
+_wrap_gimp_color_notebook_get_color(PyGObject *self)
+{
+    GimpRGB rgb;
+
+    gimp_color_notebook_get_color(GIMP_COLOR_NOTEBOOK(self->obj), &rgb);
+
+    return pygimp_rgb_new(&rgb);
+}
+%%
+override gimp_color_selection_get_color noargs
+static PyObject *
+_wrap_gimp_color_selection_get_color(PyGObject *self)
+{
+    GimpRGB rgb;
+
+    gimp_color_selection_get_color(GIMP_COLOR_SELECTION(self->obj), &rgb);
+
+    return pygimp_rgb_new(&rgb);
+}
+%%
+override gimp_color_selection_get_old_color noargs
+static PyObject *
+_wrap_gimp_color_selection_get_old_color(PyGObject *self)
+{
+    GimpRGB rgb;
+
+    gimp_color_selection_get_old_color(GIMP_COLOR_SELECTION(self->obj), &rgb);
+
+    return pygimp_rgb_new(&rgb);
+}
+%%
+override gimp_enum_store_new kwargs
+static int
+_wrap_gimp_enum_store_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "enum_type", "minimum", "maximum", NULL };
+    PyObject *py_enum_type = NULL;
+    PyObject *py_minimum = NULL;
+    PyObject *py_maximum = NULL;
+    GType enum_type;
+    GEnumClass *enum_class;
+    gint minimum, maximum;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O|O!O!:GimpEnumStore.__init__", kwlist,
+                                      &py_enum_type, &PyInt_Type, &py_minimum,
+                                      &PyInt_Type, &py_maximum))
+        return -1;
+    if ((enum_type = pyg_type_from_object(py_enum_type)) == 0)
+        return -1;
+
+    enum_class = g_type_class_ref(enum_type);
+
+    if (py_minimum == NULL)
+        minimum = enum_class->minimum;
+    else
+        minimum = PyInt_AsLong(py_minimum);
+    
+    if (py_maximum == NULL)
+        maximum = enum_class->maximum;
+    else
+        maximum = PyInt_AsLong(py_maximum);
+    
+    g_type_class_unref(enum_class);
+
+    self->obj = (GObject *)gimp_enum_store_new_with_range(enum_type, minimum, maximum);
+
+    if (!self->obj) {
+        PyErr_SetString(PyExc_RuntimeError, "could not create GimpEnumStore object");
+        return -1;
+    }
+    pygobject_register_wrapper((PyObject *)self);
+    return 0;
+}
+%%
+override gimp_zoom_preview_new_with_model kwargs
+static int
+_wrap_gimp_zoom_preview_new_with_model(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "drawable", "model", NULL };
+    PyGimpDrawable *py_drawable;
+    PyGObject *py_zoom_model = NULL;
+    GimpZoomModel *zoom_model;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O!|O!:GimpZoomPreview.__init__", kwlist,
+                                     PyGimpDrawable_Type, &py_drawable,
+                                     &PyGimpZoomModel_Type, &py_zoom_model))
+        return -1;
+
+    if (py_zoom_model)
+        zoom_model = (GimpZoomModel*)py_zoom_model->obj;
+    else
+        zoom_model = NULL;
+
+    if (!py_drawable->drawable)
+        py_drawable->drawable = gimp_drawable_get(py_drawable->ID);
+
+    if (pygobject_construct(self, "drawable", py_drawable->drawable, "model", zoom_model, NULL))
+        return -1;
+
+    g_object_set_data_full(self->obj, "pygimp-zoom-preview-pydrawable",
+                           py_drawable,
+                           (GDestroyNotify)pygimp_decref_callback);
+
+    Py_INCREF(py_drawable);
+
+    return 0;
+}
+%%
+new-constructor GIMP_TYPE_ZOOM_PREVIEW
+%%
+override gimp_aspect_preview_new kwargs
+static int
+_wrap_gimp_aspect_preview_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "drawable", NULL };
+    PyGimpDrawable *py_drawable;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O!|:GimpAspectPreview.__init__", kwlist,
+                                     PyGimpDrawable_Type, &py_drawable))
+        return -1;
+
+    if (!py_drawable->drawable)
+        py_drawable->drawable = gimp_drawable_get(py_drawable->ID);
+    
+    if (pygobject_construct(self, "drawable", py_drawable->drawable, NULL))
+        return -1;
+    
+    g_signal_connect_swapped(self->obj, "destroy",
+                             (GCallback)pygimp_decref_callback, py_drawable);
+    Py_INCREF(py_drawable);
+
+    return 0;
+}
+%%
+new-constructor GIMP_TYPE_ASPECT_PREVIEW
+%%
+override gimp_drawable_preview_new kwargs
+static int
+_wrap_gimp_drawable_preview_new(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+    static char *kwlist[] = { "drawable", NULL };
+    PyGimpDrawable *py_drawable;
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+                                     "O!|:GimpDrawablePreview.__init__", kwlist,
+                                     PyGimpDrawable_Type, &py_drawable))
+        return -1;
+
+    if (!py_drawable->drawable)
+        py_drawable->drawable = gimp_drawable_get(py_drawable->ID);
+  
+    if (pygobject_construct(self, "drawable", py_drawable->drawable, NULL))
+        return -1;
+
+    g_object_set_data_full(self->obj, "pygimp-drawable-preview-pydrawable",
+                           py_drawable, 
+                           (GDestroyNotify)pygimp_decref_callback);
+
+    Py_INCREF(py_drawable);
+
+    return 0;
+}
+
+%%
+new-constructor GIMP_TYPE_DRAWABLE_PREVIEW
+%%
+override gimp_ruler_get_range noargs
+static PyObject *
+_wrap_gimp_ruler_get_range(PyGObject *self)
+{
+    gdouble lower, upper, max_size;
+
+    gimp_ruler_get_range(GIMP_RULER(self->obj), &lower, &upper, &max_size);
+
+    return Py_BuildValue("(ddd)", lower, upper, max_size);
+}

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpui.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpui.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpui.py	Sun Oct 12 15:38:02 2008
@@ -55,7 +55,7 @@
                               callback, data)
         menu_item.show()
     return menu
-        
+
 
 def ImageMenu(constraint=None, callback=None, data=None):
     items = []
@@ -210,7 +210,7 @@
             self.set_palette(default)
     def get_value(self):
         return self.get_palette()
-    
+
 class FontSelector(FontSelectButton):
     def __init__(self, default="Sans"):
         FontSelectButton.__init__(self)
@@ -218,7 +218,7 @@
             self.set_font(default)
     def get_value(self):
         return self.get_font()
-                
+
 class FileSelector(gtk.FileChooserButton):
     def __init__(self, default=""):
         gtk.FileChooserButton.__init__(self, _("Python-Fu File Selection"))

Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpuimodule.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpuimodule.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpuimodule.c	Sun Oct 12 15:38:02 2008
@@ -35,12 +35,12 @@
 #include "pygimp-util.h"
 
 
-void gimpui_register_classes(PyObject *d); 
+void gimpui_register_classes(PyObject *d);
 void gimpui_add_constants(PyObject *module, const gchar *strip_prefix);
 extern PyMethodDef gimpui_functions[];
 
 
-static char gimpui_doc[] = 
+static char gimpui_doc[] =
 "This module provides interfaces to allow you to write gimp plugins"
 ;
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py	Sun Oct 12 15:38:02 2008
@@ -48,7 +48,7 @@
     if not os.path.exists (folder):
         gimp.message("Folder '" + folder + "' doesn't exist.\n")
         return;
-    
+
     total_unclassified = 0
     total_misclassified = 0
     total_time = 0.0

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/foggify.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/foggify.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/foggify.py	Sun Oct 12 15:38:02 2008
@@ -38,10 +38,10 @@
     # create a layer mask for the new layer
     mask = fog.create_mask(0)
     fog.add_mask(mask)
-        
+
     # add some clouds to the layer
     pdb.plug_in_plasma(img, mask, int(time.time()), turbulence)
-        
+
     # apply the clouds to the layer
     fog.remove_mask(MASK_APPLY)
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-offset.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-offset.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-offset.py	Sun Oct 12 15:38:02 2008
@@ -20,8 +20,8 @@
 
 def palette_offset(palette, amount):
     #If palette is read only, work on a copy:
-    editable = pdb.gimp_palette_is_editable(palette) 
-    if not editable:palette = pdb.gimp_palette_duplicate (palette)     
+    editable = pdb.gimp_palette_is_editable(palette)
+    if not editable:palette = pdb.gimp_palette_duplicate (palette)
 
     num_colors = pdb.gimp_palette_get_info (palette)
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-sort.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-sort.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-sort.py	Sun Oct 12 15:38:02 2008
@@ -19,11 +19,11 @@
 gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
 
 def palette_sort (palette, model, channel, ascending):
-    #If palette is read only, work on a copy:        
-    editable = pdb.gimp_palette_is_editable(palette) 
-    if not editable:palette = pdb.gimp_palette_duplicate (palette)     
+    #If palette is read only, work on a copy:
+    editable = pdb.gimp_palette_is_editable(palette)
+    if not editable:palette = pdb.gimp_palette_duplicate (palette)
 
-    num_colors = pdb.gimp_palette_get_info (palette) 
+    num_colors = pdb.gimp_palette_get_info (palette)
     entry_list = []
     for i in xrange (num_colors):
         entry =  (pdb.gimp_palette_entry_get_name (palette, i),
@@ -39,8 +39,8 @@
         entry_list.reverse()
     for i in xrange(num_colors):
         pdb.gimp_palette_entry_set_name (palette, i, entry_list[i][1][0])
-        pdb.gimp_palette_entry_set_color (palette, i, entry_list[i][1][1])  
-    
+        pdb.gimp_palette_entry_set_color (palette, i, entry_list[i][1][1])
+
     return palette
 
 
@@ -55,15 +55,15 @@
     "",
     [
         (PF_PALETTE, "palette",  _("Palette"), ""),
-        (PF_RADIO,   "model",    _("Color _model"), "HSV", 
-                                    ((_("RGB"), "RGB"), 
+        (PF_RADIO,   "model",    _("Color _model"), "HSV",
+                                    ((_("RGB"), "RGB"),
                                      (_("HSV"), "HSV"))),
-        (PF_RADIO,   "channel",  _("Channel to _sort"), 2, 
-                                    ((_("Red or Hue"),          0), 
-                                     (_("Green or Saturation"), 1), 
+        (PF_RADIO,   "channel",  _("Channel to _sort"), 2,
+                                    ((_("Red or Hue"),          0),
+                                     (_("Green or Saturation"), 1),
                                      (_("Blue or Value"),       2))),
         (PF_BOOL,   "ascending", _("_Ascending"), True)
-    ],     
+    ],
     [],
     palette_sort,
     menu="<Palettes>",

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-to-gradient.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-to-gradient.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/palette-to-gradient.py	Sun Oct 12 15:38:02 2008
@@ -21,7 +21,7 @@
 def make_gradient(palette, num_segments, num_colors):
     gradient = pdb.gimp_gradient_new(palette)
     pdb.gimp_gradient_segment_range_split_uniform(gradient, 0, -1, num_segments)
-    
+
     for color_number in range(0,num_segments):
         if (color_number == num_colors-1):color_number_next = 0
         else: color_number_next = color_number + 1

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/py-slice.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/py-slice.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/py-slice.py	Sun Oct 12 15:38:02 2008
@@ -175,9 +175,9 @@
                                         True, False, False)
     if image_extension == "jpg" and image.base_type == INDEXED:
         pdb.gimp_image_convert_rgb (temp_image)
-    
-    pdb.gimp_file_save(temp_image, temp_drawable, filename, filename)        
-        
+
+    pdb.gimp_file_save(temp_image, temp_drawable, filename, filename)
+
     gimp.delete(temp_image)
     return src
 
@@ -238,7 +238,7 @@
         self.image_prefix = self.image_prefix.replace ("-", "_")
         self.image_prefix = self.image_prefix.replace (" ", "_")
 
-        
+
         if animate:
             self.animate = True
             self.images = []
@@ -252,12 +252,12 @@
             self.urls = self.parse_urls ()
         else:
             self.urls = []
-            
+
         self.url_index = 0
-        
-        self.html = open(filename, 'wt')    
+
+        self.html = open(filename, 'wt')
         self.open()
-    
+
     def next_url (self):
         if self.url_index < len (self.urls):
             self.url_index += 1
@@ -392,24 +392,24 @@
            of the given file and return then as a list
         """
         import re
-        url_list = [] 
+        url_list = []
         try:
             html_file = open (self.filename)
-            
+
             #Regular expression to  pick everything up to the next doublequote
             #character after finding  the sequence 'href="'. The found sequences
             #will be returned as  a list by the "findall" method.
             expr = re.compile (r"""href\=\"([^\"]*?)\"""")
             url_list = expr.findall (html_file.read (2 ** 18))
             html_file.close()
-            
+
         except:
             #silently ignore any errors parsing this. The file being
             #ovewriten  may not be a  file genrated by py-slice.
             pass
-            
+
         return url_list
-        
+
 
 register(
     "python-fu-slice",

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/pyconsole.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/pyconsole.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/pyconsole.py	Sun Oct 12 15:38:02 2008
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 #
 #   pyconsole.py
 #

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-console.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-console.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-console.py	Sun Oct 12 15:38:02 2008
@@ -36,7 +36,7 @@
                  '__name__': '__main__', '__doc__': None,
                  'gimp': gimp, 'pdb': gimp.pdb,
                  'shelf': gimpshelf.shelf}
-    
+
     for s in gimpenums.__dict__.keys():
         if s[0] != '_':
             namespace[s] = getattr(gimpenums, s)
@@ -109,7 +109,7 @@
                 return
 
             proc = pdb[proc_name]
-            
+
             cmd = ''
 
             if len(proc.return_vals) > 0:

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-eval.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-eval.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/python-eval.py	Sun Oct 12 15:38:02 2008
@@ -23,8 +23,8 @@
     if code == '-':
         import sys
         code = sys.stdin
-    exec code
- 
+    exec code in globals()
+
 register(
         "python-fu-eval",
         "Evaluate Python code",

Modified: branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/whirlpinch.py
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/whirlpinch.py	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/plug-ins/whirlpinch.py	Sun Oct 12 15:38:02 2008
@@ -34,8 +34,8 @@
                 self.img_height = drawable.height
                 self.img_bpp = drawable.bpp
                 self.img_has_alpha = drawable.has_alpha
-                self.tile_width = 64
-                self.tile_height = 64
+                self.tile_width = gimp.tile_width()
+                self.tile_height = gimp.tile_height()
                 self.bg_colour = '\0\0\0\0'
                 self.bounds = drawable.mask_bounds
                 self.drawable = drawable
@@ -93,22 +93,28 @@
         if not drawable.is_rgb and not drawable.is_grey:
                 return
 
-        gimp.tile_cache_ntiles(2 * (self.width + 63) / 64)
+        gimp.tile_cache_ntiles(2 * (1 + self.width / gimp.tile_width()))
 
         whirl = whirl * math.pi / 180
         dest_rgn = drawable.get_pixel_rgn(self.sel_x1, self.sel_y1,
                                           self.sel_w, self.sel_h, True, True)
         pft = pixel_fetcher(drawable)
         pfb = pixel_fetcher(drawable)
+
         bg_colour = gimp.get_background()
+
         pft.set_bg_colour(bg_colour[0], bg_colour[1], bg_colour[2], 0)
         pfb.set_bg_colour(bg_colour[0], bg_colour[1], bg_colour[2], 0)
+
         progress = 0
         max_progress = self.sel_w * self.sel_h
-        gimp.progress_init("Whirling and pinching...")
+
+        gimp.progress_init("Whirling and pinching")
+
         self.radius2 = self.radius * self.radius * radius
         pixel = ['', '', '', '']
         values = [0,0,0,0]
+
         for row in range(self.sel_y1, (self.sel_y1+self.sel_y2)/2+1):
                 top_p = ''
                 bot_p = ''
@@ -154,11 +160,14 @@
                                 bot_p = pfb.get_pixel((self.sel_x2 - 1) -
                                         (col - self.sel_x1), (self.sel_y2-1) -
                                         (row - self.sel_y1)) + bot_p
+
                 dest_rgn[self.sel_x1:self.sel_x2, row] = top_p
                 dest_rgn[self.sel_x1:self.sel_x2, (self.sel_y2 - 1)
                          - (row - self.sel_y1)] = bot_p
+
                 progress = progress + self.sel_w * 2
                 gimp.progress_update(float(progress) / max_progress)
+
         drawable.flush()
         drawable.merge_shadow(True)
         drawable.update(self.sel_x1,self.sel_y1,self.sel_w,self.sel_h)
@@ -188,7 +197,7 @@
                 x = wx
                 y = wy
         return inside, float(x), float(y)
-        
+
 def bilinear(x, y, values):
         x = x % 1.0
         y = y % 1.0

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c	Sun Oct 12 15:38:02 2008
@@ -460,7 +460,7 @@
     { NULL, (getter)0, (setter)0 },
 };
 
-static Py_ssize_t 
+static Py_ssize_t
 rgb_length(PyObject *self)
 {
     return 4;
@@ -480,7 +480,7 @@
 	return NULL;
     }
 
-    rgb = pyg_boxed_get(self, GimpRGB); 
+    rgb = pyg_boxed_get(self, GimpRGB);
 
     switch (pos) {
     case 0: val = rgb->r; break;
@@ -600,7 +600,7 @@
 	else {
 	    PyErr_SetObject(PyExc_KeyError, item);
 	    return NULL;
-	} 
+	}
     } else {
 	PyErr_SetString(PyExc_TypeError,
 			"indices must be integers");
@@ -983,7 +983,7 @@
     { NULL, (getter)0, (setter)0 },
 };
 
-static Py_ssize_t 
+static Py_ssize_t
 hsv_length(PyObject *self)
 {
     return 4;
@@ -1003,7 +1003,7 @@
 	return NULL;
     }
 
-    hsv = pyg_boxed_get(self, GimpHSV); 
+    hsv = pyg_boxed_get(self, GimpHSV);
 
     switch (pos) {
     case 0: val = hsv->h; scale_factor = 360.0; break;
@@ -1516,7 +1516,7 @@
 	return NULL;
     }
 
-    hsl = pyg_boxed_get(self, GimpHSL); 
+    hsl = pyg_boxed_get(self, GimpHSL);
 
     switch (pos) {
     case 0: val = hsl->h; scale_factor = 360.0; break;
@@ -2020,7 +2020,7 @@
 	return NULL;
     }
 
-    cmyk = pyg_boxed_get(self, GimpCMYK); 
+    cmyk = pyg_boxed_get(self, GimpCMYK);
 
     switch (pos) {
     case 0: val = cmyk->c; break;

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c	Sun Oct 12 15:38:02 2008
@@ -94,6 +94,18 @@
     return Py_None;
 }
 
+static PyObject *
+drw_free_shadow(PyGimpDrawable *self)
+{
+    if (!gimp_drawable_free_shadow(self->ID)) {
+	PyErr_Format(pygimp_error, "could not free shadow tiles on drawable (ID %d)",
+		     self->ID);
+	return NULL;
+    }
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
 
 static PyObject *
 drw_fill(PyGimpDrawable *self, PyObject *args, PyObject *kwargs)
@@ -131,6 +143,12 @@
 
     ensure_drawable(self);
 
+    if(row < 0 || row >= self->drawable->ntile_rows ||
+       col < 0 || col >= self->drawable->ntile_cols) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
     t = gimp_drawable_get_tile(self->drawable, shadow, row, col);
     return pygimp_tile_new(t, self);
 }
@@ -148,6 +166,11 @@
 	return NULL;
 
     ensure_drawable(self);
+    if(x < 0 || x >= self->drawable->width ||
+       y < 0 || y >= self->drawable->height) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
 
     t = gimp_drawable_get_tile2(self->drawable, shadow, x, y);
     return pygimp_tile_new(t, self);
@@ -474,7 +497,7 @@
 			      "clip_result", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				     "iid|:transform_flip_simple", kwlist,
+				     "iid|i:transform_flip_simple", kwlist,
 				     &flip_type, &auto_center, &axis,
 				     &clip_result))
 	return NULL;
@@ -578,7 +601,7 @@
 			      "clip_result", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				     "diiii|iii:transform_rotate", kwlist,
+				     "diiiii|iii:transform_rotate", kwlist,
 				     &angle, &auto_center, &center_x, &center_y,
 				     &transform_direction, &interpolation,
 				     &supersample, &recursion_level,
@@ -879,6 +902,7 @@
     {"flush",	(PyCFunction)drw_flush,	METH_NOARGS},
     {"update",	(PyCFunction)drw_update,	METH_VARARGS},
     {"merge_shadow",	(PyCFunction)drw_merge_shadow,	METH_VARARGS | METH_KEYWORDS},
+    {"free_shadow", (PyCFunction)drw_free_shadow, METH_NOARGS},
     {"fill",	(PyCFunction)drw_fill,	METH_VARARGS | METH_KEYWORDS},
     {"get_tile",	(PyCFunction)drw_get_tile,	METH_VARARGS | METH_KEYWORDS},
     {"get_tile2",	(PyCFunction)drw_get_tile2,	METH_VARARGS | METH_KEYWORDS},
@@ -1377,20 +1401,33 @@
 static PyObject *
 lay_scale(PyGimpLayer *self, PyObject *args, PyObject *kwargs)
 {
-    unsigned int new_w, new_h;
+    int new_width, new_height;
+    int interpolation = -1;
     gboolean local_origin = FALSE;
 
     static char *kwlist[] = { "width", "height", "local_origin", NULL };
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|i:scale", kwlist,
-				     &new_w, &new_h, &local_origin))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|ii:scale", kwlist,
+				     &new_width, &new_height,
+                                     &local_origin, &interpolation))
 	return NULL;
 
-    if (!gimp_layer_scale(self->ID, new_w, new_h, local_origin)) {
-	PyErr_Format(pygimp_error,
-		     "could not scale layer (ID %d) to size %dx%d",
-		     self->ID, new_w, new_h);
-	return NULL;
+    if (interpolation != -1) {
+        if (!gimp_layer_scale_full(self->ID,
+                                   new_width, new_height,
+                                   local_origin, interpolation)) {
+            PyErr_Format(pygimp_error,
+                         "could not scale layer (ID %d) to size %dx%d",
+                         self->ID, new_width, new_height);
+            return NULL;
+        }
+    } else {
+        if (!gimp_layer_scale(self->ID, new_width, new_height, local_origin)) {
+            PyErr_Format(pygimp_error,
+                         "could not scale layer (ID %d) to size %dx%d",
+                         self->ID, new_width, new_height);
+            return NULL;
+        }
     }
 
     Py_INCREF(Py_None);

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c	Sun Oct 12 15:38:02 2008
@@ -21,6 +21,7 @@
 #  include <config.h>
 #endif
 
+#undef GIMP_DISABLE_DEPRECATED
 #include "pygimp.h"
 
 static PyObject *
@@ -28,7 +29,7 @@
 {
     PyGimpChannel *chn;
     int pos = -1;
-	
+
     if (!PyArg_ParseTuple(args, "O!|i:add_channel",
 	                        &PyGimpChannel_Type, &chn, &pos))
 	return NULL;
@@ -49,7 +50,7 @@
 {
     PyGimpLayer *lay;
     int pos = -1;
-	
+
     if (!PyArg_ParseTuple(args, "O!|i:add_layer", &PyGimpLayer_Type, &lay,
 			  &pos))
 	return NULL;
@@ -108,7 +109,7 @@
             break;
         default:
             PyErr_SetString(pygimp_error, "Unknown image base type");
-            return NULL; 
+            return NULL;
     }
 
     if (fill_mode == -1)
@@ -293,7 +294,7 @@
 {
     int x,y;
     gint32 id;
-	
+
     if (!PyArg_ParseTuple(args, "ii:pick_correlate_layer", &x, &y))
 	return NULL;
 
@@ -311,7 +312,7 @@
 img_raise_channel(PyGimpImage *self, PyObject *args)
 {
     PyGimpChannel *chn;
-	
+
     if (!PyArg_ParseTuple(args, "O!:raise_channel", &PyGimpChannel_Type, &chn))
 	return NULL;
 
@@ -445,17 +446,27 @@
 img_scale(PyGimpImage *self, PyObject *args, PyObject *kwargs)
 {
     int new_width, new_height;
+    int interpolation = -1;
 
-    static char *kwlist[] = { "width", "height", NULL };
+    static char *kwlist[] = { "width", "height", "interpolation", NULL };
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:scale", kwlist,
-				     &new_width, &new_height))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|i:scale", kwlist,
+				     &new_width, &new_height, &interpolation))
 	return NULL;
 
-    if (!gimp_image_scale(self->ID, new_width, new_height)) {
-	PyErr_Format(pygimp_error, "could not scale image (ID %d) to %dx%d",
-		     self->ID, new_width, new_height);
-	return NULL;
+    if (interpolation != -1) {
+        if (!gimp_image_scale_full(self->ID,
+                                   new_width, new_height, interpolation)) {
+            PyErr_Format(pygimp_error, "could not scale image (ID %d) to %dx%d",
+                         self->ID, new_width, new_height);
+            return NULL;
+        }
+    } else {
+        if (!gimp_image_scale(self->ID, new_width, new_height)) {
+            PyErr_Format(pygimp_error, "could not scale image (ID %d) to %dx%d",
+                         self->ID, new_width, new_height);
+            return NULL;
+        }
     }
 
     Py_INCREF(Py_None);
@@ -490,7 +501,7 @@
 img_free_shadow(PyGimpImage *self)
 {
     if (!gimp_image_free_shadow(self->ID)) {
-	PyErr_Format(pygimp_error, "could not free shadow on image (ID %d)",
+	PyErr_Format(pygimp_error, "could not free shadow tiles on image (ID %d)",
 		     self->ID);
 	return NULL;
     }
@@ -529,10 +540,10 @@
 img_get_component_visible(PyGimpImage *self, PyObject *args)
 {
     int comp;
-	
+
     if (!PyArg_ParseTuple(args, "i:get_component_visible", &comp))
 	return NULL;
-	
+
     return PyBool_FromLong(gimp_image_get_component_visible(self->ID, comp));
 }
 
@@ -1014,7 +1025,7 @@
 		     self->ID);
 	return NULL;
     }
-	
+
     ret = PyString_FromStringAndSize((char *)cmap, n_colours * 3);
     g_free(cmap);
 

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c	Sun Oct 12 15:38:02 2008
@@ -711,7 +711,7 @@
     }
 
     if (attr_name[0] == '_') {
-        if (strcmp(attr_name, "__members__")) {
+        if (!strcmp(attr_name, "__members__")) {
             return build_procedure_list();
         } else {
             return PyObject_GenericGetAttr((PyObject *)self, attr);

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c	Sun Oct 12 15:38:02 2008
@@ -28,9 +28,6 @@
 
 #include <structmember.h>
 
-/* maximum bits per pixel ... */
-#define MAX_BPP 4
-
 static PyObject *
 tile_flush(PyGimpTile *self, PyObject *args)
 {
@@ -56,7 +53,7 @@
 pygimp_tile_new(GimpTile *t, PyGimpDrawable *drw)
 {
     PyGimpTile *self;
-	
+
     self = PyObject_NEW(PyGimpTile, &PyGimpTile_Type);
 
     if (self == NULL)
@@ -146,7 +143,7 @@
     return s;
 }
 
-static Py_ssize_t 
+static Py_ssize_t
 tile_length(PyObject *self)
 {
     return ((PyGimpTile*)self)->tile->ewidth * ((PyGimpTile*)self)->tile->eheight;
@@ -195,7 +192,7 @@
     int bpp = tile->bpp, i;
     long x, y;
     guchar *pix, *data;
-	
+
     if (w == NULL) {
 	PyErr_SetString(PyExc_TypeError,
 			"can not delete pixels in tile");
@@ -333,11 +330,25 @@
 		     int width, int height, int dirty, int shadow)
 {
     PyGimpPixelRgn *self;
-	
+    int drw_width;
+    int drw_height;
+
     self = PyObject_NEW(PyGimpPixelRgn, &PyGimpPixelRgn_Type);
 
-    if (self == NULL)
-	return NULL;
+    if (self == NULL || drawable == NULL)
+        return NULL;
+
+    drw_width = gimp_drawable_width(drawable->ID);
+    drw_height = gimp_drawable_height(drawable->ID);
+
+    if(x < 0) x = 0;
+    if(y < 0) y = 0;
+    if(width < 0) width = drw_width - x;
+    if(height < 0) height = drw_height - y;
+    if(x >= drw_width) x = drw_width - 1;
+    if(y >= drw_height) y = drw_height - 1;
+    if(x + width > drw_width) width = drw_width - x;
+    if(y + height > drw_height) height = drw_height - y;
 
     gimp_pixel_rgn_init(&(self->pr), drawable->drawable, x, y, width, height,
 			dirty, shadow);
@@ -358,7 +369,7 @@
 
 /* Code to access pr objects as mappings */
 
-static Py_ssize_t 
+static Py_ssize_t
 pr_length(PyObject *self)
 {
     PyErr_SetString(pygimp_error, "Can't get size of pixel region");
@@ -369,226 +380,253 @@
 pr_subscript(PyGimpPixelRgn *self, PyObject *key)
 {
     GimpPixelRgn *pr = &(self->pr);
-    int bpp = pr->bpp;
     PyObject *x, *y;
     Py_ssize_t x1, y1, x2, y2, xs, ys;
+    PyObject *ret;
 
     if (!PyTuple_Check(key) || PyTuple_Size(key) != 2) {
-	PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
-	return NULL;
+        PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
+        return NULL;
     }
 
     if (!PyArg_ParseTuple(key, "OO", &x, &y))
-	return NULL;
+        return NULL;
 
     if (PyInt_Check(x)) {
-	x1 = PyInt_AsLong(x);
-
-	if (pr->x > x1 || x1 >= pr->x + pr->w) {
-	    PyErr_SetString(PyExc_IndexError, "x subscript out of range");
-	    return NULL;
-	}
+        x1 = PyInt_AsSsize_t(x);
 
-	if (PyInt_Check(y)) {
-	    guchar buf[MAX_BPP];
-			
-	    y1 = PyInt_AsLong(y);
-
-	    if (pr->y > y1 || y1 >= pr->y + pr->h) {
-		PyErr_SetString(PyExc_IndexError, "y subscript out of range");
-		return NULL;
-	    }
+        if (x1 < pr->x || x1 >= pr->x + pr->w) {
+            PyErr_SetString(PyExc_IndexError, "x subscript out of range");
+            return NULL;
+        }
 
-	    gimp_pixel_rgn_get_pixel(pr, buf, x1, y1);
+        if (PyInt_Check(y)) {
+            y1 = PyInt_AsSsize_t(y);
 
-	    return PyString_FromStringAndSize((char *)buf, bpp);
-	} else if (PySlice_Check(y))
-	    if (PySlice_GetIndices((PySliceObject *)y,
-				   pr->y + pr->h, &y1, &y2, &ys) ||
-		(y1 != 0 && pr->y > y1) ||
-		pr->y > y2 || ys != 1) {
-		PyErr_SetString(PyExc_IndexError, "invalid y slice");
-		return NULL;
-	    } else {
-		guchar *buf = g_new(guchar, bpp * (y2 - y1));
-		PyObject *ret;
-				
-		if (y1 == 0) y1 = pr->y;
-		gimp_pixel_rgn_get_col(pr, buf, x1, y1, y2-y1);
-		ret = PyString_FromStringAndSize((char *)buf, bpp * (y2 - y1));
-		g_free(buf);
-		return ret;
+            if (y1 < pr->y || y1 >= pr->y + pr->h) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return NULL;
+            }
+
+            ret = PyString_FromStringAndSize(NULL, pr->bpp);
+            gimp_pixel_rgn_get_pixel(pr, (guchar*)PyString_AS_STRING(ret),
+                                     x1, y1);
+
+        } else if (PySlice_Check(y)) {
+            if (PySlice_GetIndices((PySliceObject*)y, pr->y + pr->h,
+                                   &y1, &y2, &ys) ||
+                y1 >= y2 || ys != 1) {
+                PyErr_SetString(PyExc_IndexError, "invalid y slice");
+                return NULL;
+            }
+
+            if(y1 == 0)
+                y1 = pr->y;
+
+            if(y1 < pr->y || y2 < pr->y) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return NULL;
+            }
+
+            ret = PyString_FromStringAndSize(NULL, pr->bpp * (y2 - y1));
+            gimp_pixel_rgn_get_col(pr, (guchar*)PyString_AS_STRING(ret),
+                                   x1, y1, y2-y1);
 	    }
-	else {
-	    PyErr_SetString(PyExc_TypeError,"invalid y subscript");
-	    return NULL;
-	}
+        else {
+            PyErr_SetString(PyExc_TypeError, "invalid y subscript");
+            return NULL;
+        }
     } else if (PySlice_Check(x)) {
-	if (PySlice_GetIndices((PySliceObject *)x, pr->x + pr->w,
-			       &x1, &x2, &xs) || (x1 != 0 && pr->x > x1) ||
-	    pr->x > x2 || xs != 1) {
-	    PyErr_SetString(PyExc_IndexError, "invalid x slice");
-	    return NULL;
-	}
-	if (x1 == 0) x1 = pr->x;
-	if (PyInt_Check(y)) {
-	    guchar *buf;
-	    PyObject *ret;
-			
-	    y1 = PyInt_AsLong(y);
-	    if (pr->y > y1 || y1 >= pr->y + pr->h) {
-		PyErr_SetString(PyExc_IndexError, "y subscript out of range");
-		return NULL;
-	    }
-	    buf = g_new(guchar, bpp * (x2 - x1));
-	    gimp_pixel_rgn_get_row(pr, buf, x1, y1, x2 - x1);
-	    ret = PyString_FromStringAndSize((char *)buf, bpp * (x2-x1));
-	    g_free(buf);
-	    return ret;
-	} else if (PySlice_Check(y))
-	    if (PySlice_GetIndices((PySliceObject *)y,
-				   pr->y + pr->h, &y1, &y2, &ys) ||
-		(y1 != 0 && pr->y) > y1 ||
-		pr->y > y2 || ys != 1) {
-		PyErr_SetString(PyExc_IndexError, "invalid y slice");
-		return NULL;
-	    } else {
-		guchar *buf = g_new(guchar, bpp * (x2 - x1) * (y2 - y1));
-		PyObject *ret;
-				
-		if (y1 == 0) y1 = pr->y;
-		gimp_pixel_rgn_get_rect(pr, buf, x1, y1,
-					x2 - x1, y2 - y1);
-		ret = PyString_FromStringAndSize((char *)buf, bpp * (x2-x1) * (y2-y1));
-		g_free(buf);
-		return ret;
+        if (PySlice_GetIndices((PySliceObject *)x, pr->x + pr->w,
+                               &x1, &x2, &xs) ||
+            x1 >= x2 || xs != 1) {
+            PyErr_SetString(PyExc_IndexError, "invalid x slice");
+            return NULL;
+        }
+        if (x1 == 0)
+            x1 = pr->x;
+        if(x1 < pr->x || x2 < pr->x) {
+            PyErr_SetString(PyExc_IndexError, "x subscript out of range");
+            return NULL;
+        }
+
+        if (PyInt_Check(y)) {
+            y1 = PyInt_AsSsize_t(y);
+            if (y1 < pr->y || y1 >= pr->y + pr->h) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return NULL;
+            }
+            ret = PyString_FromStringAndSize(NULL, pr->bpp * (x2 - x1));
+            gimp_pixel_rgn_get_row(pr, (guchar*)PyString_AS_STRING(ret),
+                                   x1, y1, x2 - x1);
+
+        } else if (PySlice_Check(y)) {
+            if (PySlice_GetIndices((PySliceObject*)y, pr->y + pr->h,
+                                   &y1, &y2, &ys) ||
+                y1 >= y2 || ys != 1) {
+                PyErr_SetString(PyExc_IndexError, "invalid y slice");
+                return NULL;
+            }
+
+            if(y1 == 0)
+                y1 = pr->y;
+            if(y1 < pr->y || y2 < pr->y) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return NULL;
+            }
+
+            ret = PyString_FromStringAndSize(NULL,
+                                             pr->bpp * (x2 - x1) * (y2 - y1));
+            gimp_pixel_rgn_get_rect(pr, (guchar*)PyString_AS_STRING(ret),
+                                    x1, y1, x2 - x1, y2 - y1);
 	    }
-	else {
-	    PyErr_SetString(PyExc_TypeError, "invalid y subscript");
-	    return NULL;
-	}
+        else {
+            PyErr_SetString(PyExc_TypeError, "invalid y subscript");
+            return NULL;
+        }
+
     } else {
-	PyErr_SetString(PyExc_TypeError, "invalid x subscript");
-	return NULL;
+        PyErr_SetString(PyExc_TypeError, "invalid x subscript");
+        return NULL;
     }
+    return ret;
 }
 
 static int
 pr_ass_sub(PyGimpPixelRgn *self, PyObject *v, PyObject *w)
 {
     GimpPixelRgn *pr = &(self->pr);
-    int bpp = pr->bpp;
     PyObject *x, *y;
-    guchar *buf;
+    const guchar *buf;
     Py_ssize_t len, x1, x2, xs, y1, y2, ys;
-	
+
     if (w == NULL) {
-	PyErr_SetString(PyExc_TypeError, "can't delete subscripts");
-	return -1;
+        PyErr_SetString(PyExc_TypeError, "can't delete subscripts");
+        return -1;
     }
 
     if (!PyString_Check(w)) {
-	PyErr_SetString(PyExc_TypeError, "must assign string to subscript");
-	return -1;
+        PyErr_SetString(PyExc_TypeError, "must assign string to subscript");
+        return -1;
     }
 
     if (!PyTuple_Check(v) || PyTuple_Size(v) != 2) {
-	PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
-	return -1;
+        PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
+        return -1;
     }
 
     if (!PyArg_ParseTuple(v, "OO", &x, &y))
-	return -1;
+        return -1;
 
-    buf = (guchar *)PyString_AsString(w);
+    buf = (const guchar *)PyString_AsString(w);
     len = PyString_Size(w);
+    if (!buf || len > INT_MAX) {
+        return -1;
+    }
 
     if (PyInt_Check(x)) {
-	x1 = PyInt_AsLong(x);
+        x1 = PyInt_AsSsize_t(x);
+        if (x1 < pr->x || x1 >= pr->x + pr->w) {
+            PyErr_SetString(PyExc_IndexError, "x subscript out of range");
+            return -1;
+        }
 
-	if (pr->x > x1 || x1 >= pr->x + pr->w) {
-	    PyErr_SetString(PyExc_IndexError, "x subscript out of range");
-	    return -1;
-	}
-	
-	if (PyInt_Check(y)) {
-	    y1 = PyInt_AsLong(y);
-	
-	    if (pr->y > y1 || y1 >= pr->y + pr->h) {
-		PyErr_SetString(PyExc_IndexError, "y subscript out of range");
-		return -1;
-	    }
+        if (PyInt_Check(y)) {
+            y1 = PyInt_AsSsize_t(y);
 
-	    if (len != bpp) {
-		PyErr_SetString(PyExc_TypeError, "string is wrong length");
-		return -1;
-	    }
+            if (y1 < pr->y || y1 >= pr->y + pr->h) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return -1;
+            }
+
+            if (len != pr->bpp) {
+                PyErr_SetString(PyExc_TypeError, "string is wrong length");
+                return -1;
+            }
+            gimp_pixel_rgn_set_pixel(pr, buf, x1, y1);
+
+        } else if (PySlice_Check(y)) {
+            if (PySlice_GetIndices((PySliceObject *)y, pr->y + pr->h,
+                                   &y1, &y2, &ys) ||
+                y1 >= y2 || ys != 1) {
+                PyErr_SetString(PyExc_IndexError, "invalid y slice");
+                return -1;
+            }
+            if (y1 == 0)
+                y1 = pr->y;
+
+            if(y1 < pr->y || y2 < pr->y) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return -1;
+            }
+            if (len != pr->bpp * (y2 - y1)) {
+                PyErr_SetString(PyExc_TypeError, "string is wrong length");
+                return -1;
+            }
+            gimp_pixel_rgn_set_col(pr, buf, x1, y1, y2 - y1);
 
-	    gimp_pixel_rgn_set_pixel(pr, buf, x1, y1);
-	    return 0;
-	} else if (PySlice_Check(y)) {
-	    if (PySlice_GetIndices((PySliceObject *)y,
-				   pr->y + pr->h, &y1, &y2, &ys) ||
-		(y1 != 0 && pr->y > y1) ||
-		pr->y > y2 || ys != 1) {
-		PyErr_SetString(PyExc_IndexError, "invalid y slice");
-		return -1;
-	    }
-	    if (y1 == 0) y1 = pr->y;
-	    if (len != bpp * (y2 - y1)) {
-		PyErr_SetString(PyExc_TypeError, "string is wrong length");
-		return -1;
-	    }
-	    gimp_pixel_rgn_set_col(pr, buf, x1, y1, y2 - y1);
-	    return 0;
-	} else {
-	    PyErr_SetString(PyExc_IndexError,"invalid y subscript");
-	    return -1;
-	}
+        } else {
+            PyErr_SetString(PyExc_IndexError,"invalid y subscript");
+            return -1;
+        }
     } else if (PySlice_Check(x)) {
-	if (PySlice_GetIndices((PySliceObject *)x, pr->x + pr->w,
-			       &x1, &x2, &xs) || (x1 != 0 && pr->x > x1) ||
-	    pr->x > x2 || xs != 1) {
-	    PyErr_SetString(PyExc_IndexError, "invalid x slice");
-	    return -1;
-	}
-	if (x1 == 0) x1 = pr->x;
-	if (PyInt_Check(y)) {
-	    y1 = PyInt_AsLong(y);
-	    if (pr->y > y1 || y1 >= pr->y + pr->h) {
-		PyErr_SetString(PyExc_IndexError, "y subscript out of range");
-		return -1;
-	    }
-	    if (len != bpp * (x2 - x1)) {
-		PyErr_SetString(PyExc_TypeError, "string is wrong length");
-		return -1;
-	    }
-	    gimp_pixel_rgn_set_row(pr, buf, x1, y1, x2 - x1);
-	    return 0;
-	} else if (PySlice_Check(y)) {
-	    if (PySlice_GetIndices((PySliceObject *)y,
-				   pr->y + pr->h, &y1, &y2, &ys) ||
-		(y1 != 0 && pr->y > y1) ||
-		pr->y > y2 || ys != 1) {
-		PyErr_SetString(PyExc_IndexError, "invalid y slice");
-		return -1;
-	    }
-	    if (y1 == 0) y1 = pr->y;
-	    if (len != bpp * (x2 - x1) * (y2 - y1)) {
-		PyErr_SetString(PyExc_TypeError, "string is wrong length");
-		return -1;
-	    }
-	    gimp_pixel_rgn_set_rect(pr, buf, x1, y1, x2-x1, y2-y1);
-	    return 0;
-	} else {
-	    PyErr_SetString(PyExc_TypeError,"invalid y subscript");
-	    return -1;
-	}
+        if (PySlice_GetIndices((PySliceObject *)x, pr->x + pr->w,
+                               &x1, &x2, &xs) ||
+	        x1 >= x2 || xs != 1) {
+            PyErr_SetString(PyExc_IndexError, "invalid x slice");
+	        return -1;
+        }
+        if(x1 == 0)
+            x1 = pr->x;
+
+        if(x1 < pr->x || x2 < pr->x) {
+            PyErr_SetString(PyExc_IndexError, "x subscript out of range");
+            return -1;
+        }
+
+        if (PyInt_Check(y)) {
+            y1 = PyInt_AsSsize_t(y);
+
+            if (y1 < pr->y || y1 >= pr->y + pr->h) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return -1;
+            }
+
+            if (len != pr->bpp * (x2 - x1)) {
+                PyErr_SetString(PyExc_TypeError, "string is wrong length");
+                return -1;
+            }
+            gimp_pixel_rgn_set_row(pr, buf, x1, y1, x2 - x1);
+
+        } else if (PySlice_Check(y)) {
+            if (PySlice_GetIndices((PySliceObject *)y, pr->y + pr->h,
+                                   &y1, &y2, &ys) ||
+                y1 >= y2 || ys != 1) {
+                PyErr_SetString(PyExc_IndexError, "invalid y slice");
+                return -1;
+            }
+            if (y1 == 0)
+                y1 = pr->y;
+
+            if(y1 < pr->y || y2 < pr->y) {
+                PyErr_SetString(PyExc_IndexError, "y subscript out of range");
+                return -1;
+            }
+            if (len != pr->bpp * (x2 - x1) * (y2 - y1)) {
+                PyErr_SetString(PyExc_TypeError, "string is wrong length");
+                return -1;
+            }
+            gimp_pixel_rgn_set_rect(pr, buf, x1, y1, x2 - x1, y2 - y1);
+
+        } else {
+            PyErr_SetString(PyExc_IndexError,"invalid y subscript");
+            return -1;
+        }
     } else {
-	PyErr_SetString(PyExc_TypeError, "invalid x subscript");
-	return -1;
+        PyErr_SetString(PyExc_TypeError, "invalid x subscript");
+        return -1;
     }
-    return -1;
+    return 0;
 }
 
 static PyMappingMethods pr_as_mapping = {
@@ -726,7 +764,7 @@
     guchar *pixel;
     static char *kwlist[] = { "x", "y", "pixel", NULL };
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, 
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                                      "iis#:put_pixel", kwlist,
                                       &x, &y, &pixel, &len))
         return NULL;
@@ -902,7 +940,8 @@
 {
     gimp_pixel_fetcher_destroy(self->pf);
 
-    Py_DECREF(self->drawable);
+    Py_XDECREF(self->drawable);
+
     PyObject_DEL(self);
 }
 
@@ -942,6 +981,9 @@
                                      &edge_mode))
         return -1;
 
+    if(!drw->drawable)
+        drw->drawable = gimp_drawable_get(drw->ID);
+
     self->pf = gimp_pixel_fetcher_new(drw->drawable, shadow);
 
     Py_INCREF(drw);

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h	Sun Oct 12 15:38:02 2008
@@ -31,6 +31,7 @@
 typedef int Py_ssize_t;
 #define PY_SSIZE_T_MAX INT_MAX
 #define PY_SSIZE_T_MIN INT_MIN
+#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
 #endif
 
 G_BEGIN_DECLS

Modified: branches/soc-2008-tagging/plug-ins/script-fu/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/Makefile.am	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -10,7 +10,6 @@
 
 libtinyscheme=tinyscheme/libtinyscheme.a
 libftx=ftx/libftx.a
-libre=re/libre.a
 
 if OS_WIN32
 mwindows = -mwindows
@@ -27,7 +26,7 @@
 
 AM_LDFLAGS = $(mwindows)
 
-SUBDIRS = tinyscheme ftx re scripts
+SUBDIRS = tinyscheme ftx scripts
 
 
 libexecdir = $(gimpplugindir)/plug-ins
@@ -35,20 +34,29 @@
 libexec_PROGRAMS = script-fu
 
 script_fu_SOURCES = \
+	script-fu-types.h		\
+	script-fu-enums.h		\
+	\
 	script-fu.c			\
 	script-fu-console.c		\
 	script-fu-console.h		\
+	script-fu-eval.c		\
+	script-fu-eval.h		\
 	script-fu-interface.c		\
 	script-fu-interface.h		\
 	script-fu-text-console.h	\
 	script-fu-text-console.c	\
 	script-fu-intl.h		\
+	script-fu-regex.c		\
+	script-fu-regex.h		\
+	script-fu-script.c		\
+	script-fu-script.h		\
 	script-fu-scripts.c		\
 	script-fu-scripts.h		\
 	script-fu-server.c		\
 	script-fu-server.h		\
-	script-fu-types.h		\
-	script-fu-enums.h		\
+	script-fu-utils.c		\
+	script-fu-utils.h		\
 	scheme-wrapper.c		\
 	scheme-wrapper.h
 
@@ -62,8 +70,6 @@
 	$(libgimpbase)		\
 	$(libtinyscheme)	\
 	$(libftx)		\
-	$(libre)		\
-	$(REGEXREPL)		\
 	$(GTK_LIBS)		\
 	$(SOCKET_LIBS)		\
 	$(WINSOCK_LIBS)		\

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c	Sun Oct 12 15:38:02 2008
@@ -17,13 +17,13 @@
  */
 
 #if 0
-#define DEBUG_MARSHALL       0  /* No need to define this until you need it */
-#define DEBUG_SCRIPTS        0
+#define DEBUG_MARSHALL 0  /* No need to define this until you need it */
+#define DEBUG_SCRIPTS  0
 #endif
 
 #include "config.h"
 
-#include <string.h> /* memcpy, strcpy, strlen */
+#include <string.h>
 
 #include <glib/gstdio.h>
 
@@ -36,26 +36,46 @@
 #include "tinyscheme/dynload.h"
 #endif
 #include "ftx/ftx.h"
-#include "re/re.h"
 
 #include "script-fu-types.h"
 
 #include "script-fu-console.h"
 #include "script-fu-interface.h"
+#include "script-fu-regex.h"
 #include "script-fu-scripts.h"
 #include "script-fu-server.h"
 
 #include "scheme-wrapper.h"
 
+
 #undef cons
 
-struct named_constant
+static void     ts_init_constants                (scheme    *sc);
+static void     ts_init_procedures               (scheme    *sc,
+                                                  gboolean   register_scipts);
+static void     convert_string                   (gchar     *str);
+static pointer  script_fu_marshal_procedure_call (scheme    *sc,
+                                                  pointer    a);
+static void     script_fu_marshal_destroy_args   (GimpParam *params,
+                                                  gint       n_params);
+
+static pointer  script_fu_register_call          (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_menu_register_call     (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_quit_call              (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_nil_call               (scheme    *sc,
+                                                  pointer    a);
+
+
+typedef struct
 {
   const gchar *name;
   gint         value;
-};
+} NamedConstant;
 
-struct named_constant const script_constants[] =
+static const NamedConstant const script_constants[] =
 {
   /* Useful values from libgimpbase/gimplimits.h */
   { "MIN-IMAGE-SIZE", GIMP_MIN_IMAGE_SIZE },
@@ -104,64 +124,65 @@
   { NULL, 0 }
 };
 
-/* The following constants are deprecated. They are */
-/* included to keep backwards compatability with    */
-/* older scripts used with version 2.0 of GIMP.     */
-struct named_constant const old_constants[] =
-{
-  { "NORMAL",       GIMP_NORMAL_MODE       },
-  { "DISSOLVE",     GIMP_DISSOLVE_MODE     },
-  { "BEHIND",       GIMP_BEHIND_MODE       },
-  { "MULTIPLY",     GIMP_MULTIPLY_MODE     },
-  { "SCREEN",       GIMP_SCREEN_MODE       },
-  { "OVERLAY",      GIMP_OVERLAY_MODE      },
-  { "DIFFERENCE",   GIMP_DIFFERENCE_MODE   },
-  { "ADDITION",     GIMP_ADDITION_MODE     },
-  { "SUBTRACT",     GIMP_SUBTRACT_MODE     },
-  { "DARKEN-ONLY",  GIMP_DARKEN_ONLY_MODE  },
-  { "LIGHTEN-ONLY", GIMP_LIGHTEN_ONLY_MODE },
-  { "HUE",          GIMP_HUE_MODE          },
-  { "SATURATION",   GIMP_SATURATION_MODE   },
-  { "COLOR",        GIMP_COLOR_MODE        },
-  { "VALUE",        GIMP_VALUE_MODE        },
-  { "DIVIDE",       GIMP_DIVIDE_MODE       },
-
-  { "BLUR",         GIMP_BLUR_CONVOLVE     },
-  { "SHARPEN",      GIMP_SHARPEN_CONVOLVE  },
-
-  { "WHITE-MASK",     GIMP_ADD_WHITE_MASK     },
-  { "BLACK-MASK",     GIMP_ADD_BLACK_MASK     },
-  { "ALPHA-MASK",     GIMP_ADD_ALPHA_MASK     },
-  { "SELECTION-MASK", GIMP_ADD_SELECTION_MASK },
-  { "COPY-MASK",      GIMP_ADD_COPY_MASK      },
-
-  { "ADD",          GIMP_CHANNEL_OP_ADD       },
-  { "SUB",          GIMP_CHANNEL_OP_SUBTRACT  },
-  { "REPLACE",      GIMP_CHANNEL_OP_REPLACE   },
-  { "INTERSECT",    GIMP_CHANNEL_OP_INTERSECT },
-
-  { "FG-BG-RGB",    GIMP_FG_BG_RGB_MODE       },
-  { "FG-BG-HSV",    GIMP_FG_BG_HSV_MODE       },
-  { "FG-TRANS",     GIMP_FG_TRANSPARENT_MODE  },
-  { "CUSTOM",       GIMP_CUSTOM_MODE          },
-
-  { "FG-IMAGE-FILL",    GIMP_FOREGROUND_FILL  },
-  { "BG-IMAGE-FILL",    GIMP_BACKGROUND_FILL  },
-  { "WHITE-IMAGE-FILL", GIMP_WHITE_FILL       },
-  { "TRANS-IMAGE-FILL", GIMP_TRANSPARENT_FILL },
-
-  { "APPLY",        GIMP_MASK_APPLY   },
-  { "DISCARD",      GIMP_MASK_DISCARD },
-
-  { "HARD",         GIMP_BRUSH_HARD },
-  { "SOFT",         GIMP_BRUSH_SOFT },
-
-  { "CONTINUOUS",   GIMP_PAINT_CONSTANT    },
-  { "INCREMENTAL",  GIMP_PAINT_INCREMENTAL },
-
-  { "HORIZONTAL",   GIMP_ORIENTATION_HORIZONTAL },
-  { "VERTICAL",     GIMP_ORIENTATION_VERTICAL   },
-  { "UNKNOWN",      GIMP_ORIENTATION_UNKNOWN    },
+/* The following constants are deprecated. They are
+ * included to keep backwards compatability with
+ * older scripts used with version 2.0 of GIMP.
+ */
+static const NamedConstant const old_constants[] =
+{
+  { "NORMAL",               GIMP_NORMAL_MODE       },
+  { "DISSOLVE",             GIMP_DISSOLVE_MODE     },
+  { "BEHIND",               GIMP_BEHIND_MODE       },
+  { "MULTIPLY",             GIMP_MULTIPLY_MODE     },
+  { "SCREEN",               GIMP_SCREEN_MODE       },
+  { "OVERLAY",              GIMP_OVERLAY_MODE      },
+  { "DIFFERENCE",           GIMP_DIFFERENCE_MODE   },
+  { "ADDITION",             GIMP_ADDITION_MODE     },
+  { "SUBTRACT",             GIMP_SUBTRACT_MODE     },
+  { "DARKEN-ONLY",          GIMP_DARKEN_ONLY_MODE  },
+  { "LIGHTEN-ONLY",         GIMP_LIGHTEN_ONLY_MODE },
+  { "HUE",                  GIMP_HUE_MODE          },
+  { "SATURATION",           GIMP_SATURATION_MODE   },
+  { "COLOR",                GIMP_COLOR_MODE        },
+  { "VALUE",                GIMP_VALUE_MODE        },
+  { "DIVIDE",               GIMP_DIVIDE_MODE       },
+
+  { "BLUR",                 GIMP_BLUR_CONVOLVE     },
+  { "SHARPEN",              GIMP_SHARPEN_CONVOLVE  },
+
+  { "WHITE-MASK",           GIMP_ADD_WHITE_MASK     },
+  { "BLACK-MASK",           GIMP_ADD_BLACK_MASK     },
+  { "ALPHA-MASK",           GIMP_ADD_ALPHA_MASK     },
+  { "SELECTION-MASK",       GIMP_ADD_SELECTION_MASK },
+  { "COPY-MASK",            GIMP_ADD_COPY_MASK      },
+
+  { "ADD",                  GIMP_CHANNEL_OP_ADD       },
+  { "SUB",                  GIMP_CHANNEL_OP_SUBTRACT  },
+  { "REPLACE",              GIMP_CHANNEL_OP_REPLACE   },
+  { "INTERSECT",            GIMP_CHANNEL_OP_INTERSECT },
+
+  { "FG-BG-RGB",            GIMP_FG_BG_RGB_MODE       },
+  { "FG-BG-HSV",            GIMP_FG_BG_HSV_MODE       },
+  { "FG-TRANS",             GIMP_FG_TRANSPARENT_MODE  },
+  { "CUSTOM",               GIMP_CUSTOM_MODE          },
+
+  { "FG-IMAGE-FILL",        GIMP_FOREGROUND_FILL  },
+  { "BG-IMAGE-FILL",        GIMP_BACKGROUND_FILL  },
+  { "WHITE-IMAGE-FILL",     GIMP_WHITE_FILL       },
+  { "TRANS-IMAGE-FILL",     GIMP_TRANSPARENT_FILL },
+
+  { "APPLY",                GIMP_MASK_APPLY   },
+  { "DISCARD",              GIMP_MASK_DISCARD },
+
+  { "HARD",                 GIMP_BRUSH_HARD },
+  { "SOFT",                 GIMP_BRUSH_SOFT },
+
+  { "CONTINUOUS",           GIMP_PAINT_CONSTANT    },
+  { "INCREMENTAL",          GIMP_PAINT_INCREMENTAL },
+
+  { "HORIZONTAL",           GIMP_ORIENTATION_HORIZONTAL },
+  { "VERTICAL",             GIMP_ORIENTATION_VERTICAL   },
+  { "UNKNOWN",              GIMP_ORIENTATION_UNKNOWN    },
 
   { "LINEAR",               GIMP_GRADIENT_LINEAR               },
   { "BILINEAR",             GIMP_GRADIENT_BILINEAR             },
@@ -175,11 +196,11 @@
   { "SPIRAL-CLOCKWISE",     GIMP_GRADIENT_SPIRAL_CLOCKWISE     },
   { "SPIRAL-ANTICLOCKWISE", GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE },
 
-  { "VALUE-LUT",      GIMP_HISTOGRAM_VALUE },
-  { "RED-LUT",        GIMP_HISTOGRAM_RED   },
-  { "GREEN-LUT",      GIMP_HISTOGRAM_GREEN },
-  { "BLUE-LUT",       GIMP_HISTOGRAM_BLUE  },
-  { "ALPHA-LUT",      GIMP_HISTOGRAM_ALPHA },
+  { "VALUE-LUT",            GIMP_HISTOGRAM_VALUE },
+  { "RED-LUT",              GIMP_HISTOGRAM_RED   },
+  { "GREEN-LUT",            GIMP_HISTOGRAM_GREEN },
+  { "BLUE-LUT",             GIMP_HISTOGRAM_BLUE  },
+  { "ALPHA-LUT",            GIMP_HISTOGRAM_ALPHA },
 
   { NULL, 0 }
 };
@@ -189,84 +210,11 @@
 
 
 void
-ts_stdout_output_func (TsOutputType  type,
-                       const char   *string,
-                       int           len,
-                       gpointer      user_data)
-{
-  if (len < 0)
-    len = strlen (string);
-  fprintf (stdout, "%.*s", len, string);
-}
-
-void
-ts_gstring_output_func (TsOutputType  type,
-                        const char   *string,
-                        int           len,
-                        gpointer      user_data)
-{
-  GString *gstr = (GString *) user_data;
-
-  g_string_append_len (gstr, string, len);
-}
-
-void
-ts_set_print_flag (gint print_flag)
-{
-  sc.print_output = print_flag;
-}
-
-void
-ts_print_welcome (void)
-{
-  ts_output_string (TS_OUTPUT_NORMAL,
-                    "Welcome to TinyScheme, Version 1.38\n", -1);
-  ts_output_string (TS_OUTPUT_NORMAL,
-                    "Copyright (c) Dimitrios Souflis\n", -1);
-}
-
-void
-ts_interpret_stdin (void)
-{
-  scheme_load_file (&sc, stdin);
-}
-
-gint
-ts_interpret_string (const gchar *expr)
-{
-#if DEBUG_SCRIPTS
-  sc.print_output = 1;
-  sc.tracing = 1;
-#endif
-
-  sc.vptr->load_string (&sc, (char *)expr);
-
-  return sc.retcode;
-}
-
-const gchar *
-ts_get_success_msg (void)
-{
-  if (sc.vptr->is_string(sc.value))
-    return sc.vptr->string_value(sc.value);
-
-  return "Success";
-}
-
-
-static void  init_constants  (void);
-static void  init_procedures (void);
-
-static gboolean register_scripts = FALSE;
-
-void
 tinyscheme_init (const gchar *path,
-                 gboolean     local_register_scripts)
+                 gboolean     register_scripts)
 {
-  register_scripts = local_register_scripts;
-
   /* init the interpreter */
-  if (!scheme_init (&sc))
+  if (! scheme_init (&sc))
     {
       g_message ("Could not initialize TinyScheme!");
       return;
@@ -278,11 +226,11 @@
 
   /* Initialize the TinyScheme extensions */
   init_ftx (&sc);
-  init_re (&sc);
+  script_fu_regex_init (&sc);
 
   /* register in the interpreter the gimp functions and types. */
-  init_constants ();
-  init_procedures ();
+  ts_init_constants (&sc);
+  ts_init_procedures (&sc, register_scripts);
 
   if (path)
     {
@@ -327,73 +275,124 @@
     }
 }
 
+/* Create an SF-RUN-MODE constant for use in scripts.
+ * It is set to the run mode state determined by GIMP.
+ */
 void
-tinyscheme_deinit (void)
-{
-  scheme_deinit (&sc);
-}
-
-/* Create an SF-RUN-MODE constant for use in scripts.  */
-/* It is set to the run mode state determined by GIMP. */
-void
-set_run_mode_constant (GimpRunMode run_mode)
+ts_set_run_mode (GimpRunMode run_mode)
 {
   pointer symbol;
 
   symbol = sc.vptr->mk_symbol (&sc, "SF-RUN-MODE");
   sc.vptr->scheme_define (&sc, sc.global_env, symbol,
                           sc.vptr->mk_integer (&sc, run_mode));
-  sc.vptr->setimmutable(symbol);
+  sc.vptr->setimmutable (symbol);
 }
 
-static void     convert_string                   (gchar  *str);
-static pointer  script_fu_marshal_procedure_call (scheme *sc, pointer  a);
-static void     script_fu_marshal_destroy_args   (GimpParam *params,
-                                                  gint       n_params);
+void
+ts_set_print_flag (gint print_flag)
+{
+  sc.print_output = print_flag;
+}
+
+void
+ts_print_welcome (void)
+{
+  ts_output_string (TS_OUTPUT_NORMAL,
+                    "Welcome to TinyScheme, Version 1.38\n", -1);
+  ts_output_string (TS_OUTPUT_NORMAL,
+                    "Copyright (c) Dimitrios Souflis\n", -1);
+}
 
-static pointer  script_fu_register_call          (scheme *sc, pointer  a);
-static pointer  script_fu_menu_register_call     (scheme *sc, pointer  a);
-static pointer  script_fu_quit_call              (scheme *sc, pointer  a);
+void
+ts_interpret_stdin (void)
+{
+  scheme_load_file (&sc, stdin);
+}
 
+gint
+ts_interpret_string (const gchar *expr)
+{
+#if DEBUG_SCRIPTS
+  sc.print_output = 1;
+  sc.tracing = 1;
+#endif
+
+  sc.vptr->load_string (&sc, (char *) expr);
+
+  return sc.retcode;
+}
+
+const gchar *
+ts_get_success_msg (void)
+{
+  if (sc.vptr->is_string (sc.value))
+    return sc.vptr->string_value (sc.value);
+
+  return "Success";
+}
+
+void
+ts_stdout_output_func (TsOutputType  type,
+                       const char   *string,
+                       int           len,
+                       gpointer      user_data)
+{
+  if (len < 0)
+    len = strlen (string);
+  fprintf (stdout, "%.*s", len, string);
+}
+
+void
+ts_gstring_output_func (TsOutputType  type,
+                        const char   *string,
+                        int           len,
+                        gpointer      user_data)
+{
+  GString *gstr = (GString *) user_data;
+
+  g_string_append_len (gstr, string, len);
+}
+
+
+/*  private functions  */
 
 /*
  * Below can be found the functions responsible for registering the
  * gimp functions and types against the scheme interpreter.
  */
-
-
 static void
-init_constants (void)
+ts_init_constants (scheme *sc)
 {
   const gchar **enum_type_names;
   gint          n_enum_type_names;
   gint          i;
   pointer       symbol;
 
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-data-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_data_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-plug-in-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_plug_in_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-locale-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_locale_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-sysconf-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_sysconf_directory ()));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-data-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_data_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-plug-in-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_plug_in_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-locale-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_locale_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-sysconf-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_sysconf_directory ()));
+  sc->vptr->setimmutable (symbol);
 
   enum_type_names = gimp_enums_get_type_names (&n_enum_type_names);
 
@@ -413,10 +412,10 @@
               scheme_name = g_strdup (value->value_name + strlen ("GIMP_"));
               convert_string (scheme_name);
 
-              symbol = sc.vptr->mk_symbol (&sc, scheme_name);
-              sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                                      sc.vptr->mk_integer (&sc, value->value));
-              sc.vptr->setimmutable(symbol);
+              symbol = sc->vptr->mk_symbol (sc, scheme_name);
+              sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                                       sc->vptr->mk_integer (sc, value->value));
+              sc->vptr->setimmutable (symbol);
 
               g_free (scheme_name);
             }
@@ -428,94 +427,88 @@
   /* Constants used in the register block of scripts */
   for (i = 0; script_constants[i].name != NULL; ++i)
     {
-      symbol = sc.vptr->mk_symbol (&sc, script_constants[i].name);
-      sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                              sc.vptr->mk_integer (&sc,
-                                                   script_constants[i].value));
-      sc.vptr->setimmutable(symbol);
+      symbol = sc->vptr->mk_symbol (sc, script_constants[i].name);
+      sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                               sc->vptr->mk_integer (sc,
+                                                     script_constants[i].value));
+      sc->vptr->setimmutable (symbol);
     }
 
   /* Define string constant for use in building paths to files/directories */
-  symbol = sc.vptr->mk_symbol (&sc, "DIR-SEPARATOR");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, G_DIR_SEPARATOR_S));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "DIR-SEPARATOR");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, G_DIR_SEPARATOR_S));
+  sc->vptr->setimmutable (symbol);
 
   /* These constants are deprecated and will be removed at a later date. */
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_directory () ));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-data-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_data_directory () ));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-plugin-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_plug_in_directory () ));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-data-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_data_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-plugin-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_plug_in_directory ()));
+  sc->vptr->setimmutable (symbol);
 
   for (i = 0; old_constants[i].name != NULL; ++i)
     {
-      symbol = sc.vptr->mk_symbol (&sc, old_constants[i].name);
-      sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                              sc.vptr->mk_integer (&sc,
-                                                   old_constants[i].value));
-      sc.vptr->setimmutable(symbol);
+      symbol = sc->vptr->mk_symbol (sc, old_constants[i].name);
+      sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                               sc->vptr->mk_integer (sc,
+                                                     old_constants[i].value));
+      sc->vptr->setimmutable (symbol);
     }
 }
 
 static void
-init_procedures (void)
+ts_init_procedures (scheme   *sc,
+                    gboolean  register_scripts)
 {
-  gchar          **proc_list;
-  gchar           *proc_blurb;
-  gchar           *proc_help;
-  gchar           *proc_author;
-  gchar           *proc_copyright;
-  gchar           *proc_date;
-  GimpPDBProcType  proc_type;
-  gint             nparams;
-  gint             nreturn_vals;
-  GimpParamDef    *params;
-  GimpParamDef    *return_vals;
-  gint             num_procs;
-  gint             i;
-  gchar           *buff;
-  pointer          symbol;
+  gchar   **proc_list;
+  gint      num_procs;
+  gint      i;
+  pointer   symbol;
 
 #if USE_DL
-  symbol = sc.vptr->mk_symbol (&sc,"load-extension");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc, scm_load_ext));
-  sc.vptr->setimmutable(symbol);
-#endif
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-register");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_register_call));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-menu-register");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_menu_register_call));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-quit");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc, script_fu_quit_call));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc,"load-extension");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc, scm_load_ext));
+  sc->vptr->setimmutable (symbol);
+#endif
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-register");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      register_scripts ?
+                                                      script_fu_register_call :
+                                                      script_fu_nil_call));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-menu-register");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      register_scripts ?
+                                                      script_fu_menu_register_call :
+                                                      script_fu_nil_call));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-quit");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc, script_fu_quit_call));
+  sc->vptr->setimmutable (symbol);
 
   /*  register the database execution procedure  */
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-proc-db-call");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_marshal_procedure_call));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-proc-db-call");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      script_fu_marshal_procedure_call));
+  sc->vptr->setimmutable (symbol);
 
   gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", ".*", ".*",
                             &num_procs, &proc_list);
@@ -523,6 +516,17 @@
   /*  Register each procedure as a scheme func  */
   for (i = 0; i < num_procs; i++)
     {
+      gchar           *proc_blurb;
+      gchar           *proc_help;
+      gchar           *proc_author;
+      gchar           *proc_copyright;
+      gchar           *proc_date;
+      GimpPDBProcType  proc_type;
+      gint             n_params;
+      gint             n_return_vals;
+      GimpParamDef    *params;
+      GimpParamDef    *return_vals;
+
       /*  lookup the procedure  */
       if (gimp_procedural_db_proc_info (proc_list[i],
                                         &proc_blurb,
@@ -531,39 +535,42 @@
                                         &proc_copyright,
                                         &proc_date,
                                         &proc_type,
-                                        &nparams, &nreturn_vals,
+                                        &n_params, &n_return_vals,
                                         &params, &return_vals))
-      {
-         /* Build a define that will call the foreign function */
-         /* The Scheme statement was suggested by Simon Budig  */
-         if (nparams == 0)
-           {
-             buff = g_strdup_printf (" (define (%s)"
-                                     " (gimp-proc-db-call \"%s\"))",
-                                     proc_list[i], proc_list[i]);
-           }
-         else
-           {
-             buff = g_strdup_printf (" (define %s (lambda x"
-                                     " (apply gimp-proc-db-call (cons \"%s\" x))))",
-                                     proc_list[i], proc_list[i]);
-           }
-
-         /*  Execute the 'define'  */
-         sc.vptr->load_string (&sc, buff);
-
-         g_free (buff);
-
-         /*  free the queried information  */
-         g_free (proc_blurb);
-         g_free (proc_help);
-         g_free (proc_author);
-         g_free (proc_copyright);
-         g_free (proc_date);
+        {
+          gchar *buff;
 
-         gimp_destroy_paramdefs (params, nparams);
-         gimp_destroy_paramdefs (return_vals, nreturn_vals);
-      }
+          /* Build a define that will call the foreign function.
+           * The Scheme statement was suggested by Simon Budig.
+           */
+          if (n_params == 0)
+            {
+              buff = g_strdup_printf (" (define (%s)"
+                                      " (gimp-proc-db-call \"%s\"))",
+                                      proc_list[i], proc_list[i]);
+            }
+          else
+            {
+              buff = g_strdup_printf (" (define %s (lambda x"
+                                      " (apply gimp-proc-db-call (cons \"%s\" x))))",
+                                      proc_list[i], proc_list[i]);
+            }
+
+          /*  Execute the 'define'  */
+          sc->vptr->load_string (sc, buff);
+
+          g_free (buff);
+
+          /*  free the queried information  */
+          g_free (proc_blurb);
+          g_free (proc_help);
+          g_free (proc_author);
+          g_free (proc_copyright);
+          g_free (proc_date);
+
+          gimp_destroy_paramdefs (params, n_params);
+          gimp_destroy_paramdefs (return_vals, n_return_vals);
+        }
 
       g_free (proc_list[i]);
     }
@@ -583,7 +590,8 @@
 
 /* This is called by the Scheme interpreter to allow calls to GIMP functions */
 static pointer
-script_fu_marshal_procedure_call (scheme *sc, pointer a)
+script_fu_marshal_procedure_call (scheme  *sc,
+                                  pointer  a)
 {
   GimpParam       *args;
   GimpParam       *values = NULL;
@@ -599,15 +607,10 @@
   gint             nreturn_vals;
   GimpParamDef    *params;
   GimpParamDef    *return_vals;
-  gchar            error_str[256];
+  gchar            error_str[1024];
   gint             i;
-  gint             j;
   gint             success = TRUE;
-  pointer          intermediate_val;
   pointer          return_val = sc->NIL;
-  gchar           *string;
-  gint32           n_elements;
-  pointer          vector;
 
 #if DEBUG_MARSHALL
 /* These three #defines are from Tinyscheme (tinyscheme/scheme.c) */
@@ -615,32 +618,16 @@
 #define typeflag(p) ((p)->_flag)
 #define type(p)     (typeflag(p)&T_MASKTYPE)
 
-static const char *ret_types[] = {
-  "GIMP_PDB_INT32",       "GIMP_PDB_INT16",     "GIMP_PDB_INT8",
-  "GIMP_PDB_FLOAT",       "GIMP_PDB_STRING",    "GIMP_PDB_INT32ARRAY",
-  "GIMP_PDB_INT16ARRAY",  "GIMP_PDB_INT8ARRAY", "GIMP_PDB_FLOATARRAY",
-  "GIMP_PDB_STRINGARRAY", "GIMP_PDB_COLOR",     "GIMP_PDB_REGION",
-  "GIMP_PDB_DISPLAY",     "GIMP_PDB_IMAGE",     "GIMP_PDB_LAYER",
-  "GIMP_PDB_CHANNEL",     "GIMP_PDB_DRAWABLE",  "GIMP_PDB_SELECTION",
-  "GIMP_PDB_COLORARRY",   "GIMP_PDB_VECTORS",   "GIMP_PDB_PARASITE",
-  "GIMP_PDB_STATUS",      "GIMP_PDB_END"
-};
-
-static const char *ts_types[] = {
-  "T_NONE",
-  "T_STRING",    "T_NUMBER",     "T_SYMBOL",       "T_PROC",
-  "T_PAIR",      "T_CLOSURE",    "T_CONTINUATION", "T_FOREIGN",
-  "T_CHARACTER", "T_PORT",       "T_VECTOR",       "T_MACRO",
-  "T_PROMISE",   "T_ENVIRONMENT","T_ARRAY"
-};
-
-static const char *status_types[] = {
-  "GIMP_PDB_EXECUTION_ERROR", "GIMP_PDB_CALLING_ERROR",
-  "GIMP_PDB_PASS_THROUGH",    "GIMP_PDB_SUCCESS",
-  "GIMP_PDB_CANCEL"
-};
+  static const char *ts_types[] =
+  {
+    "T_NONE",
+    "T_STRING",    "T_NUMBER",     "T_SYMBOL",       "T_PROC",
+    "T_PAIR",      "T_CLOSURE",    "T_CONTINUATION", "T_FOREIGN",
+    "T_CHARACTER", "T_PORT",       "T_VECTOR",       "T_MACRO",
+    "T_PROMISE",   "T_ENVIRONMENT","T_ARRAY"
+  };
 
-g_printerr ("\nIn script_fu_marshal_procedure_call ()\n");
+  g_printerr ("\nIn %s()\n", G_STRFUNC);
 #endif
 
   /*  Make sure there are arguments  */
@@ -657,10 +644,8 @@
     proc_name = g_strdup (sc->vptr->string_value (a));
 
 #ifdef DEBUG_MARSHALL
-g_printerr ("  proc name: %s\n", proc_name);
-#endif
-#if DEBUG_MARSHALL
-g_printerr ("  parms rcvd: %d\n", sc->vptr->list_length (sc, a)-1);
+  g_printerr ("  proc name: %s\n", proc_name);
+  g_printerr ("  parms rcvd: %d\n", sc->vptr->list_length (sc, a)-1);
 #endif
 
   /*  report the current command  */
@@ -678,7 +663,7 @@
                                       &params, &return_vals))
     {
 #ifdef DEBUG_MARSHALL
-g_printerr ("  Invalid procedure name\n");
+      g_printerr ("  Invalid procedure name\n");
 #endif
       g_snprintf (error_str, sizeof (error_str),
                   "Invalid procedure name %s specified", proc_name);
@@ -698,11 +683,11 @@
     }
 
   /*  Check the supplied number of arguments  */
-  if ( (sc->vptr->list_length (sc, a) - 1) != nparams)
+  if ((sc->vptr->list_length (sc, a) - 1) != nparams)
     {
 #if DEBUG_MARSHALL
-g_printerr ("  Invalid number of arguments (expected %d but received %d)",
-                 nparams, (sc->vptr->list_length (sc, a) - 1));
+      g_printerr ("  Invalid number of arguments (expected %d but received %d)",
+                  nparams, (sc->vptr->list_length (sc, a) - 1));
 #endif
       g_snprintf (error_str, sizeof (error_str),
                   "Invalid number of arguments for %s (expected %d but received %d)",
@@ -718,14 +703,26 @@
 
   for (i = 0; i < nparams; i++)
     {
+      gint32  n_elements;
+      pointer vector;
+      gint    j;
+
       a = sc->vptr->pair_cdr (a);
 
 #if DEBUG_MARSHALL
-g_printerr ("    param %d - expecting type %s (%d)\n",
-                 i+1, ret_types[ params[i].type ], params[i].type);
-g_printerr ("      passed arg is type %s (%d)\n",
-                 ts_types[ type(sc->vptr->pair_car (a)) ],
-                 type(sc->vptr->pair_car (a)));
+      {
+        const gchar *type_name;
+
+        gimp_enum_get_value (GIMP_TYPE_PDB_ARG_TYPE,
+                             params[i].type,
+                             &type_name, NULL, NULL, NULL);
+
+        g_printerr ("    param %d - expecting type %s (%d)\n",
+                    i + 1, type_name, params[i].type);
+        g_printerr ("      passed arg is type %s (%d)\n",
+                    ts_types[ type(sc->vptr->pair_car (a)) ],
+                    type(sc->vptr->pair_car (a)));
+      }
 #endif
 
       args[i].type = params[i].type;
@@ -746,7 +743,7 @@
             {
               args[i].data.d_int32 = sc->vptr->ivalue (sc->vptr->pair_car (a));
 #if DEBUG_MARSHALL
-g_printerr ("      int32 arg is '%d'\n", args[i].data.d_int32);
+              g_printerr ("      int32 arg is '%d'\n", args[i].data.d_int32);
 #endif
             }
           break;
@@ -758,7 +755,7 @@
             {
               args[i].data.d_int16 = (gint16) sc->vptr->ivalue (sc->vptr->pair_car (a));
 #if DEBUG_MARSHALL
-g_printerr ("      int16 arg is '%d'\n", args[i].data.d_int16);
+              g_printerr ("      int16 arg is '%d'\n", args[i].data.d_int16);
 #endif
             }
           break;
@@ -770,7 +767,7 @@
             {
               args[i].data.d_int8 = (guint8) sc->vptr->ivalue (sc->vptr->pair_car (a));
 #if DEBUG_MARSHALL
-g_printerr ("      int8 arg is '%u'\n", args[i].data.d_int8);
+              g_printerr ("      int8 arg is '%u'\n", args[i].data.d_int8);
 #endif
             }
           break;
@@ -782,7 +779,7 @@
             {
               args[i].data.d_float = sc->vptr->rvalue (sc->vptr->pair_car (a));
 #if DEBUG_MARSHALL
-g_printerr ("      float arg is '%f'\n", args[i].data.d_float);
+              g_printerr ("      float arg is '%f'\n", args[i].data.d_float);
 #endif
             }
           break;
@@ -794,7 +791,7 @@
             {
               args[i].data.d_string = sc->vptr->string_value (sc->vptr->pair_car (a));
 #if DEBUG_MARSHALL
-g_printerr ("      string arg is '%s'\n", args[i].data.d_string);
+              g_printerr ("      string arg is '%s'\n", args[i].data.d_string);
 #endif
             }
           break;
@@ -837,18 +834,18 @@
                 }
 
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->vector_length (vector);
-g_printerr ("      int32 vector has %ld elements\n", count);
-if (count > 0)
-  {
-    g_printerr ("     ");
-    for (j = 0; j < count; ++j)
-      g_printerr (" %ld",
-                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
-    g_printerr ("\n");
-  }
-}
+              {
+                glong count = sc->vptr->vector_length (vector);
+                g_printerr ("      int32 vector has %ld elements\n", count);
+                if (count > 0)
+                  {
+                    g_printerr ("     ");
+                    for (j = 0; j < count; ++j)
+                      g_printerr (" %ld",
+                                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                    g_printerr ("\n");
+                  }
+              }
 #endif
             }
           break;
@@ -888,18 +885,18 @@
                 }
 
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->vector_length (vector);
-g_printerr ("      int16 vector has %ld elements\n", count);
-if (count > 0)
-  {
-    g_printerr ("     ");
-    for (j = 0; j < count; ++j)
-      g_printerr (" %ld",
-                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
-    g_printerr ("\n");
-  }
-}
+              {
+                glong count = sc->vptr->vector_length (vector);
+                g_printerr ("      int16 vector has %ld elements\n", count);
+                if (count > 0)
+                  {
+                    g_printerr ("     ");
+                    for (j = 0; j < count; ++j)
+                      g_printerr (" %ld",
+                                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                    g_printerr ("\n");
+                  }
+              }
 #endif
             }
           break;
@@ -941,18 +938,18 @@
                 }
 
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->vector_length (vector);
-g_printerr ("      int8 vector has %ld elements\n", count);
-if (count > 0)
-  {
-    g_printerr ("     ");
-    for (j = 0; j < count; ++j)
-      g_printerr (" %ld",
-                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
-    g_printerr ("\n");
-  }
-}
+              {
+                glong count = sc->vptr->vector_length (vector);
+                g_printerr ("      int8 vector has %ld elements\n", count);
+                if (count > 0)
+                  {
+                    g_printerr ("     ");
+                    for (j = 0; j < count; ++j)
+                      g_printerr (" %ld",
+                                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                    g_printerr ("\n");
+                  }
+              }
 #endif
             }
           break;
@@ -994,18 +991,18 @@
                 }
 
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->vector_length (vector);
-g_printerr ("      float vector has %ld elements\n", count);
-if (count > 0)
-  {
-    g_printerr ("     ");
-    for (j = 0; j < count; ++j)
-      g_printerr (" %f",
-                  sc->vptr->rvalue ( sc->vptr->vector_elem (vector, j) ));
-    g_printerr ("\n");
-  }
-}
+              {
+                glong count = sc->vptr->vector_length (vector);
+                g_printerr ("      float vector has %ld elements\n", count);
+                if (count > 0)
+                  {
+                    g_printerr ("     ");
+                    for (j = 0; j < count; ++j)
+                      g_printerr (" %f",
+                                  sc->vptr->rvalue ( sc->vptr->vector_elem (vector, j) ));
+                    g_printerr ("\n");
+                  }
+              }
 #endif
             }
           break;
@@ -1049,18 +1046,18 @@
                 }
 
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->list_length ( sc, sc->vptr->pair_car (a) );
-g_printerr ("      string vector has %ld elements\n", count);
-if (count > 0)
-  {
-    g_printerr ("     ");
-    for (j = 0; j < count; ++j)
-      g_printerr (" \"%s\"",
-                  args[i].data.d_stringarray[j]);
-    g_printerr ("\n");
-  }
-}
+              {
+                glong count = sc->vptr->list_length ( sc, sc->vptr->pair_car (a) );
+                g_printerr ("      string vector has %ld elements\n", count);
+                if (count > 0)
+                  {
+                    g_printerr ("     ");
+                    for (j = 0; j < count; ++j)
+                      g_printerr (" \"%s\"",
+                                  args[i].data.d_stringarray[j]);
+                    g_printerr ("\n");
+                  }
+              }
 #endif
             }
           break;
@@ -1075,8 +1072,8 @@
 
               gimp_rgb_set_alpha (&args[i].data.d_color, 1.0);
 #if DEBUG_MARSHALL
-g_printerr ("      (%s)\n",
-                 sc->vptr->string_value (sc->vptr->pair_car (a)));
+              g_printerr ("      (%s)\n",
+                          sc->vptr->string_value (sc->vptr->pair_car (a)));
 #endif
             }
           else if (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
@@ -1094,7 +1091,7 @@
 
               gimp_rgba_set_uchar (&args[i].data.d_color, r, g, b, 255);
 #if DEBUG_MARSHALL
-g_printerr ("      (%d %d %d)\n", r, g, b);
+              g_printerr ("      (%d %d %d)\n", r, g, b);
 #endif
             }
           else
@@ -1155,10 +1152,10 @@
                                        r, g, b, 255);
                 }
 #if DEBUG_MARSHALL
-{
-glong count = sc->vptr->vector_length (vector);
-g_printerr ("      color vector has %ld elements\n", count);
-}
+              {
+                glong count = sc->vptr->vector_length (vector);
+                g_printerr ("      color vector has %ld elements\n", count);
+              }
 #endif
             }
           break;
@@ -1184,11 +1181,11 @@
               args[i].data.d_region.height =
                            sc->vptr->ivalue (sc->vptr->pair_car (region));
 #if DEBUG_MARSHALL
-g_printerr ("      (%d %d %d %d)\n",
-                 args[i].data.d_region.x,
-                 args[i].data.d_region.y,
-                 args[i].data.d_region.width,
-                 args[i].data.d_region.height);
+              g_printerr ("      (%d %d %d %d)\n",
+                          args[i].data.d_region.x,
+                          args[i].data.d_region.y,
+                          args[i].data.d_region.width,
+                          args[i].data.d_region.height);
 #endif
             }
           break;
@@ -1199,52 +1196,55 @@
             success = FALSE;
           if (success)
             {
+              pointer temp_val;
+
               /* parasite->name */
-              intermediate_val = sc->vptr->pair_car (a);
+              temp_val = sc->vptr->pair_car (a);
 
-              if (!sc->vptr->is_string (sc->vptr->pair_car (intermediate_val)))
+              if (!sc->vptr->is_string (sc->vptr->pair_car (temp_val)))
                 {
                   success = FALSE;
                   break;
                 }
 
               args[i].data.d_parasite.name =
-                sc->vptr->string_value (sc->vptr->pair_car (intermediate_val));
+                sc->vptr->string_value (sc->vptr->pair_car (temp_val));
 #if DEBUG_MARSHALL
-g_printerr ("      name '%s'\n", args[i].data.d_parasite.name);
+              g_printerr ("      name '%s'\n", args[i].data.d_parasite.name);
 #endif
 
               /* parasite->flags */
-              intermediate_val = sc->vptr->pair_cdr (intermediate_val);
+              temp_val = sc->vptr->pair_cdr (temp_val);
 
-              if (!sc->vptr->is_number (sc->vptr->pair_car (intermediate_val)))
+              if (!sc->vptr->is_number (sc->vptr->pair_car (temp_val)))
                 {
                   success = FALSE;
                   break;
                 }
 
               args[i].data.d_parasite.flags =
-                sc->vptr->ivalue (sc->vptr->pair_car (intermediate_val));
+                sc->vptr->ivalue (sc->vptr->pair_car (temp_val));
 #if DEBUG_MARSHALL
-g_printerr ("      flags %d", args[i].data.d_parasite.flags);
+              g_printerr ("      flags %d", args[i].data.d_parasite.flags);
 #endif
 
               /* parasite->data */
-              intermediate_val = sc->vptr->pair_cdr (intermediate_val);
+              temp_val = sc->vptr->pair_cdr (temp_val);
 
-              if (!sc->vptr->is_string (sc->vptr->pair_car (intermediate_val)))
+              if (!sc->vptr->is_string (sc->vptr->pair_car (temp_val)))
                 {
                   success = FALSE;
                   break;
                 }
 
               args[i].data.d_parasite.size =
-                sc->vptr->ivalue (sc->vptr->pair_car (intermediate_val));
+                sc->vptr->ivalue (sc->vptr->pair_car (temp_val));
               args[i].data.d_parasite.data =
-                sc->vptr->string_value (sc->vptr->pair_car (intermediate_val));
+                sc->vptr->string_value (sc->vptr->pair_car (temp_val));
+
 #if DEBUG_MARSHALL
-g_printerr (", size %d\n", args[i].data.d_parasite.size);
-g_printerr ("      data '%s'\n", (char *)args[i].data.d_parasite.data);
+              g_printerr (", size %d\n", args[i].data.d_parasite.size);
+              g_printerr ("      data '%s'\n", (char *)args[i].data.d_parasite.data);
 #endif
             }
           break;
@@ -1268,19 +1268,19 @@
     }
 
   if (success)
+    {
 #if DEBUG_MARSHALL
-{
-g_printerr ("    calling %s...", proc_name);
+      g_printerr ("    calling %s...", proc_name);
 #endif
-    values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
+      values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
 #if DEBUG_MARSHALL
-g_printerr ("  done.\n");
-}
+      g_printerr ("  done.\n");
 #endif
+    }
   else
     {
 #if DEBUG_MARSHALL
-g_printerr ("  Invalid type for argument %d\n", i+1);
+      g_printerr ("  Invalid type for argument %d\n", i+1);
 #endif
       g_snprintf (error_str, sizeof (error_str),
                   "Invalid type for argument %d to %s",
@@ -1292,7 +1292,7 @@
   if (! values)
     {
 #if DEBUG_MARSHALL
-g_printerr ("  Did not return status\n");
+      g_printerr ("  Did not return status\n");
 #endif
       g_snprintf (error_str, sizeof(error_str),
                   "Procedure execution of %s did not return a status",
@@ -1302,35 +1302,70 @@
     }
 
 #if DEBUG_MARSHALL
-g_printerr ("    return value is %s\n",
-                 status_types[ values[0].data.d_status ]);
+  {
+    const gchar *status_name;
+
+    gimp_enum_get_value (GIMP_TYPE_PDB_STATUS_TYPE,
+                         values[0].data.d_status,
+                         &status_name, NULL, NULL, NULL);
+    g_printerr ("    return value is %s\n", status_name);
+  }
 #endif
 
   switch (values[0].data.d_status)
     {
     case GIMP_PDB_EXECUTION_ERROR:
-      g_snprintf (error_str, sizeof (error_str),
-                  "Procedure execution of %s failed",
-                  proc_name);
+      if (nvalues > 1 && values[1].type == GIMP_PDB_STRING)
+        {
+          g_snprintf (error_str, sizeof (error_str),
+                      "Procedure execution of %s failed: %s",
+                      proc_name, values[1].data.d_string);
+        }
+      else
+        {
+          g_snprintf (error_str, sizeof (error_str),
+                      "Procedure execution of %s failed",
+                      proc_name);
+        }
       return foreign_error (sc, error_str, 0);
       break;
 
     case GIMP_PDB_CALLING_ERROR:
-      g_snprintf (error_str, sizeof (error_str),
-                  "Procedure execution of %s failed on invalid input arguments",
-                  proc_name);
+      if (nvalues > 1 && values[1].type == GIMP_PDB_STRING)
+        {
+          g_snprintf (error_str, sizeof (error_str),
+                      "Procedure execution of %s failed on invalid input arguments: %s",
+                      proc_name, values[1].data.d_string);
+        }
+      else
+        {
+          g_snprintf (error_str, sizeof (error_str),
+                      "Procedure execution of %s failed on invalid input arguments",
+                      proc_name);
+        }
       return foreign_error (sc, error_str, 0);
       break;
 
     case GIMP_PDB_SUCCESS:
 #if DEBUG_MARSHALL
-g_printerr ("    values returned: %d\n", nvalues-1);
+      g_printerr ("    values returned: %d\n", nvalues-1);
 #endif
       for (i = nvalues - 2; i >= 0; --i)
         {
+          const gchar *string;
+          gint         j;
+
 #if DEBUG_MARSHALL
-g_printerr ("      value %d is type %s (%d)\n",
-                 i, ret_types[ return_vals[i].type ], return_vals[i].type);
+          {
+            const gchar *type_name;
+
+            gimp_enum_get_value (GIMP_TYPE_PDB_ARG_TYPE,
+                                 return_vals[i].type,
+                                 &type_name, NULL, NULL, NULL);
+
+            g_printerr ("      value %d is type %s (%d)\n",
+                        i, type_name, return_vals[i].type);
+          }
 #endif
           switch (return_vals[i].type)
             {
@@ -1345,7 +1380,7 @@
               return_val = sc->vptr->cons (sc,
                              sc->vptr->mk_integer (sc,
                                                    values[i + 1].data.d_int32),
-                                                   return_val);
+                             return_val);
               set_safe_foreign (sc, return_val);
               break;
 
@@ -1353,7 +1388,7 @@
               return_val = sc->vptr->cons (sc,
                              sc->vptr->mk_integer (sc,
                                                    values[i + 1].data.d_int16),
-                                                   return_val);
+                             return_val);
               set_safe_foreign (sc, return_val);
               break;
 
@@ -1361,7 +1396,7 @@
               return_val = sc->vptr->cons (sc,
                              sc->vptr->mk_integer (sc,
                                                    values[i + 1].data.d_int8),
-                                                   return_val);
+                             return_val);
               set_safe_foreign (sc, return_val);
               break;
 
@@ -1369,7 +1404,7 @@
               return_val = sc->vptr->cons (sc,
                              sc->vptr->mk_real (sc,
                                                 values[i + 1].data.d_float),
-                                                return_val);
+                             return_val);
               set_safe_foreign (sc, return_val);
               break;
 
@@ -1378,15 +1413,12 @@
               if (! string)
                 string = "";
               return_val = sc->vptr->cons (sc,
-                                           sc->vptr->mk_string (sc, string),
-                                           return_val);
+                             sc->vptr->mk_string (sc, string),
+                             return_val);
               set_safe_foreign (sc, return_val);
               break;
 
             case GIMP_PDB_INT32ARRAY:
-              /*  integer arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
                 gint32  num_int32s = values[i].data.d_int32;
                 gint32 *array      = (gint32 *) values[i + 1].data.d_int32array;
@@ -1405,9 +1437,6 @@
               break;
 
             case GIMP_PDB_INT16ARRAY:
-              /*  integer arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
                 gint32  num_int16s = values[i].data.d_int32;
                 gint16 *array      = (gint16 *) values[i + 1].data.d_int16array;
@@ -1426,13 +1455,10 @@
               break;
 
             case GIMP_PDB_INT8ARRAY:
-              /*  integer arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
-                gint32  num_int8s  = values[i].data.d_int32;
-                guint8 *array      = (guint8 *) values[i + 1].data.d_int8array;
-                pointer vector     = sc->vptr->mk_vector (sc, num_int8s);
+                gint32  num_int8s = values[i].data.d_int32;
+                guint8 *array     = (guint8 *) values[i + 1].data.d_int8array;
+                pointer vector    = sc->vptr->mk_vector (sc, num_int8s);
 
                 return_val = sc->vptr->cons (sc, vector, return_val);
                 set_safe_foreign (sc, return_val);
@@ -1447,13 +1473,10 @@
               break;
 
             case GIMP_PDB_FLOATARRAY:
-              /*  float arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
                 gint32   num_floats = values[i].data.d_int32;
-                gdouble *array  = (gdouble *) values[i + 1].data.d_floatarray;
-                pointer  vector = sc->vptr->mk_vector (sc, num_floats);
+                gdouble *array      = (gdouble *) values[i + 1].data.d_floatarray;
+                pointer  vector     = sc->vptr->mk_vector (sc, num_floats);
 
                 return_val = sc->vptr->cons (sc, vector, return_val);
                 set_safe_foreign (sc, return_val);
@@ -1468,13 +1491,10 @@
               break;
 
             case GIMP_PDB_STRINGARRAY:
-              /*  string arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
                 gint    num_strings = values[i].data.d_int32;
-                gchar **array  = (gchar **) values[i + 1].data.d_stringarray;
-                pointer list   = sc->NIL;
+                gchar **array       = (gchar **) values[i + 1].data.d_stringarray;
+                pointer list        = sc->NIL;
 
                 return_val = sc->vptr->cons (sc, list, return_val);
                 set_safe_foreign (sc, return_val);
@@ -1482,14 +1502,16 @@
                 for (j = num_strings - 1; j >= 0; j--)
                   {
                     list = sc->vptr->cons (sc,
-                                           sc->vptr->mk_string
-                                               (sc, array[j] ? array[j] : ""),
+                                           sc->vptr->mk_string (sc,
+                                                                array[j] ?
+                                                                array[j] : ""),
                                            list);
 
                     /* hook the current list into return_val, so that it
                      * inherits the set_safe_foreign()-protection.
                      * May be removed when tinyscheme fixes the GC issue
-                     * with foreign functions */
+                     * with foreign functions
+                     */
                     sc->vptr->set_car (return_val, list);
                   }
               }
@@ -1497,76 +1519,77 @@
 
             case GIMP_PDB_COLOR:
               {
-                guchar r, g, b;
+                guchar   r, g, b;
+                gpointer temp_val;
 
                 gimp_rgb_get_uchar (&values[i + 1].data.d_color, &r, &g, &b);
 
-                intermediate_val = sc->vptr->cons (sc,
-                    sc->vptr->mk_integer (sc, r),
-                    sc->vptr->cons (sc,
-                        sc->vptr->mk_integer (sc, g),
-                        sc->vptr->cons (sc,
-                            sc->vptr->mk_integer (sc, b),
-                            sc->NIL)));
+                temp_val = sc->vptr->cons (sc,
+                             sc->vptr->mk_integer (sc, r),
+                             sc->vptr->cons (sc,
+                               sc->vptr->mk_integer (sc, g),
+                               sc->vptr->cons (sc,
+                                 sc->vptr->mk_integer (sc, b),
+                                 sc->NIL)));
                 return_val = sc->vptr->cons (sc,
-                                             intermediate_val,
+                                             temp_val,
                                              return_val);
                 set_safe_foreign (sc, return_val);
                 break;
               }
 
             case GIMP_PDB_COLORARRAY:
-              /*  color arrays are always implemented such that the previous
-               *  return value contains the number of strings in the array
-               */
               {
                 gint32   num_colors = values[i].data.d_int32;
-                GimpRGB *array  = (GimpRGB *) values[i + 1].data.d_colorarray;
-                pointer  vector = sc->vptr->mk_vector (sc, num_colors);
+                GimpRGB *array      = (GimpRGB *) values[i + 1].data.d_colorarray;
+                pointer  vector     = sc->vptr->mk_vector (sc, num_colors);
 
                 return_val = sc->vptr->cons (sc, vector, return_val);
                 set_safe_foreign (sc, return_val);
 
                 for (j = 0; j < num_colors; j++)
                   {
-                    guchar r, g, b;
+                    guchar  r, g, b;
+                    pointer temp_val;
 
                     gimp_rgb_get_uchar (&array[j], &r, &g, &b);
 
-                    intermediate_val = sc->vptr->cons (sc,
-                        sc->vptr->mk_integer (sc, r),
-                        sc->vptr->cons (sc,
-                            sc->vptr->mk_integer (sc, g),
-                            sc->vptr->cons (sc,
-                                sc->vptr->mk_integer (sc, b),
-                                sc->NIL)));
+                    temp_val = sc->vptr->cons (sc,
+                                 sc->vptr->mk_integer (sc, r),
+                                 sc->vptr->cons (sc,
+                                   sc->vptr->mk_integer (sc, g),
+                                   sc->vptr->cons (sc,
+                                     sc->vptr->mk_integer (sc, b),
+                                     sc->NIL)));
                     return_val = sc->vptr->cons (sc,
-                                                 intermediate_val,
+                                                 temp_val,
                                                  return_val);
                     set_safe_foreign (sc, return_val);
                   }
               }
               break;
+
             case GIMP_PDB_REGION:
               {
-                gint32 x, y, w, h;
+                gint32  x, y, w, h;
+                pointer temp_val;
 
                 x = values[i + 1].data.d_region.x;
                 y = values[i + 1].data.d_region.y;
                 w = values[i + 1].data.d_region.width;
                 h = values[i + 1].data.d_region.height;
 
-                intermediate_val = sc->vptr->cons (sc,
-                    sc->vptr->mk_integer (sc, x),
-                    sc->vptr->cons (sc,
-                        sc->vptr->mk_integer (sc, y),
-                        sc->vptr->cons (sc,
-                            sc->vptr->mk_integer (sc, w),
-                            sc->vptr->cons (sc,
-                                sc->vptr->mk_integer (sc, h),
-                                sc->NIL))));
+                temp_val = sc->vptr->cons (sc,
+                             sc->vptr->mk_integer (sc, x),
+                             sc->vptr->cons (sc,
+                               sc->vptr->mk_integer (sc, y),
+                               sc->vptr->cons (sc,
+                                 sc->vptr->mk_integer (sc, w),
+                                 sc->vptr->cons (sc,
+                                   sc->vptr->mk_integer (sc, h),
+                                   sc->NIL))));
                 return_val = sc->vptr->cons (sc,
-                                             intermediate_val,
+                                             temp_val,
                                              return_val);
                 set_safe_foreign (sc, return_val);
                 break;
@@ -1576,34 +1599,37 @@
             case GIMP_PDB_PARASITE:
               {
                 if (values[i + 1].data.d_parasite.name == NULL)
+                  {
                     return_val = foreign_error (sc, "Error: null parasite", 0);
+                  }
                 else
                   {
+                    GimpParasite *p = &values[i + 1].data.d_parasite;
+                    pointer       temp_val;
+
                     /* don't move the mk_foo() calls outside this function call,
-                     * otherwise they might be garbage collected away!  */
-                    intermediate_val = sc->vptr->cons (sc,
-                        sc->vptr->mk_string (sc,
-                                             values[i + 1].data.d_parasite.name),
-                        sc->vptr->cons (sc,
-                            sc->vptr->mk_integer (sc,
-                                                  values[i + 1].data.d_parasite.flags),
-                            sc->vptr->cons (sc,
-                                sc->vptr->mk_counted_string (sc,
-                                                             values[i + 1].data.d_parasite.data,
-                                                             values[i + 1].data.d_parasite.size),
-                                 sc->NIL)));
+                     * otherwise they might be garbage collected away!
+                     */
+                    temp_val = sc->vptr->cons (sc,
+                                 sc->vptr->mk_string (sc, p->name),
+                                 sc->vptr->cons (sc,
+                                   sc->vptr->mk_integer (sc, p->flags),
+                                   sc->vptr->cons (sc,
+                                     sc->vptr->mk_counted_string (sc,
+                                                                  p->data,
+                                                                  p->size),
+                                     sc->NIL)));
                     return_val = sc->vptr->cons (sc,
-                                                 intermediate_val,
+                                                 temp_val,
                                                  return_val);
                     set_safe_foreign (sc, return_val);
 
 #if DEBUG_MARSHALL
-g_printerr ("      name '%s'\n", values[i+1].data.d_parasite.name);
-g_printerr ("      flags %d", values[i+1].data.d_parasite.flags);
-g_printerr (", size %d\n", values[i+1].data.d_parasite.size);
-g_printerr ("      data '%.*s'\n",
-                 values[i+1].data.d_parasite.size,
-                 (char *)values[i+1].data.d_parasite.data);
+                    g_printerr ("      name '%s'\n", p->name);
+                    g_printerr ("      flags %d", p->flags);
+                    g_printerr (", size %d\n", p->size);
+                    g_printerr ("      data '%.*s'\n",
+                                p->size, (gchar *) p->data);
 #endif
                   }
               }
@@ -1623,14 +1649,15 @@
       break;
     }
 
-  /* If we have no return value(s) from PDB call, return */
-  /* either TRUE or FALSE to indicate if call succeeded. */
+  /* If we have no return value(s) from PDB call, return
+   * either TRUE or FALSE to indicate if call succeeded.
+   */
   if (return_val == sc->NIL)
     {
       if (values[0].data.d_status == GIMP_PDB_SUCCESS)
-         return_val = sc->vptr->cons (sc, sc->T, sc->NIL);
+        return_val = sc->vptr->cons (sc, sc->T, sc->NIL);
       else
-         return_val = sc->vptr->cons (sc, sc->F, sc->NIL);
+        return_val = sc->vptr->cons (sc, sc->F, sc->NIL);
     }
 
   /*  free the proc name  */
@@ -1662,7 +1689,6 @@
 #endif
 
   return return_val;
-
 }
 
 static void
@@ -1726,25 +1752,22 @@
 }
 
 static pointer
-script_fu_register_call (scheme *sc, pointer a)
+script_fu_register_call (scheme  *sc,
+                         pointer  a)
 {
-  if (register_scripts)
-    return script_fu_add_script (sc, a);
-  else
-    return sc->NIL;
+  return script_fu_add_script (sc, a);
 }
 
 static pointer
-script_fu_menu_register_call (scheme *sc, pointer a)
+script_fu_menu_register_call (scheme  *sc,
+                              pointer  a)
 {
-  if (register_scripts)
-    return script_fu_add_menu (sc, a);
-  else
-    return sc->NIL;
+  return script_fu_add_menu (sc, a);
 }
 
 static pointer
-script_fu_quit_call (scheme *sc, pointer a)
+script_fu_quit_call (scheme  *sc,
+                     pointer  a)
 {
   script_fu_server_quit ();
 
@@ -1752,3 +1775,10 @@
 
   return sc->NIL;
 }
+
+static pointer
+script_fu_nil_call (scheme  *sc,
+                    pointer  a)
+{
+  return sc->NIL;
+}

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.h	Sun Oct 12 15:38:02 2008
@@ -16,35 +16,33 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifndef SCHEME_WRAPPER_H
-#define SCHEME_WRAPPER_H
+#ifndef __SCHEME_WRAPPER_H__
+#define __SCHEME_WRAPPER_H__
 
 #include "tinyscheme/scheme.h"
 
-void          ts_stdout_output_func   (TsOutputType    type,
-                                       const char     *string,
-                                       int             len,
-                                       gpointer        user_data);
+void          tinyscheme_init         (const gchar  *path,
+                                       gboolean      register_scripts);
 
-void          ts_gstring_output_func  (TsOutputType    type,
-                                       const char     *string,
-                                       int             len,
-                                       gpointer        user_data);
+void          ts_set_run_mode         (GimpRunMode   run_mode);
 
-void          ts_set_print_flag    (gint);
-void          ts_print_welcome     (void);
+void          ts_set_print_flag       (gint          print_flag);
+void          ts_print_welcome        (void);
 
-const gchar * ts_get_success_msg   (void);
+const gchar * ts_get_success_msg      (void);
 
-void          tinyscheme_init      (const gchar  *path,
-                                    gboolean      local_register_scripts);
-void          tinyscheme_deinit    (void);
-
-void          set_run_mode_constant (GimpRunMode run_mode);
-
-void          ts_interpret_stdin   (void);
+void          ts_interpret_stdin      (void);
 
 /* if the return value is 0, success. error otherwise. */
-gint          ts_interpret_string  (const gchar *);
+gint          ts_interpret_string     (const gchar  *expr);
+
+void          ts_stdout_output_func   (TsOutputType  type,
+                                       const char   *string,
+                                       int           len,
+                                       gpointer      user_data);
+void          ts_gstring_output_func  (TsOutputType  type,
+                                       const char   *string,
+                                       int           len,
+                                       gpointer      user_data);
 
-#endif /* SCHEME_WRAPPER_H */
+#endif /* __SCHEME_WRAPPER_H__ */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.c	Sun Oct 12 15:38:02 2008
@@ -28,8 +28,6 @@
 
 #include <gdk/gdkkeysyms.h>
 
-#include "tinyscheme/scheme.h"
-
 #include "scheme-wrapper.h"
 #include "script-fu-console.h"
 
@@ -514,10 +512,13 @@
 
   if (console && console->text_view)
     {
-      GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (console->text_view));
+      GtkTextBuffer *buffer;
       GtkTextIter    cursor;
 
+      buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (console->text_view));
+
       gtk_text_buffer_get_end_iter (buffer, &cursor);
+
       if (type == TS_OUTPUT_NORMAL)
         {
           gtk_text_buffer_insert (buffer, &cursor, text, len);
@@ -528,6 +529,7 @@
                                                     text, len, "emphasis",
                                                     NULL);
         }
+
       script_fu_console_scroll_end (console->text_view);
     }
 }
@@ -593,8 +595,11 @@
 
       gtk_entry_set_text (GTK_ENTRY (console->cc), "");
 
-      output = g_string_new ("");
+      output = g_string_new (NULL);
       ts_register_output_func (ts_gstring_output_func, output);
+
+      gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
+
       if (ts_interpret_string (list->data) != 0)
         {
           script_fu_output_to_console (TS_OUTPUT_ERROR,
@@ -610,6 +615,8 @@
                                        console);
         }
 
+      gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_INTERNAL);
+
       g_string_free (output, TRUE);
 
       gimp_displays_flush ();
@@ -689,44 +696,3 @@
 
   return FALSE;
 }
-
-void
-script_fu_eval_run (const gchar      *name,
-                    gint              nparams,
-                    const GimpParam  *params,
-                    gint             *nreturn_vals,
-                    GimpParam       **return_vals)
-{
-  static GimpParam  values[1];
-  GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  GimpRunMode       run_mode;
-
-  run_mode = params[0].data.d_int32;
-  set_run_mode_constant (run_mode);
-
-  switch (run_mode)
-    {
-    case GIMP_RUN_NONINTERACTIVE:
-      /*  Disable Script-Fu output  */
-      ts_register_output_func (NULL, NULL);
-      if (ts_interpret_string (params[1].data.d_string) != 0)
-          status = GIMP_PDB_EXECUTION_ERROR;
-      break;
-
-    case GIMP_RUN_INTERACTIVE:
-    case GIMP_RUN_WITH_LAST_VALS:
-      status = GIMP_PDB_CALLING_ERROR;
-      g_message (_("Script-Fu evaluation mode only allows "
-                   "non-interactive invocation"));
-      break;
-
-    default:
-      break;
-    }
-
-  *nreturn_vals = 1;
-  *return_vals = values;
-
-  values[0].type          = GIMP_PDB_STATUS;
-  values[0].data.d_status = status;
-}

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-console.h	Sun Oct 12 15:38:02 2008
@@ -20,16 +20,11 @@
 #define __SCRIPT_FU_CONSOLE_H__
 
 
-void   script_fu_console_run       (const gchar      *name,
-                                    gint              nparams,
-                                    const GimpParam  *params,
-                                    gint             *nreturn_vals,
-                                    GimpParam       **return_vals);
-void   script_fu_eval_run          (const gchar      *name,
-                                    gint              nparams,
-                                    const GimpParam  *params,
-                                    gint             *nreturn_vals,
-                                    GimpParam       **return_vals);
+void  script_fu_console_run (const gchar      *name,
+                             gint              nparams,
+                             const GimpParam  *params,
+                             gint             *nreturn_vals,
+                             GimpParam       **return_vals);
 
 
-#endif /*  __SCRIPT_FU_CONSOLE__  */
+#endif /*  __SCRIPT_FU_CONSOLE_H__  */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.c	Sun Oct 12 15:38:02 2008
@@ -30,6 +30,7 @@
 
 #include "script-fu-interface.h"
 #include "script-fu-scripts.h"
+#include "script-fu-script.h"
 
 #include "script-fu-intl.h"
 
@@ -108,8 +109,11 @@
  *  Local variables
  */
 
-static SFInterface *sf_interface = NULL;  /*  there can only be at most one
-                                              interactive interface  */
+static SFInterface       *sf_interface = NULL;  /*  there can only be at most
+                                                 *  one interactive interface
+                                                 */
+
+static GimpPDBStatusType  sf_status    = GIMP_PDB_SUCCESS;
 
 
 /*
@@ -153,7 +157,8 @@
 
       if (! g_str_has_prefix (command, "gimp-progress-"))
         {
-          gtk_label_set_text (GTK_LABEL (sf_interface->progress_label), command);
+          gtk_label_set_text (GTK_LABEL (sf_interface->progress_label),
+                              command);
         }
       else
         {
@@ -165,9 +170,9 @@
     gtk_main_iteration ();
 }
 
-void
-script_fu_interface (SFScript *script,
-                     gint      start_arg)
+GimpPDBStatusType
+script_fu_interface (SFScript  *script,
+                     gint       start_arg)
 {
   GtkWidget    *dialog;
   GtkWidget    *menu;
@@ -175,15 +180,15 @@
   GtkWidget    *vbox2;
   GtkSizeGroup *group;
   GSList       *list;
-  gchar        *tmp;
   gchar        *title;
   gint          i;
 
   static gboolean gtk_initted = FALSE;
 
-  /*  Simply return if there is already an interface. This is an
-      ugly workaround for the fact that we can not process two
-      scripts at a time.  */
+  /* Simply return if there is already an interface. This is an
+   * ugly workaround for the fact that we can not process two
+   * scripts at a time.
+   */
   if (sf_interface != NULL)
     {
       gchar *message =
@@ -195,10 +200,10 @@
       g_message (message, sf_interface->title);
       g_free (message);
 
-      return;
+      return GIMP_PDB_CANCEL;
     }
 
-  g_return_if_fail (script != NULL);
+  g_return_val_if_fail (script != NULL, FALSE);
 
   if (!gtk_initted)
     {
@@ -209,31 +214,12 @@
       gtk_initted = TRUE;
     }
 
-  sf_interface = g_slice_new0 (SFInterface);
-
-  sf_interface->widgets = g_new0 (GtkWidget *, script->num_args);
-
-  /* strip mnemonics from the menupath */
-  sf_interface->title = gimp_strip_uline (gettext (script->menu_path));
-
-  /* if this looks like a full menu path, use only the last part */
-  if (sf_interface->title[0] == '<' &&
-      (tmp = strrchr (sf_interface->title, '/')) && tmp[1])
-    {
-      tmp = g_strdup (tmp + 1);
+  sf_status = GIMP_PDB_SUCCESS;
 
-      g_free (sf_interface->title);
-      sf_interface->title = tmp;
-    }
-
-  /* cut off ellipsis */
-  tmp = (strstr (sf_interface->title, "..."));
-  if (! tmp)
-    /* U+2026 HORIZONTAL ELLIPSIS */
-    tmp = strstr (sf_interface->title, "\342\200\246");
+  sf_interface = g_slice_new0 (SFInterface);
 
-  if (tmp && tmp == (sf_interface->title + strlen (sf_interface->title) - 3))
-    *tmp = '\0';
+  sf_interface->widgets = g_new0 (GtkWidget *, script->n_args);
+  sf_interface->title   = script_fu_script_get_title (script);
 
   title = g_strdup_printf (_("Script-Fu: %s"), sf_interface->title);
 
@@ -249,7 +235,7 @@
                      NULL);
   g_free (title);
 
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (sf_interface->dialog),
+  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
                                            RESPONSE_RESET,
                                            GTK_RESPONSE_OK,
                                            GTK_RESPONSE_CANCEL,
@@ -274,7 +260,7 @@
   gtk_widget_show (vbox);
 
   /*  The argument table  */
-  sf_interface->table = gtk_table_new (script->num_args - start_arg, 3, FALSE);
+  sf_interface->table = gtk_table_new (script->n_args - start_arg, 3, FALSE);
 
   gtk_table_set_col_spacings (GTK_TABLE (sf_interface->table), 6);
   gtk_table_set_row_spacings (GTK_TABLE (sf_interface->table), 6);
@@ -283,7 +269,7 @@
 
   group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
-  for (i = start_arg; i < script->num_args; i++)
+  for (i = start_arg; i < script->n_args; i++)
     {
       GtkWidget *widget       = NULL;
       GtkObject *adj;
@@ -292,263 +278,263 @@
       gint      *ID_ptr       = NULL;
       gint       row          = i;
       gboolean   left_align   = FALSE;
+      SFArg     *arg          = &script->args[i];
 
       row -= start_arg;
 
       /*  we add a colon after the label;
-          some languages want an extra space here  */
-      label_text = g_strdup_printf (_("%s:"), gettext (script->arg_labels[i]));
+       *  some languages want an extra space here
+       */
+      label_text = g_strdup_printf (_("%s:"), gettext (arg->label));
 
-      switch (script->arg_types[i])
-      {
-      case SF_IMAGE:
-      case SF_DRAWABLE:
-      case SF_LAYER:
-      case SF_CHANNEL:
-      case SF_VECTORS:
-        switch (script->arg_types[i])
-          {
-          case SF_IMAGE:
-            widget = gimp_image_combo_box_new (NULL, NULL);
-            ID_ptr = &script->arg_values[i].sfa_image;
-            break;
-
-          case SF_DRAWABLE:
-            widget = gimp_drawable_combo_box_new (NULL, NULL);
-            ID_ptr = &script->arg_values[i].sfa_drawable;
-            break;
-
-          case SF_LAYER:
-            widget = gimp_layer_combo_box_new (NULL, NULL);
-            ID_ptr = &script->arg_values[i].sfa_layer;
-            break;
-
-          case SF_CHANNEL:
-            widget = gimp_channel_combo_box_new (NULL, NULL);
-            ID_ptr = &script->arg_values[i].sfa_channel;
-            break;
-
-          case SF_VECTORS:
-            widget = gimp_vectors_combo_box_new (NULL, NULL);
-            ID_ptr = &script->arg_values[i].sfa_vectors;
-            break;
-
-          default:
-            menu = NULL;
-            break;
-          }
+      switch (arg->type)
+        {
+        case SF_IMAGE:
+        case SF_DRAWABLE:
+        case SF_LAYER:
+        case SF_CHANNEL:
+        case SF_VECTORS:
+          switch (arg->type)
+            {
+            case SF_IMAGE:
+              widget = gimp_image_combo_box_new (NULL, NULL);
+              ID_ptr = &arg->value.sfa_image;
+              break;
+
+            case SF_DRAWABLE:
+              widget = gimp_drawable_combo_box_new (NULL, NULL);
+              ID_ptr = &arg->value.sfa_drawable;
+              break;
+
+            case SF_LAYER:
+              widget = gimp_layer_combo_box_new (NULL, NULL);
+              ID_ptr = &arg->value.sfa_layer;
+              break;
+
+            case SF_CHANNEL:
+              widget = gimp_channel_combo_box_new (NULL, NULL);
+              ID_ptr = &arg->value.sfa_channel;
+              break;
+
+            case SF_VECTORS:
+              widget = gimp_vectors_combo_box_new (NULL, NULL);
+              ID_ptr = &arg->value.sfa_vectors;
+              break;
+
+            default:
+              menu = NULL;
+              break;
+            }
 
           gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (widget), *ID_ptr,
                                       G_CALLBACK (gimp_int_combo_box_get_active),
                                       ID_ptr);
-        break;
-
-      case SF_COLOR:
-        left_align = TRUE;
-        widget = gimp_color_button_new (_("Script-Fu Color Selection"),
-                                        COLOR_SAMPLE_WIDTH,
-                                        COLOR_SAMPLE_HEIGHT,
-                                        &script->arg_values[i].sfa_color,
-                                        GIMP_COLOR_AREA_FLAT);
-
-        gimp_color_button_set_update (GIMP_COLOR_BUTTON (widget), TRUE);
-
-        g_signal_connect (widget, "color-changed",
-                          G_CALLBACK (gimp_color_button_get_color),
-                          &script->arg_values[i].sfa_color);
-        break;
-
-      case SF_TOGGLE:
-        g_free (label_text);
-        label_text = NULL;
-        widget =
-              gtk_check_button_new_with_mnemonic (gettext (script->arg_labels[i]));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-                                      script->arg_values[i].sfa_toggle);
-
-        g_signal_connect (widget, "toggled",
-                          G_CALLBACK (gimp_toggle_button_update),
-                          &script->arg_values[i].sfa_toggle);
-        break;
+          break;
 
-      case SF_VALUE:
-      case SF_STRING:
-        widget = gtk_entry_new ();
-        gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
-        gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+        case SF_COLOR:
+          left_align = TRUE;
+          widget = gimp_color_button_new (_("Script-Fu Color Selection"),
+                                          COLOR_SAMPLE_WIDTH,
+                                          COLOR_SAMPLE_HEIGHT,
+                                          &arg->value.sfa_color,
+                                          GIMP_COLOR_AREA_FLAT);
+
+          gimp_color_button_set_update (GIMP_COLOR_BUTTON (widget), TRUE);
+
+          g_signal_connect (widget, "color-changed",
+                            G_CALLBACK (gimp_color_button_get_color),
+                            &arg->value.sfa_color);
+          break;
 
-        gtk_entry_set_text (GTK_ENTRY (widget),
-                            script->arg_values[i].sfa_value);
-        break;
+        case SF_TOGGLE:
+          g_free (label_text);
+          label_text = NULL;
+          widget = gtk_check_button_new_with_mnemonic (gettext (arg->label));
+          gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+                                        arg->value.sfa_toggle);
 
-      case SF_TEXT:
-        {
-          GtkWidget     *view;
-          GtkTextBuffer *buffer;
+          g_signal_connect (widget, "toggled",
+                            G_CALLBACK (gimp_toggle_button_update),
+                            &arg->value.sfa_toggle);
+          break;
 
-          widget = gtk_scrolled_window_new (NULL, NULL);
-          gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
-                                               GTK_SHADOW_IN);
-          gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
-                                          GTK_POLICY_AUTOMATIC,
-                                          GTK_POLICY_AUTOMATIC);
+        case SF_VALUE:
+        case SF_STRING:
+          widget = gtk_entry_new ();
           gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
+          gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
 
-          view = gtk_text_view_new ();
-          gtk_container_add (GTK_CONTAINER (widget), view);
-          gtk_widget_show (view);
+          gtk_entry_set_text (GTK_ENTRY (widget), arg->value.sfa_value);
+          break;
 
-          buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
-          gtk_text_view_set_editable (GTK_TEXT_VIEW (view), TRUE);
+        case SF_TEXT:
+          {
+            GtkWidget     *view;
+            GtkTextBuffer *buffer;
 
-          gtk_text_buffer_set_text (buffer,
-                                    script->arg_values[i].sfa_value, -1);
+            widget = gtk_scrolled_window_new (NULL, NULL);
+            gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
+                                                 GTK_SHADOW_IN);
+            gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
+                                            GTK_POLICY_AUTOMATIC,
+                                            GTK_POLICY_AUTOMATIC);
+            gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
+
+            view = gtk_text_view_new ();
+            gtk_container_add (GTK_CONTAINER (widget), view);
+            gtk_widget_show (view);
 
-          label_yalign = 0.0;
-        }
-        break;
+            buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+            gtk_text_view_set_editable (GTK_TEXT_VIEW (view), TRUE);
 
-      case SF_ADJUSTMENT:
-        switch (script->arg_defaults[i].sfa_adjustment.type)
-          {
-          case SF_SLIDER:
-            script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
-              gimp_scale_entry_new (GTK_TABLE (sf_interface->table),
-                        0, row,
-                        label_text, SLIDER_WIDTH, -1,
-                        script->arg_values[i].sfa_adjustment.value,
-                        script->arg_defaults[i].sfa_adjustment.lower,
-                        script->arg_defaults[i].sfa_adjustment.upper,
-                        script->arg_defaults[i].sfa_adjustment.step,
-                        script->arg_defaults[i].sfa_adjustment.page,
-                        script->arg_defaults[i].sfa_adjustment.digits,
-                        TRUE, 0.0, 0.0,
-                        NULL, NULL);
-              gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (script->arg_values[i].sfa_adjustment.adj), TRUE);
-            break;
-
-          default:
-            g_warning ("unexpected adjustment type: %d",
-                       script->arg_defaults[i].sfa_adjustment.type);
-            /* fallthrough */
-
-          case SF_SPINNER:
-            left_align = TRUE;
-            widget =
-              gimp_spin_button_new (&adj,
-                                    script->arg_values[i].sfa_adjustment.value,
-                                    script->arg_defaults[i].sfa_adjustment.lower,
-                                    script->arg_defaults[i].sfa_adjustment.upper,
-                                    script->arg_defaults[i].sfa_adjustment.step,
-                                    script->arg_defaults[i].sfa_adjustment.page,
-                                    0, 0,
-                                    script->arg_defaults[i].sfa_adjustment.digits);
-            gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
-            script->arg_values[i].sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
-            break;
+            gtk_text_buffer_set_text (buffer, arg->value.sfa_value, -1);
+
+            label_yalign = 0.0;
           }
+          break;
 
-          g_signal_connect (script->arg_values[i].sfa_adjustment.adj,
+        case SF_ADJUSTMENT:
+          switch (arg->default_value.sfa_adjustment.type)
+            {
+            case SF_SLIDER:
+              arg->value.sfa_adjustment.adj = (GtkAdjustment *)
+                gimp_scale_entry_new (GTK_TABLE (sf_interface->table),
+                                      0, row,
+                                      label_text, SLIDER_WIDTH, -1,
+                                      arg->value.sfa_adjustment.value,
+                                      arg->default_value.sfa_adjustment.lower,
+                                      arg->default_value.sfa_adjustment.upper,
+                                      arg->default_value.sfa_adjustment.step,
+                                      arg->default_value.sfa_adjustment.page,
+                                      arg->default_value.sfa_adjustment.digits,
+                                      TRUE, 0.0, 0.0,
+                                      NULL, NULL);
+              gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (arg->value.sfa_adjustment.adj), TRUE);
+              break;
+
+            default:
+              g_warning ("unexpected adjustment type: %d",
+                         arg->default_value.sfa_adjustment.type);
+              /* fallthrough */
+
+            case SF_SPINNER:
+              left_align = TRUE;
+              widget =
+                gimp_spin_button_new (&adj,
+                                      arg->value.sfa_adjustment.value,
+                                      arg->default_value.sfa_adjustment.lower,
+                                      arg->default_value.sfa_adjustment.upper,
+                                      arg->default_value.sfa_adjustment.step,
+                                      arg->default_value.sfa_adjustment.page,
+                                      0, 0,
+                                      arg->default_value.sfa_adjustment.digits);
+              gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+              arg->value.sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
+              break;
+            }
+
+          g_signal_connect (arg->value.sfa_adjustment.adj,
                             "value-changed",
                             G_CALLBACK (gimp_double_adjustment_update),
-                            &script->arg_values[i].sfa_adjustment.value);
-        break;
+                            &arg->value.sfa_adjustment.value);
+          break;
 
-      case SF_FILENAME:
-      case SF_DIRNAME:
-        if (script->arg_types[i] == SF_FILENAME)
-          widget = gtk_file_chooser_button_new (_("Script-Fu File Selection"),
-                                                GTK_FILE_CHOOSER_ACTION_OPEN);
+        case SF_FILENAME:
+        case SF_DIRNAME:
+          if (arg->type == SF_FILENAME)
+            widget = gtk_file_chooser_button_new (_("Script-Fu File Selection"),
+                                                  GTK_FILE_CHOOSER_ACTION_OPEN);
           else
             widget = gtk_file_chooser_button_new (_("Script-Fu Folder Selection"),
                                                   GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
-        if (script->arg_values[i].sfa_file.filename)
-          gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
-                                           script->arg_values[i].sfa_file.filename);
 
-        g_signal_connect (widget, "selection-changed",
-                          G_CALLBACK (script_fu_file_callback),
-                          &script->arg_values[i].sfa_file);
-        break;
+          if (arg->value.sfa_file.filename)
+            gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
+                                           arg->value.sfa_file.filename);
+
+          g_signal_connect (widget, "selection-changed",
+                            G_CALLBACK (script_fu_file_callback),
+                            &arg->value.sfa_file);
+          break;
 
-      case SF_FONT:
-        widget = gimp_font_select_button_new (_("Script-Fu Font Selection"),
-                                              script->arg_values[i].sfa_font);
-        g_signal_connect_swapped (widget, "font-set",
-                                  G_CALLBACK (script_fu_font_callback),
-                                  &script->arg_values[i].sfa_font);
-        break;
+        case SF_FONT:
+          widget = gimp_font_select_button_new (_("Script-Fu Font Selection"),
+                                                arg->value.sfa_font);
+          g_signal_connect_swapped (widget, "font-set",
+                                    G_CALLBACK (script_fu_font_callback),
+                                    &arg->value.sfa_font);
+          break;
 
-      case SF_PALETTE:
-        widget = gimp_palette_select_button_new (_("Script-Fu Palette Selection"),
-                                                 script->arg_values[i].sfa_palette);
-        g_signal_connect_swapped (widget, "palette-set",
-                                  G_CALLBACK (script_fu_palette_callback),
-                                  &script->arg_values[i].sfa_palette);
-        break;
+        case SF_PALETTE:
+          widget = gimp_palette_select_button_new (_("Script-Fu Palette Selection"),
+                                                   arg->value.sfa_palette);
+          g_signal_connect_swapped (widget, "palette-set",
+                                    G_CALLBACK (script_fu_palette_callback),
+                                    &arg->value.sfa_palette);
+          break;
 
-      case SF_PATTERN:
-        left_align = TRUE;
-        widget = gimp_pattern_select_button_new (_("Script-Fu Pattern Selection"),
-                                                 script->arg_values[i].sfa_pattern);
-        g_signal_connect_swapped (widget, "pattern-set",
-                                  G_CALLBACK (script_fu_pattern_callback),
-                                  &script->arg_values[i].sfa_pattern);
-        break;
+        case SF_PATTERN:
+          left_align = TRUE;
+          widget = gimp_pattern_select_button_new (_("Script-Fu Pattern Selection"),
+                                                   arg->value.sfa_pattern);
+          g_signal_connect_swapped (widget, "pattern-set",
+                                    G_CALLBACK (script_fu_pattern_callback),
+                                    &arg->value.sfa_pattern);
+          break;
 
-      case SF_GRADIENT:
-        left_align = TRUE;
-        widget = gimp_gradient_select_button_new (_("Script-Fu Gradient Selection"),
-                                                  script->arg_values[i].sfa_gradient);
-        g_signal_connect_swapped (widget, "gradient-set",
-                                  G_CALLBACK (script_fu_gradient_callback),
-                                  &script->arg_values[i].sfa_gradient);
-        break;
+        case SF_GRADIENT:
+          left_align = TRUE;
+          widget = gimp_gradient_select_button_new (_("Script-Fu Gradient Selection"),
+                                                    arg->value.sfa_gradient);
+          g_signal_connect_swapped (widget, "gradient-set",
+                                    G_CALLBACK (script_fu_gradient_callback),
+                                    &arg->value.sfa_gradient);
+          break;
 
-      case SF_BRUSH:
-        left_align = TRUE;
-        widget = gimp_brush_select_button_new (_("Script-Fu Brush Selection"),
-                                               script->arg_values[i].sfa_brush.name,
-                                               script->arg_values[i].sfa_brush.opacity,
-                                               script->arg_values[i].sfa_brush.spacing,
-                                               script->arg_values[i].sfa_brush.paint_mode);
-        g_signal_connect_swapped (widget, "brush-set",
-                                  G_CALLBACK (script_fu_brush_callback),
-                                  &script->arg_values[i].sfa_brush);
-        break;
+        case SF_BRUSH:
+          left_align = TRUE;
+          widget = gimp_brush_select_button_new (_("Script-Fu Brush Selection"),
+                                                 arg->value.sfa_brush.name,
+                                                 arg->value.sfa_brush.opacity,
+                                                 arg->value.sfa_brush.spacing,
+                                                 arg->value.sfa_brush.paint_mode);
+          g_signal_connect_swapped (widget, "brush-set",
+                                    G_CALLBACK (script_fu_brush_callback),
+                                    &arg->value.sfa_brush);
+          break;
 
-      case SF_OPTION:
-        widget = gtk_combo_box_new_text ();
-        for (list = script->arg_defaults[i].sfa_option.list;
-             list;
-             list = g_slist_next (list))
-          {
-            gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
-                                       gettext ((const gchar *) list->data));
-          }
+        case SF_OPTION:
+          widget = gtk_combo_box_new_text ();
+          for (list = arg->default_value.sfa_option.list;
+               list;
+               list = g_slist_next (list))
+            {
+              gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
+                                         gettext ((const gchar *) list->data));
+            }
 
-        gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
-                                  script->arg_values[i].sfa_option.history);
+          gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
+                                    arg->value.sfa_option.history);
 
-        g_signal_connect (widget, "changed",
-                          G_CALLBACK (script_fu_combo_callback),
-                          &script->arg_values[i].sfa_option);
-        break;
+          g_signal_connect (widget, "changed",
+                            G_CALLBACK (script_fu_combo_callback),
+                            &arg->value.sfa_option);
+          break;
 
-      case SF_ENUM:
-        widget = gimp_enum_combo_box_new (g_type_from_name (script->arg_defaults[i].sfa_enum.type_name));
+        case SF_ENUM:
+          widget = gimp_enum_combo_box_new (g_type_from_name (arg->default_value.sfa_enum.type_name));
 
-        gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget),
-                                       script->arg_values[i].sfa_enum.history);
+          gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget),
+                                         arg->value.sfa_enum.history);
 
-        g_signal_connect (widget, "changed",
-                          G_CALLBACK (gimp_int_combo_box_get_active),
-                          &script->arg_values[i].sfa_enum.history);
-        break;
+          g_signal_connect (widget, "changed",
+                            G_CALLBACK (gimp_int_combo_box_get_active),
+                            &arg->value.sfa_enum.history);
+          break;
 
-      case SF_DISPLAY:
-        break;
-      }
+        case SF_DISPLAY:
+          break;
+        }
 
       if (widget)
         {
@@ -601,6 +587,8 @@
   gtk_widget_show (dialog);
 
   gtk_main ();
+
+  return sf_status;
 }
 
 static void
@@ -613,8 +601,8 @@
 
   g_free (sf_interface->title);
 
-  for (i = 0; i < script->num_args; i++)
-    switch (script->arg_types[i])
+  for (i = 0; i < script->n_args; i++)
+    switch (script->args[i].type)
       {
       case SF_FONT:
       case SF_PALETTE:
@@ -635,8 +623,7 @@
   g_slice_free (SFInterface, sf_interface);
   sf_interface = NULL;
 
-  /*
-   *  We do not call gtk_main_quit() earlier to reduce the possibility
+  /*  We do not call gtk_main_quit() earlier to reduce the possibility
    *  that script_fu_script_proc() is called from gimp_extension_process()
    *  while we are not finished with the current script. This sucks!
    */
@@ -750,9 +737,11 @@
                                 FALSE);
 
       script_fu_ok (script);
-      /* fallthru */
+      gtk_widget_destroy (sf_interface->dialog);
+      break;
 
     default:
+      sf_status = GIMP_PDB_CANCEL;
       gtk_widget_destroy (sf_interface->dialog);
       break;
     }
@@ -761,23 +750,16 @@
 static void
 script_fu_ok (SFScript *script)
 {
-  gchar   *escaped;
-  GString *s, *output;
+  GString *output;
   gchar   *command;
-  gchar    buffer[G_ASCII_DTOSTR_BUF_SIZE];
   gint     i;
 
-  s = g_string_new ("(");
-  g_string_append (s, script->name);
-
-  for (i = 0; i < script->num_args; i++)
+  for (i = 0; i < script->n_args; i++)
     {
-      SFArgValue *arg_value = &script->arg_values[i];
+      SFArgValue *arg_value = &script->args[i].value;
       GtkWidget  *widget    = sf_interface->widgets[i];
 
-      g_string_append_c (s, ' ');
-
-      switch (script->arg_types[i])
+      switch (script->args[i].type)
         {
         case SF_IMAGE:
         case SF_DRAWABLE:
@@ -785,39 +767,15 @@
         case SF_CHANNEL:
         case SF_VECTORS:
         case SF_DISPLAY:
-          g_string_append_printf (s, "%d", arg_value->sfa_image);
-          break;
-
         case SF_COLOR:
-          {
-            guchar r, g, b;
-
-            gimp_rgb_get_uchar (&arg_value->sfa_color, &r, &g, &b);
-            g_string_append_printf (s, "'(%d %d %d)",
-                                    (gint) r, (gint) g, (gint) b);
-          }
-          break;
-
         case SF_TOGGLE:
-          g_string_append (s, arg_value->sfa_toggle ? "TRUE" : "FALSE");
           break;
 
         case SF_VALUE:
-          g_free (arg_value->sfa_value);
-          arg_value->sfa_value =
-            g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
-
-          g_string_append (s, arg_value->sfa_value);
-          break;
-
         case SF_STRING:
           g_free (arg_value->sfa_value);
           arg_value->sfa_value =
             g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
-
-          escaped = script_fu_strescape (arg_value->sfa_value);
-          g_string_append_printf (s, "\"%s\"", escaped);
-          g_free (escaped);
           break;
 
         case SF_TEXT:
@@ -836,72 +794,42 @@
             arg_value->sfa_value = gtk_text_buffer_get_text (buffer,
                                                              &start, &end,
                                                              FALSE);
-
-            escaped = script_fu_strescape (arg_value->sfa_value);
-            g_string_append_printf (s, "\"%s\"", escaped);
-            g_free (escaped);
           }
           break;
 
         case SF_ADJUSTMENT:
-          g_ascii_dtostr (buffer, sizeof (buffer),
-                          arg_value->sfa_adjustment.value);
-          g_string_append (s, buffer);
-          break;
-
         case SF_FILENAME:
         case SF_DIRNAME:
-          escaped = script_fu_strescape (arg_value->sfa_file.filename);
-          g_string_append_printf (s, "\"%s\"", escaped);
-          g_free (escaped);
-          break;
-
         case SF_FONT:
-          g_string_append_printf (s, "\"%s\"", arg_value->sfa_font);
-          break;
-
         case SF_PALETTE:
-          g_string_append_printf (s, "\"%s\"", arg_value->sfa_palette);
-          break;
-
         case SF_PATTERN:
-          g_string_append_printf (s, "\"%s\"", arg_value->sfa_pattern);
-          break;
-
         case SF_GRADIENT:
-          g_string_append_printf (s, "\"%s\"", arg_value->sfa_gradient);
-          break;
-
         case SF_BRUSH:
-          g_ascii_dtostr (buffer, sizeof (buffer),
-                          arg_value->sfa_brush.opacity);
-
-          g_string_append_printf (s, "'(\"%s\" %s %d %d)",
-                                  arg_value->sfa_brush.name,
-                                  buffer,
-                                  arg_value->sfa_brush.spacing,
-                                  arg_value->sfa_brush.paint_mode);
-          break;
-
         case SF_OPTION:
-          g_string_append_printf (s, "%d", arg_value->sfa_option.history);
-          break;
-
         case SF_ENUM:
-          g_string_append_printf (s, "%d", arg_value->sfa_enum.history);
           break;
         }
     }
 
-  g_string_append_c (s, ')');
-
-  command = g_string_free (s, FALSE);
+  command = script_fu_script_get_command (script);
 
   /*  run the command through the interpreter  */
-  output = g_string_new ("");
+  output = g_string_new (NULL);
   ts_register_output_func (ts_gstring_output_func, output);
+
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
+
   if (ts_interpret_string (command))
-    script_fu_error_msg (command, output->str);
+    {
+      gchar *message = g_strdup_printf (_("Error while executing %s:"),
+                                        script->name);
+
+      g_message ("%s\n\n%s", message, output->str);
+      g_free (message);
+    }
+
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_INTERNAL);
+
   g_string_free (output, TRUE);
 
   g_free (command);
@@ -912,11 +840,14 @@
 {
   gint i;
 
-  for (i = 0; i < script->num_args; i++)
+  script_fu_script_reset (script, FALSE);
+
+  for (i = 0; i < script->n_args; i++)
     {
-      GtkWidget *widget = sf_interface->widgets[i];
+      SFArgValue *value  = &script->args[i].value;
+      GtkWidget  *widget = sf_interface->widgets[i];
 
-      switch (script->arg_types[i])
+      switch (script->args[i].type)
         {
         case SF_IMAGE:
         case SF_DRAWABLE:
@@ -928,18 +859,17 @@
 
         case SF_COLOR:
           gimp_color_button_set_color (GIMP_COLOR_BUTTON (widget),
-                                       &script->arg_defaults[i].sfa_color);
+                                       &value->sfa_color);
           break;
 
         case SF_TOGGLE:
           gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
-                                        script->arg_defaults[i].sfa_toggle);
+                                        value->sfa_toggle);
           break;
 
         case SF_VALUE:
         case SF_STRING:
-          gtk_entry_set_text (GTK_ENTRY (widget),
-                              script->arg_defaults[i].sfa_value);
+          gtk_entry_set_text (GTK_ENTRY (widget), value->sfa_value);
           break;
 
         case SF_TEXT:
@@ -947,65 +877,60 @@
             GtkWidget     *view;
             GtkTextBuffer *buffer;
 
-            g_free (script->arg_values[i].sfa_value);
-            script->arg_values[i].sfa_value =
-              g_strdup (script->arg_defaults[i].sfa_value);
-
             view = gtk_bin_get_child (GTK_BIN (widget));
             buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
-            gtk_text_buffer_set_text (buffer,
-                                      script->arg_values[i].sfa_value, -1);
+            gtk_text_buffer_set_text (buffer, value->sfa_value, -1);
           }
           break;
 
         case SF_ADJUSTMENT:
-          gtk_adjustment_set_value (script->arg_values[i].sfa_adjustment.adj,
-                                    script->arg_defaults[i].sfa_adjustment.value);
+          gtk_adjustment_set_value (value->sfa_adjustment.adj,
+                                    value->sfa_adjustment.value);
           break;
 
         case SF_FILENAME:
         case SF_DIRNAME:
           gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
-                                         script->arg_defaults[i].sfa_file.filename);
+                                         value->sfa_file.filename);
           break;
 
         case SF_FONT:
           gimp_font_select_button_set_font (GIMP_FONT_SELECT_BUTTON (widget),
-                                            script->arg_defaults[i].sfa_font);
+                                            value->sfa_font);
           break;
 
         case SF_PALETTE:
           gimp_palette_select_button_set_palette (GIMP_PALETTE_SELECT_BUTTON (widget),
-                                                  script->arg_defaults[i].sfa_palette);
+                                                  value->sfa_palette);
           break;
 
         case SF_PATTERN:
           gimp_pattern_select_button_set_pattern (GIMP_PATTERN_SELECT_BUTTON (widget),
-                                                  script->arg_defaults[i].sfa_pattern);
+                                                  value->sfa_pattern);
           break;
 
         case SF_GRADIENT:
           gimp_gradient_select_button_set_gradient (GIMP_GRADIENT_SELECT_BUTTON (widget),
-                                                    script->arg_defaults[i].sfa_gradient);
+                                                    value->sfa_gradient);
           break;
 
         case SF_BRUSH:
           gimp_brush_select_button_set_brush (GIMP_BRUSH_SELECT_BUTTON (widget),
-                                              script->arg_defaults[i].sfa_brush.name,
-                                              script->arg_defaults[i].sfa_brush.opacity,
-                                              script->arg_defaults[i].sfa_brush.spacing,
-                                              script->arg_defaults[i].sfa_brush.paint_mode);
+                                              value->sfa_brush.name,
+                                              value->sfa_brush.opacity,
+                                              value->sfa_brush.spacing,
+                                              value->sfa_brush.paint_mode);
           break;
 
         case SF_OPTION:
           gtk_combo_box_set_active (GTK_COMBO_BOX (widget),
-                                    script->arg_defaults[i].sfa_option.history);
+                                    value->sfa_option.history);
           break;
 
         case SF_ENUM:
           gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (widget),
-                                         script->arg_defaults[i].sfa_enum.history);
+                                         value->sfa_enum.history);
           break;
         }
     }

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-interface.h	Sun Oct 12 15:38:02 2008
@@ -20,10 +20,10 @@
 #define __SCRIPT_FU_INTERFACE_H__
 
 
-void       script_fu_interface           (SFScript    *script,
-                                          gint         start_arg);
-void       script_fu_interface_report_cc (const gchar *command);
-gboolean   script_fu_interface_is_active (void);
+GimpPDBStatusType  script_fu_interface           (SFScript     *script,
+                                                  gint          start_arg);
+void               script_fu_interface_report_cc (const gchar  *command);
+gboolean           script_fu_interface_is_active (void);
 
 
 #endif /*  __SCRIPT_FU_INTERFACE_H__  */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.c	Sun Oct 12 15:38:02 2008
@@ -37,7 +37,9 @@
 #include "script-fu-types.h"
 
 #include "script-fu-interface.h"
+#include "script-fu-script.h"
 #include "script-fu-scripts.h"
+#include "script-fu-utils.h"
 
 #include "script-fu-intl.h"
 
@@ -53,27 +55,28 @@
  *  Local Functions
  */
 
-static void      script_fu_load_script    (const GimpDatafileData *file_data,
-                                           gpointer                user_data);
-static gboolean  script_fu_install_script (gpointer                foo,
-                                           GList                  *scripts,
-                                           gpointer                bar);
-static void      script_fu_install_menu   (SFMenu                 *menu);
-static gboolean  script_fu_remove_script  (gpointer                foo,
-                                           GList                  *scripts,
-                                           gpointer                bar);
-static void      script_fu_script_proc    (const gchar            *name,
-                                           gint                    nparams,
-                                           const GimpParam        *params,
-                                           gint                   *nreturn_vals,
-                                           GimpParam             **return_vals);
-
-static SFScript *script_fu_find_script    (const gchar            *name);
-static void      script_fu_free_script    (SFScript               *script);
-
-static void      script_fu_menu_map       (SFScript               *script);
-static gint      script_fu_menu_compare   (gconstpointer           a,
-                                           gconstpointer           b);
+static gboolean  script_fu_run_command    (const gchar             *command,
+                                           GError                 **error);
+static void      script_fu_load_script    (const GimpDatafileData  *file_data,
+                                           gpointer                 user_data);
+static gboolean  script_fu_install_script (gpointer                 foo,
+                                           GList                   *scripts,
+                                           gpointer                 bar);
+static void      script_fu_install_menu   (SFMenu                  *menu);
+static gboolean  script_fu_remove_script  (gpointer                 foo,
+                                           GList                   *scripts,
+                                           gpointer                 bar);
+static void      script_fu_script_proc    (const gchar             *name,
+                                           gint                     nparams,
+                                           const GimpParam         *params,
+                                           gint                    *nreturn_vals,
+                                           GimpParam              **return_vals);
+
+static SFScript *script_fu_find_script    (const gchar             *name);
+
+static gchar *   script_fu_menu_map       (const gchar             *menu_path);
+static gint      script_fu_menu_compare   (gconstpointer            a,
+                                           gconstpointer            b);
 
 
 /*
@@ -130,492 +133,384 @@
 script_fu_add_script (scheme  *sc,
                       pointer  a)
 {
-  GimpParamDef *args;
-  SFScript     *script;
-  GType         enum_type;
-  GEnumValue   *enum_value;
-  const gchar  *val;
-  gint          i;
-  guchar        r, g, b;
-  pointer       color_list;
-  pointer       adj_list;
-  pointer       brush_list;
-  pointer       option_list;
+  SFScript    *script;
+  const gchar *name;
+  const gchar *menu_label;
+  const gchar *blurb;
+  const gchar *author;
+  const gchar *copyright;
+  const gchar *date;
+  const gchar *image_types;
+  gint         n_args;
+  gint         i;
 
   /*  Check the length of a  */
   if (sc->vptr->list_length (sc, a) < 7)
-  {
-    g_message (_("Too few arguments to 'script-fu-register' call"));
-
-    return sc->NIL;
-  }
-
-  /*  Create a new script  */
-  script = g_slice_new0 (SFScript);
+    {
+      g_message (_("Too few arguments to 'script-fu-register' call"));
+      return sc->NIL;
+    }
 
   /*  Find the script name  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->name = g_strdup (val);
+  name = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
-  /*  Find the script menu_path  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->menu_path = g_strdup (val);
+  /*  Find the script menu_label  */
+  menu_label = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
   /*  Find the script blurb  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->blurb = g_strdup (val);
+  blurb = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
   /*  Find the script author  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->author = g_strdup (val);
+  author = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
   /*  Find the script copyright  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->copyright = g_strdup (val);
+  copyright = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
   /*  Find the script date  */
-  val = sc->vptr->string_value (sc->vptr->pair_car (a));
-  script->date = g_strdup (val);
+  date = sc->vptr->string_value (sc->vptr->pair_car (a));
   a = sc->vptr->pair_cdr (a);
 
   /*  Find the script image types  */
   if (sc->vptr->is_pair (a))
     {
-      val = sc->vptr->string_value (sc->vptr->pair_car (a));
+      image_types = sc->vptr->string_value (sc->vptr->pair_car (a));
       a = sc->vptr->pair_cdr (a);
     }
   else
     {
-      val = sc->vptr->string_value (a);
+      image_types = sc->vptr->string_value (a);
       a = sc->NIL;
     }
-  script->img_types = g_strdup (val);
 
   /*  Check the supplied number of arguments  */
-  script->num_args = sc->vptr->list_length (sc, a) / 3;
+  n_args = sc->vptr->list_length (sc, a) / 3;
+
+  /*  Create a new script  */
+  script = script_fu_script_new (name,
+                                 menu_label,
+                                 blurb,
+                                 author,
+                                 copyright,
+                                 date,
+                                 image_types,
+                                 n_args);
 
-  args = g_new0 (GimpParamDef, script->num_args + 1);
+  for (i = 0; i < script->n_args; i++)
+    {
+      SFArg *arg = &script->args[i];
 
-  args[0].type        = GIMP_PDB_INT32;
-  args[0].name        = "run-mode";
-  args[0].description = "Interactive, non-interactive";
+      if (a != sc->NIL)
+        {
+          if (!sc->vptr->is_integer (sc->vptr->pair_car (a)))
+            return foreign_error (sc, "script-fu-register: argument types must be integer values", 0);
 
-  script->arg_types    = g_new0 (SFArgType, script->num_args);
-  script->arg_labels   = g_new0 (gchar *, script->num_args);
-  script->arg_defaults = g_new0 (SFArgValue, script->num_args);
-  script->arg_values   = g_new0 (SFArgValue, script->num_args);
+          arg->type = sc->vptr->ivalue (sc->vptr->pair_car (a));
+          a = sc->vptr->pair_cdr (a);
+        }
+      else
+        return foreign_error (sc, "script-fu-register: missing type specifier", 0);
 
-  if (script->num_args > 0)
-    {
-      for (i = 0; i < script->num_args; i++)
+      if (a != sc->NIL)
         {
-          if (a != sc->NIL)
+          if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+            return foreign_error (sc, "script-fu-register: argument labels must be strings", 0);
+
+          arg->label = g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+          a = sc->vptr->pair_cdr (a);
+        }
+      else
+        return foreign_error (sc, "script-fu-register: missing arguments label", 0);
+
+      if (a != sc->NIL)
+        {
+          switch (arg->type)
             {
+            case SF_IMAGE:
+            case SF_DRAWABLE:
+            case SF_LAYER:
+            case SF_CHANNEL:
+            case SF_VECTORS:
+            case SF_DISPLAY:
               if (!sc->vptr->is_integer (sc->vptr->pair_car (a)))
-                return foreign_error (sc, "script-fu-register: argument types must be integer values", 0);
-              script->arg_types[i] = sc->vptr->ivalue (sc->vptr->pair_car (a));
-              a = sc->vptr->pair_cdr (a);
-            }
-          else
-            return foreign_error (sc, "script-fu-register: missing type specifier", 0);
+                return foreign_error (sc, "script-fu-register: default IDs must be integer values", 0);
 
-          if (a != sc->NIL)
-            {
-              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                return foreign_error (sc, "script-fu-register: argument labels must be strings", 0);
-              script->arg_labels[i] = g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-              a = sc->vptr->pair_cdr (a);
-            }
-          else
-            return foreign_error (sc, "script-fu-register: missing arguments label", 0);
+              arg->default_value.sfa_image =
+                sc->vptr->ivalue (sc->vptr->pair_car (a));
+              break;
 
-          if (a != sc->NIL)
-            {
-              gchar *type_name;
+            case SF_COLOR:
+              if (sc->vptr->is_string (sc->vptr->pair_car (a)))
+                {
+                  if (! gimp_rgb_parse_css (&arg->default_value.sfa_color,
+                                            sc->vptr->string_value (sc->vptr->pair_car (a)),
+                                            -1))
+                    return foreign_error (sc, "script-fu-register: invalid default color name", 0);
+
+                  gimp_rgb_set_alpha (&arg->default_value.sfa_color, 1.0);
+                }
+              else if (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
+                       sc->vptr->list_length(sc, sc->vptr->pair_car (a)) == 3)
+                {
+                  pointer color_list;
+                  guchar  r, g, b;
+
+                  color_list = sc->vptr->pair_car (a);
+                  r = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
+                  color_list = sc->vptr->pair_cdr (color_list);
+                  g = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
+                  color_list = sc->vptr->pair_cdr (color_list);
+                  b = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
 
-              switch (script->arg_types[i])
+                  gimp_rgb_set_uchar (&arg->default_value.sfa_color, r, g, b);
+                }
+              else
                 {
-                case SF_IMAGE:
-                case SF_DRAWABLE:
-                case SF_LAYER:
-                case SF_CHANNEL:
-                case SF_VECTORS:
-                case SF_DISPLAY:
-                  if (!sc->vptr->is_integer (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: default IDs must be integer values", 0);
-                  script->arg_defaults[i].sfa_image =
-                      sc->vptr->ivalue (sc->vptr->pair_car (a));
-                  script->arg_values[i].sfa_image =
-                    script->arg_defaults[i].sfa_image;
-
-                  switch (script->arg_types[i])
-                    {
-                    case SF_IMAGE:
-                      args[i + 1].type = GIMP_PDB_IMAGE;
-                      args[i + 1].name = "image";
-                      break;
-
-                    case SF_DRAWABLE:
-                      args[i + 1].type = GIMP_PDB_DRAWABLE;
-                      args[i + 1].name = "drawable";
-                      break;
-
-                    case SF_LAYER:
-                      args[i + 1].type = GIMP_PDB_LAYER;
-                      args[i + 1].name = "layer";
-                      break;
-
-                    case SF_CHANNEL:
-                      args[i + 1].type = GIMP_PDB_CHANNEL;
-                      args[i + 1].name = "channel";
-                      break;
-
-                    case SF_VECTORS:
-                      args[i + 1].type = GIMP_PDB_VECTORS;
-                      args[i + 1].name = "vectors";
-                      break;
-
-                    case SF_DISPLAY:
-                      args[i + 1].type = GIMP_PDB_DISPLAY;
-                      args[i + 1].name = "display";
-                      break;
-
-                    default:
-                      break;
-                    }
-
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_COLOR:
-                  if (sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    {
-                      if (! gimp_rgb_parse_css (&script->arg_defaults[i].sfa_color,
-                                                sc->vptr->string_value (sc->vptr->pair_car (a)),
-                                                -1))
-                        return foreign_error (sc, "script-fu-register: invalid default color name", 0);
-                      gimp_rgb_set_alpha (&script->arg_defaults[i].sfa_color,
-                                          1.0);
-                    }
-                  else if (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
-                           sc->vptr->list_length(sc, sc->vptr->pair_car (a)) == 3)
-                    {
-                      color_list = sc->vptr->pair_car (a);
-                      r = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
-                      color_list = sc->vptr->pair_cdr (color_list);
-                      g = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
-                      color_list = sc->vptr->pair_cdr (color_list);
-                      b = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)), 0, 255);
-
-                      gimp_rgb_set_uchar (&script->arg_defaults[i].sfa_color, r, g, b);
-                    }
-                  else
-                    {
-                      return foreign_error (sc, "script-fu-register: color defaults must be a list of 3 integers or a color name", 0);
-                    }
-
-                  script->arg_values[i].sfa_color = script->arg_defaults[i].sfa_color;
-
-                  args[i + 1].type        = GIMP_PDB_COLOR;
-                  args[i + 1].name        = "color";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_TOGGLE:
-                  if (!sc->vptr->is_integer (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: toggle default must be an integer value", 0);
-
-                  script->arg_defaults[i].sfa_toggle =
-                    (sc->vptr->ivalue (sc->vptr->pair_car (a))) ? TRUE : FALSE;
-                  script->arg_values[i].sfa_toggle =
-                    script->arg_defaults[i].sfa_toggle;
-
-                  args[i + 1].type        = GIMP_PDB_INT32;
-                  args[i + 1].name        = "toggle";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_VALUE:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: value defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_value =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_value =
-                    g_strdup (script->arg_defaults[i].sfa_value);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "value";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_STRING:
-                case SF_TEXT:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: string defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_value =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_value =
-                    g_strdup (script->arg_defaults[i].sfa_value);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "string";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_ADJUSTMENT:
-                  if (!sc->vptr->is_list (sc, a))
-                    return foreign_error (sc, "script-fu-register: adjustment defaults must be a list", 0);
-
-                  adj_list = sc->vptr->pair_car (a);
-                  script->arg_defaults[i].sfa_adjustment.value =
-                    sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.lower =
-                    sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.upper =
-                    sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.step =
-                    sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.page =
-                    sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.digits =
-                    sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
-
-                  adj_list = sc->vptr->pair_cdr (adj_list);
-                  script->arg_defaults[i].sfa_adjustment.type =
-                    sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
-
-                  script->arg_values[i].sfa_adjustment.adj = NULL;
-                  script->arg_values[i].sfa_adjustment.value =
-                    script->arg_defaults[i].sfa_adjustment.value;
-
-                  args[i + 1].type        = GIMP_PDB_FLOAT;
-                  args[i + 1].name        = "value";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_FILENAME:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: filename defaults must be string values", 0);
-                  /* fallthrough */
-
-                case SF_DIRNAME:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: dirname defaults must be string values", 0);
+                  return foreign_error (sc, "script-fu-register: color defaults must be a list of 3 integers or a color name", 0);
+                }
+              break;
 
-                  script->arg_defaults[i].sfa_file.filename =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+            case SF_TOGGLE:
+              if (!sc->vptr->is_integer (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: toggle default must be an integer value", 0);
+
+              arg->default_value.sfa_toggle =
+                (sc->vptr->ivalue (sc->vptr->pair_car (a))) ? TRUE : FALSE;
+              break;
+
+            case SF_VALUE:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: value defaults must be string values", 0);
+
+              arg->default_value.sfa_value =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_STRING:
+            case SF_TEXT:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: string defaults must be string values", 0);
+
+              arg->default_value.sfa_value =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_ADJUSTMENT:
+              {
+                pointer adj_list;
+
+                if (!sc->vptr->is_list (sc, a))
+                  return foreign_error (sc, "script-fu-register: adjustment defaults must be a list", 0);
+
+                adj_list = sc->vptr->pair_car (a);
+                arg->default_value.sfa_adjustment.value =
+                  sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.lower =
+                  sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.upper =
+                  sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.step =
+                  sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.page =
+                  sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.digits =
+                  sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
+
+                adj_list = sc->vptr->pair_cdr (adj_list);
+                arg->default_value.sfa_adjustment.type =
+                  sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
+              }
+              break;
+
+            case SF_FILENAME:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: filename defaults must be string values", 0);
+              /* fallthrough */
+
+            case SF_DIRNAME:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: dirname defaults must be string values", 0);
+
+              arg->default_value.sfa_file.filename =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
 
 #ifdef G_OS_WIN32
+              {
+                /* Replace POSIX slashes with Win32 backslashes. This
+                 * is just so script-fus can be written with only
+                 * POSIX directory separators.
+                 */
+                gchar *filename = arg->default_value.sfa_file.filename;
+
+                while (*filename)
                   {
-                    /* Replace POSIX slashes with Win32 backslashes. This
-                     * is just so script-fus can be written with only
-                     * POSIX directory separators.
-                     */
-                    gchar *filename = script->arg_defaults[i].sfa_file.filename;
-
-                    while (*filename)
-                      {
-                        if (*filename == '/')
-                          *filename = G_DIR_SEPARATOR;
+                    if (*filename == '/')
+                      *filename = G_DIR_SEPARATOR;
 
-                        filename++;
-                      }
+                    filename++;
                   }
+              }
 #endif
-                  script->arg_values[i].sfa_file.filename =
-                    g_strdup (script->arg_defaults[i].sfa_file.filename);
+              break;
 
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = (script->arg_types[i] == SF_FILENAME ?
-                                             "filename" : "dirname");
-                  args[i + 1].description = script->arg_labels[i];
-                 break;
-
-                case SF_FONT:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: font defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_font =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_font =
-                    g_strdup (script->arg_defaults[i].sfa_font);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "font";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_PALETTE:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: palette defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_palette =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_palette =
-                    g_strdup (script->arg_defaults[i].sfa_pattern);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "palette";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_PATTERN:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: pattern defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_pattern =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_pattern =
-                    g_strdup (script->arg_defaults[i].sfa_pattern);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "pattern";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_BRUSH:
-                  if (!sc->vptr->is_list (sc, a))
-                    return foreign_error (sc, "script-fu-register: brush defaults must be a list", 0);
-
-                  brush_list = sc->vptr->pair_car (a);
-                  script->arg_defaults[i].sfa_brush.name =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (brush_list)));
-                  script->arg_values[i].sfa_brush.name =
-                    g_strdup (script->arg_defaults[i].sfa_brush.name);
-
-                  brush_list = sc->vptr->pair_cdr (brush_list);
-                  script->arg_defaults[i].sfa_brush.opacity =
-                    sc->vptr->rvalue (sc->vptr->pair_car (brush_list));
-                  script->arg_values[i].sfa_brush.opacity =
-                    script->arg_defaults[i].sfa_brush.opacity;
-
-                  brush_list = sc->vptr->pair_cdr (brush_list);
-                  script->arg_defaults[i].sfa_brush.spacing =
-                    sc->vptr->ivalue (sc->vptr->pair_car (brush_list));
-                  script->arg_values[i].sfa_brush.spacing =
-                    script->arg_defaults[i].sfa_brush.spacing;
-
-                  brush_list = sc->vptr->pair_cdr (brush_list);
-                  script->arg_defaults[i].sfa_brush.paint_mode =
-                    sc->vptr->ivalue (sc->vptr->pair_car (brush_list));
-                  script->arg_values[i].sfa_brush.paint_mode =
-                    script->arg_defaults[i].sfa_brush.paint_mode;
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "brush";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_GRADIENT:
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
-                    return foreign_error (sc, "script-fu-register: gradient defaults must be string values", 0);
-
-                  script->arg_defaults[i].sfa_gradient =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
-                  script->arg_values[i].sfa_gradient =
-                    g_strdup (script->arg_defaults[i].sfa_gradient);
-
-                  args[i + 1].type        = GIMP_PDB_STRING;
-                  args[i + 1].name        = "gradient";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_OPTION:
-                  if (!sc->vptr->is_list (sc, a))
-                    return foreign_error (sc, "script-fu-register: option defaults must be a list", 0);
-
-                  for (option_list = sc->vptr->pair_car (a);
-                       option_list != sc->NIL;
-                       option_list = sc->vptr->pair_cdr (option_list))
-                    {
-                      script->arg_defaults[i].sfa_option.list =
-                        g_slist_append (script->arg_defaults[i].sfa_option.list,
-                                        g_strdup (sc->vptr->string_value
-                                           (sc->vptr->pair_car (option_list))));
-                    }
-
-                  script->arg_defaults[i].sfa_option.history = 0;
-                  script->arg_values[i].sfa_option.history = 0;
-
-                  args[i + 1].type        = GIMP_PDB_INT32;
-                  args[i + 1].name        = "option";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-
-                case SF_ENUM:
-                  if (!sc->vptr->is_list (sc, a))
-                    return foreign_error (sc, "script-fu-register: enum defaults must be a list", 0);
-
-                  option_list = sc->vptr->pair_car (a);
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (option_list)))
-                    return foreign_error (sc, "script-fu-register: first element in enum defaults must be a type-name", 0);
-
-                  val =
-                    sc->vptr->string_value (sc->vptr->pair_car (option_list));
-
-                  if (g_str_has_prefix (val, "Gimp"))
-                    type_name = g_strdup (val);
-                  else
-                    type_name = g_strconcat ("Gimp", val, NULL);
-
-                  enum_type = g_type_from_name (type_name);
-                  if (! G_TYPE_IS_ENUM (enum_type))
-                    {
-                      g_free (type_name);
-                      return foreign_error (sc, "script-fu-register: first element in enum defaults must be the name of a registered type", 0);
-                    }
-
-                  script->arg_defaults[i].sfa_enum.type_name = type_name;
-
-                  option_list = sc->vptr->pair_cdr (option_list);
-                  if (!sc->vptr->is_string (sc->vptr->pair_car (option_list)))
-                    return foreign_error (sc, "script-fu-register: second element in enum defaults must be a string", 0);
-
-                  enum_value =
-                    g_enum_get_value_by_nick (g_type_class_peek (enum_type),
-                      sc->vptr->string_value (sc->vptr->pair_car (option_list)));
-                  if (enum_value)
-                    script->arg_defaults[i].sfa_enum.history =
-                      script->arg_values[i].sfa_enum.history = enum_value->value;
-
-                  args[i + 1].type        = GIMP_PDB_INT32;
-                  args[i + 1].name        = "enum";
-                  args[i + 1].description = script->arg_labels[i];
-                  break;
-                }
+            case SF_FONT:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: font defaults must be string values", 0);
 
-              a = sc->vptr->pair_cdr (a);
-            }
-          else
-            {
-              return foreign_error (sc, "script-fu-register: missing default argument", 0);
+              arg->default_value.sfa_font =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_PALETTE:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: palette defaults must be string values", 0);
+
+              arg->default_value.sfa_palette =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_PATTERN:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: pattern defaults must be string values", 0);
+
+              arg->default_value.sfa_pattern =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_BRUSH:
+              {
+                pointer brush_list;
+
+                if (!sc->vptr->is_list (sc, a))
+                  return foreign_error (sc, "script-fu-register: brush defaults must be a list", 0);
+
+                brush_list = sc->vptr->pair_car (a);
+                arg->default_value.sfa_brush.name =
+                  g_strdup (sc->vptr->string_value (sc->vptr->pair_car (brush_list)));
+
+                brush_list = sc->vptr->pair_cdr (brush_list);
+                arg->default_value.sfa_brush.opacity =
+                  sc->vptr->rvalue (sc->vptr->pair_car (brush_list));
+
+                brush_list = sc->vptr->pair_cdr (brush_list);
+                arg->default_value.sfa_brush.spacing =
+                  sc->vptr->ivalue (sc->vptr->pair_car (brush_list));
+
+                brush_list = sc->vptr->pair_cdr (brush_list);
+                arg->default_value.sfa_brush.paint_mode =
+                  sc->vptr->ivalue (sc->vptr->pair_car (brush_list));
+              }
+              break;
+
+            case SF_GRADIENT:
+              if (!sc->vptr->is_string (sc->vptr->pair_car (a)))
+                return foreign_error (sc, "script-fu-register: gradient defaults must be string values", 0);
+
+              arg->default_value.sfa_gradient =
+                g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              break;
+
+            case SF_OPTION:
+              {
+                pointer option_list;
+
+                if (!sc->vptr->is_list (sc, a))
+                  return foreign_error (sc, "script-fu-register: option defaults must be a list", 0);
+
+                for (option_list = sc->vptr->pair_car (a);
+                     option_list != sc->NIL;
+                     option_list = sc->vptr->pair_cdr (option_list))
+                  {
+                    arg->default_value.sfa_option.list =
+                      g_slist_append (arg->default_value.sfa_option.list,
+                                      g_strdup (sc->vptr->string_value
+                                                (sc->vptr->pair_car (option_list))));
+                  }
+              }
+              break;
+
+            case SF_ENUM:
+              {
+                pointer      option_list;
+                const gchar *val;
+                gchar       *type_name;
+                GEnumValue  *enum_value;
+                GType        enum_type;
+
+                if (!sc->vptr->is_list (sc, a))
+                  return foreign_error (sc, "script-fu-register: enum defaults must be a list", 0);
+
+                option_list = sc->vptr->pair_car (a);
+                if (!sc->vptr->is_string (sc->vptr->pair_car (option_list)))
+                  return foreign_error (sc, "script-fu-register: first element in enum defaults must be a type-name", 0);
+
+                val = sc->vptr->string_value (sc->vptr->pair_car (option_list));
+
+                if (g_str_has_prefix (val, "Gimp"))
+                  type_name = g_strdup (val);
+                else
+                  type_name = g_strconcat ("Gimp", val, NULL);
+
+                enum_type = g_type_from_name (type_name);
+                if (! G_TYPE_IS_ENUM (enum_type))
+                  {
+                    g_free (type_name);
+                    return foreign_error (sc, "script-fu-register: first element in enum defaults must be the name of a registered type", 0);
+                  }
+
+                arg->default_value.sfa_enum.type_name = type_name;
+
+                option_list = sc->vptr->pair_cdr (option_list);
+                if (!sc->vptr->is_string (sc->vptr->pair_car (option_list)))
+                  return foreign_error (sc, "script-fu-register: second element in enum defaults must be a string", 0);
+
+                enum_value =
+                  g_enum_get_value_by_nick (g_type_class_peek (enum_type),
+                                            sc->vptr->string_value (sc->vptr->pair_car (option_list)));
+                if (enum_value)
+                  arg->default_value.sfa_enum.history = enum_value->value;
+              }
+              break;
             }
+
+          a = sc->vptr->pair_cdr (a);
+        }
+      else
+        {
+          return foreign_error (sc, "script-fu-register: missing default argument", 0);
         }
     }
 
-  script->args = args;
+  /*  fill all values from defaults  */
+  script_fu_script_reset (script, TRUE);
+
+  if (script->menu_label[0] == '<')
+    {
+      gchar *mapped = script_fu_menu_map (script->menu_label);
 
-  script_fu_menu_map (script);
+      if (mapped)
+        {
+          g_free (script->menu_label);
+          script->menu_label = mapped;
+        }
+    }
 
   {
-    const gchar *key  = gettext (script->menu_path);
+    const gchar *key  = gettext (script->menu_label);
     GList       *list = g_tree_lookup (script_tree, key);
 
     g_tree_insert (script_tree, (gpointer) key, g_list_append (list, script));
@@ -625,11 +520,13 @@
 }
 
 pointer
-script_fu_add_menu (scheme *sc, pointer a)
+script_fu_add_menu (scheme  *sc,
+                    pointer  a)
 {
   SFScript    *script;
   SFMenu      *menu;
   const gchar *name;
+  const gchar *path;
 
   /*  Check the length of a  */
   if (sc->vptr->list_length (sc, a) != 2)
@@ -642,10 +539,11 @@
   script = script_fu_find_script (name);
 
   if (! script)
-  {
-    g_message ("Procedure %s in script-fu-menu-register does not exist", name);
-    return sc->NIL;
-  }
+    {
+      g_message ("Procedure %s in script-fu-menu-register does not exist",
+                 name);
+      return sc->NIL;
+    }
 
   /*  Create a new list of menus  */
   menu = g_slice_new0 (SFMenu);
@@ -653,22 +551,44 @@
   menu->script = script;
 
   /*  Find the script menu path  */
-  menu->menu_path = g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+  path = sc->vptr->string_value (sc->vptr->pair_car (a));
+
+  menu->menu_path = script_fu_menu_map (path);
+
+  if (! menu->menu_path)
+    menu->menu_path = g_strdup (path);
 
   script_menu_list = g_list_prepend (script_menu_list, menu);
 
   return sc->NIL;
 }
 
-void
-script_fu_error_msg (const gchar *command,
-                     const gchar *msg)
+
+/*  private functions  */
+
+static gboolean
+script_fu_run_command (const gchar  *command,
+                       GError      **error)
 {
-  g_message (_("Error while executing\n%s\n\n%s"), command, msg);
-}
+  GString  *output;
+  gboolean  success = FALSE;
 
+  output = g_string_new (NULL);
+  ts_register_output_func (ts_gstring_output_func, output);
 
-/*  private functions  */
+  if (ts_interpret_string (command))
+    {
+      g_set_error (error, 0, 0, "%s", output->str);
+    }
+  else
+    {
+      success = TRUE;
+    }
+
+  g_string_free (output, TRUE);
+
+  return success;
+}
 
 static void
 script_fu_load_script (const GimpDatafileData *file_data,
@@ -676,18 +596,25 @@
 {
   if (gimp_datafiles_check_extension (file_data->filename, ".scm"))
     {
-      gchar   *command;
-      gchar   *escaped = script_fu_strescape (file_data->filename);
-      GString *output;
+      gchar  *escaped = script_fu_strescape (file_data->filename);
+      gchar  *command;
+      GError *error   = NULL;
 
       command = g_strdup_printf ("(load \"%s\")", escaped);
       g_free (escaped);
 
-      output = g_string_new ("");
-      ts_register_output_func (ts_gstring_output_func, output);
-      if (ts_interpret_string (command))
-        script_fu_error_msg (command, output->str);
-      g_string_free (output, TRUE);
+      if (! script_fu_run_command (command, &error))
+        {
+          gchar *display_name = g_filename_display_name (file_data->filename);
+          gchar *message      = g_strdup_printf (_("Error while loading %s:"),
+                                                 display_name);
+
+          g_message ("%s\n\n%s", message, error->message);
+
+          g_clear_error (&error);
+          g_free (message);
+          g_free (display_name);
+        }
 
 #ifdef G_OS_WIN32
       /* No, I don't know why, but this is
@@ -702,7 +629,6 @@
 
 /*
  *  The following function is a GTraverseFunction.
- *  Please note that it frees the script->args structure.
  */
 static gboolean
 script_fu_install_script (gpointer  foo G_GNUC_UNUSED,
@@ -713,28 +639,9 @@
 
   for (list = scripts; list; list = g_list_next (list))
     {
-      SFScript    *script    = list->data;
-      const gchar *menu_path = NULL;
-
-      /* Allow scripts with no menus */
-      if (strncmp (script->menu_path, "<None>", 6) != 0)
-        menu_path = script->menu_path;
-
-      gimp_install_temp_proc (script->name,
-                              script->blurb,
-                              "",
-                              script->author,
-                              script->copyright,
-                              script->date,
-                              menu_path,
-                              script->img_types,
-                              GIMP_TEMPORARY,
-                              script->num_args + 1, 0,
-                              script->args, NULL,
-                              script_fu_script_proc);
+      SFScript *script = list->data;
 
-      g_free (script->args);
-      script->args = NULL;
+      script_fu_script_install_proc (script, script_fu_script_proc);
     }
 
   return FALSE;
@@ -760,121 +667,16 @@
   GList *list;
 
   for (list = scripts; list; list = g_list_next (list))
-    script_fu_free_script (list->data);
-
-  g_list_free (scripts);
-
-  return FALSE;
-}
-
-static gboolean
-script_fu_param_init (SFScript        *script,
-                      gint             nparams,
-                      const GimpParam *params,
-                      SFArgType        type,
-                      gint             n)
-{
-  if (script->num_args > n && script->arg_types[n] == type && nparams > n + 1)
     {
-      switch (type)
-        {
-        case SF_IMAGE:
-          if (params[n + 1].type == GIMP_PDB_IMAGE)
-            {
-              script->arg_values[n].sfa_image = params[n + 1].data.d_image;
-              return TRUE;
-            }
-          break;
-
-        case SF_DRAWABLE:
-          if (params[n + 1].type == GIMP_PDB_DRAWABLE)
-            {
-              script->arg_values[n].sfa_drawable = params[n + 1].data.d_drawable;
-              return TRUE;
-            }
-          break;
-
-        case SF_LAYER:
-          if (params[n + 1].type == GIMP_PDB_LAYER)
-            {
-              script->arg_values[n].sfa_layer = params[n + 1].data.d_layer;
-              return TRUE;
-            }
-          break;
-
-        case SF_CHANNEL:
-          if (params[n + 1].type == GIMP_PDB_CHANNEL)
-            {
-              script->arg_values[n].sfa_channel = params[n + 1].data.d_channel;
-              return TRUE;
-            }
-          break;
-
-        case SF_VECTORS:
-          if (params[n + 1].type == GIMP_PDB_VECTORS)
-            {
-              script->arg_values[n].sfa_vectors = params[n + 1].data.d_vectors;
-              return TRUE;
-            }
-          break;
-
-        case SF_DISPLAY:
-          if (params[n + 1].type == GIMP_PDB_DISPLAY)
-            {
-              script->arg_values[n].sfa_display = params[n + 1].data.d_display;
-              return TRUE;
-            }
-          break;
-
-        default:
-          break;
-        }
-    }
-
-  return FALSE;
-}
-
-static gint
-script_fu_collect_standard_args (SFScript        *script,
-                                 gint             nparams,
-                                 const GimpParam *params)
-{
-  gint params_consumed = 0;
+      SFScript *script = list->data;
 
-  /*  the first parameter may be a DISPLAY id  */
-  if (script_fu_param_init (script,
-                            nparams, params, SF_DISPLAY, params_consumed))
-    {
-      params_consumed++;
+      script_fu_script_uninstall_proc (script);
+      script_fu_script_free (script);
     }
 
-  /*  an IMAGE id may come first or after the DISPLAY id  */
-  if (script_fu_param_init (script,
-                            nparams, params, SF_IMAGE, params_consumed))
-    {
-      params_consumed++;
-
-      /*  and may be followed by a DRAWABLE, LAYER, CHANNEL or
-       *  VECTORS id
-       */
-      if (script_fu_param_init (script,
-                                nparams, params, SF_DRAWABLE,
-                                params_consumed) ||
-          script_fu_param_init (script,
-                                nparams, params, SF_LAYER,
-                                params_consumed) ||
-          script_fu_param_init (script,
-                                nparams, params, SF_CHANNEL,
-                                params_consumed) ||
-          script_fu_param_init (script,
-                                nparams, params, SF_VECTORS,
-                                params_consumed))
-        {
-          params_consumed++;
-        }
-    }
+  g_list_free (scripts);
 
-  return params_consumed;
+  return FALSE;
 }
 
 static void
@@ -884,9 +686,21 @@
                        gint             *nreturn_vals,
                        GimpParam       **return_vals)
 {
-  static GimpParam   values[1];
-  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  static GimpParam   values[2] = { { 0, }, { 0, } };
+  GimpPDBStatusType  status    = GIMP_PDB_SUCCESS;
   SFScript          *script;
+  GError            *error     = NULL;
+
+  if (values[1].type == GIMP_PDB_STRING && values[1].data.d_string)
+    {
+      g_free (values[1].data.d_string);
+      values[1].data.d_string = NULL;
+    }
+
+  *nreturn_vals = 1;
+  *return_vals  = values;
+
+  values[0].type = GIMP_PDB_STATUS;
 
   script = script_fu_find_script (name);
 
@@ -897,7 +711,7 @@
     {
       GimpRunMode run_mode = params[0].data.d_int32;
 
-      set_run_mode_constant (run_mode);
+      ts_set_run_mode (run_mode);
 
       switch (run_mode)
         {
@@ -906,13 +720,13 @@
             gint min_args = 0;
 
             /*  First, try to collect the standard script arguments...  */
-            min_args = script_fu_collect_standard_args (script,
-                                                        nparams, params);
+            min_args = script_fu_script_collect_standard_args (script,
+                                                               nparams, params);
 
             /*  ...then acquire the rest of arguments (if any) with a dialog  */
-            if (script->num_args > min_args)
+            if (script->n_args > min_args)
               {
-                script_fu_interface (script, min_args);
+                status = script_fu_interface (script, min_args);
                 break;
               }
             /*  otherwise (if the script takes no more arguments), skip
@@ -922,240 +736,53 @@
 
         case GIMP_RUN_NONINTERACTIVE:
           /*  Make sure all the arguments are there  */
-          if (nparams != (script->num_args + 1))
+          if (nparams != (script->n_args + 1))
             status = GIMP_PDB_CALLING_ERROR;
 
           if (status == GIMP_PDB_SUCCESS)
             {
-              GString *s;
-              GString *output;
-              gchar   *command;
-              gint     i;
+              gchar *command;
 
-              s = g_string_new ("(");
-              g_string_append (s, script->name);
+              command = script_fu_script_get_command_from_params (script,
+                                                                  params);
 
-              for (i = 0; i < script->num_args; i++)
+              /*  run the command through the interpreter  */
+              if (! script_fu_run_command (command, &error))
                 {
-                  const GimpParam *param = &params[i + 1];
+                  status                  = GIMP_PDB_EXECUTION_ERROR;
+                  *nreturn_vals           = 2;
+                  values[1].type          = GIMP_PDB_STRING;
+                  values[1].data.d_string = error->message;
 
-                  g_string_append_c (s, ' ');
-
-                  switch (script->arg_types[i])
-                    {
-                    case SF_IMAGE:
-                    case SF_DRAWABLE:
-                    case SF_LAYER:
-                    case SF_CHANNEL:
-                    case SF_VECTORS:
-                    case SF_DISPLAY:
-                      g_string_append_printf (s, "%d", param->data.d_int32);
-                      break;
-
-                    case SF_COLOR:
-                      {
-                        guchar r, g, b;
-
-                        gimp_rgb_get_uchar (&param->data.d_color, &r, &g, &b);
-                        g_string_append_printf (s, "'(%d %d %d)",
-                                                (gint) r, (gint) g, (gint) b);
-                      }
-                      break;
-
-                    case SF_TOGGLE:
-                      g_string_append_printf (s, (param->data.d_int32 ?
-                                                  "TRUE" : "FALSE"));
-                      break;
-
-                    case SF_VALUE:
-                      g_string_append (s, param->data.d_string);
-                      break;
-
-                    case SF_STRING:
-                    case SF_TEXT:
-                    case SF_FILENAME:
-                    case SF_DIRNAME:
-                      {
-                        gchar *tmp;
-
-                        tmp = script_fu_strescape (param->data.d_string);
-                        g_string_append_printf (s, "\"%s\"", tmp);
-                        g_free (tmp);
-                      }
-                      break;
-
-                    case SF_ADJUSTMENT:
-                      {
-                        gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
-
-                        g_ascii_dtostr (buffer, sizeof (buffer),
-                                        param->data.d_float);
-                        g_string_append (s, buffer);
-                      }
-                      break;
-
-                    case SF_FONT:
-                    case SF_PALETTE:
-                    case SF_PATTERN:
-                    case SF_GRADIENT:
-                    case SF_BRUSH:
-                      g_string_append_printf (s, "\"%s\"",
-                                              param->data.d_string);
-                      break;
-
-                    case SF_OPTION:
-                    case SF_ENUM:
-                      g_string_append_printf (s, "%d", param->data.d_int32);
-                      break;
-                    }
+                  error->message = NULL;
+                  g_error_free (error);
                 }
 
-              g_string_append_c (s, ')');
-
-              command = g_string_free (s, FALSE);
-
-              /*  run the command through the interpreter  */
-              output = g_string_new ("");
-              ts_register_output_func (ts_gstring_output_func, output);
-              if (ts_interpret_string (command))
-                script_fu_error_msg (command, output->str);
-              g_string_free (output, TRUE);
-
               g_free (command);
             }
           break;
 
         case GIMP_RUN_WITH_LAST_VALS:
           {
-            GString *s;
-            GString *output;
-            gchar   *command;
-            gint     i;
+            gchar *command;
 
             /*  First, try to collect the standard script arguments  */
-            script_fu_collect_standard_args (script, nparams, params);
+            script_fu_script_collect_standard_args (script, nparams, params);
 
-            s = g_string_new ("(");
-            g_string_append (s, script->name);
+            command = script_fu_script_get_command (script);
 
-            for (i = 0; i < script->num_args; i++)
+            /*  run the command through the interpreter  */
+            if (! script_fu_run_command (command, &error))
               {
-                SFArgValue *arg_value = &script->arg_values[i];
+                status                  = GIMP_PDB_EXECUTION_ERROR;
+                *nreturn_vals           = 2;
+                values[1].type          = GIMP_PDB_STRING;
+                values[1].data.d_string = error->message;
 
-                g_string_append_c (s, ' ');
-
-                switch (script->arg_types[i])
-                  {
-                  case SF_IMAGE:
-                  case SF_DRAWABLE:
-                  case SF_LAYER:
-                  case SF_CHANNEL:
-                  case SF_VECTORS:
-                  case SF_DISPLAY:
-                    g_string_append_printf (s, "%d", arg_value->sfa_image);
-                    break;
-
-                  case SF_COLOR:
-                    {
-                      guchar r, g, b;
-
-                      gimp_rgb_get_uchar (&arg_value->sfa_color, &r, &g, &b);
-                      g_string_append_printf (s, "'(%d %d %d)",
-                                              (gint) r, (gint) g, (gint) b);
-                    }
-                    break;
-
-                  case SF_TOGGLE:
-                    g_string_append (s, arg_value->sfa_toggle ? "TRUE" : "FALSE");
-                    break;
-
-                  case SF_VALUE:
-                    g_string_append (s, arg_value->sfa_value);
-                    break;
-
-                  case SF_STRING:
-                  case SF_TEXT:
-                    {
-                      gchar *tmp;
-
-                      tmp = script_fu_strescape (arg_value->sfa_value);
-                      g_string_append_printf (s, "\"%s\"", tmp);
-                      g_free (tmp);
-                    }
-                    break;
-
-                  case SF_ADJUSTMENT:
-                    {
-                      gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
-
-                      g_ascii_dtostr (buffer, sizeof (buffer),
-                                      arg_value->sfa_adjustment.value);
-                      g_string_append (s, buffer);
-                    }
-                    break;
-
-                  case SF_FILENAME:
-                  case SF_DIRNAME:
-                    {
-                      gchar *tmp;
-
-                      tmp = script_fu_strescape (arg_value->sfa_file.filename);
-                      g_string_append_printf (s, "\"%s\"", tmp);
-                      g_free (tmp);
-                    }
-                    break;
-
-                  case SF_FONT:
-                    g_string_append_printf (s, "\"%s\"", arg_value->sfa_font);
-                    break;
-
-                  case SF_PALETTE:
-                    g_string_append_printf (s, "\"%s\"", arg_value->sfa_palette);
-                    break;
-
-                  case SF_PATTERN:
-                    g_string_append_printf (s, "\"%s\"", arg_value->sfa_pattern);
-                    break;
-
-                  case SF_GRADIENT:
-                    g_string_append_printf (s, "\"%s\"", arg_value->sfa_gradient);
-                    break;
-
-                  case SF_BRUSH:
-                    {
-                      gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
-
-                      g_ascii_dtostr (buffer, sizeof (buffer),
-                                      arg_value->sfa_brush.opacity);
-                      g_string_append_printf (s, "'(\"%s\" %s %d %d)",
-                                              arg_value->sfa_brush.name,
-                                              buffer,
-                                              arg_value->sfa_brush.spacing,
-                                              arg_value->sfa_brush.paint_mode);
-                    }
-                    break;
-
-                  case SF_OPTION:
-                    g_string_append_printf (s, "%d", arg_value->sfa_option.history);
-                    break;
-
-                  case SF_ENUM:
-                    g_string_append_printf (s, "%d", arg_value->sfa_enum.history);
-                    break;
-                  }
+                error->message = NULL;
+                g_error_free (error);
               }
 
-            g_string_append_c (s, ')');
-
-            command = g_string_free (s, FALSE);
-
-            /*  run the command through the interpreter  */
-            output = g_string_new ("");
-            ts_register_output_func (ts_gstring_output_func, output);
-            if (ts_interpret_string (command))
-              script_fu_error_msg (command, output->str);
-            g_string_free (output, TRUE);
-
             g_free (command);
           }
           break;
@@ -1165,10 +792,6 @@
         }
     }
 
-  *nreturn_vals = 1;
-  *return_vals  = values;
-
-  values[0].type          = GIMP_PDB_STATUS;
   values[0].data.d_status = status;
 }
 
@@ -1210,102 +833,8 @@
   return (SFScript *) script;
 }
 
-static void
-script_fu_free_script (SFScript *script)
-{
-  gint i;
-
-  g_return_if_fail (script != NULL);
-
-  /*  Uninstall the temporary procedure for this script  */
-  gimp_uninstall_temp_proc (script->name);
-
-  g_free (script->name);
-  g_free (script->blurb);
-  g_free (script->menu_path);
-  g_free (script->author);
-  g_free (script->copyright);
-  g_free (script->date);
-  g_free (script->img_types);
-
-  for (i = 0; i < script->num_args; i++)
-    {
-      g_free (script->arg_labels[i]);
-      switch (script->arg_types[i])
-        {
-        case SF_IMAGE:
-        case SF_DRAWABLE:
-        case SF_LAYER:
-        case SF_CHANNEL:
-        case SF_VECTORS:
-        case SF_DISPLAY:
-        case SF_COLOR:
-        case SF_TOGGLE:
-          break;
-
-        case SF_VALUE:
-        case SF_STRING:
-        case SF_TEXT:
-          g_free (script->arg_defaults[i].sfa_value);
-          g_free (script->arg_values[i].sfa_value);
-          break;
-
-        case SF_ADJUSTMENT:
-          break;
-
-        case SF_FILENAME:
-        case SF_DIRNAME:
-          g_free (script->arg_defaults[i].sfa_file.filename);
-          g_free (script->arg_values[i].sfa_file.filename);
-          break;
-
-        case SF_FONT:
-          g_free (script->arg_defaults[i].sfa_font);
-          g_free (script->arg_values[i].sfa_font);
-          break;
-
-        case SF_PALETTE:
-          g_free (script->arg_defaults[i].sfa_palette);
-          g_free (script->arg_values[i].sfa_palette);
-          break;
-
-        case SF_PATTERN:
-          g_free (script->arg_defaults[i].sfa_pattern);
-          g_free (script->arg_values[i].sfa_pattern);
-          break;
-
-        case SF_GRADIENT:
-          g_free (script->arg_defaults[i].sfa_gradient);
-          g_free (script->arg_values[i].sfa_gradient);
-          break;
-
-        case SF_BRUSH:
-          g_free (script->arg_defaults[i].sfa_brush.name);
-          g_free (script->arg_values[i].sfa_brush.name);
-          break;
-
-        case SF_OPTION:
-          g_slist_foreach (script->arg_defaults[i].sfa_option.list,
-                           (GFunc) g_free, NULL);
-          g_slist_free (script->arg_defaults[i].sfa_option.list);
-          break;
-
-        case SF_ENUM:
-          g_free (script->arg_defaults[i].sfa_enum.type_name);
-          break;
-        }
-    }
-
-  g_free (script->arg_labels);
-  g_free (script->arg_defaults);
-  g_free (script->arg_types);
-  g_free (script->arg_values);
-
-  g_slice_free (SFScript, script);
-}
-
-static void
-script_fu_menu_map (SFScript *script)
+static gchar *
+script_fu_menu_map (const gchar *menu_path)
 {
   /*  for backward compatibility, we fiddle with some menu paths  */
   const struct
@@ -1327,22 +856,18 @@
 
   for (i = 0; i < G_N_ELEMENTS (mapping); i++)
     {
-      if (g_str_has_prefix (script->menu_path, mapping[i].old))
+      if (g_str_has_prefix (menu_path, mapping[i].old))
         {
-          const gchar *suffix = script->menu_path + strlen (mapping[i].old);
-          gchar       *tmp;
+          const gchar *suffix = menu_path + strlen (mapping[i].old);
 
           if (! *suffix == '/')
             continue;
 
-          tmp = g_strconcat (mapping[i].new, suffix, NULL);
-
-          g_free (script->menu_path);
-          script->menu_path = tmp;
-
-          break;
+          return g_strconcat (mapping[i].new, suffix, NULL);
         }
     }
+
+  return NULL;
 }
 
 static gint
@@ -1359,56 +884,12 @@
                                gettext (menu_b->menu_path));
 
       if (retval == 0 &&
-          menu_a->script->menu_path && menu_b->script->menu_path)
+          menu_a->script->menu_label && menu_b->script->menu_label)
         {
-          retval = g_utf8_collate (gettext (menu_a->script->menu_path),
-                                   gettext (menu_b->script->menu_path));
+          retval = g_utf8_collate (gettext (menu_a->script->menu_label),
+                                   gettext (menu_b->script->menu_label));
         }
     }
 
   return retval;
 }
-
-/*
- * Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\' and '"'
- * in the string source by inserting a '\' before them.
- */
-gchar *
-script_fu_strescape (const gchar *source)
-{
-  const guchar *p;
-  gchar        *dest;
-  gchar        *q;
-
-  g_return_val_if_fail (source != NULL, NULL);
-
-  p = (const guchar *) source;
-
-  /* Each source byte needs maximally two destination chars */
-  q = dest = g_malloc (strlen (source) * 2 + 1);
-
-  while (*p)
-    {
-      switch (*p)
-        {
-        case '\b':
-        case '\f':
-        case '\n':
-        case '\r':
-        case '\t':
-        case '\\':
-        case '"':
-          *q++ = '\\';
-          /* fallthrough */
-        default:
-          *q++ = *p;
-          break;
-        }
-
-      p++;
-    }
-
-  *q = 0;
-
-  return dest;
-}

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-scripts.h	Sun Oct 12 15:38:02 2008
@@ -20,12 +20,11 @@
 #define __SCRIPT_FU_SCRIPTS_H__
 
 
-void       script_fu_find_scripts  (const gchar *path);
-pointer    script_fu_add_script    (scheme *sc, pointer a);
-pointer    script_fu_add_menu      (scheme *sc, pointer a);
-void       script_fu_error_msg     (const gchar *command,
-                                    const gchar *msg);
-gchar   * script_fu_strescape      (const gchar *source);
+void      script_fu_find_scripts  (const gchar *path);
+pointer   script_fu_add_script    (scheme      *sc,
+                                   pointer      a);
+pointer   script_fu_add_menu      (scheme      *sc,
+                                   pointer      a);
 
 
 #endif /*  __SCRIPT_FU_SCRIPTS__  */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-server.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-server.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-server.c	Sun Oct 12 15:38:02 2008
@@ -199,7 +199,8 @@
   GimpRunMode        run_mode;
 
   run_mode = params[0].data.d_int32;
-  set_run_mode_constant (run_mode);
+
+  ts_set_run_mode (run_mode);
 
   switch (run_mode)
     {
@@ -450,17 +451,17 @@
 static gboolean
 execute_command (SFCommand *cmd)
 {
-  guchar       buffer[RESPONSE_HEADER];
-  GString     *response;
-  time_t       clock1;
-  time_t       clock2;
-  gboolean     error;
-  gint         i;
+  guchar    buffer[RESPONSE_HEADER];
+  GString  *response;
+  time_t    clock1;
+  time_t    clock2;
+  gboolean  error;
+  gint      i;
 
   server_log ("Processing request #%d\n", cmd->request_no);
   time (&clock1);
 
-  response = g_string_new ("");
+  response = g_string_new (NULL);
   ts_register_output_func (ts_gstring_output_func, response);
 
   /*  run the command  */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.c	Sun Oct 12 15:38:02 2008
@@ -46,8 +46,12 @@
 
   ts_print_welcome ();
 
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_PLUGIN);
+
   /*  Run the interface  */
-  ts_interpret_stdin();
+  ts_interpret_stdin ();
+
+  gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_INTERNAL);
 
   values[0].type          = GIMP_PDB_STATUS;
   values[0].data.d_status = GIMP_PDB_SUCCESS;

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-text-console.h	Sun Oct 12 15:38:02 2008
@@ -20,11 +20,11 @@
 #define __SCRIPT_FU_TEXT_CONSOLE_H__
 
 
-void   script_fu_text_console_run (const gchar      *name,
-				   gint              nparams,
-				   const GimpParam  *params,
-				   gint             *nreturn_vals,
-				   GimpParam       **return_vals);
+void  script_fu_text_console_run (const gchar      *name,
+                                  gint              nparams,
+                                  const GimpParam  *params,
+                                  gint             *nreturn_vals,
+                                  GimpParam       **return_vals);
 
 
-#endif /*  __SCRIPT_FU_TEXT_CONSOLE__  */
+#endif /*  __SCRIPT_FU_TEXT_CONSOLE_H__  */

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu-types.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu-types.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu-types.h	Sun Oct 12 15:38:02 2008
@@ -50,14 +50,14 @@
 
 typedef struct
 {
-  GSList  *list;
-  gint     history;
+  GSList *list;
+  gint    history;
 } SFOption;
 
 typedef struct
 {
-  gchar   *type_name;
-  gint     history;
+  gchar *type_name;
+  gint   history;
 } SFEnum;
 
 typedef union
@@ -84,19 +84,24 @@
 
 typedef struct
 {
-  gchar         *name;
-  gchar         *menu_path;
-  gchar         *blurb;
-  gchar         *author;
-  gchar         *copyright;
-  gchar         *date;
-  gchar         *img_types;
-  gint           num_args;
-  SFArgType     *arg_types;
-  gchar        **arg_labels;
-  SFArgValue    *arg_defaults;
-  SFArgValue    *arg_values;
-  GimpParamDef  *args;     /*  used only temporary until installed  */
+  SFArgType   type;
+  gchar      *label;
+  SFArgValue  default_value;
+  SFArgValue  value;
+} SFArg;
+
+typedef struct
+{
+  gchar        *name;
+  gchar        *menu_label;
+  gchar        *blurb;
+  gchar        *author;
+  gchar        *copyright;
+  gchar        *date;
+  gchar        *image_types;
+
+  gint          n_args;
+  SFArg        *args;
 } SFScript;
 
 

Modified: branches/soc-2008-tagging/plug-ins/script-fu/script-fu.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/script-fu.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/script-fu.c	Sun Oct 12 15:38:02 2008
@@ -28,6 +28,7 @@
 #include "script-fu-types.h"
 
 #include "script-fu-console.h"
+#include "script-fu-eval.h"
 #include "script-fu-interface.h"
 #include "script-fu-scripts.h"
 #include "script-fu-server.h"
@@ -196,7 +197,7 @@
     }
 
   if (param != NULL)
-      set_run_mode_constant ((GimpRunMode)param[0].data.d_int32);
+    ts_set_run_mode ((GimpRunMode) param[0].data.d_int32);
 
   /*  Load all of the available scripts  */
   script_fu_find_scripts (path);
@@ -306,20 +307,20 @@
   gimp_plugin_menu_branch_register ("<Image>/Filters/Languages/Script-Fu",
                                     N_("_Test"));
 
-  gimp_plugin_menu_branch_register ("<Image>/File/New",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                     N_("_Buttons"));
-  gimp_plugin_menu_branch_register ("<Image>/File/New",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                     N_("_Logos"));
-  gimp_plugin_menu_branch_register ("<Image>/File/New",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                     N_("_Patterns"));
 
-  gimp_plugin_menu_branch_register ("<Image>/File/New",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                     N_("_Web Page Themes"));
-  gimp_plugin_menu_branch_register ("<Image>/File/New/Web Page Themes",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                     N_("_Alien Glow"));
-  gimp_plugin_menu_branch_register ("<Image>/File/New/Web Page Themes",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                     N_("_Beveled Pattern"));
-  gimp_plugin_menu_branch_register ("<Image>/File/New/Web Page Themes",
+  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                     N_("_Classic.Gimp.Org"));
 
   gimp_plugin_menu_branch_register ("<Image>/Filters",

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/3d-outline.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/3d-outline.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/3d-outline.scm	Sun Oct 12 15:38:02 2008
@@ -183,4 +183,4 @@
 )
 
 (script-fu-menu-register "script-fu-3d-outline-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/3dTruchet.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/3dTruchet.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/3dTruchet.scm	Sun Oct 12 15:38:02 2008
@@ -236,4 +236,4 @@
 )
 
 (script-fu-menu-register "script-fu-3dtruchet"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/add-bevel.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/add-bevel.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/add-bevel.scm	Sun Oct 12 15:38:02 2008
@@ -27,7 +27,7 @@
 ; If there is a selection, it is bevelled.
 ; Otherwise if there is an alpha channel, the selection is taken from it
 ; and bevelled.
-; Otherwise the whole image is bevelled.
+; Otherwise the part of the layer inside the image boundries is bevelled.
 ;
 ; The selection is set on exit, so Select->Invert then Edit->Clear will
 ; leave a cut-out.  Then use Sven's add-shadow for that
@@ -46,6 +46,10 @@
 ; 1.04: Fixed undo handling, ensure that bumpmap is big enough,
 ;       (instead of resizing the image). Removed references to outdated
 ;       bumpmap plugin.     (Simon)
+; 1.05  When there is no selection, bevel the whole layer instead of the
+;       whole image (which was broken in the first place).
+;       Also fixed some bugs with setting the selection when there is no
+;       initial selection.     (Barak Itkin)
 ;
 
 (define (script-fu-add-bevel img
@@ -56,7 +60,6 @@
 
   (let* (
         (index 1)
-        (bevelling-whole-image FALSE)
         (greyness 0)
         (thickness (abs thickness))
         (type (car (gimp-drawable-type-with-alpha drawable)))
@@ -74,7 +77,9 @@
                                          "Bumpmap"
                                          100
                                          NORMAL-MODE)))
-        (select 0)
+
+        (selection-exists (car (gimp-selection-bounds image)))
+        (selection 0)
         )
 
     (gimp-context-push)
@@ -96,18 +101,12 @@
     ;
     ; Set the selection to the area we want to bevel.
     ;
-    (if (eq? 0 (car (gimp-selection-bounds image)))
-        (begin
-          (set! bevelling-whole-image TRUE) ; ...so we can restore things properly, and crop.
-          (if (car (gimp-drawable-has-alpha pic-layer))
-              (gimp-selection-layer-alpha pic-layer)
-              (gimp-selection-all image)
-          )
-        )
+    (if (= selection-exists 0)
+        (gimp-selection-layer-alpha pic-layer)
     )
 
     ; Store it for later.
-    (set! select (car (gimp-selection-save image)))
+    (set! selection (car (gimp-selection-save image)))
     ; Try to lose the jaggies
     (gimp-selection-feather image 2)
 
@@ -151,15 +150,15 @@
     ;
     ; Restore things
     ;
-    (if (= bevelling-whole-image TRUE)
+    (if (= selection-exists 0)
         (gimp-selection-none image)        ; No selection to start with
-        (gimp-selection-load select)
+        (gimp-selection-load selection)
     )
     ; If they started with a selection, they can Select->Invert then
     ; Edit->Clear for a cutout.
 
     ; clean up
-    (gimp-image-remove-channel image select)
+    (gimp-image-remove-channel image selection)
     (if (= keep-bump-layer TRUE)
         (gimp-drawable-set-visible bump-layer 0)
         (gimp-image-remove-layer image bump-layer)

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-arrow.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-arrow.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-arrow.scm	Sun Oct 12 15:38:02 2008
@@ -186,4 +186,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-glow-right-arrow"
-                         "<Image>/File/New/Web Page Themes/Alien Glow")
+                         "<Image>/File/Create/Web Page Themes/Alien Glow")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bar.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bar.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bar.scm	Sun Oct 12 15:38:02 2008
@@ -97,4 +97,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-glow-horizontal-ruler"
-                         "<Image>/File/New/Web Page Themes/Alien Glow")
+                         "<Image>/File/Create/Web Page Themes/Alien Glow")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bullet.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bullet.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-bullet.scm	Sun Oct 12 15:38:02 2008
@@ -106,4 +106,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-glow-bullet"
-                         "<Image>/File/New/Web Page Themes/Alien Glow")
+                         "<Image>/File/Create/Web Page Themes/Alien Glow")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-button.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-button.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-button.scm	Sun Oct 12 15:38:02 2008
@@ -165,4 +165,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-glow-button"
-                         "<Image>/File/New/Web Page Themes/Alien Glow")
+                         "<Image>/File/Create/Web Page Themes/Alien Glow")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-glow-logo.scm	Sun Oct 12 15:38:02 2008
@@ -114,4 +114,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-glow-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-neon-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-neon-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/alien-neon-logo.scm	Sun Oct 12 15:38:02 2008
@@ -184,4 +184,4 @@
 )
 
 (script-fu-menu-register "script-fu-alien-neon-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic1-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic1-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic1-logo.scm	Sun Oct 12 15:38:02 2008
@@ -102,4 +102,4 @@
 )
 
 (script-fu-menu-register "script-fu-basic1-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic2-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic2-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/basic2-logo.scm	Sun Oct 12 15:38:02 2008
@@ -124,4 +124,4 @@
 )
 
 (script-fu-menu-register "script-fu-basic2-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-button.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-button.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-button.scm	Sun Oct 12 15:38:02 2008
@@ -158,4 +158,4 @@
 )
 
 (script-fu-menu-register "script-fu-button00"
-                         "<Image>/File/New/Buttons")
+                         "<Image>/File/Create/Buttons")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm	Sun Oct 12 15:38:02 2008
@@ -158,4 +158,4 @@
 )
 
 (script-fu-menu-register "script-fu-beveled-pattern-arrow"
-                         "<Image>/File/New/Web Page Themes/Beveled Pattern")
+                         "<Image>/File/Create/Web Page Themes/Beveled Pattern")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm	Sun Oct 12 15:38:02 2008
@@ -93,4 +93,4 @@
 )
 
 (script-fu-menu-register "script-fu-beveled-pattern-bullet"
-                         "<Image>/File/New/Web Page Themes/Beveled Pattern")
+                         "<Image>/File/Create/Web Page Themes/Beveled Pattern")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-button.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-button.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-button.scm	Sun Oct 12 15:38:02 2008
@@ -132,4 +132,4 @@
 )
 
 (script-fu-menu-register "script-fu-beveled-pattern-button"
-                         "<Image>/File/New/Web Page Themes/Beveled Pattern")
+                         "<Image>/File/Create/Web Page Themes/Beveled Pattern")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-heading.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-heading.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-heading.scm	Sun Oct 12 15:38:02 2008
@@ -118,4 +118,4 @@
 )
 
 (script-fu-menu-register "script-fu-beveled-pattern-heading"
-                         "<Image>/File/New/Web Page Themes/Beveled Pattern")
+                         "<Image>/File/Create/Web Page Themes/Beveled Pattern")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm	Sun Oct 12 15:38:02 2008
@@ -86,4 +86,4 @@
 )
 
 (script-fu-menu-register "script-fu-beveled-pattern-hrule"
-                         "<Image>/File/New/Web Page Themes/Beveled Pattern")
+                         "<Image>/File/Create/Web Page Themes/Beveled Pattern")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/blended-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/blended-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/blended-logo.scm	Sun Oct 12 15:38:02 2008
@@ -197,4 +197,4 @@
 )
 
 (script-fu-menu-register "script-fu-blended-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/bovinated-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/bovinated-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/bovinated-logo.scm	Sun Oct 12 15:38:02 2008
@@ -137,4 +137,4 @@
 )
 
 (script-fu-menu-register "script-fu-bovinated-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/camo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/camo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/camo.scm	Sun Oct 12 15:38:02 2008
@@ -109,4 +109,4 @@
 
 
 (script-fu-menu-register "script-fu-camo-pattern"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/carved-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/carved-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/carved-logo.scm	Sun Oct 12 15:38:02 2008
@@ -175,4 +175,4 @@
 )
 
 (script-fu-menu-register "script-fu-carved-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/chalk.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/chalk.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/chalk.scm	Sun Oct 12 15:38:02 2008
@@ -127,4 +127,4 @@
 )
 
 (script-fu-menu-register "script-fu-chalk-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/chip-away.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/chip-away.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/chip-away.scm	Sun Oct 12 15:38:02 2008
@@ -203,4 +203,4 @@
 )
 
 (script-fu-menu-register "script-fu-chip-away-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/chrome-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/chrome-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/chrome-logo.scm	Sun Oct 12 15:38:02 2008
@@ -129,4 +129,4 @@
 )
 
 (script-fu-menu-register "script-fu-chrome-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/comic-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/comic-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/comic-logo.scm	Sun Oct 12 15:38:02 2008
@@ -167,4 +167,4 @@
 )
 
 (script-fu-menu-register "script-fu-comic-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/coolmetal-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/coolmetal-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/coolmetal-logo.scm	Sun Oct 12 15:38:02 2008
@@ -118,6 +118,14 @@
                                          gradient-reverse)
   (begin
     (gimp-image-undo-group-start img)
+
+    (if (car (gimp-layer-is-floating-sel logo-layer))
+        (begin
+            (gimp-floating-sel-to-layer logo-layer)
+            (set! logo-layer (car (gimp-image-get-active-layer img)))
+        )
+     )
+
     (apply-cool-metal-logo-effect img logo-layer size bg-color
                                   gradient gradient-reverse)
     (gimp-image-undo-group-end img)
@@ -179,4 +187,4 @@
 )
 
 (script-fu-menu-register "script-fu-cool-metal-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/crystal-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/crystal-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/crystal-logo.scm	Sun Oct 12 15:38:02 2008
@@ -224,4 +224,4 @@
 )
 
 (script-fu-menu-register "script-fu-crystal-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/flatland.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/flatland.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/flatland.scm	Sun Oct 12 15:38:02 2008
@@ -73,4 +73,4 @@
 )
 
 (script-fu-menu-register "script-fu-flatland"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/frosty-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/frosty-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/frosty-logo.scm	Sun Oct 12 15:38:02 2008
@@ -199,4 +199,4 @@
 )
 
 (script-fu-menu-register "script-fu-frosty-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-headers.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-headers.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-headers.scm	Sun Oct 12 15:38:02 2008
@@ -166,7 +166,7 @@
 )
 
 (script-fu-menu-register "script-fu-big-header-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
 
 (script-fu-register "script-fu-small-header-gimp-org"
   _"_Small Header..."
@@ -190,4 +190,4 @@
 )
 
 (script-fu-menu-register "script-fu-small-header-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-labels.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-labels.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/gimp-labels.scm	Sun Oct 12 15:38:02 2008
@@ -130,7 +130,7 @@
 )
 
 (script-fu-menu-register "script-fu-tube-button-label-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
 
 
 (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
@@ -146,7 +146,7 @@
 )
 
 (script-fu-menu-register "script-fu-tube-subbutton-label-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
 
 
 (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
@@ -162,7 +162,7 @@
 )
 
 (script-fu-menu-register "script-fu-tube-subsubbutton-label-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
 
 
 (script-fu-register "script-fu-labels-gimp-org"
@@ -188,4 +188,4 @@
 )
 
 (script-fu-menu-register "script-fu-labels-gimp-org"
-                         "<Image>/File/New/Web Page Themes/Classic.Gimp.Org")
+                         "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/glossy.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/glossy.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/glossy.scm	Sun Oct 12 15:38:02 2008
@@ -292,4 +292,4 @@
 )
 
 (script-fu-menu-register "script-fu-glossy-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/glowing-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/glowing-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/glowing-logo.scm	Sun Oct 12 15:38:02 2008
@@ -118,4 +118,4 @@
 )
 
 (script-fu-menu-register "script-fu-glowing-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/gradient-bevel-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/gradient-bevel-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/gradient-bevel-logo.scm	Sun Oct 12 15:38:02 2008
@@ -145,4 +145,4 @@
 )
 
 (script-fu-menu-register "script-fu-gradient-bevel-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/i26-gunya2.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/i26-gunya2.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/i26-gunya2.scm	Sun Oct 12 15:38:02 2008
@@ -103,4 +103,4 @@
 )
 
 (script-fu-menu-register "script-fu-i26-gunya2"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/land.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/land.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/land.scm	Sun Oct 12 15:38:02 2008
@@ -87,4 +87,4 @@
 )
 
 (script-fu-menu-register "script-fu-land"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/neon-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/neon-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/neon-logo.scm	Sun Oct 12 15:38:02 2008
@@ -292,4 +292,4 @@
 )
 
 (script-fu-menu-register "script-fu-neon-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/news-text.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/news-text.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/news-text.scm	Sun Oct 12 15:38:02 2008
@@ -91,4 +91,4 @@
 )
 
 (script-fu-menu-register "script-fu-newsprint-text"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/pupi-button.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/pupi-button.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/pupi-button.scm	Sun Oct 12 15:38:02 2008
@@ -209,4 +209,4 @@
 )
 
 (script-fu-menu-register "script-fu-round-button"
-                         "<Image>/File/New/Buttons")
+                         "<Image>/File/Create/Buttons")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/rendermap.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/rendermap.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/rendermap.scm	Sun Oct 12 15:38:02 2008
@@ -92,4 +92,4 @@
 )
 
 (script-fu-menu-register "script-fu-render-map"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/sota-chrome-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/sota-chrome-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/sota-chrome-logo.scm	Sun Oct 12 15:38:02 2008
@@ -220,4 +220,4 @@
 )
 
 (script-fu-menu-register "script-fu-sota-chrome-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/speed-text.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/speed-text.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/speed-text.scm	Sun Oct 12 15:38:02 2008
@@ -98,4 +98,4 @@
 )
 
 (script-fu-menu-register "script-fu-speed-text"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/starscape-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/starscape-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/starscape-logo.scm	Sun Oct 12 15:38:02 2008
@@ -148,4 +148,4 @@
 )
 
 (script-fu-menu-register "script-fu-starscape-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirltile.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirltile.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirltile.scm	Sun Oct 12 15:38:02 2008
@@ -66,4 +66,4 @@
 )
 
 (script-fu-menu-register "script-fu-swirl-tile"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirly-pattern.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirly-pattern.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/swirly-pattern.scm	Sun Oct 12 15:38:02 2008
@@ -91,4 +91,4 @@
 )
 
 (script-fu-menu-register "script-fu-swirly-pattern"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/t-o-p-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/t-o-p-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/t-o-p-logo.scm	Sun Oct 12 15:38:02 2008
@@ -151,4 +151,4 @@
 )
 
 (script-fu-menu-register "script-fu-t-o-p-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/text-circle.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/text-circle.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/text-circle.scm	Sun Oct 12 15:38:02 2008
@@ -217,4 +217,4 @@
 )
 
 (script-fu-menu-register "script-fu-text-circle"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/textured-logo.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/textured-logo.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/textured-logo.scm	Sun Oct 12 15:38:02 2008
@@ -175,4 +175,4 @@
 )
 
 (script-fu-menu-register "script-fu-textured-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/title-header.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/title-header.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/title-header.scm	Sun Oct 12 15:38:02 2008
@@ -174,4 +174,4 @@
 )
 
 (script-fu-menu-register "script-fu-title-header"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scripts/truchet.scm
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scripts/truchet.scm	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scripts/truchet.scm	Sun Oct 12 15:38:02 2008
@@ -169,4 +169,4 @@
 )
 
 (script-fu-menu-register "script-fu-truchet"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/CHANGES
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/CHANGES	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/CHANGES	Sun Oct 12 15:38:02 2008
@@ -1,206 +1,207 @@
-     Change Log
-     ----------
-     Version 1.38
-          Interim release until the rewrite, mostly incorporating modifications from 
-          Kevin Cozens. Small addition for Cygwin in the makefile, and modifications
-          by Andrew Guenther for Apple platforms.
-     Version 1.37
-          Joe Buehler submitted reserve_cells.
-     Version 1.36
-	  Joe Buehler fixed a patch in the allocator.
-	  Alexander Shendi moved the comment handling in the scanner, which 
-	  fixed an obscure bug for which Mike E had provided a patch as well.
-	  Kevin Cozens has submitted some fixes and modifications which have not
-	  been incorporated yet in their entirety.
-     Version 1.35
-	  Todd Showalter discovered that the number of free cells reported 
-	  after GC was incorrect, which could also cause unnecessary allocations.
-	 Version 1.34
-	  Long missing version. Lots of bugfixes have accumulated in my email, so
-	  I had to start using them. In this version, Keenan Pepper has submitted
-	  a bugfix for the string comparison library procedure, Wouter Boeke 
-	  modified some code that was casting to the wrong type and crashed on
-	  some machines, "SheppardCo" submitted a replacement "modulo" code and
-	  Scott Fenton submitted lots of corrections that shut up some compiler
-	  warnings. Brian Maher submitted instructions on how to build on OS-X.
-	  I have to dig deeper into my mailbox and find earlier emails, too.
-     Version 1.33
-	  Charles Hayden fixed a nasty GC bug of the new stack frame, while in
-	  the process of porting TinyScheme to C++. He also submitted other 
-	  changes, and other people also had comments or requests, but the GC
-	  bug was so important that this version is put through the door to 
-	  correct it.
-     Version 1.32
-	  Stephen Gildea put some quality time on TinyScheme again, and made
-	  a whole lot of changes to the interpreter that made it noticeably 
-	  faster.
-     Version 1.31
-          Patches to the hastily-done version 1.30. Stephen Gildea fixed
-	  some things done wrongly, and Richard Russo fixed the makefile
-	  for building on Windows. Property lists (heritage from MiniScheme)
-	  are now optional and have dissappeared from the interface. They
-	  should be considered as deprecated.
-     Version 1.30
-	  After many months, I followed Preston Bannister's advice of
-	  using macros and a single source text to keep the enums and the
-	  dispatch table in sync, and I used his contributed "opdefines.h".
-	  Timothy Downs contributed a helpful function, "scheme_call".
-	  Stephen Gildea contributed new versions of the makefile and 
-	  practically all other sources. He created a built-in STRING-APPEND,
-	  and fixed a lot of other bugs.
-	  Ruhi Bloodworth reported fixes necessary for OS X and a small
-	  bug in dynload.c.
-     Version 1.29
-	  The previous version contained a lot of corrections, but there
-	  were a lot more that still wait on a sheet of paper lost in a
-	  carton someplace after my house move... Manuel Heras-Gilsanz
-	  noticed this and resent his own contribution, which relies on
-	  another bugfix that v.1.28 was missing: a problem with string
-	  output, that this version fixes. I hope other people will take
-	  the time to resend their contributions, if they didn't make it
-	  to v.1.28.
-     Version 1.28
-	  Many people have contacted me with bugfixes or remarks in
-	  the three months I was inactive. A lot of them spotted that 
-	  scheme_deinit crashed while reporting gc results. They suggested
-	  that sc->outport be set to NIL in scheme_deinit, which I did.
-	  Dennis Taylor remarked that OP_VALUEPRINT reset sc->value instead
-	  of preserving it. He submitted a modification which I adopted 
-	  partially. David Hovemeyer sent me many little changes, that you
-	  will find in version 1.28, and Partice Stoessel modified the 
-	  float reader to conform to R5RS.
-     Version 1.27
-          Version 1.27 is the successor of 1.25. Bug fixes only, but I had to
-          release them so that everybody can profit. 'Backchar' tried to write
-          back to the string, which obviously didn't work for const strings.
-          'Substring' didn't check for crossed start and end indices. Defines
-          changed to restore the ability to compile under MSVC.
-     Version 1.26
-          Version 1.26 was never released. I changed a lot of things, in fact
-          too much, even the garbage collector, and hell broke loose. I'll
-          try a more gradual approach next time.
-     Version 1.25
-          Types have been homogenized to be able to accomodate a different
-	  representation. Plus, promises are no longer closures. Unfortunately,
-	  I discovered that continuations and force/delay do not pass the SCM
-	  test (and never did)... However, on the bright side, what little
-	  modifications I did had a large impact on the footprint: 
-	  USE_NO_FEATURES now produces an object file of 63960 bytes on Linux!
-     Version 1.24
-	  SCM tests now pass again after change in atom2str.
-     Version 1.23
-          Finally I managed to mess it up with my version control. Version
-	  1.22 actually lacked some of the things I have been fixing in the
-	  meantime. This should be considered as a complete replacement for
-	  1.22.
-     Version 1.22
-          The new ports had a bug in LOAD. MK_CLOSURE is introduced.
-	  Shawn Wagner inquired about string->number and number->string.
-	  I added string->atom and atom->string and defined the number
-	  functions from them. Doing that, I fixed WRITE applied to symbols
-	  (it didn't quote them). Unfortunately, minimum build is now
-	  slightly larger than 64k... I postpone action because Jason's idea
-	  might solve it elegantly.
-     Version 1.21
-          Jason Felice submitted a radically different datatype representation
-	  which he had implemented. While discussing its pros and cons, it
-	  became apparent that the current implementation of ports suffered
-	  from a grave fault: ports were not garbage-collected. I changed the
-	  ports to be heap-allocated, which enabled the use of string ports
-	  for loading. Jason also fixed errors in the garbage collection of 
-	  vectors. USE_VERBATIM is gone. "ssp_compiler.c" has a better solution
-	  on HTML generation. A bug involving backslash notation in strings
-	  has been fixed. '-c' flag now executes next argument as a stream of
-	  Scheme commands. Foreign functions are now also heap allocated,
-          and scheme_define is used to define everything.
-     Version 1.20
-          Tracing has been added. The toplevel loop has been slightly
-	  rearranged. Backquote reading for vector templates has been
-	  sanitized. Symbol interning is now correct. Arithmetic functions
-	  have been corrected. APPLY, MAP, FOR-EACH, numeric comparison
-	  functions fixed. String reader/writer understands \xAA notation.
-     Version 1.19
-          Carriage Return now delimits identifiers. DOS-formatted Scheme files
-          can be used by Unix. Random number generator added to library.
-          Fixed some glitches of the new type-checking scheme. Fixed erroneous
-          (append '() 'a) behavior. Will continue with r4rstest.scm to
-          fix errors.
-     Version 1.18
-          The FFI has been extended. USE_VERBOSE_GC has gone. Anyone wanting
-          the same functionality can put (gcverbose #t) in init.scm.
-          print-width was removed, along with three corresponding op-codes.
-     	  Extended character constants with ASCII names were added.
-          mk_counted_string paves the way for full support of binary strings.
-          As much as possible of the type-checking chores were delegated
-          to the inner loop, thus reducing the code size to less than 4200 loc!
-     Version 1.17
-          Dynamically-loaded extensions are more fully integrated.
-          TinyScheme is now distributed under the BSD open-source license.
-     Version 1.16
-          Dynamically-loaded extensions introduced (USE_DL).
-          Santeri Paavolainen found a race condition: When a cons is executed,
-          and each of the two arguments is a constructing function,  GC could
-          happen before all arguments are evaluated and cons() is called, and
-          the evaluated arguments would all be reclaimed!
-          Fortunately, such a case was rare in the code, although it is
-          a pitfall in new code and code in foreign functions. Currently, only
-          one such case remains, when COLON_HOOK is defined.
-     Version 1.15
-          David Gould also contributed some changes that speed up operation.
-          Kirk Zurell fixed HASPROP.
-          The Garbage Collection didn't collect all the garbage...fixed.
-     Version 1.14
-          Unfortunately, after Andre fixed the GC it became obvious that the
-          algorithm was too slow... Fortunately, David Gould found a way to
-          speed it up.
-     Version 1.13
-          Silly bug involving division by zero resolved by Roland Kaufman.
-          Macintoch support from Shmulik Regev.
-          Float parser bug fixed by Alexander Shendi.
-          GC bug from Andru Luvisi.
-     Version 1.12
-          Cis* incorrectly called isalpha() instead of isascii()
-          Added USE_CHAR_CLASSIFIERS, USE_STRING_PORTS.
-     Version 1.11
-          BSDI defines isnumber... changed all similar functions to is_*
-          EXPT now has correct definition. Added FLOOR,CEILING,TRUNCATE
-          and ROUND, courtesy of Bengt Kleberg. Preprocessor symbols now
-          have values 1 or 0, and can be set as compiler defines (proposed
-          by Andy Ganor *months* ago). 'prompt' and 'InitFile' can now be
-          defined during compilation, too.
-     Version 1.10
-          Another bug when file ends with comment!
-          Added DEFINE-MACRO in init.scm, courtesy of Andy Gaynor.
-     Version 1.09
-          Removed bug when READ met EOF. lcm.
-     Version 1.08
-          quotient,remainder and modulo. gcd.
-     Version 1.07
-          '=>' in cond now exists
-          list? now checks for circularity
-          some reader bugs removed
-          Reader is more consistent wrt vectors
-          Quote and Quasiquote work with vectors
-     Version 1.06
-          #! is now skipped
-          generic-assoc bug removed
-          strings are now managed differently, hack.txt is removed
-          various delicate points fixed
-     Version 1.05
-          Support for scripts, *args*, "-1" option.
-          Various R5RS procedures.
-          *sharp-hook*
-          Handles unmatched parentheses.
-          New architecture for procedures.
-     Version 1.04
-          Added missing T_ATOM bits...
-          Added vectors
-          Free-list is sorted by address, since vectors need consecutive cells.
-          (quit <exitcode>) for use with scripts
-     Version 1.03 (26 Aug 1998):
-          Extended .h with useful functions for FFI
-          Library: with-input-* etc.
-          Finished R5RS I/O, added string ports.
-     Version 1.02 (25 Aug 1998):
-          First part of R5RS I/O.
-	
\ No newline at end of file
+Change Log
+----------
+
+Version 1.38
+    Interim release until the rewrite, mostly incorporating modifications
+    from Kevin Cozens. Small addition for Cygwin in the makefile, and
+    modifications by Andrew Guenther for Apple platforms.
+Version 1.37
+    Joe Buehler submitted reserve_cells.
+Version 1.36
+    Joe Buehler fixed a patch in the allocator.
+    Alexander Shendi moved the comment handling in the scanner, which 
+    fixed an obscure bug for which Mike E had provided a patch as well.
+    Kevin Cozens has submitted some fixes and modifications which have
+    not been incorporated yet in their entirety.
+Version 1.35
+    Todd Showalter discovered that the number of free cells reported 
+    after GC was incorrect, which could also cause unnecessary allocations.
+Version 1.34
+    Long missing version. Lots of bugfixes have accumulated in my email, so
+    I had to start using them. In this version, Keenan Pepper has submitted
+    a bugfix for the string comparison library procedure, Wouter Boeke 
+    modified some code that was casting to the wrong type and crashed on
+    some machines, "SheppardCo" submitted a replacement "modulo" code and
+    Scott Fenton submitted lots of corrections that shut up some compiler
+    warnings. Brian Maher submitted instructions on how to build on OS-X.
+    I have to dig deeper into my mailbox and find earlier emails, too.
+Version 1.33
+    Charles Hayden fixed a nasty GC bug of the new stack frame, while in
+    the process of porting TinyScheme to C++. He also submitted other 
+    changes, and other people also had comments or requests, but the GC
+    bug was so important that this version is put through the door to 
+    correct it.
+Version 1.32
+    Stephen Gildea put some quality time on TinyScheme again, and made
+    a whole lot of changes to the interpreter that made it noticeably 
+    faster.
+Version 1.31
+    Patches to the hastily-done version 1.30. Stephen Gildea fixed
+    some things done wrongly, and Richard Russo fixed the makefile
+    for building on Windows. Property lists (heritage from MiniScheme)
+    are now optional and have dissappeared from the interface. They
+    should be considered as deprecated.
+Version 1.30
+    After many months, I followed Preston Bannister's advice of
+    using macros and a single source text to keep the enums and the
+    dispatch table in sync, and I used his contributed "opdefines.h".
+    Timothy Downs contributed a helpful function, "scheme_call".
+    Stephen Gildea contributed new versions of the makefile and 
+    practically all other sources. He created a built-in STRING-APPEND,
+    and fixed a lot of other bugs.
+    Ruhi Bloodworth reported fixes necessary for OS X and a small
+    bug in dynload.c.
+Version 1.29
+    The previous version contained a lot of corrections, but there
+    were a lot more that still wait on a sheet of paper lost in a
+    carton someplace after my house move... Manuel Heras-Gilsanz
+    noticed this and resent his own contribution, which relies on
+    another bugfix that v.1.28 was missing: a problem with string
+    output, that this version fixes. I hope other people will take
+    the time to resend their contributions, if they didn't make it
+    to v.1.28.
+Version 1.28
+    Many people have contacted me with bugfixes or remarks in
+    the three months I was inactive. A lot of them spotted that 
+    scheme_deinit crashed while reporting gc results. They suggested
+    that sc->outport be set to NIL in scheme_deinit, which I did.
+    Dennis Taylor remarked that OP_VALUEPRINT reset sc->value instead
+    of preserving it. He submitted a modification which I adopted 
+    partially. David Hovemeyer sent me many little changes, that you
+    will find in version 1.28, and Partice Stoessel modified the 
+    float reader to conform to R5RS.
+Version 1.27
+    Version 1.27 is the successor of 1.25. Bug fixes only, but I had to
+    release them so that everybody can profit. 'Backchar' tried to write
+    back to the string, which obviously didn't work for const strings.
+    'Substring' didn't check for crossed start and end indices. Defines
+    changed to restore the ability to compile under MSVC.
+Version 1.26
+    Version 1.26 was never released. I changed a lot of things, in fact
+    too much, even the garbage collector, and hell broke loose. I'll
+    try a more gradual approach next time.
+Version 1.25
+    Types have been homogenized to be able to accomodate a different
+    representation. Plus, promises are no longer closures. Unfortunately,
+    I discovered that continuations and force/delay do not pass the SCM
+    test (and never did)... However, on the bright side, what little
+    modifications I did had a large impact on the footprint: 
+    USE_NO_FEATURES now produces an object file of 63960 bytes on Linux!
+Version 1.24
+    SCM tests now pass again after change in atom2str.
+Version 1.23
+    Finally I managed to mess it up with my version control. Version
+    1.22 actually lacked some of the things I have been fixing in the
+    meantime. This should be considered as a complete replacement for
+    1.22.
+Version 1.22
+    The new ports had a bug in LOAD. MK_CLOSURE is introduced.
+    Shawn Wagner inquired about string->number and number->string.
+    I added string->atom and atom->string and defined the number
+    functions from them. Doing that, I fixed WRITE applied to symbols
+    (it didn't quote them). Unfortunately, minimum build is now
+    slightly larger than 64k... I postpone action because Jason's idea
+    might solve it elegantly.
+Version 1.21
+    Jason Felice submitted a radically different datatype representation
+    which he had implemented. While discussing its pros and cons, it
+    became apparent that the current implementation of ports suffered
+    from a grave fault: ports were not garbage-collected. I changed the
+    ports to be heap-allocated, which enabled the use of string ports
+    for loading. Jason also fixed errors in the garbage collection of 
+    vectors. USE_VERBATIM is gone. "ssp_compiler.c" has a better solution
+    on HTML generation. A bug involving backslash notation in strings
+    has been fixed. '-c' flag now executes next argument as a stream of
+    Scheme commands. Foreign functions are now also heap allocated,
+    and scheme_define is used to define everything.
+Version 1.20
+    Tracing has been added. The toplevel loop has been slightly
+    rearranged. Backquote reading for vector templates has been
+    sanitized. Symbol interning is now correct. Arithmetic functions
+    have been corrected. APPLY, MAP, FOR-EACH, numeric comparison
+    functions fixed. String reader/writer understands \xAA notation.
+Version 1.19
+    Carriage Return now delimits identifiers. DOS-formatted Scheme files
+    can be used by Unix. Random number generator added to library.
+    Fixed some glitches of the new type-checking scheme. Fixed erroneous
+    (append '() 'a) behavior. Will continue with r4rstest.scm to
+    fix errors.
+Version 1.18
+    The FFI has been extended. USE_VERBOSE_GC has gone. Anyone wanting
+    the same functionality can put (gcverbose #t) in init.scm.
+    print-width was removed, along with three corresponding op-codes.
+    Extended character constants with ASCII names were added.
+    mk_counted_string paves the way for full support of binary strings.
+    As much as possible of the type-checking chores were delegated
+    to the inner loop, thus reducing the code size to less than 4200 loc!
+Version 1.17
+    Dynamically-loaded extensions are more fully integrated.
+    TinyScheme is now distributed under the BSD open-source license.
+Version 1.16
+    Dynamically-loaded extensions introduced (USE_DL).
+    Santeri Paavolainen found a race condition: When a cons is executed,
+    and each of the two arguments is a constructing function,  GC could
+    happen before all arguments are evaluated and cons() is called, and
+    the evaluated arguments would all be reclaimed!
+    Fortunately, such a case was rare in the code, although it is
+    a pitfall in new code and code in foreign functions. Currently, only
+    one such case remains, when COLON_HOOK is defined.
+Version 1.15
+    David Gould also contributed some changes that speed up operation.
+    Kirk Zurell fixed HASPROP.
+    The Garbage Collection didn't collect all the garbage...fixed.
+Version 1.14
+    Unfortunately, after Andre fixed the GC it became obvious that the
+    algorithm was too slow... Fortunately, David Gould found a way to
+    speed it up.
+Version 1.13
+    Silly bug involving division by zero resolved by Roland Kaufman.
+    Macintoch support from Shmulik Regev.
+    Float parser bug fixed by Alexander Shendi.
+    GC bug from Andru Luvisi.
+Version 1.12
+    Cis* incorrectly called isalpha() instead of isascii()
+    Added USE_CHAR_CLASSIFIERS, USE_STRING_PORTS.
+Version 1.11
+    BSDI defines isnumber... changed all similar functions to is_*
+    EXPT now has correct definition. Added FLOOR,CEILING,TRUNCATE
+    and ROUND, courtesy of Bengt Kleberg. Preprocessor symbols now
+    have values 1 or 0, and can be set as compiler defines (proposed
+    by Andy Ganor *months* ago). 'prompt' and 'InitFile' can now be
+    defined during compilation, too.
+Version 1.10
+    Another bug when file ends with comment!
+    Added DEFINE-MACRO in init.scm, courtesy of Andy Gaynor.
+Version 1.09
+    Removed bug when READ met EOF. lcm.
+Version 1.08
+    quotient,remainder and modulo. gcd.
+Version 1.07
+    '=>' in cond now exists
+    list? now checks for circularity
+    some reader bugs removed
+    Reader is more consistent wrt vectors
+    Quote and Quasiquote work with vectors
+Version 1.06
+    #! is now skipped
+    generic-assoc bug removed
+    strings are now managed differently, hack.txt is removed
+    various delicate points fixed
+Version 1.05
+    Support for scripts, *args*, "-1" option.
+    Various R5RS procedures.
+    *sharp-hook*
+    Handles unmatched parentheses.
+    New architecture for procedures.
+Version 1.04
+    Added missing T_ATOM bits...
+    Added vectors
+    Free-list is sorted by address, since vectors need consecutive cells.
+    (quit <exitcode>) for use with scripts
+Version 1.03 (26 Aug 1998):
+    Extended .h with useful functions for FFI
+    Library: with-input-* etc.
+    Finished R5RS I/O, added string ports.
+Version 1.02 (25 Aug 1998):
+    First part of R5RS I/O.
+

Modified: branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/dynload.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/dynload.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/dynload.c	Sun Oct 12 15:38:02 2008
@@ -13,8 +13,8 @@
 # define MAXPATHLEN 1024
 #endif
 
-static void make_filename(const char *name, char *filename); 
-static void make_init_fn(const char *name, char *init_fn); 
+static void make_filename(const char *name, char *filename);
+static void make_init_fn(const char *name, char *init_fn);
 
 #ifdef _WIN32
 # include <windows.h>
@@ -28,27 +28,27 @@
 #define PREFIX ""
 #define SUFFIX ".dll"
 
- static void display_w32_error_msg(const char *additional_message) 
- { 
-   LPVOID msg_buf; 
- 
-   FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, 
-		 NULL, GetLastError(), 0, 
-		 (LPTSTR)&msg_buf, 0, NULL); 
-   fprintf(stderr, "scheme load-extension: %s: %s", additional_message, msg_buf); 
-   LocalFree(msg_buf); 
- } 
+ static void display_w32_error_msg(const char *additional_message)
+ {
+   LPVOID msg_buf;
+
+   FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+		 NULL, GetLastError(), 0,
+		 (LPTSTR)&msg_buf, 0, NULL);
+   fprintf(stderr, "scheme load-extension: %s: %s", additional_message, msg_buf);
+   LocalFree(msg_buf);
+ }
 
 static HMODULE dl_attach(const char *module) {
   HMODULE dll = LoadLibrary(module);
-  if (!dll) display_w32_error_msg(module); 
-  return dll; 
+  if (!dll) display_w32_error_msg(module);
+  return dll;
 }
 
 static FARPROC dl_proc(HMODULE mo, const char *proc) {
-  FARPROC procedure = GetProcAddress(mo,proc); 
-  if (!procedure) display_w32_error_msg(proc); 
-  return procedure; 
+  FARPROC procedure = GetProcAddress(mo,proc);
+  if (!procedure) display_w32_error_msg(proc);
+  return procedure;
 }
 
 static void dl_detach(HMODULE mo) {
@@ -65,7 +65,7 @@
 static HMODULE dl_attach(const char *module) {
   HMODULE so=dlopen(module,RTLD_LAZY);
   if(!so) {
-    fprintf(stderr, "Error loading scheme extension \"%s\": %s\n", module, dlerror()); 
+    fprintf(stderr, "Error loading scheme extension \"%s\": %s\n", module, dlerror());
   }
   return so;
 }
@@ -93,11 +93,11 @@
    char *name;
    HMODULE dll_handle;
    void (*module_init)(scheme *sc);
-   
+
    if ((args != sc->NIL) && is_string((first_arg = pair_car(args)))) {
       name = string_value(first_arg);
-      make_filename(name,filename);     
-      make_init_fn(name,init_fn);     
+      make_filename(name,filename);
+      make_init_fn(name,init_fn);
       dll_handle = dl_attach(filename);
       if (dll_handle == 0) {
          retval = sc -> F;
@@ -116,14 +116,14 @@
    else {
       retval = sc -> F;
    }
-   
+
   return(retval);
 }
 
 static void make_filename(const char *name, char *filename) {
  strcpy(filename,name);
  strcat(filename,SUFFIX);
-}         
+}
 
 static void make_init_fn(const char *name, char *init_fn) {
  const char *p=strrchr(name,'/');

Modified: branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.c	Sun Oct 12 15:38:02 2008
@@ -377,7 +377,6 @@
 static int count_consecutive_cells(pointer x, int needed);
 static pointer find_slot_in_env(scheme *sc, pointer env, pointer sym, int all);
 static pointer mk_number(scheme *sc, num n);
-static pointer mk_empty_string(scheme *sc, int len, gunichar fill);
 static char *store_string(scheme *sc, int len, const char *str, gunichar fill);
 static pointer mk_vector(scheme *sc, int len);
 static pointer mk_atom(scheme *sc, char *q);
@@ -407,8 +406,9 @@
 static pointer reverse(scheme *sc, pointer a);
 static pointer reverse_in_place(scheme *sc, pointer term, pointer list);
 static pointer append(scheme *sc, pointer a, pointer b);
-static int list_length(scheme *sc, pointer a);
-static int eqv(pointer a, pointer b);
+int list_length(scheme *sc, pointer a);
+int eqv(pointer a, pointer b);
+
 static INLINE void dump_stack_mark(scheme *);
 static pointer opexe_0(scheme *sc, enum scheme_opcodes op);
 static pointer opexe_1(scheme *sc, enum scheme_opcodes op);
@@ -422,9 +422,6 @@
 static int syntaxnum(pointer p);
 static void assign_proc(scheme *sc, enum scheme_opcodes, char *name);
 scheme *scheme_init_new(void);
-#if !STANDALONE
-void scheme_call(scheme *sc, pointer func, pointer args);
-#endif
 
 #define num_ivalue(n)       (n.is_fixnum?(n).value.ivalue:(long)(n).value.rvalue)
 #define num_rvalue(n)       (!n.is_fixnum?(n).value.rvalue:(double)(n).value.ivalue)
@@ -1018,7 +1015,7 @@
      return (x);
 }
 
-static pointer mk_empty_string(scheme *sc, int len, gunichar fill) {
+INTERFACE pointer mk_empty_string(scheme *sc, int len, gunichar fill) {
      pointer x = get_cell(sc, sc->NIL, sc->NIL);
 
      strvalue(x) = store_string(sc,len,0,fill);
@@ -1029,6 +1026,7 @@
 
 INTERFACE static pointer mk_vector(scheme *sc, int len) {
      pointer x=get_consecutive_cells(sc,len/2+len%2+1);
+     if(sc->no_memory) { return sc->sink; }
      typeflag(x) = (T_VECTOR | T_ATOM);
      ivalue_unchecked(x)=len;
      set_num_integer(x);
@@ -2111,7 +2109,7 @@
 }
 
 /* equivalence of atoms */
-static int eqv(pointer a, pointer b) {
+int eqv(pointer a, pointer b) {
      if (is_string(a)) {
           if (is_string(b))
                return (strvalue(a) == strvalue(b));
@@ -3446,6 +3444,7 @@
                Error_1(sc,"vector: not a proper list:",sc->args);
           }
           vec=mk_vector(sc,len);
+          if(sc->no_memory) { s_return(sc, sc->sink); }
           for (x = sc->args, i = 0; is_pair(x); x = cdr(x), i++) {
                set_vector_elem(vec,i,car(x));
           }
@@ -3463,6 +3462,7 @@
                fill=cadr(sc->args);
           }
           vec=mk_vector(sc,len);
+          if(sc->no_memory) { s_return(sc, sc->sink); }
           if(fill!=sc->NIL) {
                fill_vector(vec,fill);
           }
@@ -3535,7 +3535,7 @@
     }
 }
 
-static int list_length(scheme *sc, pointer a) {
+int list_length(scheme *sc, pointer a) {
     int i=0;
     pointer slow, fast;
 
@@ -4743,27 +4743,38 @@
 }
 
 #if !STANDALONE
-void scheme_apply0(scheme *sc, const char *procname) {
-     pointer carx=mk_symbol(sc,procname);
-     pointer cdrx=sc->NIL;
-
-     dump_stack_reset(sc);
-     sc->envir = sc->global_env;
-     sc->code = cons(sc,carx,cdrx);
-     sc->interactive_repl=0;
-     sc->retcode=0;
-     Eval_Cycle(sc,OP_EVAL);
-     }
-
-void scheme_call(scheme *sc, pointer func, pointer args) {
-   dump_stack_reset(sc);
-   sc->envir = sc->global_env;
-   sc->args = args;
-   sc->code = func;
-   sc->interactive_repl =0;
-   sc->retcode = 0;
-   Eval_Cycle(sc, OP_APPLY);
+pointer scheme_apply0(scheme *sc, const char *procname)
+{ return scheme_eval(sc, cons(sc,mk_symbol(sc,procname),sc->NIL)); }
+
+/* "func" and "args" are assumed to be already eval'ed. */
+pointer scheme_call(scheme *sc, pointer func, pointer args)
+{
+  int old_repl = sc->interactive_repl;
+  sc->interactive_repl = 0;
+  s_save(sc,OP_QUIT,sc->NIL,sc->NIL);
+  sc->envir = sc->global_env;
+  sc->args = args;
+  sc->code = func;
+  sc->retcode = 0;
+  Eval_Cycle(sc, OP_APPLY);
+  sc->interactive_repl = old_repl;
+  return sc->value;
 }
+
+pointer scheme_eval(scheme *sc, pointer obj)
+{
+  int old_repl = sc->interactive_repl;
+  sc->interactive_repl = 0;
+  s_save(sc,OP_QUIT,sc->NIL,sc->NIL);
+  sc->args = sc->NIL;
+  sc->code = obj;
+  sc->retcode = 0;
+  Eval_Cycle(sc, OP_EVAL);
+  sc->interactive_repl = old_repl;
+  return sc->value;
+}
+
+
 #endif
 
 /* ========== Main ========== */
@@ -4793,7 +4804,13 @@
     printf(banner);
   }
   if(argc==2 && strcmp(argv[1],"-?")==0) {
-    printf("Usage: %s [-? | <file1> <file2> ... | -1 <file> <arg1> <arg2> ...]\n\tUse - as filename for stdin.\n",argv[0]);
+    printf("Usage: tinyscheme -?\n");
+    printf("or:    tinyscheme [<file1> <file2> ...]\n");
+    printf("followed by\n");
+    printf("          -1 <file> [<arg1> <arg2> ...]\n");
+    printf("          -c <Scheme commands> [<arg1> <arg2> ...]\n");
+    printf("assuming that the executable is named tinyscheme.\n");
+    printf("Use - as filename for stdin.\n");
     return 1;
   }
   if(!scheme_init(&sc)) {

Modified: branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.h	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/tinyscheme/scheme.h	Sun Oct 12 15:38:02 2008
@@ -130,7 +130,7 @@
                                             int             len);
 #endif
 
-SCHEME_EXPORT scheme *scheme_init_new();
+SCHEME_EXPORT scheme *scheme_init_new(void);
 SCHEME_EXPORT scheme *scheme_init_new_custom_alloc(func_alloc malloc, func_dealloc free);
 SCHEME_EXPORT int scheme_init(scheme *sc);
 SCHEME_EXPORT int scheme_init_custom_alloc(scheme *sc, func_alloc, func_dealloc);
@@ -141,8 +141,9 @@
 void scheme_set_output_port_string(scheme *sc, char *start, char *past_the_end);
 SCHEME_EXPORT void scheme_load_file(scheme *sc, FILE *fin);
 SCHEME_EXPORT void scheme_load_string(scheme *sc, const char *cmd);
-void scheme_apply0(scheme *sc, const char *procname);
-SCHEME_EXPORT pointer scheme_apply1(scheme *sc, const char *procname, pointer);
+SCHEME_EXPORT pointer scheme_apply0(scheme *sc, const char *procname);
+SCHEME_EXPORT pointer scheme_call(scheme *sc, pointer func, pointer args);
+SCHEME_EXPORT pointer scheme_eval(scheme *sc, pointer obj);
 void scheme_set_external_data(scheme *sc, void *p);
 SCHEME_EXPORT void scheme_define(scheme *sc, pointer env, pointer symbol, pointer value);
 
@@ -155,10 +156,14 @@
 pointer gensym(scheme *sc);
 pointer mk_string(scheme *sc, const char *str);
 pointer mk_counted_string(scheme *sc, const char *str, int len);
+pointer mk_empty_string(scheme *sc, int len, gunichar fill);
 pointer mk_character(scheme *sc, gunichar c);
 pointer mk_foreign_func(scheme *sc, foreign_func f);
 void    putcharacter(scheme *sc, gunichar c);
 void    putstr(scheme *sc, const char *s);
+int list_length(scheme *sc, pointer a);
+int eqv(pointer a, pointer b);
+
 
 SCHEME_EXPORT void set_safe_foreign (scheme *sc, pointer data);
 SCHEME_EXPORT pointer foreign_error (scheme *sc, const char *s, pointer a);

Modified: branches/soc-2008-tagging/plug-ins/twain/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/Makefile.am	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -14,8 +14,7 @@
 
 
 if OS_WIN32
-twain_LDFLAGS = -mwindows
-winlink = -luser32
+twain_LDFLAGS = -mwindows -luser32
 
 twainplatform = tw_win.c
 endif
@@ -31,8 +30,6 @@
 endif
 
 
-AM_LDFLAGS = $(winlink)
-
 twain_SOURCES = \
 	tw_func.c	\
 	tw_func.h	\

Modified: branches/soc-2008-tagging/plug-ins/twain/tw_func.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/tw_func.c	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/tw_func.c	Sun Oct 12 15:38:02 2008
@@ -229,7 +229,7 @@
       twSession->twainState = 3;
       return TRUE;
       break;
-	
+
     case TWRC_FAILURE:
     default:
       LogMessage("OpenDSM failure\n");
@@ -272,7 +272,7 @@
     LogMessage("User cancelled TWAIN source selection\n");
     break;
 
-  case TWRC_FAILURE:	
+  case TWRC_FAILURE:
   default:
     LogMessage("Error \"%s\" during TWAIN source selection\n",
 	       currentTwainError(twSession));
@@ -602,22 +602,22 @@
   TW_SETUPMEMXFER setupMemXfer;
   TW_IMAGEMEMXFER imageMemXfer;
   char *buffer;
-	
+
   /* Clear our structures */
   memset(&setupMemXfer, 0, sizeof(TW_SETUPMEMXFER));
   memset(&imageMemXfer, 0, sizeof(TW_IMAGEMEMXFER));
-	
+
   /* Find out how the source would like to transfer... */
   twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
 			    DG_CONTROL, DAT_SETUPMEMXFER, MSG_GET,
 			    (TW_MEMREF) &setupMemXfer);
-	
+
   /* Allocate the buffer for the transfer */
   buffer = g_new (char, setupMemXfer.Preferred);
   imageMemXfer.Memory.Flags = TWMF_APPOWNS | TWMF_POINTER;
   imageMemXfer.Memory.Length = setupMemXfer.Preferred;
   imageMemXfer.Memory.TheMem = (TW_MEMREF) buffer;
-	
+
   /* Get the data */
   do {
     /* Setup for the memory transfer */
@@ -628,18 +628,18 @@
     imageMemXfer.XOffset = TWON_DONTCARE32;
     imageMemXfer.YOffset = TWON_DONTCARE32;
     imageMemXfer.BytesWritten = TWON_DONTCARE32;
-		
+
     /* Get the next block of memory */
     twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
 			      DG_IMAGE, DAT_IMAGEMEMXFER, MSG_GET,
 			      (TW_MEMREF) &imageMemXfer);
-		
+
     if ((twSession->twRC == TWRC_SUCCESS) ||
 	(twSession->twRC == TWRC_XFERDONE)) {
       /* Call the callback function */
       if (!(*twSession->transferFunctions->txfrDataCb) (
 							imageInfo,
-							&imageMemXfer,	
+							&imageMemXfer,
 							twSession->clientData)) {
 	/* Callback function requested to cancel */
 	twSession->twRC = TWRC_CANCEL;
@@ -757,14 +757,14 @@
   do {
     /* Move to the new state */
     twSession->twainState = 6;
-		
+
     /* Begin the image transfer */
     if (!beginImageTransfer(twSession, &imageInfo))
       continue;
-		
+
     /* Call the image transfer function */
     transferImage(twSession, &imageInfo);
-		
+
   } while (endImageTransfer(twSession, &pendingCount));
 
   /*

Modified: branches/soc-2008-tagging/plug-ins/twain/tw_util.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/tw_util.c	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/tw_util.c	Sun Oct 12 15:38:02 2008
@@ -109,13 +109,13 @@
 {
   int i;
   char buffer[256];
-		
+
   LogMessage("\n");
   LogMessage("*************************************\n");
   LogMessage("\n");
   LogMessage("Image transfer begin:\n");
   /*	LogMessage("\tClient data: %s\n", (char *) clientData); */
-		
+
   /* Log the image information */
   LogMessage("Image information:\n");
   LogMessage("\tXResolution: %f\n", FIX32ToFloat(imageInfo->XResolution));
@@ -129,19 +129,19 @@
       strcat(buffer, "1");
     else
       strcat(buffer, "0");
-			
+
     if (i != 7)
       strcat(buffer, ",");
   }
   LogMessage("%s}\n", buffer);
-		
+
   LogMessage("\tBitsPerPixel: %d\n", imageInfo->BitsPerPixel);
   LogMessage("\tPlanar: %s\n", (imageInfo->Planar ? "TRUE" : "FALSE"));
   LogMessage("\tPixelType: %d\n", imageInfo->PixelType);
   /* Compression */
-		
+
 }
-	
+
 void
 logData(pTW_IMAGEINFO imageInfo,
 	pTW_IMAGEMEMXFER imageMemXfer,
@@ -157,7 +157,7 @@
   LogMessage("\tYOffset = %d\n", imageMemXfer->YOffset);
   LogMessage("\tBytesWritten = %d\n", imageMemXfer->BytesWritten);
 }
-	
+
 #else
 
 /*

Modified: branches/soc-2008-tagging/plug-ins/twain/tw_win.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/tw_win.c	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/tw_win.c	Sun Oct 12 15:38:02 2008
@@ -174,9 +174,9 @@
 TwainProcessMessage(LPMSG lpMsg, pTW_SESSION twSession)
 {
   TW_EVENT   twEvent;
-	
+
   twSession->twRC = TWRC_NOTDSEVENT;
-	
+
   /* Only ask Source Manager to process event if there is a Source connected. */
   if (DSM_IS_OPEN(twSession) && DS_IS_OPEN(twSession)) {
 		/*
@@ -189,16 +189,16 @@
 		twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
 			DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT,
 			(TW_MEMREF) &twEvent);
-		
+
 		/* Check the return code */
 		if (twSession->twRC == TWRC_NOTDSEVENT) {
 			return FALSE;
 		}
-		
+
 		/* Process the message as necessary */
 		processTwainMessage(twEvent.TWMessage, twSession);
   }
-	
+
   /* tell the caller what happened */
   return (twSession->twRC == TWRC_DSEVENT);
 }
@@ -214,14 +214,14 @@
 twainMessageLoop(pTW_SESSION twSession)
 {
   MSG msg;
-	
+
   while (GetMessage(&msg, NULL, 0, 0)) {
     if (DS_IS_CLOSED(twSession) || !TwainProcessMessage(&msg, twSession)) {
       TranslateMessage((LPMSG)&msg);
       DispatchMessage(&msg);
     }
   }
-	
+
   return msg.wParam;
 }
 
@@ -235,7 +235,7 @@
 LogLastWinError(void)
 {
 	LPVOID lpMsgBuf;
-	
+
 	FormatMessage(
 		FORMAT_MESSAGE_ALLOCATE_BUFFER |
 		FORMAT_MESSAGE_FROM_SYSTEM |
@@ -247,9 +247,9 @@
 		0,
 		NULL
 		);
-	
+
 	LogMessage("%s\n", lpMsgBuf);
-	
+
 	/* Free the buffer. */
 	LocalFree( lpMsgBuf );
 }

Modified: branches/soc-2008-tagging/plug-ins/twain/twain.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/twain.c	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/twain.c	Sun Oct 12 15:38:02 2008
@@ -318,7 +318,7 @@
                              args,
                              return_vals);
 
-      gimp_plugin_menu_register (PLUG_IN_D_NAME, "<Image>/File/New/Acquire");
+      gimp_plugin_menu_register (PLUG_IN_D_NAME, "<Image>/File/Create/Acquire");
     }
   else if (twain_run_mode == RUN_READDUMP)
     {
@@ -337,7 +337,7 @@
                              args,
                              return_vals);
 
-      gimp_plugin_menu_register (PLUG_IN_R_NAME, "<Image>/File/New/Acquire");
+      gimp_plugin_menu_register (PLUG_IN_R_NAME, "<Image>/File/Create/Acquire");
     }
   else
 #endif /* _DEBUG */
@@ -357,7 +357,7 @@
                              args,
                              return_vals);
 
-      gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/New/Acquire");
+      gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Create/Acquire");
     }
 }
 

Modified: branches/soc-2008-tagging/plug-ins/twain/twain.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/twain/twain.h	(original)
+++ branches/soc-2008-tagging/plug-ins/twain/twain.h	Sun Oct 12 15:38:02 2008
@@ -821,7 +821,7 @@
 #define TWCB_NOCLEAR        2
 
 /* CAP_DEVICEEVENT values (DE_ means device event) */
-#define TWDE_CUSTOMEVENTS						0x8000			
+#define TWDE_CUSTOMEVENTS						0x8000
 #define TWDE_CHECKAUTOMATICCAPTURE	0
 #define TWDE_CHECKBATTERY						1
 #define TWDE_CHECKDEVICEONLINE			2

Modified: branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c	(original)
+++ branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c	Sun Oct 12 15:38:02 2008
@@ -999,7 +999,7 @@
                           args,
                           return_vals);
 
-  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/New/Acquire");
+  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/Create/Acquire");
 }
 
 /* Return values storage */

Modified: branches/soc-2008-tagging/po-libgimp/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po-libgimp/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po-libgimp/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,6 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 plug-ins
 tools

Modified: branches/soc-2008-tagging/po-plug-ins/Makefile.in.in
==============================================================================
--- branches/soc-2008-tagging/po-plug-ins/Makefile.in.in	(original)
+++ branches/soc-2008-tagging/po-plug-ins/Makefile.in.in	Sun Oct 12 15:38:02 2008
@@ -17,7 +17,7 @@
 # We have the following line for use by intltoolize:
 # INTLTOOL_MAKEFILE
 
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE -plug-ins
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE -std-plug-ins
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
 
 PACKAGE = @PACKAGE@

Modified: branches/soc-2008-tagging/po-plug-ins/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po-plug-ins/POTFILES.in	(original)
+++ branches/soc-2008-tagging/po-plug-ins/POTFILES.in	Sun Oct 12 15:38:02 2008
@@ -30,7 +30,6 @@
 plug-ins/common/colorify.c
 plug-ins/common/colormap-remap.c
 plug-ins/common/compose.c
-plug-ins/common/compressor.c
 plug-ins/common/contrast-normalize.c
 plug-ins/common/contrast-retinex.c
 plug-ins/common/contrast-stretch-hsv.c
@@ -56,6 +55,7 @@
 plug-ins/common/engrave.c
 plug-ins/common/file-aa.c
 plug-ins/common/file-cel.c
+plug-ins/common/file-compressor.c
 plug-ins/common/file-csource.c
 plug-ins/common/file-desktop-link.c
 plug-ins/common/file-dicom.c

Modified: branches/soc-2008-tagging/po-plug-ins/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po-plug-ins/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po-plug-ins/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,6 +1,7 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-tagging/po-python/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po-python/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po-python/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,6 +1,7 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig
@@ -8,35 +9,35 @@
 libgimpthumb
 libgimpwidgets
 modules
-plug-ins/bmp
 plug-ins/color-rotate
 plug-ins/common
-plug-ins/faxg3
-plug-ins/fits
+plug-ins/file-bmp
+plug-ins/file-faxg3
+plug-ins/file-fits
+plug-ins/file-fli
+plug-ins/file-ico
+plug-ins/file-jpeg
+plug-ins/file-psd
+plug-ins/file-sgi
+plug-ins/file-uri
+plug-ins/file-xjt
 plug-ins/flame
-plug-ins/fli
 plug-ins/fractal-explorer
 plug-ins/gfig
 plug-ins/gimpressionist
 plug-ins/gradient-flare
-plug-ins/help-browser
 plug-ins/help
-plug-ins/ico
+plug-ins/help-browser
 plug-ins/ifs-compose
 plug-ins/imagemap
-plug-ins/jpeg
 plug-ins/lighting
 plug-ins/map-object
 plug-ins/maze
 plug-ins/metadata
 plug-ins/pagecurl
 plug-ins/print
-plug-ins/psd
 plug-ins/script-fu
 plug-ins/selection-to-path
-plug-ins/sgi
 plug-ins/twain
-plug-ins/uri
 plug-ins/win-snap
-plug-ins/xjt
 tools

Modified: branches/soc-2008-tagging/po-script-fu/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po-script-fu/POTFILES.in	(original)
+++ branches/soc-2008-tagging/po-script-fu/POTFILES.in	Sun Oct 12 15:38:02 2008
@@ -4,6 +4,7 @@
 [encoding: UTF-8]
 
 plug-ins/script-fu/script-fu-console.c
+plug-ins/script-fu/script-fu-eval.c
 plug-ins/script-fu/script-fu-interface.c
 plug-ins/script-fu/script-fu-scripts.c
 plug-ins/script-fu/script-fu-server.c

Modified: branches/soc-2008-tagging/po-script-fu/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po-script-fu/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po-script-fu/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,6 +1,7 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig
@@ -8,35 +9,35 @@
 libgimpthumb
 libgimpwidgets
 modules
-plug-ins/bmp
 plug-ins/color-rotate
 plug-ins/common
-plug-ins/faxg3
-plug-ins/fits
+plug-ins/file-bmp
+plug-ins/file-faxg3
+plug-ins/file-fits
+plug-ins/file-fli
+plug-ins/file-ico
+plug-ins/file-jpeg
+plug-ins/file-psd
+plug-ins/file-sgi
+plug-ins/file-uri
+plug-ins/file-xjt
 plug-ins/flame
-plug-ins/fli
 plug-ins/fractal-explorer
 plug-ins/gfig
 plug-ins/gimpressionist
 plug-ins/gradient-flare
-plug-ins/help-browser
 plug-ins/help
-plug-ins/ico
+plug-ins/help-browser
 plug-ins/ifs-compose
 plug-ins/imagemap
-plug-ins/jpeg
 plug-ins/lighting
 plug-ins/map-object
 plug-ins/maze
 plug-ins/metadata
 plug-ins/pagecurl
 plug-ins/print
-plug-ins/psd
 plug-ins/pygimp
 plug-ins/selection-to-path
-plug-ins/sgi
 plug-ins/twain
-plug-ins/uri
 plug-ins/win-snap
-plug-ins/xjt
 tools

Modified: branches/soc-2008-tagging/po-tips/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po-tips/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po-tips/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,5 +1,6 @@
 app
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-tagging/po/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po/POTFILES.in	(original)
+++ branches/soc-2008-tagging/po/POTFILES.in	Sun Oct 12 15:38:02 2008
@@ -18,6 +18,7 @@
 app/actions/channels-commands.c
 app/actions/colormap-actions.c
 app/actions/colormap-commands.c
+app/actions/config-actions.c
 app/actions/context-actions.c
 app/actions/cursor-info-actions.c
 app/actions/data-commands.c
@@ -368,6 +369,7 @@
 app/vectors/gimpvectors-export.c
 app/vectors/gimpvectors-import.c
 
+app/widgets/gimpactioneditor.c
 app/widgets/gimpactiongroup.c
 app/widgets/gimpactionview.c
 app/widgets/gimpbrusheditor.c

Modified: branches/soc-2008-tagging/po/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po/POTFILES.skip	(original)
+++ branches/soc-2008-tagging/po/POTFILES.skip	Sun Oct 12 15:38:02 2008
@@ -1,7 +1,6 @@
 app/widgets/gtkscalebutton.c
 data/tips/gimp-tips.xml.in
 desktop/gimp.desktop.in
-desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-tagging/themes/Default/gtkrc
==============================================================================
--- branches/soc-2008-tagging/themes/Default/gtkrc	(original)
+++ branches/soc-2008-tagging/themes/Default/gtkrc	Sun Oct 12 15:38:02 2008
@@ -36,26 +36,27 @@
       { "images/stock-warning-64.png", *, *, "gtk-dialog" }
     }
 
-  GtkPaned::handle_size             = 6
-  GimpDock::default_height          = 300
+  GtkPaned::handle-size             = 6
+  GimpDock::default-height          = 300
+  GimpDock::font-scale              = 0.8333
   GimpDockSeparator::height         = 6
-  GimpMenuDock::minimal_width       = 200
-  GimpMenuDock::menu_preview_size   = button
-  GimpToolbox::tool_icon_size       = button
-  GimpToolbox::button_relief        = none
-  GimpDockbook::tab_border          = 0
-  GimpDockbook::tab_icon_size       = button
-  GimpColorNotebook::tab_border     = 0
-  GimpColorNotebook::tab_icon_size  = button
-  GimpDockable::content_border      = 2
-  GimpEditor::content_spacing       = 2
-  GimpEditor::button_spacing        = 2
-  GimpEditor::button_icon_size      = menu
-  GimpDataEditor::minimal_height    = 96
-  GtkDialog::content_area_border    = 0
-  GtkDialog::button_spacing         = 6
-  GtkDialog::action_area_border     = 12
-  GimpUnitComboBox::appears_as_list = 0
+  GimpMenuDock::minimal-width       = 200
+  GimpMenuDock::menu-preview-size   = button
+  GimpToolbox::tool-icon-size       = button
+  GimpToolbox::button-relief        = none
+  GimpDockbook::tab-border          = 0
+  GimpDockbook::tab-icon-size       = button
+  GimpColorNotebook::tab-border     = 0
+  GimpColorNotebook::tab-icon-size  = button
+  GimpDockable::content-border      = 2
+  GimpEditor::content-spacing       = 2
+  GimpEditor::button-spacing        = 2
+  GimpEditor::button-icon-size      = menu
+  GimpDataEditor::minimal-height    = 96
+  GtkDialog::content-area-border    = 0
+  GtkDialog::button-spacing         = 6
+  GtkDialog::action-area-border     = 12
+  GimpUnitComboBox::appears-as-list = 0
 }
 
 class "GtkWidget" style "gimp-default-style"
@@ -63,7 +64,7 @@
 
 style "gimp-tool-dialog-style" = "gimp-default-style"
 {
-  GtkDialog::action_area_border = 6
+  GtkDialog::action-area-border = 6
 }
 
 class "GimpToolDialog" style "gimp-tool-dialog-style"
@@ -79,10 +80,10 @@
 
 style "gimp-dockable-style" = "gimp-default-style"
 {
-  GimpFrame::label_bold       = 0
-  GimpFrame::label_spacing    = 2
-  GtkButton::focus_line_width = 1
-  GtkButton::focus_padding    = 0
+  GimpFrame::label-bold       = 0
+  GimpFrame::label-spacing    = 2
+  GtkButton::focus-line_width = 1
+  GtkButton::focus-padding    = 0
 }
 
 widget "*GimpDockable.*" style "gimp-dockable-style"
@@ -90,12 +91,13 @@
 
 style "gimp-display-style" = "gimp-default-style"
 {
+  GimpRuler::font-scale          = 0.8333
   GimpUnitComboBox::label-scale  = 0.8333
   GimpScaleComboBox::label-scale = 0.8333
   GtkComboBox::arrow-size        = 8
   GtkButton::inner-border        = { 0, 0, 0, 0 }
-  GtkButton::focus_line_width    = 0
-  GtkButton::focus_padding       = 0
+  GtkButton::focus-line_width    = 0
+  GtkButton::focus-padding       = 0
 }
 
 widget "*GimpDisplayShell.*" style "gimp-display-style"

Modified: branches/soc-2008-tagging/themes/Default/images/makefile.msc
==============================================================================
--- branches/soc-2008-tagging/themes/Default/images/makefile.msc	(original)
+++ branches/soc-2008-tagging/themes/Default/images/makefile.msc	Sun Oct 12 15:38:02 2008
@@ -91,6 +91,8 @@
 	stock_floating_selection_32	stock-floating-selection-32.png \
 	stock_floating_selection_48	stock-floating-selection-48.png \
 	stock_frame_64		stock-frame-64.png \
+	stock_gegl_16	stock-gegl-16.png \
+	stock_gegl_22	stock-gegl-22.png \
 	stock_gradient_bilinear_16		stock-gradient-bilinear-16.png	\
 	stock_gradient_conical_asymmetric_16		stock-gradient-conical-asymmetric-16.png	\
 	stock_gradient_conical_symmetric_16		stock-gradient-conical-symmetric-16.png	\
@@ -213,6 +215,9 @@
 	stock_transparency_24	stock-transparency-24.png \
 	stock_undo_history_16		stock-undo-history-16.png \
 	stock_undo_history_24		stock-undo-history-24.png \
+	stock_user_manual_16	stock-user-manual-16.png \
+	stock_user_manual_32	stock-user-manual-32.png \
+	stock_user_manual_64	stock-user-manual-64.png \
 	stock_vcenter_24	stock-vcenter-24.png	\
 	stock_vchain_24		stock-vchain-24.png	\
 	stock_vchain_broken_24		stock-vchain-broken-24.png	\
@@ -224,10 +229,6 @@
 	stock_web_16		stock-web-16.png	\
 	stock_web_24		stock-web-24.png	\
 	\
-	stock_wilber_16		stock-wilber-16.png	\
-	stock_wilber_64		stock-wilber-64.png	\
-	stock_wilber_eek_64		stock-wilber-eek-64.png	\
-	\
 	stock_zoom_follow_window_12	stock-zoom-follow-window-12.png
 
 STOCK_TOOL_VARIABLES = \
@@ -316,8 +317,10 @@
 
 WILBER_VARIABLES = \
 	stock_wilber_16		stock-wilber-16.png	\
-	stock_wilber_48		stock-wilber-48.png	\
+	stock_wilber_22		stock-wilber-22.png	\
+#	stock_wilber_48		stock-wilber-48.png	\
 	stock_wilber_64		stock-wilber-64.png	\
+	stock_wilber_eek_64		stock-wilber-eek-64.png	\
 
 CORE_VARIABLES = \
 	stock_question_64 stock-question-64.png
@@ -332,7 +335,9 @@
 	gdk-pixbuf-csource --raw --build-list $(CORE_VARIABLES) > gimp-core-pixbufs.h
 
 gimp-stock-pixbufs.h: $(STOCK_IMAGES) makefile.msc
-	gdk-pixbuf-csource --raw --build-list $(STOCK_VARIABLES) $(STOCK_TOOL_VARIABLES) > gimp-stock-pixbufs.h
+	gdk-pixbuf-csource --raw --build-list $(STOCK_VARIABLES) > gimp-stock-pixbufs.h
+	gdk-pixbuf-csource --raw --build-list $(STOCK_TOOL_VARIABLES) >> gimp-stock-pixbufs.h
+	gdk-pixbuf-csource --raw --build-list $(WILBER_VARIABLES) >> gimp-stock-pixbufs.h
 
 gimp-wilber-pixbufs.h: $(WILBER_IMAGES) makefile.msc
 	gdk-pixbuf-csource --raw --build-list $(WILBER_VARIABLES) > gimp-wilber-pixbufs.h

Modified: branches/soc-2008-tagging/themes/Small/gtkrc
==============================================================================
--- branches/soc-2008-tagging/themes/Small/gtkrc	(original)
+++ branches/soc-2008-tagging/themes/Small/gtkrc	Sun Oct 12 15:38:02 2008
@@ -30,38 +30,41 @@
       { "../Default/images/stock-warning-64.png", *, *, "gtk-dialog" }
     }
 
+# Uncommenting this line allows to set a different (smaller) font for GIMP.
+#
 # font_name = "sans 8"
 
 # Enabling the following line for some reason breaks toolbox resize
 # increment calculation. You can enable it to get an even smaller GUI
 # but need to restart GIMP after the theme change.
 #
-# GtkWidget::focus_padding         = 0
+# GtkWidget::focus-padding         = 0
 
-  GtkOptionMenu::indicator_size    = { 5, 11 }
-  GtkOptionMenu::indicator_spacing = { 4, 3, 1, 1 }
+  GtkOptionMenu::indicator-size    = { 5, 11 }
+  GtkOptionMenu::indicator-spacing = { 4, 3, 1, 1 }
 
-  GtkPaned::handle_size             = 5
-  GimpDock::default_height          = 240
+  GtkPaned::handle-size             = 5
+  GimpDock::default-height          = 240
+  GimpDock::font-scale              = 0.8333
   GimpDockSeparator::height         = 5
-  GimpMenuDock::minimal_width       = 200
-  GimpMenuDock::menu_preview_size   = small-toolbar
-  GimpToolbox::tool_icon_size       = menu
-  GimpToolbox::button_relief        = none
-  GimpDockbook::tab_border          = 0
-  GimpDockbook::tab_icon_size       = menu
-  GimpColorNotebook::tab_border     = 0
-  GimpColorNotebook::tab_icon_size  = menu
-  GimpDockable::content_border      = 1
-  GimpEditor::content_spacing       = 1
-  GimpEditor::button_spacing        = 1
-  GimpEditor::button_icon_size      = menu
-  GimpDataEditor::minimal_height    = 64
-  GimpFrame::label_spacing          = 2
-  GtkDialog::content_area_border    = 0
-  GtkDialog::button_spacing         = 6
-  GtkDialog::action_area_border     = 12
-  GimpUnitComboBox::appears_as_list = 0
+  GimpMenuDock::minimal-width       = 200
+  GimpMenuDock::menu-preview-size   = small-toolbar
+  GimpToolbox::tool-icon-size       = menu
+  GimpToolbox::button-relief        = none
+  GimpDockbook::tab-border          = 0
+  GimpDockbook::tab-icon-size       = menu
+  GimpColorNotebook::tab-border     = 0
+  GimpColorNotebook::tab-icon-size  = menu
+  GimpDockable::content-border      = 1
+  GimpEditor::content-spacing       = 1
+  GimpEditor::button-spacing        = 1
+  GimpEditor::button-icon-size      = menu
+  GimpDataEditor::minimal-height    = 64
+  GimpFrame::label-spacing          = 2
+  GtkDialog::content-area-border    = 0
+  GtkDialog::button-spacing         = 6
+  GtkDialog::action-area-border     = 12
+  GimpUnitComboBox::appears-as-list = 0
 }
 
 class "GtkWidget" style "gimp-default-style"
@@ -69,7 +72,7 @@
 
 style "gimp-tool-dialog-style" = "gimp-default-style"
 {
-  GtkDialog::action_area_border = 6
+  GtkDialog::action-area-border = 6
 }
 
 class "GimpToolDialog" style "gimp-tool-dialog-style"
@@ -85,9 +88,9 @@
 
 style "gimp-dockable-style" = "gimp-default-style"
 {
-  GimpFrame::label_bold       = 0
-  GtkButton::focus_line_width = 1
-  GtkButton::focus_padding    = 0
+  GimpFrame::label-bold       = 0
+  GtkButton::focus-line_width = 1
+  GtkButton::focus-padding    = 0
 }
 
 widget "*GimpDockable.*" style "gimp-dockable-style"
@@ -95,12 +98,13 @@
 
 style "gimp-display-style" = "gimp-default-style"
 {
+  GimpRuler::font-scale          = 0.6444
   GimpUnitComboBox::label-scale  = 0.8333
   GimpScaleComboBox::label-scale = 0.8333
   GtkComboBox::arrow-size        = 8
   GtkButton::inner-border        = { 0, 0, 0, 0 }
-  GtkButton::focus_line_width    = 0
-  GtkButton::focus_padding       = 0
+  GtkButton::focus-line-width    = 0
+  GtkButton::focus-padding       = 0
 }
 
 widget "*GimpDisplayShell.*" style "gimp-display-style"

Modified: branches/soc-2008-tagging/tools/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/tools/Makefile.am	(original)
+++ branches/soc-2008-tagging/tools/Makefile.am	Sun Oct 12 15:38:02 2008
@@ -13,15 +13,15 @@
 noinst_PROGRAMS = test-clipboard
 
 EXTRA_PROGRAMS = \
-	gimp-remote-2.5	\
+	gimp-remote-2.7	\
 	kernelgen
 
-gimp_remote_2_5_SOURCES = \
+gimp_remote_2_7_SOURCES = \
 	gimp-remote.c	\
 	gimp-remote.h	\
 	gimp-remote-x11.c
 
-gimp_remote_2_5_LDADD = \
+gimp_remote_2_7_LDADD = \
 	$(GTK_LIBS)	\
 	$(XMU_LIBS)
 

Modified: branches/soc-2008-tagging/tools/defcheck.py
==============================================================================
--- branches/soc-2008-tagging/tools/defcheck.py	(original)
+++ branches/soc-2008-tagging/tools/defcheck.py	Sun Oct 12 15:38:02 2008
@@ -117,7 +117,7 @@
          for s in doublesymbols:
             print "     : %s (line %d)" % s
          print
-         
+
       if unsortindex >= 0:
          print "  the .def-file is not properly sorted (line %d)" % (unsortindex + 2)
          print

Modified: branches/soc-2008-tagging/tools/gimppath2svg.py
==============================================================================
--- branches/soc-2008-tagging/tools/gimppath2svg.py	(original)
+++ branches/soc-2008-tagging/tools/gimppath2svg.py	Sun Oct 12 15:38:02 2008
@@ -47,7 +47,7 @@
       self.svgpath = ""
       self.gimppoints = [[]]
       self.bounds = None
-   
+
    def readgimpfile (self, filedesc):
       text = filedesc.readlines()
       for line in text:
@@ -67,7 +67,7 @@
 	       if self.bounds[3] < y: self.bounds[3] = y
 	    else:
 	       self.bounds = [x,y,x,y]
-   
+
    def makesvg (self):
       for path in self.gimppoints:
          if path:
@@ -79,13 +79,13 @@
 	       path = path[3:]
 	       if len (curve) == 2:
 		  svg = svg + "C %d %d %d %d %d %d z " % tuple (
-			   tuple (curve [0][1:]) + 
-			   tuple (curve [1][1:]) + 
+			   tuple (curve [0][1:]) +
+			   tuple (curve [1][1:]) +
 			   tuple (start [1:]))
 	       if len (curve) == 3:
 		  svg = svg + "C %d %d %d %d %d %d " % tuple (
-			   tuple (curve [0][1:]) + 
-			   tuple (curve [1][1:]) + 
+			   tuple (curve [0][1:]) +
+			   tuple (curve [1][1:]) +
 			   tuple (curve [2][1:]))
 	    self.svgpath = self.svgpath + svg
 

Modified: branches/soc-2008-tagging/tools/gimptool.c
==============================================================================
--- branches/soc-2008-tagging/tools/gimptool.c	(original)
+++ branches/soc-2008-tagging/tools/gimptool.c	Sun Oct 12 15:38:02 2008
@@ -31,21 +31,27 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <sys/stat.h>
+
 #include <glib.h>
 
 #include "libgimpbase/gimpversion.h"
 
+#ifdef G_OS_WIN32
+#include "libgimpbase/gimpwin32-io.h"
+#endif
+
 
-static gboolean  silent  = FALSE;
-static gboolean  dry_run = FALSE;
-static gchar    *prefix;
-static gchar    *exec_prefix;
-
-static gchar    *env_cc;
-static gboolean  msvc_syntax = FALSE;
-static gchar    *env_cflags;
-static gchar    *env_ldflags;
-static gchar    *env_libs;
+static gboolean     silent  = FALSE;
+static gboolean     dry_run = FALSE;
+static gchar       *prefix;
+static const gchar *exec_prefix;
+
+static gboolean     msvc_syntax = FALSE;
+static const gchar *env_cc;
+static const gchar *env_cflags;
+static const gchar *env_ldflags;
+static const gchar *env_libs;
 
 
 #ifdef G_OS_WIN32
@@ -64,7 +70,7 @@
 
 static struct {
   const gchar *option;
-  gchar       *value;
+  const gchar *value;
 } dirs[] = {
   { "prefix",         PREFIX         },
   { "exec-prefix",    EXEC_PREFIX    },
@@ -92,12 +98,12 @@
 #ifdef G_OS_WIN32
 
 static gchar *
-win32_command (gchar *command)
+win32_command (const gchar *command)
 {
-  gchar *comspec = getenv ("COMSPEC");
+  const gchar *comspec = getenv ("COMSPEC");
 
   if (!comspec)
-    comspec = "command.com";
+    comspec = "cmd.exe";
 
   return g_strdup_printf ("%s /c %s", comspec, command);
 }
@@ -105,16 +111,16 @@
 #endif
 
 static gboolean
-starts_with_dir (gchar *string,
-		 gchar *test)
+starts_with_dir (const gchar *string,
+		 const gchar *test)
 {
   return g_str_has_prefix (string, g_strconcat (test, "/", NULL)) ||
     strcmp (string, test) == 0;
 }
 
 static gchar *
-one_line_output (gchar *program,
-		 gchar *args)
+one_line_output (const gchar *program,
+		 const gchar *args)
 {
   gchar *command = g_strconcat (program, " ", args, NULL);
   FILE  *pipe    = popen (command, "r");
@@ -146,7 +152,7 @@
 }
 
 static gchar *
-pkg_config (gchar *args)
+pkg_config (const gchar *args)
 {
 #ifdef G_OS_WIN32
   if (msvc_syntax)
@@ -156,7 +162,7 @@
   return one_line_output ("pkg-config", args);
 }
 
-static gchar *
+static const gchar *
 get_runtime_prefix (gchar slash)
 {
 #ifdef G_OS_WIN32
@@ -204,7 +210,7 @@
 #endif
 }
 
-static gchar *
+static const gchar *
 get_exec_prefix (gchar slash)
 {
 #ifdef G_OS_WIN32
@@ -221,20 +227,25 @@
 #endif
 }
 
-static gchar *
-expand_and_munge (gchar *value)
+static const gchar *
+expand_and_munge (const gchar *value)
 {
+  const gchar *retval;
+
   if (starts_with_dir (value, "${prefix}"))
-    value = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
+    retval = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
   else if (starts_with_dir (value, "${exec_prefix}"))
-    value = g_strconcat (EXEC_PREFIX, value + strlen ("${exec_prefix}"), NULL);
-  if (starts_with_dir (value, EXEC_PREFIX))
-    value = g_strconcat (get_exec_prefix ('/'), value + strlen (EXEC_PREFIX), NULL);
+    retval = g_strconcat (EXEC_PREFIX, value + strlen ("${exec_prefix}"), NULL);
+  else
+    retval = g_strdup (value);
 
-  if (starts_with_dir (value, PREFIX))
-    value = g_strconcat (get_runtime_prefix ('/'), value + strlen (PREFIX), NULL);
+  if (starts_with_dir (retval, EXEC_PREFIX))
+    retval = g_strconcat (get_exec_prefix ('/'), retval + strlen (EXEC_PREFIX), NULL);
 
-  return value;
+  if (starts_with_dir (retval, PREFIX))
+    retval = g_strconcat (get_runtime_prefix ('/'), retval + strlen (PREFIX), NULL);
+
+  return retval;
 }
 
 static void
@@ -417,18 +428,18 @@
 }
 
 static void
-do_build_2 (gchar *cflags,
-	    gchar *libs,
-	    gchar *install_dir,
-	    gchar *what)
-{
-  gchar *cmd;
-  gchar *dest_dir;
-  gchar *output_flag;
-  gchar *dest_exe;
-  gchar *here_comes_linker_flags = "";
-  gchar *windows_subsystem_flag = "";
-  gchar *p, *q;
+do_build_2 (const gchar *cflags,
+	    const gchar *libs,
+	    const gchar *install_dir,
+	    const gchar *what)
+{
+  gchar       *cmd;
+  const gchar *dest_dir;
+  const gchar *output_flag;
+  gchar       *dest_exe;
+  const gchar *here_comes_linker_flags = "";
+  const gchar *windows_subsystem_flag = "";
+  gchar       *p, *q;
 
   if (install_dir != NULL)
     dest_dir = g_strconcat (install_dir, "/", NULL);
@@ -494,19 +505,19 @@
 }
 
 static void
-do_build (char *what)
+do_build (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), NULL, what);
 }
 
 static void
-do_build_noui (char *what)
+do_build_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), NULL, what);
 }
 
 static void
-do_build_nogimpui (char *what)
+do_build_nogimpui (const gchar *what)
 {
   do_build (what);
 }
@@ -530,19 +541,19 @@
 }
 
 static void
-do_install (char *what)
+do_install (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_noui (char *what)
+do_install_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_nogimpui (char *what)
+do_install_nogimpui (const gchar *what)
 {
   do_install (what);
 }
@@ -562,51 +573,56 @@
 }
 
 static void
-do_install_admin (char *what)
+do_install_admin (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_admin_noui (char *what)
+do_install_admin_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_admin_nogimpui (char *what)
+do_install_admin_nogimpui (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_bin_2 (gchar *dir,
-		  gchar *what)
+do_install_bin_2 (const gchar *dir,
+		  const gchar *what)
 {
+  g_mkdir_with_parents (dir,
+                        S_IRUSR | S_IXUSR | S_IWUSR |
+                        S_IRGRP | S_IXGRP |
+                        S_IROTH | S_IXOTH);
+
   maybe_run (g_strconcat (COPY, " ", what, " ", dir, NULL));
 }
 
 static void
-do_install_bin (char *what)
+do_install_bin (const gchar *what)
 {
   do_install_bin_2 (get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_admin_bin (char *what)
+do_install_admin_bin (const gchar *what)
 {
   do_install_bin_2 (get_sys_plugin_dir (FALSE), what);
 }
 
 static void
-do_uninstall (gchar *dir,
-	      gchar *what)
+do_uninstall (const gchar *dir,
+	      const gchar *what)
 {
   maybe_run (g_strconcat (REMOVE, " ", dir, G_DIR_SEPARATOR_S, what, NULL));
 }
 
-static gchar *
-maybe_append_exe (gchar *what)
+static const gchar *
+maybe_append_exe (const gchar *what)
 {
 #ifdef G_OS_WIN32
   gchar *p = strrchr (what, '.');
@@ -619,13 +635,13 @@
 }
 
 static void
-do_uninstall_bin (char *what)
+do_uninstall_bin (const gchar *what)
 {
   do_uninstall (get_user_plugin_dir (FALSE), maybe_append_exe (what));
 }
 
 static void
-do_uninstall_admin_bin (char *what)
+do_uninstall_admin_bin (const gchar *what)
 {
   do_uninstall (get_sys_plugin_dir (FALSE), maybe_append_exe (what));
 }
@@ -644,7 +660,7 @@
 }
 
 static void
-do_install_script (char *what)
+do_install_script (const gchar *what)
 {
   do_install_bin_2 (get_user_script_dir (FALSE), what);
 }
@@ -666,19 +682,19 @@
 }
 
 static void
-do_install_admin_script (char *what)
+do_install_admin_script (const gchar *what)
 {
   do_install_bin_2 (get_sys_script_dir (FALSE), what);
 }
 
 static void
-do_uninstall_script (char *what)
+do_uninstall_script (const gchar *what)
 {
   do_uninstall (get_user_script_dir (FALSE), what);
 }
 
 static void
-do_uninstall_admin_script (char *what)
+do_uninstall_admin_script (const gchar *what)
 {
   do_uninstall (get_sys_script_dir (FALSE), what);
 }

Modified: branches/soc-2008-tagging/tools/pdbgen/app.pl
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/app.pl	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/app.pl	Sun Oct 12 15:38:02 2008
@@ -721,7 +721,7 @@
 	    if ($sys == 0 && !/^</) {
 		$sys = 1;
 		$headers .= "\n" if $seen;
-		$headers .= "#include <glib-object.h>\n\n";
+		$headers .= "#include <gegl.h>\n\n";
 	    }
 
 	    $seen = 0 if !/^</;

Modified: branches/soc-2008-tagging/tools/pdbgen/enums.pl
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/enums.pl	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/enums.pl	Sun Oct 12 15:38:02 2008
@@ -294,6 +294,14 @@
 		       GIMP_PDB_PATH => 'GIMP_PDB_VECTORS',
 		       GIMP_PDB_BOUNDARY => 'GIMP_PDB_COLORARRAY' }
 	},
+    GimpPDBErrorHandler =>
+	{ contig => 1,
+	  header => 'libgimpbase/gimpbaseenums.h',
+	  symbols => [ qw(GIMP_PDB_ERROR_HANDLER_INTERNAL
+			  GIMP_PDB_ERROR_HANDLER_PLUGIN) ],
+	  mapping => { GIMP_PDB_ERROR_HANDLER_INTERNAL => '0',
+		       GIMP_PDB_ERROR_HANDLER_PLUGIN => '1' }
+	},
     GimpPDBProcType =>
 	{ contig => 1,
 	  header => 'libgimpbase/gimpbaseenums.h',

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/drawable.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/drawable.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/drawable.pdb	Sun Oct 12 15:38:02 2008
@@ -232,7 +232,10 @@
     %invoke = (
 	code => <<'CODE'
 {
-  non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
+    non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -276,7 +279,11 @@
     %invoke = (
 	code => <<'CODE'
 {
-  non_empty = gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
+    non_empty = gimp_drawable_mask_intersect (drawable,
+                                              &x, &y, &width, &height);
+  else
+    success = FALSE;
 }
 CODE
     );

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/gradient.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/gradient.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/gradient.pdb	Sun Oct 12 15:38:02 2008
@@ -1252,6 +1252,9 @@
 
   if (start_seg)
     {
+      if (!end_seg)
+        end_seg = gimp_gradient_segment_get_last (start_seg);
+
       gimp_gradient_segment_range_blend (gradient,
                                          start_seg, end_seg,
                                          &start_seg->left_color,
@@ -1298,6 +1301,9 @@
 
   if (start_seg)
     {
+      if (!end_seg)
+        end_seg = gimp_gradient_segment_get_last (start_seg);
+
       gimp_gradient_segment_range_blend (gradient,
                                          start_seg, end_seg,
                                          &start_seg->left_color,

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/image.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/image.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/image.pdb	Sun Oct 12 15:38:02 2008
@@ -87,11 +87,12 @@
     $blurb = 'Creates a new image with the specified width, height, and type.';
 
     $help = <<'HELP';
-Creates a new image, undisplayed with the specified extents and type. A layer
-should be created and added before this image is displayed, or subsequent calls
-to gimp_display_new() with this image as an argument will fail. Layers can be
-created using the gimp_layer_new() commands. They can be added to an image
-using the gimp_image_add_layer() command.
+Creates a new image, undisplayed with the specified extents and
+type. A layer should be created and added before this image is
+displayed, or subsequent calls to gimp_display_new() with this image
+as an argument will fail. Layers can be created using the
+gimp_layer_new() commands. They can be added to an image using the
+gimp_image_add_layer() command.
 HELP
 
     &std_pdb_misc;
@@ -190,13 +191,12 @@
     $blurb = 'Resize the image to the specified extents.';
 
     $help = <<'HELP';
-This procedure resizes the image so that it's new width and height are equal to
-the supplied parameters. Offsets are also provided which describe the position
-of the previous image's content. No bounds checking is currently provided, so
-don't supply parameters that are out of bounds. All channels within the image
-are resized according to the specified parameters; this includes the image
-selection mask. All layers within the image are repositioned according to the
-specified offsets.
+This procedure resizes the image so that it's new width and height are
+equal to the supplied parameters. Offsets are also provided which
+describe the position of the previous image's content. All channels
+within the image are resized according to the specified parameters;
+this includes the image selection mask. All layers within the image
+are repositioned according to the specified offsets.
 HELP
 
     &std_pdb_misc;
@@ -231,10 +231,10 @@
     $blurb = 'Resize the image to fit all layers.';
 
     $help = <<'HELP';
-This procedure resizes the image to the bounding box of all layers of the
-image. All channels within the image are resized to the new size; this includes
-the image selection mask. All layers within the image are repositioned to the
-new image area.
+This procedure resizes the image to the bounding box of all layers of
+the image. All channels within the image are resized to the new size;
+this includes the image selection mask. All layers within the image
+are repositioned to the new image area.
 HELP
 
     &simon_pdb_misc('2004', '2.2');
@@ -255,16 +255,14 @@
 }
 
 sub image_scale {
-    $blurb = 'Scale the image to the specified extents.';
+    $blurb = 'Scale the image using the default interpolation method.';
 
     $help = <<'HELP';
-This procedure scales the image so that its new width and height are equal to
-the supplied parameters. Offsets are also provided which describe the position
-of the previous image's content. No bounds checking is currently provided, so
-don't supply parameters that are out of bounds. All channels within the image
-are scaled according to the specified parameters; this includes the image
-selection mask. All layers within the image are repositioned according to the
-specified offsets.
+
+This procedure scales the image so that its new width and height are
+equal to the supplied parameters. All layers and channels within the
+image are scaled according to the specified parameters; this includes
+the image selection mask. The default interpolation method is used.
 HELP
 
     &std_pdb_misc;
@@ -282,9 +280,55 @@
 	headers => [ qw("config/gimpcoreconfig.h" "core/gimpimage-scale.h") ],
 	code => <<'CODE'
 {
+  if (progress)
+    gimp_progress_start (progress, _("Scaling"), FALSE);
+
   gimp_image_scale (image, new_width, new_height,
                     gimp->config->interpolation_type,
-                    NULL);
+                    progress);
+
+  if (progress)
+    gimp_progress_end (progress);
+}
+CODE
+    );
+}
+
+sub image_scale_full {
+    $blurb = 'Scale the image using a specific interpolation method.';
+
+    $help = <<'HELP';
+This procedure scales the image so that its new width and height are
+equal to the supplied parameters. All layers and channels within the
+image are scaled according to the specified parameters; this includes
+the image selection mask. This procedure allows you to specify the
+interpolation method explicitly.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @inargs = (
+	{ name => 'image', type => 'image',
+	  desc => 'The image' },
+	{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
+	  desc => 'New image width' },
+	{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
+	  desc => 'New image height' },
+	{ name => 'interpolation', type => 'enum GimpInterpolationType',
+	  desc => 'Type of interpolation' }
+    );
+
+    %invoke = (
+	headers => [ qw("config/gimpcoreconfig.h" "core/gimpimage-scale.h") ],
+	code => <<'CODE'
+{
+  if (progress)
+    gimp_progress_start (progress, _("Scaling"), FALSE);
+
+  gimp_image_scale (image, new_width, new_height, interpolation, progress);
+
+  if (progress)
+    gimp_progress_end (progress);
 }
 CODE
     );
@@ -294,11 +338,12 @@
     $blurb = 'Crop the image to the specified extents.';
 
     $help = <<'HELP';
-This procedure crops the image so that it's new width and height are equal to
-the supplied parameters. Offsets are also provided which describe the position
-of the previous image's content. All channels and layers within the image are
-cropped to the new image extents; this includes the image selection mask. If
-any parameters are out of range, an error is returned.
+This procedure crops the image so that it's new width and height are
+equal to the supplied parameters. Offsets are also provided which
+describe the position of the previous image's content. All channels
+and layers within the image are cropped to the new image extents; this
+includes the image selection mask. If any parameters are out of range,
+an error is returned.
 HELP
 
     &std_pdb_misc;
@@ -311,9 +356,9 @@
 	{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
 	  desc => 'New image height: (0 < new_height <= height)' },
 	{ name => 'offx', type => '0 <= int32',
-	  desc => 'x offset: (0 <= offx <= (width - new_width))' },
+	  desc => 'X offset: (0 <= offx <= (width - new_width))' },
 	{ name => 'offy', type => '0 <= int32',
-	  desc => 'y offset: (0 <= offy <= (height - new_height))' }
+	  desc => 'Y offset: (0 <= offy <= (height - new_height))' }
     );
 
     %invoke = (
@@ -378,7 +423,13 @@
 	headers => [ qw("core/gimpimage-rotate.h") ],
 	code => <<'CODE'
 {
-  gimp_image_rotate (image, context, rotate_type, NULL);
+  if (progress)
+    gimp_progress_start (progress, _("Rotating"), FALSE);
+
+  gimp_image_rotate (image, context, rotate_type, progress);
+
+  if (progress)
+    gimp_progress_end (progress);  
 }
 CODE
     );
@@ -533,9 +584,10 @@
     $blurb = 'Unsets the active channel in the specified image.';
 
     $help = <<'HELP';
-If an active channel exists, it is unset. There then exists no active channel,
-and if desired, one can be set through a call to 'Set Active Channel'. No error
-is returned in the case of no existing active channel.
+If an active channel exists, it is unset. There then exists no active
+channel, and if desired, one can be set through a call to 'Set Active
+Channel'. No error is returned in the case of no existing active
+channel.
 HELP
 
     &std_pdb_misc;
@@ -638,10 +690,11 @@
     $blurb = 'Find the layer visible at the specified coordinates.';
 
     $help = <<'HELP';
-This procedure finds the layer which is visible at the specified coordinates.
-Layers which do not qualify are those whose extents do not pass within the
-specified coordinates, or which are transparent at the specified coordinates.
-This procedure will return -1 if no layer is found.
+This procedure finds the layer which is visible at the specified
+coordinates.  Layers which do not qualify are those whose extents do
+not pass within the specified coordinates, or which are transparent at
+the specified coordinates.  This procedure will return -1 if no layer
+is found.
 HELP
 
     &std_pdb_misc;
@@ -673,8 +726,9 @@
     $blurb = 'Returns the position of the layer in the layer stack.';
 
     $help = <<'HELP';
-This procedure determines the positioin of the specified layer in the images
-layer stack. If the layer doesn't exist in the image, an error is returned.
+This procedure determines the position of the specified layer in the
+images layer stack. If the layer doesn't exist in the image, an error
+is returned.
 HELP
 
     &simon_pdb_misc('2006', '2.4');
@@ -709,7 +763,7 @@
 
     $help = <<'HELP';
 This procedure raises the specified layer one step in the existing layer stack.
-It will not move the layer if there is no layer above it.
+The procecure call will fail if there is no layer above it.
 HELP
 
     &std_pdb_misc;
@@ -724,7 +778,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_raise_layer (image, layer);
+  success = gimp_image_raise_layer (image, layer, error);
 }
 CODE
     );
@@ -735,7 +789,7 @@
 
     $help = <<'HELP';
 This procedure lowers the specified layer one step in the existing layer stack.
-It will not move the layer if there is no layer below it.
+The procecure call will fail if there is no layer below it.
 HELP
 
     &std_pdb_misc;
@@ -750,7 +804,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_lower_layer (image, layer);
+  success = gimp_image_lower_layer (image, layer, error);
 }
 CODE
     );
@@ -818,12 +872,12 @@
     $blurb = 'Merge the visible image layers into one.';
 
     $help = <<'HELP';
-This procedure combines the visible layers into a single layer using the
-specified merge type. A merge type of EXPAND_AS_NECESSARY expands the final
-layer to encompass the areas of the visible layers. A merge type of
-CLIP_TO_IMAGE clips the final layer to the extents of the image. A merge type
-of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost
-layer.
+This procedure combines the visible layers into a single layer using
+the specified merge type. A merge type of EXPAND_AS_NECESSARY expands
+the final layer to encompass the areas of the visible layers. A merge
+type of CLIP_TO_IMAGE clips the final layer to the extents of the
+image. A merge type of CLIP_TO_BOTTOM_LAYER clips the final layer to
+the size of the bottommost layer.
 HELP
 
     &std_pdb_misc;
@@ -858,12 +912,13 @@
     $blurb = 'Merge the layer passed and the first visible layer below.';
 
     $help = <<'HELP';
-This procedure combines the passed layer and the first visible layer below it
-using the specified merge type. A merge type of EXPAND_AS_NECESSARY expands the
-final layer to encompass the areas of the visible layers. A merge type of
-CLIP_TO_IMAGE clips the final layer to the extents of the image. A merge type
-of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost
-layer.
+This procedure combines the passed layer and the first visible layer
+below it using the specified merge type. A merge type of
+EXPAND_AS_NECESSARY expands the final layer to encompass the areas of
+the visible layers. A merge type of CLIP_TO_IMAGE clips the final
+layer to the extents of the image. A merge type of
+CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
+bottommost layer.
 HELP
 
     &larry_pdb_misc('1998');
@@ -954,12 +1009,12 @@
 
     $invoke{code} = <<'CODE';
 {
-  if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), error) &&
+  if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), image, error) &&
       gimp_pdb_image_is_base_type (image,
 				   GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (GIMP_DRAWABLE (layer))),
 				   error))
     {
-      success = gimp_image_add_layer (image, layer, MAX (position, -1));
+      success = gimp_image_add_layer (image, layer, MAX (position, -1), TRUE);
     }
   else
     {
@@ -973,10 +1028,10 @@
     $blurb = 'Remove the specified layer from the image.';
 
     $help = <<'HELP';
-This procedure removes the specified layer from the image. If the layer doesn't
-exist, an error is returned. If there are no layers left in the image, this
-call will fail. If this layer is the last layer remaining, the image will
-become empty and have no active layer.
+This procedure removes the specified layer from the image. If the
+layer doesn't exist, an error is returned. If there are no layers left
+in the image, this call will fail. If this layer is the last layer
+remaining, the image will become empty and have no active layer.
 HELP
 
     &std_pdb_misc;
@@ -991,7 +1046,10 @@
     %invoke = (
 	code => <<'CODE'
 {
-  gimp_image_remove_layer (image, layer);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+    gimp_image_remove_layer (image, layer, TRUE, NULL);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -1012,7 +1070,9 @@
     %invoke = (
 	code => <<'CODE'
 {
-  if (! gimp_layer_add_mask (layer, mask, TRUE))
+  if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), image, error))
+    success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
+  else
     success = FALSE;
 }
 CODE
@@ -1034,7 +1094,11 @@
     %invoke = (
 	code => <<'CODE'
 {
-  gimp_layer_apply_mask (layer, mode, TRUE);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
+      gimp_layer_get_mask (layer))
+    gimp_layer_apply_mask (layer, mode, TRUE);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -1044,8 +1108,9 @@
     $blurb = 'Returns the position of the channel in the channel stack.';
 
     $help = <<'HELP';
-This procedure determines the positioin of the specified channel in the images
-channel stack. If the channel doesn't exist in the image, an error is returned.
+This procedure determines the position of the specified channel in
+the images channel stack. If the channel doesn't exist in the image,
+an error is returned.
 HELP
 
     &simon_pdb_misc('2006', '2.4');
@@ -1080,7 +1145,7 @@
 
     $help = <<'HELP';
 This procedure raises the specified channel one step in the existing
-channel stack. It will not move the channel if there is no channel
+channel stack. The procecure call will fail if there is no channel
 above it.
 HELP
 
@@ -1096,7 +1161,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_raise_channel (image, channel);
+  success = gimp_image_raise_channel (image, channel, error);
 }
 CODE
     );
@@ -1107,7 +1172,7 @@
 
     $help = <<'HELP';
 This procedure lowers the specified channel one step in the existing
-channel stack. It will not move the channel if there is no channel
+channel stack. The procecure call will fail if there is no channel
 below it.
 HELP
 
@@ -1123,7 +1188,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_lower_channel (image, channel);
+  success = gimp_image_lower_channel (image, channel, error);
 }
 CODE
     );
@@ -1152,9 +1217,9 @@
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), error))
+  if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), image, error))
     {
-      success = gimp_image_add_channel (image, channel, MAX (position, -1));
+      success = gimp_image_add_channel (image, channel, MAX (position, -1), TRUE);
     }
   else
     {
@@ -1185,7 +1250,10 @@
     %invoke = (
 	code => <<'CODE'
 {
-  gimp_image_remove_channel (image, channel);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), error))
+    gimp_image_remove_channel (image, channel, TRUE, NULL);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -1213,9 +1281,9 @@
 
     $invoke{code} = <<'CODE';
 {
-  if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), error))
+  if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), image, error))
     {
-      success = gimp_image_add_vectors (image, vectors, MAX (position, -1));
+      success = gimp_image_add_vectors (image, vectors, MAX (position, -1), TRUE);
     }
   else
     {
@@ -1245,7 +1313,10 @@
     %invoke = (
 	code => <<'CODE'
 {
-  gimp_image_remove_vectors (image, vectors);
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
+    gimp_image_remove_vectors (image, vectors, TRUE, NULL);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -1255,7 +1326,7 @@
     $blurb = 'Returns the position of the vectors object in the vectors objects stack.';
 
     $help = <<'HELP';
-This procedure determines the positioin of the specified vectors object in the
+This procedure determines the position of the specified vectors object in the
 images vectors object stack. If the vectors object doesn't exist in the image,
 an error is returned.
 HELP
@@ -1292,7 +1363,7 @@
 
     $help = <<'HELP';
 This procedure raises the specified vectors one step in the existing
-vectors stack. It will not move the vectors if there is no vectors
+vectors stack. The procecure call will fail if there is no vectors
 above it.
 HELP
 
@@ -1308,7 +1379,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_raise_vectors (image, vectors);
+  success = gimp_image_raise_vectors (image, vectors, error);
 }
 CODE
     );
@@ -1319,7 +1390,7 @@
 
     $help = <<'HELP';
 This procedure lowers the specified vectors one step in the existing
-vectors stack. It will not move the vectors if there is no vectors
+vectors stack. The procecure call will fail if there is no vectors
 below it.
 HELP
 
@@ -1335,7 +1406,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  success = gimp_image_lower_vectors (image, vectors);
+  success = gimp_image_lower_vectors (image, vectors, error);
 }
 CODE
     );
@@ -2431,7 +2502,8 @@
     $blurb = 'Find a vectors with a given tattoo in an image.';
 
     $help = <<'HELP';
-This procedure returns the vectors with the given tattoo in the specified image.
+This procedure returns the vectors with the given tattoo in the
+specified image.
 HELP
 
     &simon_pdb_misc('2005', '2.6');
@@ -2549,6 +2621,7 @@
               "base/temp-buf.h"
               "core/gimp.h"
               "core/gimplist.h"
+              "core/gimpprogress.h"
               "core/gimpunit.h"
               "gimppdberror.h"
               "gimppdb-utils.h"
@@ -2561,7 +2634,7 @@
             image_width image_height
             image_free_shadow
             image_resize image_resize_to_layers
-            image_scale
+            image_scale image_scale_full
             image_crop image_flip image_rotate
             image_get_layers
             image_get_channels
@@ -2603,7 +2676,7 @@
             image_get_channel_by_tattoo
             image_get_vectors_by_tattoo);
 
-%exports = (app => [ procs], lib => [ procs[0  45,48..75]]);
+%exports = (app => [ procs], lib => [ procs[0  46,49..76]]);
 
 $desc = 'Image';
 

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/layer.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/layer.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/layer.pdb	Sun Oct 12 15:38:02 2008
@@ -276,8 +276,10 @@
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
-    gimp_layer_add_mask (layer, mask, TRUE);
+  if (gimp_pdb_item_is_floating (GIMP_ITEM (mask),
+                                 gimp_item_get_image (GIMP_ITEM (layer)),
+                                 error))
+    success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
   else
     success = FALSE;
 }
@@ -305,7 +307,8 @@
     %invoke = (
 	code => <<'CODE'
 {
-  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error) &&
+      gimp_layer_get_mask (layer))
     gimp_layer_apply_mask (layer, mode, TRUE);
   else
     success = FALSE;
@@ -315,14 +318,14 @@
 }
 
 sub layer_scale {
-    $blurb = 'Scale the layer to the specified extents.';
+    $blurb = 'Scale the layer using the default interpolation method.';
 
     $help = <<'HELP';
 This procedure scales the layer so that its new width and height are
 equal to the supplied parameters. The 'local-origin' parameter
 specifies whether to scale from the center of the layer, or from the
 image origin. This operation only works if the layer has been added to
-an image.
+an image. The default interpolation method is used for scaling.
 HELP
 
     &std_pdb_misc;
@@ -342,11 +345,72 @@
 	code => <<'CODE'
 {
   if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
-    gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
-                               gimp->config->interpolation_type, NULL,
-                               local_origin);
+    {
+      if (progress)
+        gimp_progress_start (progress, _("Scaling"), FALSE);
+
+      gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
+                                 gimp->config->interpolation_type, progress,
+                                 local_origin);
+
+      if (progress)
+        gimp_progress_end (progress);
+    }
   else
-    success = FALSE;
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
+sub layer_scale_full {
+    $blurb = 'Scale the layer using a specific interpolation method.';
+
+    $help = <<'HELP';
+This procedure scales the layer so that its new width and height are
+equal to the supplied parameters. The 'local-origin' parameter
+specifies whether to scale from the center of the layer, or from the
+image origin. This operation only works if the layer has been added to
+an image. This procedure allows you to specify the interpolation
+method explicitly.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @inargs = (
+	{ name => 'layer', type => 'layer',
+	  desc => 'The layer' },
+	{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
+	  desc => 'New layer width' },
+	{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
+	  desc => 'New layer height' },
+	{ name => 'local_origin', type => 'boolean',
+	  desc => 'Use a local origin (as opposed to the image origin)' },
+	{ name => 'interpolation', type => 'enum GimpInterpolationType',
+	  desc => 'Type of interpolation' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), error))
+    {
+      if (progress)
+        gimp_progress_start (progress, _("Scaling"), FALSE);
+
+      gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
+                                 interpolation, progress,
+                                 local_origin);
+
+      if (progress)
+        gimp_progress_end (progress);
+    }
+  else
+    {
+      success = FALSE;
+    }
 }
 CODE
     );
@@ -995,6 +1059,7 @@
               "core/gimp.h"
               "core/gimpimage-undo.h"
               "core/gimpitem-linked.h"
+              "core/gimpprogress.h"
               "core/gimpprojection.h"
               "gimppdb-utils.h"
               "gimp-intl.h");
@@ -1005,7 +1070,7 @@
             layer_copy
             layer_add_alpha
             layer_flatten
-            layer_scale
+            layer_scale layer_scale_full
             layer_resize layer_resize_to_image_size
 	    layer_translate
             layer_set_offsets

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/paths.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/paths.pdb	Sun Oct 12 15:38:02 2008
@@ -242,7 +242,7 @@
       g_free (points);
 
       if (vectors)
-        gimp_image_add_vectors (image, vectors, 0);
+        success = gimp_image_add_vectors (image, vectors, 0, TRUE);
       else
         success = FALSE;
     }
@@ -462,7 +462,7 @@
   GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
 
   if (vectors)
-    gimp_image_remove_vectors (image, vectors);
+    gimp_image_remove_vectors (image, vectors, TRUE, NULL);
   else
     success = FALSE;
 }

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/plug_in.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/plug_in.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/plug_in.pdb	Sun Oct 12 15:38:02 2008
@@ -278,6 +278,78 @@
     );
 }
 
+sub plugin_set_pdb_error_handler {
+    $blurb = "Sets an error handler for procedure calls.";
+
+    $help = <<HELP;
+This procedure changes the way that errors in procedure calls are
+handled. By default GIMP will raise an error dialog if a procedure
+call made by a plug-in fails. Using this procedure the plug-in can
+change this behavior. If the error handler is set to
+%GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for
+calling gimp_get_pdb_error() and handling the error whenever one if
+its procedure calls fails. It can do this by displaying the error
+message or by forwarding it in its own return values.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @inargs = (
+	{ name => 'handler', type => 'enum GimpPDBErrorHandler',
+	  desc => "Who is responsible for handling procedure call errors" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      gimp_plug_in_set_error_handler (plug_in, handler);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
+sub plugin_get_pdb_error_handler {
+    $blurb = "Retrieves the active error handler for procedure calls.";
+
+    $help = <<HELP;
+This procedure retrieves the currently active error handler for
+procedure calls made by the calling plug-in. See
+gimp_plugin_set_pdb_error_handler() for details.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @outargs = (
+	{ name => 'handler', type => 'enum GimpPDBErrorHandler',
+	  desc => "Who is responsible for handling procedure call errors" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      handler = gimp_plug_in_get_error_handler (plug_in);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
 
 @headers = qw(<string.h>
               <stdlib.h>
@@ -295,9 +367,11 @@
             plugin_help_register
             plugin_menu_register
             plugin_menu_branch_register
-            plugin_icon_register);
+            plugin_icon_register
+            plugin_set_pdb_error_handler
+            plugin_get_pdb_error_handler);
 
-%exports = (app => [ procs], lib => [ procs[1,2,3,4,5]]);
+%exports = (app => [ procs], lib => [ procs[1,2,3,4,5,6,7]]);
 
 $desc = 'Plug-in';
 

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/selection.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/selection.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/selection.pdb	Sun Oct 12 15:38:02 2008
@@ -416,11 +416,12 @@
 BLURB
 
     $help = <<'HELP';
-This procedure requires a layer with an alpha channel. The alpha channel
-information is used to create a selection mask such that for any pixel in the
-image defined in the specified layer, that layer pixel's alpha value is
-transferred to the selection mask. If the layer is undefined at a particular
-image pixel, the associated selection mask value is set to 0.
+The alpha channel information is used to create a selection mask such
+that for any pixel in the image defined in the specified layer, that
+layer pixel's alpha value is transferred to the selection mask. If the
+layer is undefined at a particular image pixel, the associated
+selection mask value is set to 0. A layer without an alpha channel is
+considered opaque.
 HELP
 
     &std_pdb_misc;

Modified: branches/soc-2008-tagging/tools/test-clipboard.c
==============================================================================
--- branches/soc-2008-tagging/tools/test-clipboard.c	(original)
+++ branches/soc-2008-tagging/tools/test-clipboard.c	Sun Oct 12 15:38:02 2008
@@ -91,7 +91,7 @@
   {
     "paste", 'p', 0,
     G_OPTION_ARG_STRING, &option_paste_filename,
-    "Paste clipoard into <file>", "<file>"
+    "Paste clipoard into <file> ('-' pastes to STDOUT)", "<file>"
   },
   {
     "version", 'v', G_OPTION_FLAG_NO_ARG,
@@ -366,10 +366,12 @@
                                                            FALSE));
   if (data)
     {
-      gsize bytes;
-      gint  fd;
+      gint fd;
 
-      fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+      if (! strcmp (filename, "-"))
+        fd = 1;
+      else
+        fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 
       if (fd < 0)
         {
@@ -378,9 +380,7 @@
           return FALSE;
         }
 
-      bytes = data->length * data->format / 8;
-
-      if (write (fd, data->data, bytes) < bytes)
+      if (write (fd, data->data, data->length) < data->length)
         {
           close (fd);
           g_printerr ("%s: write() failed: %s",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]