gimp r27111 - in branches/soc-2008-text: . app app/actions app/base app/composite app/config app/core app/dialogs app/display app/gegl app/gui app/menus app/paint app/paint-funcs app/pdb app/plug-in app/tools app/widgets app/xcf data/images devel-docs devel-docs/app devel-docs/libgimp devel-docs/libgimp/tmpl devel-docs/tools docs etc libgimp libgimpbase libgimpconfig menus modules plug-ins/color-rotate plug-ins/common plug-ins/file-fits plug-ins/file-jpeg plug-ins/file-psd 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/map-object plug-ins/print plug-ins/pygimp 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/Small tools tools/pdbgen/pdb



Author: weskaggs
Date: Thu Oct  2 16:23:25 2008
New Revision: 27111
URL: http://svn.gnome.org/viewvc/gimp?rev=27111&view=rev

Log:
Bill Skaggs <weskaggs gmail com>

	* Merged 26850:27710 from trunk, updating to 2.6.0 of trunk.


Added:
   branches/soc-2008-text/ChangeLog.pre-2-6
      - copied unchanged from r27110, /trunk/ChangeLog.pre-2-6
   branches/soc-2008-text/NEWS.pre-2-6
      - copied unchanged from r27110, /trunk/NEWS.pre-2-6
   branches/soc-2008-text/app/actions/config-actions.c
      - copied unchanged from r27110, /trunk/app/actions/config-actions.c
   branches/soc-2008-text/app/actions/config-actions.h
      - copied unchanged from r27110, /trunk/app/actions/config-actions.h
   branches/soc-2008-text/app/actions/config-commands.c
      - copied unchanged from r27110, /trunk/app/actions/config-commands.c
   branches/soc-2008-text/app/actions/config-commands.h
      - copied unchanged from r27110, /trunk/app/actions/config-commands.h
   branches/soc-2008-text/app/widgets/gimpactioneditor.c
      - copied unchanged from r27110, /trunk/app/widgets/gimpactioneditor.c
   branches/soc-2008-text/app/widgets/gimpactioneditor.h
      - copied unchanged from r27110, /trunk/app/widgets/gimpactioneditor.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu-regex.c
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-regex.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-regex.h
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-regex.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu-script.c
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-script.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-script.h
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-script.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu-utils.c
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-utils.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-utils.h
      - copied unchanged from r27110, /trunk/plug-ins/script-fu/script-fu-utils.h
   branches/soc-2008-text/po-libgimp/sr latin po
      - copied unchanged from r27110, /trunk/po-libgimp/sr latin po
   branches/soc-2008-text/po-plug-ins/sr latin po
      - copied unchanged from r27110, /trunk/po-plug-ins/sr latin po
   branches/soc-2008-text/po-python/sr latin po
      - copied unchanged from r27110, /trunk/po-python/sr latin po
   branches/soc-2008-text/po-script-fu/sr latin po
      - copied unchanged from r27110, /trunk/po-script-fu/sr latin po
   branches/soc-2008-text/po-tips/sr latin po
      - copied unchanged from r27110, /trunk/po-tips/sr latin po
   branches/soc-2008-text/po/sr latin po
      - copied unchanged from r27110, /trunk/po/sr latin po
Removed:
   branches/soc-2008-text/plug-ins/script-fu/re/
   branches/soc-2008-text/po-libgimp/sr Latn po
   branches/soc-2008-text/po-plug-ins/sr Latn po
   branches/soc-2008-text/po-python/sr Latn po
   branches/soc-2008-text/po-script-fu/sr Latn po
   branches/soc-2008-text/po-tips/sr Latn po
   branches/soc-2008-text/po/sr Latn po
Modified:
   branches/soc-2008-text/AUTHORS
   branches/soc-2008-text/ChangeLog
   branches/soc-2008-text/INSTALL
   branches/soc-2008-text/Makefile.am
   branches/soc-2008-text/NEWS
   branches/soc-2008-text/README
   branches/soc-2008-text/app/   (props changed)
   branches/soc-2008-text/app/Makefile.am
   branches/soc-2008-text/app/actions/Makefile.am
   branches/soc-2008-text/app/actions/actions.c
   branches/soc-2008-text/app/actions/channels-commands.c
   branches/soc-2008-text/app/actions/context-actions.c
   branches/soc-2008-text/app/actions/context-commands.c
   branches/soc-2008-text/app/actions/debug-actions.c
   branches/soc-2008-text/app/actions/debug-commands.c
   branches/soc-2008-text/app/actions/debug-commands.h
   branches/soc-2008-text/app/actions/dialogs-actions.c
   branches/soc-2008-text/app/actions/edit-actions.c
   branches/soc-2008-text/app/actions/file-actions.c
   branches/soc-2008-text/app/actions/layers-commands.c
   branches/soc-2008-text/app/actions/plug-in-actions.c
   branches/soc-2008-text/app/actions/vectors-commands.c
   branches/soc-2008-text/app/actions/view-commands.c
   branches/soc-2008-text/app/actions/windows-actions.c
   branches/soc-2008-text/app/base/base-utils.c
   branches/soc-2008-text/app/base/base-utils.h
   branches/soc-2008-text/app/base/colorize.c
   branches/soc-2008-text/app/composite/make-installer.py
   branches/soc-2008-text/app/composite/ns.py
   branches/soc-2008-text/app/config/gimpbaseconfig.c
   branches/soc-2008-text/app/config/gimpguiconfig.c
   branches/soc-2008-text/app/config/gimprc-deserialize.c
   branches/soc-2008-text/app/core/gimp-modules.c
   branches/soc-2008-text/app/core/gimp.c
   branches/soc-2008-text/app/core/gimp.h
   branches/soc-2008-text/app/core/gimpbrush.c
   branches/soc-2008-text/app/core/gimpbrushgenerated.c
   branches/soc-2008-text/app/core/gimpchannel.c
   branches/soc-2008-text/app/core/gimpcurve.c
   branches/soc-2008-text/app/core/gimpdata.h
   branches/soc-2008-text/app/core/gimpdrawable-shadow.c
   branches/soc-2008-text/app/core/gimpgradient.c
   branches/soc-2008-text/app/core/gimpimage.c
   branches/soc-2008-text/app/core/gimpimage.h
   branches/soc-2008-text/app/core/gimplayer.c
   branches/soc-2008-text/app/core/gimplayer.h
   branches/soc-2008-text/app/core/gimplayermaskundo.c
   branches/soc-2008-text/app/core/gimppalette-load.c
   branches/soc-2008-text/app/core/gimppalette.c
   branches/soc-2008-text/app/core/gimppattern.c
   branches/soc-2008-text/app/core/gimptemplate.c
   branches/soc-2008-text/app/core/gimptemplate.h
   branches/soc-2008-text/app/dialogs/about-dialog.c
   branches/soc-2008-text/app/dialogs/authors.xsl
   branches/soc-2008-text/app/dialogs/dialogs.c
   branches/soc-2008-text/app/dialogs/image-new-dialog.c
   branches/soc-2008-text/app/dialogs/keyboard-shortcuts-dialog.c
   branches/soc-2008-text/app/dialogs/tips-dialog.c
   branches/soc-2008-text/app/display/display-enums.c
   branches/soc-2008-text/app/display/display-enums.h
   branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.c
   branches/soc-2008-text/app/display/gimpdisplayshell-dnd.c
   branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c
   branches/soc-2008-text/app/display/gimpdisplayshell-scale.c
   branches/soc-2008-text/app/display/gimpdisplayshell-scale.h
   branches/soc-2008-text/app/display/gimpdisplayshell-scroll.c
   branches/soc-2008-text/app/display/gimpdisplayshell.c
   branches/soc-2008-text/app/display/gimpnavigationeditor.c
   branches/soc-2008-text/app/display/gimpstatusbar.c
   branches/soc-2008-text/app/gegl/gimpbrightnesscontrastconfig.c
   branches/soc-2008-text/app/gegl/gimpcurvesconfig.c
   branches/soc-2008-text/app/gegl/gimplevelsconfig.c
   branches/soc-2008-text/app/gegl/gimpoperationhuesaturation.c
   branches/soc-2008-text/app/gimp-log.c
   branches/soc-2008-text/app/gimp-log.h
   branches/soc-2008-text/app/gui/gimpdbusservice.c
   branches/soc-2008-text/app/gui/gui-unique.c
   branches/soc-2008-text/app/gui/gui.c
   branches/soc-2008-text/app/gui/splash.c
   branches/soc-2008-text/app/menus/menus.c
   branches/soc-2008-text/app/menus/windows-menu.c
   branches/soc-2008-text/app/paint-funcs/scale-region.c
   branches/soc-2008-text/app/paint/gimpbrushcore.c
   branches/soc-2008-text/app/paint/gimppaintcore-stroke.c
   branches/soc-2008-text/app/pdb/drawable-cmds.c
   branches/soc-2008-text/app/pdb/gimppdb-utils.c
   branches/soc-2008-text/app/pdb/gimppdb-utils.h
   branches/soc-2008-text/app/pdb/image-cmds.c
   branches/soc-2008-text/app/pdb/internal-procs.c
   branches/soc-2008-text/app/pdb/layer-cmds.c
   branches/soc-2008-text/app/pdb/paths-cmds.c
   branches/soc-2008-text/app/pdb/selection-cmds.c
   branches/soc-2008-text/app/plug-in/gimpplugin.c
   branches/soc-2008-text/app/plug-in/gimpplugindebug.c
   branches/soc-2008-text/app/plug-in/gimpplugindebug.h
   branches/soc-2008-text/app/plug-in/gimppluginprocedure.c
   branches/soc-2008-text/app/plug-in/gimppluginshm.c
   branches/soc-2008-text/app/plug-in/plug-in-menu-path.c
   branches/soc-2008-text/app/tools/gimpcolorbalancetool.c
   branches/soc-2008-text/app/tools/gimpcroptool.c
   branches/soc-2008-text/app/tools/gimpcurvestool.c
   branches/soc-2008-text/app/tools/gimpgegltool.c
   branches/soc-2008-text/app/tools/gimphuesaturationtool.c
   branches/soc-2008-text/app/tools/gimpimagemaptool.c
   branches/soc-2008-text/app/tools/gimpimagemaptool.h
   branches/soc-2008-text/app/tools/gimplevelstool.c
   branches/soc-2008-text/app/tools/gimprectangleselecttool.c
   branches/soc-2008-text/app/tools/gimprectangletool.c
   branches/soc-2008-text/app/tools/gimptexttool.c
   branches/soc-2008-text/app/tools/gimptransformtool.c
   branches/soc-2008-text/app/widgets/Makefile.am
   branches/soc-2008-text/app/widgets/gimpactionview.c
   branches/soc-2008-text/app/widgets/gimpactionview.h
   branches/soc-2008-text/app/widgets/gimpcontainertreeview.c
   branches/soc-2008-text/app/widgets/gimpcontrollereditor.c
   branches/soc-2008-text/app/widgets/gimpdialogfactory.c
   branches/soc-2008-text/app/widgets/gimpdialogfactory.h
   branches/soc-2008-text/app/widgets/gimpdock.c
   branches/soc-2008-text/app/widgets/gimpdockable.c
   branches/soc-2008-text/app/widgets/gimphelp-ids.h
   branches/soc-2008-text/app/widgets/gimpnavigationview.c
   branches/soc-2008-text/app/widgets/gimpwidgets-utils.c
   branches/soc-2008-text/app/widgets/gimpwidgets-utils.h
   branches/soc-2008-text/app/widgets/gtkscalebutton.c
   branches/soc-2008-text/app/widgets/widgets-types.h
   branches/soc-2008-text/app/xcf/xcf-load.c
   branches/soc-2008-text/authors.xml
   branches/soc-2008-text/configure.in
   branches/soc-2008-text/data/images/gimp-splash.png
   branches/soc-2008-text/devel-docs/ChangeLog
   branches/soc-2008-text/devel-docs/app/Makefile.am
   branches/soc-2008-text/devel-docs/app/app-sections.txt
   branches/soc-2008-text/devel-docs/app/app.types
   branches/soc-2008-text/devel-docs/libgimp/libgimp-sections.txt
   branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpimage.sgml
   branches/soc-2008-text/devel-docs/libgimp/tmpl/gimplayer.sgml
   branches/soc-2008-text/devel-docs/release-howto.txt
   branches/soc-2008-text/devel-docs/tools/shadow.c
   branches/soc-2008-text/docs/   (props changed)
   branches/soc-2008-text/docs/gimprc.5.in
   branches/soc-2008-text/etc/gimprc
   branches/soc-2008-text/libgimp/gimp.c
   branches/soc-2008-text/libgimp/gimp.def
   branches/soc-2008-text/libgimp/gimp.h
   branches/soc-2008-text/libgimp/gimpexport.c
   branches/soc-2008-text/libgimp/gimpimage.c
   branches/soc-2008-text/libgimp/gimpimage_pdb.c
   branches/soc-2008-text/libgimp/gimpimage_pdb.h
   branches/soc-2008-text/libgimp/gimplayer_pdb.c
   branches/soc-2008-text/libgimp/gimplayer_pdb.h
   branches/soc-2008-text/libgimp/gimpprocview.c
   branches/soc-2008-text/libgimp/gimpprocview.h
   branches/soc-2008-text/libgimp/gimpselection_pdb.c
   branches/soc-2008-text/libgimpbase/gimpbasetypes.h
   branches/soc-2008-text/libgimpbase/gimpreloc.c
   branches/soc-2008-text/libgimpconfig/gimpconfig-utils.c
   branches/soc-2008-text/menus/Makefile.am
   branches/soc-2008-text/menus/image-menu.xml.in
   branches/soc-2008-text/modules/color-selector-wheel.c
   branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.c
   branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.h
   branches/soc-2008-text/plug-ins/common/animation-play.c
   branches/soc-2008-text/plug-ins/common/curve-bend.c
   branches/soc-2008-text/plug-ins/common/displace.c
   branches/soc-2008-text/plug-ins/common/edge-dog.c
   branches/soc-2008-text/plug-ins/common/file-header.c
   branches/soc-2008-text/plug-ins/common/file-psp.c
   branches/soc-2008-text/plug-ins/common/file-raw.c
   branches/soc-2008-text/plug-ins/common/file-xbm.c
   branches/soc-2008-text/plug-ins/common/file-xpm.c
   branches/soc-2008-text/plug-ins/common/filter-pack.c
   branches/soc-2008-text/plug-ins/common/guillotine.c
   branches/soc-2008-text/plug-ins/common/hot.c
   branches/soc-2008-text/plug-ins/common/lcms.c
   branches/soc-2008-text/plug-ins/common/mail.c
   branches/soc-2008-text/plug-ins/common/nova.c
   branches/soc-2008-text/plug-ins/common/sample-colorize.c
   branches/soc-2008-text/plug-ins/common/screenshot.c
   branches/soc-2008-text/plug-ins/file-fits/fits-io.c
   branches/soc-2008-text/plug-ins/file-fits/fits-io.h
   branches/soc-2008-text/plug-ins/file-fits/fits.c
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.c
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.h
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.c
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.h
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg.c
   branches/soc-2008-text/plug-ins/file-jpeg/jpeg.h
   branches/soc-2008-text/plug-ins/file-psd/psd-load.c
   branches/soc-2008-text/plug-ins/file-psd/psd-save.c
   branches/soc-2008-text/plug-ins/file-uri/uri-backend-wget.c
   branches/soc-2008-text/plug-ins/file-xjt/xjt.c
   branches/soc-2008-text/plug-ins/flame/rect.c
   branches/soc-2008-text/plug-ins/gfig/gfig-dobject.h
   branches/soc-2008-text/plug-ins/gfig/gfig-style.c
   branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h
   branches/soc-2008-text/plug-ins/gimpressionist/presets.c
   branches/soc-2008-text/plug-ins/gimpressionist/utils.c
   branches/soc-2008-text/plug-ins/gradient-flare/gradient-flare.c
   branches/soc-2008-text/plug-ins/help-browser/dialog.c
   branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose-storage.c
   branches/soc-2008-text/plug-ins/imagemap/imap_cern_lex.c
   branches/soc-2008-text/plug-ins/imagemap/imap_cern_parse.c
   branches/soc-2008-text/plug-ins/imagemap/imap_csim_lex.c
   branches/soc-2008-text/plug-ins/imagemap/imap_csim_parse.c
   branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c
   branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.h
   branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_lex.c
   branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_parse.c
   branches/soc-2008-text/plug-ins/imagemap/imap_object.h
   branches/soc-2008-text/plug-ins/map-object/map-object-ui.c
   branches/soc-2008-text/plug-ins/print/print-draw-page.c
   branches/soc-2008-text/plug-ins/pygimp/gimpfu.py
   branches/soc-2008-text/plug-ins/pygimp/gimpshelf.py
   branches/soc-2008-text/plug-ins/pygimp/gimpthumbmodule.c
   branches/soc-2008-text/plug-ins/pygimp/gimpui.py
   branches/soc-2008-text/plug-ins/pygimp/gimpuimodule.c
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/foggify.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-offset.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-sort.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-to-gradient.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/py-slice.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/pyconsole.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-eval.py
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/whirlpinch.py
   branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c
   branches/soc-2008-text/plug-ins/pygimp/pygimp-drawable.c
   branches/soc-2008-text/plug-ins/pygimp/pygimp-image.c
   branches/soc-2008-text/plug-ins/script-fu/Makefile.am
   branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.c
   branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-eval.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-interface.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu-server.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-text-console.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-types.h
   branches/soc-2008-text/plug-ins/script-fu/script-fu.c
   branches/soc-2008-text/plug-ins/script-fu/scripts/3d-outline.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/3dTruchet.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/add-bevel.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-arrow.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bar.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bullet.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-button.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/alien-neon-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/basic1-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/basic2-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-button.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-button.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-heading.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/blended-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/bovinated-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/camo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/carved-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/chalk.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/chip-away.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/chrome-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/comic-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/coolmetal-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/crystal-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/flatland.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-headers.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-labels.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/glossy.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/glowing-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/gradient-bevel-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/i26-gunya2.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/land.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/neon-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/news-text.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/pupi-button.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/rendermap.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/sota-chrome-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/speed-text.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/starscape-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/swirltile.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/swirly-pattern.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/t-o-p-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/text-circle.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/textured-logo.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/title-header.scm
   branches/soc-2008-text/plug-ins/script-fu/scripts/truchet.scm
   branches/soc-2008-text/plug-ins/script-fu/tinyscheme/CHANGES
   branches/soc-2008-text/plug-ins/script-fu/tinyscheme/dynload.c
   branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.c
   branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.h
   branches/soc-2008-text/plug-ins/twain/tw_func.c
   branches/soc-2008-text/plug-ins/twain/tw_util.c
   branches/soc-2008-text/plug-ins/twain/tw_win.c
   branches/soc-2008-text/plug-ins/twain/twain.c
   branches/soc-2008-text/plug-ins/twain/twain.h
   branches/soc-2008-text/plug-ins/win-snap/winsnap.c
   branches/soc-2008-text/po-libgimp/ChangeLog
   branches/soc-2008-text/po-libgimp/LINGUAS
   branches/soc-2008-text/po-libgimp/be.po
   branches/soc-2008-text/po-libgimp/ca.po
   branches/soc-2008-text/po-libgimp/et.po
   branches/soc-2008-text/po-libgimp/fr.po
   branches/soc-2008-text/po-libgimp/gl.po
   branches/soc-2008-text/po-libgimp/it.po
   branches/soc-2008-text/po-libgimp/ja.po
   branches/soc-2008-text/po-libgimp/ko.po
   branches/soc-2008-text/po-libgimp/nb.po
   branches/soc-2008-text/po-libgimp/ru.po
   branches/soc-2008-text/po-libgimp/sl.po
   branches/soc-2008-text/po-libgimp/sr.po
   branches/soc-2008-text/po-plug-ins/ChangeLog
   branches/soc-2008-text/po-plug-ins/LINGUAS
   branches/soc-2008-text/po-plug-ins/be.po
   branches/soc-2008-text/po-plug-ins/ca.po
   branches/soc-2008-text/po-plug-ins/de.po
   branches/soc-2008-text/po-plug-ins/eu.po
   branches/soc-2008-text/po-plug-ins/gl.po
   branches/soc-2008-text/po-plug-ins/it.po
   branches/soc-2008-text/po-plug-ins/ja.po
   branches/soc-2008-text/po-plug-ins/ko.po
   branches/soc-2008-text/po-plug-ins/nb.po
   branches/soc-2008-text/po-plug-ins/ru.po
   branches/soc-2008-text/po-plug-ins/sl.po
   branches/soc-2008-text/po-plug-ins/sr.po
   branches/soc-2008-text/po-python/ChangeLog
   branches/soc-2008-text/po-python/LINGUAS
   branches/soc-2008-text/po-python/ca.po
   branches/soc-2008-text/po-python/ja.po
   branches/soc-2008-text/po-python/ko.po
   branches/soc-2008-text/po-python/nb.po
   branches/soc-2008-text/po-python/ru.po
   branches/soc-2008-text/po-python/sl.po
   branches/soc-2008-text/po-python/sr.po
   branches/soc-2008-text/po-script-fu/ChangeLog
   branches/soc-2008-text/po-script-fu/LINGUAS
   branches/soc-2008-text/po-script-fu/be.po
   branches/soc-2008-text/po-script-fu/ca.po
   branches/soc-2008-text/po-script-fu/de.po
   branches/soc-2008-text/po-script-fu/eu.po
   branches/soc-2008-text/po-script-fu/gl.po
   branches/soc-2008-text/po-script-fu/it.po
   branches/soc-2008-text/po-script-fu/ja.po
   branches/soc-2008-text/po-script-fu/ko.po
   branches/soc-2008-text/po-script-fu/ru.po
   branches/soc-2008-text/po-script-fu/sl.po
   branches/soc-2008-text/po-script-fu/sr.po
   branches/soc-2008-text/po-script-fu/sv.po
   branches/soc-2008-text/po-tips/ChangeLog
   branches/soc-2008-text/po-tips/LINGUAS
   branches/soc-2008-text/po-tips/ca.po
   branches/soc-2008-text/po-tips/ja.po
   branches/soc-2008-text/po-tips/ko.po
   branches/soc-2008-text/po-tips/nb.po
   branches/soc-2008-text/po-tips/sr.po
   branches/soc-2008-text/po/ChangeLog
   branches/soc-2008-text/po/LINGUAS
   branches/soc-2008-text/po/POTFILES.in
   branches/soc-2008-text/po/be.po
   branches/soc-2008-text/po/ca.po
   branches/soc-2008-text/po/de.po
   branches/soc-2008-text/po/et.po
   branches/soc-2008-text/po/eu.po
   branches/soc-2008-text/po/fi.po
   branches/soc-2008-text/po/fr.po
   branches/soc-2008-text/po/gl.po
   branches/soc-2008-text/po/it.po
   branches/soc-2008-text/po/ja.po
   branches/soc-2008-text/po/ko.po
   branches/soc-2008-text/po/nb.po
   branches/soc-2008-text/po/pa.po
   branches/soc-2008-text/po/pl.po
   branches/soc-2008-text/po/ru.po
   branches/soc-2008-text/po/sl.po
   branches/soc-2008-text/po/sr.po
   branches/soc-2008-text/po/sv.po
   branches/soc-2008-text/themes/Default/gtkrc
   branches/soc-2008-text/themes/Small/gtkrc
   branches/soc-2008-text/tools/Makefile.am
   branches/soc-2008-text/tools/defcheck.py
   branches/soc-2008-text/tools/gimppath2svg.py
   branches/soc-2008-text/tools/gimptool.c
   branches/soc-2008-text/tools/pdbgen/pdb/drawable.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/image.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/layer.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/paths.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/selection.pdb

Modified: branches/soc-2008-text/AUTHORS
==============================================================================
--- branches/soc-2008-text/AUTHORS	(original)
+++ branches/soc-2008-text/AUTHORS	Thu Oct  2 16:23:25 2008
@@ -55,6 +55,7 @@
  Misha Dynin
  Daniel Eddeland
  Daniel Egger
+ Ulf-D. Ehlert
  Morton Eriksen
  Larry Ewing
  Pedro Alonso Ferrer
@@ -91,6 +92,7 @@
  Alan Horkan
  Daniel Hornung
  Jan HubiÄka
+ Barak Itkin
  Ben Jackson
  Tim Janik
  Kristian Jantz
@@ -121,7 +123,6 @@
  Frederic Leroy
  Raph Levien
  Wing Tung Leung
- LightningIsMyName
  Adrian Likins
  Tor Lillqvist
  Ingo LÃtkebohle
@@ -172,6 +173,7 @@
  Nils Philippsen
  Ari Pollak
  RaphaÃl Quinet
+ Dennis Ranke
  Tom Rathborne
  Jens Restemeier
  Maurits Rijk
@@ -228,10 +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
@@ -240,6 +244,8 @@
 
 The following people have helped to document GIMP:
 
+ Ignacio AntI
+ Åygimantas BeruÄka
  Carey Bunks
  Marco Ciampa
  Dust
@@ -254,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

Modified: branches/soc-2008-text/INSTALL
==============================================================================
--- branches/soc-2008-text/INSTALL	(original)
+++ branches/soc-2008-text/INSTALL	Thu Oct  2 16:23:25 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
@@ -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-text/Makefile.am
==============================================================================
--- branches/soc-2008-text/Makefile.am	(original)
+++ branches/soc-2008-text/Makefile.am	Thu Oct  2 16:23:25 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		\

Modified: branches/soc-2008-text/NEWS
==============================================================================
--- branches/soc-2008-text/NEWS	(original)
+++ branches/soc-2008-text/NEWS	Thu Oct  2 16:23:25 2008
@@ -1,205 +1,7 @@
                    ------------------------------
                    GNU Image Manipulation Program
-                         Development Branch
+                          2.6 Stable 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.3
-=====================
-
- - some fixes for the 64-bit Windows platform
- - optionally emulate brush dynamics when stroking a path or selection
- - further work on the scroll-beyond-image-borders feature, improving the
-   behavior of the image display when zooming or when the image size changes
- - added links to the user manual to the Tips dialog
- - largely rewritten scaling code improves scaling quality, in particular
-   when scaling down
- - allow to copy-on-write from the image projection
- - added "Paste as new layer" to Edit menu
- - added "New from visible" to the Layer menu allowing to create a new
-   layer from the image projection
- - added new procedure	'gimp-layer-new-from-visible'.
- - renamed all file plug-in executables to a have a file prefix
- - changed the HSV color selector to use the GtkHSV widget
- - changed the default for the 'trust-dirty-flag' gimprc property
- - dropped the "Starburst" logo script
- - improved the behavior of the zoom button in the upper right corner of
-   the image window
- - allow PDB procedures to pass an error message with their return values
- - changed all file plug-ins to pass their error messages with the
-   return values instead of raising an error dialog
- - adapt the display of the pointer position in the statusbar to the
-   pointer precision of the active tool
- - bug fixes and code cleanup
-
-
-Contributors:
-
-  Sven Neumann, Michael Natterer, Martin Nordholts, Alexia Death,
-  Tor Lillqvist, Geert Jordaens, Daniel Eddeland, Aurimas JuÅka,
-  RÃman Joost, Luidnel Maignan, LightningIsMyName, Aurore Derriennic
-
-
-
-Changes in GIMP 2.5.2
-=====================
-
- - final touches on the combined Freehand/Polygon Select tool
- - added a 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, ...
+This is the stable branch of GIMP. No new features are being added
+here, just bug-fixes.

Modified: branches/soc-2008-text/README
==============================================================================
--- branches/soc-2008-text/README	(original)
+++ branches/soc-2008-text/README	Thu Oct  2 16:23:25 2008
@@ -1,15 +1,11 @@
                    ------------------------------ 
                    GNU Image Manipulation Program
-                         Development Branch
+                            Version 2.6
                    ------------------------------
 
-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.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. 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.6/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.6/menurc. You can also manually change the keybindings to
+any of your choice by editing ~/.gimp-2.6/menurc.
 
 
 Have fun,
@@ -111,3 +107,4 @@
   Sven Neumann
   Michael Natterer
   Dave Neary
+  Martin Nordholts

Modified: branches/soc-2008-text/app/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/Makefile.am	(original)
+++ branches/soc-2008-text/app/Makefile.am	Thu Oct  2 16:23:25 2008
@@ -33,9 +33,9 @@
 
 
 if ENABLE_GIMP_CONSOLE
-bin_PROGRAMS = gimp-2.5 gimp-console-2.5
+bin_PROGRAMS = gimp-2.6 gimp-console-2.6
 else
-bin_PROGRAMS = gimp-2.5
+bin_PROGRAMS = gimp-2.6
 endif
 
 app_sources = \
@@ -59,7 +59,7 @@
 	gimp-log.h	\
 	gimp-intl.h
 
-gimp_2_5_SOURCES = $(app_sources)
+gimp_2_6_SOURCES = $(app_sources)
 
 
 EXTRA_DIST = \
@@ -103,9 +103,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_6_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags) 
 
-gimp_2_5_LDADD = \
+gimp_2_6_LDADD = \
 	gui/libappgui.a			\
 	actions/libappactions.a		\
 	dialogs/libappdialogs.a		\
@@ -134,7 +134,6 @@
 	$(libgimpmath)			\
 	$(libgimpconfig)		\
 	$(libgimpbase)			\
-	$(REGEXREPL)			\
 	$(GTK_LIBS)			\
 	$(PANGOFT2_LIBS)		\
 	$(PANGOCAIRO_LIBS)		\
@@ -149,13 +148,13 @@
 
 if ENABLE_GIMP_CONSOLE
 
-gimp_console_2_5_SOURCES = $(app_sources)
+gimp_console_2_6_SOURCES = $(app_sources)
 
-gimp_console_2_5_CPPFLAGS = \
+gimp_console_2_6_CPPFLAGS = \
 	$(AM_CPPFLAGS)			\
 	-DGIMP_CONSOLE_COMPILATION
 
-gimp_console_2_5_LDADD = \
+gimp_console_2_6_LDADD = \
 	widgets/widgets-enums.o		\
 	display/display-enums.o		\
 	display/gimpdisplayoptions.o	\
@@ -179,7 +178,6 @@
 	$(libgimpmath)			\
 	$(libgimpconfig)		\
 	$(libgimpbase)			\
-	$(REGEXREPL)			\
 	$(GDK_PIXBUF_LIBS)		\
 	$(CAIRO_LIBS)			\
 	$(PANGOFT2_LIBS)		\

Modified: branches/soc-2008-text/app/actions/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/actions/Makefile.am	(original)
+++ branches/soc-2008-text/app/actions/Makefile.am	Thu Oct  2 16:23:25 2008
@@ -23,6 +23,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		\

Modified: branches/soc-2008-text/app/actions/actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/actions.c	(original)
+++ branches/soc-2008-text/app/actions/actions.c	Thu Oct  2 16:23:25 2008
@@ -52,6 +52,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"
@@ -113,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-text/app/actions/channels-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/channels-commands.c	(original)
+++ branches/soc-2008-text/app/actions/channels-commands.c	Thu Oct  2 16:23:25 2008
@@ -181,7 +181,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 +205,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);
 }
 

Modified: branches/soc-2008-text/app/actions/context-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/context-actions.c	(original)
+++ branches/soc-2008-text/app/actions/context-actions.c	Thu Oct  2 16:23:25 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-text/app/actions/context-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/context-commands.c	(original)
+++ branches/soc-2008-text/app/actions/context-commands.c	Thu Oct  2 16:23:25 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-text/app/actions/debug-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/debug-actions.c	(original)
+++ branches/soc-2008-text/app/actions/debug-actions.c	Thu Oct  2 16:23:25 2008
@@ -59,32 +59,8 @@
     NULL }
 };
 
-static const GimpToggleActionEntry debug_toggle_actions[] =
-{
-  { "debug-use-gegl", NULL,
-    "Use _GEGL", NULL,
-    "If possible, use GEGL for image processing",
-    G_CALLBACK (debug_use_gegl_cmd_callback),
-    FALSE,
-    NULL }
-};
-
 #endif
 
-static void
-debug_actions_use_gegl_notify (GObject         *config,
-                               GParamSpec      *pspec,
-                               GimpActionGroup *group)
-{
-  gboolean active;
-
-  g_object_get (config,
-                "use-gegl", &active,
-                NULL);
-
-  gimp_action_group_set_action_active (group, "debug-use-gegl", active);
-}
-
 void
 debug_actions_setup (GimpActionGroup *group)
 {
@@ -92,15 +68,6 @@
   gimp_action_group_add_actions (group,
                                  debug_actions,
                                  G_N_ELEMENTS (debug_actions));
-
-  gimp_action_group_add_toggle_actions (group,
-                                        debug_toggle_actions,
-                                        G_N_ELEMENTS (debug_toggle_actions));
-
-  g_signal_connect_object (group->gimp->config,
-                           "notify::use-gegl",
-                           G_CALLBACK (debug_actions_use_gegl_notify),
-                           group, 0);
 #endif
 }
 

Modified: branches/soc-2008-text/app/actions/debug-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/debug-commands.c	(original)
+++ branches/soc-2008-text/app/actions/debug-commands.c	Thu Oct  2 16:23:25 2008
@@ -146,18 +146,6 @@
   debug_print_qdata (GIMP_OBJECT (user_context));
 }
 
-void
-debug_use_gegl_cmd_callback (GtkAction *action,
-                             gpointer   data)
-{
-  GtkToggleAction *toggle_action = GTK_TOGGLE_ACTION (action);
-  Gimp            *gimp          = action_data_get_gimp (data);
-
-  g_object_set (gimp->config,
-                "use-gegl", gtk_toggle_action_get_active (toggle_action),
-                NULL);
-}
-
 
 /*  private functions  */
 

Modified: branches/soc-2008-text/app/actions/debug-commands.h
==============================================================================
--- branches/soc-2008-text/app/actions/debug-commands.h	(original)
+++ branches/soc-2008-text/app/actions/debug-commands.h	Thu Oct  2 16:23:25 2008
@@ -35,8 +35,6 @@
                                               gpointer   data);
 void   debug_dump_attached_data_cmd_callback (GtkAction *action,
                                               gpointer   data);
-void   debug_use_gegl_cmd_callback           (GtkAction *action,
-                                              gpointer   data);
 
 #endif /* ENABLE_DEBUG_MENU */
 

Modified: branches/soc-2008-text/app/actions/dialogs-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/dialogs-actions.c	(original)
+++ branches/soc-2008-text/app/actions/dialogs-actions.c	Thu Oct  2 16:23:25 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",

Modified: branches/soc-2008-text/app/actions/edit-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/edit-actions.c	(original)
+++ branches/soc-2008-text/app/actions/edit-actions.c	Thu Oct  2 16:23:25 2008
@@ -118,7 +118,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 +254,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 +264,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-text/app/actions/file-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/file-actions.c	(original)
+++ branches/soc-2008-text/app/actions/file-actions.c	Thu Oct  2 16:23:25 2008
@@ -64,7 +64,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,

Modified: branches/soc-2008-text/app/actions/layers-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/layers-commands.c	(original)
+++ branches/soc-2008-text/app/actions/layers-commands.c	Thu Oct  2 16:23:25 2008
@@ -387,7 +387,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 +411,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);
 }
 
@@ -1049,7 +1049,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-text/app/actions/plug-in-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/plug-in-actions.c	(original)
+++ branches/soc-2008-text/app/actions/plug-in-actions.c	Thu Oct  2 16:23:25 2008
@@ -488,6 +488,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 +500,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 +527,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 +559,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-text/app/actions/vectors-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/vectors-commands.c	(original)
+++ branches/soc-2008-text/app/actions/vectors-commands.c	Thu Oct  2 16:23:25 2008
@@ -200,7 +200,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 +224,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);
 }
 

Modified: branches/soc-2008-text/app/actions/view-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/view-commands.c	(original)
+++ branches/soc-2008-text/app/actions/view-commands.c	Thu Oct  2 16:23:25 2008
@@ -134,27 +134,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 +189,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 +215,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);
     }
 }
 

Modified: branches/soc-2008-text/app/actions/windows-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/windows-actions.c	(original)
+++ branches/soc-2008-text/app/actions/windows-actions.c	Thu Oct  2 16:23:25 2008
@@ -212,7 +212,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 +268,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-text/app/base/base-utils.c
==============================================================================
--- branches/soc-2008-text/app/base/base-utils.c	(original)
+++ branches/soc-2008-text/app/base/base-utils.c	Thu Oct  2 16:23:25 2008
@@ -38,10 +38,10 @@
 
 /*  public functions  */
 
-GPid
+gint
 get_pid (void)
 {
-  return getpid ();
+  return (gint) getpid ();
 }
 
 gint

Modified: branches/soc-2008-text/app/base/base-utils.h
==============================================================================
--- branches/soc-2008-text/app/base/base-utils.h	(original)
+++ branches/soc-2008-text/app/base/base-utils.h	Thu Oct  2 16:23:25 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-text/app/base/colorize.c
==============================================================================
--- branches/soc-2008-text/app/base/colorize.c	(original)
+++ branches/soc-2008-text/app/base/colorize.c	Thu Oct  2 16:23:25 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-text/app/composite/make-installer.py
==============================================================================
--- branches/soc-2008-text/app/composite/make-installer.py	(original)
+++ branches/soc-2008-text/app/composite/make-installer.py	Thu Oct  2 16:23:25 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-text/app/composite/ns.py
==============================================================================
--- branches/soc-2008-text/app/composite/ns.py	(original)
+++ branches/soc-2008-text/app/composite/ns.py	Thu Oct  2 16:23:25 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-text/app/config/gimpbaseconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpbaseconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpbaseconfig.c	Thu Oct  2 16:23:25 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-text/app/config/gimpguiconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpguiconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpguiconfig.c	Thu Oct  2 16:23:25 2008
@@ -83,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
 };
 
 
@@ -268,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
@@ -401,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;
@@ -514,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-text/app/config/gimprc-deserialize.c
==============================================================================
--- branches/soc-2008-text/app/config/gimprc-deserialize.c	(original)
+++ branches/soc-2008-text/app/config/gimprc-deserialize.c	Thu Oct  2 16:23:25 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-text/app/core/gimp-modules.c
==============================================================================
--- branches/soc-2008-text/app/core/gimp-modules.c	(original)
+++ branches/soc-2008-text/app/core/gimp-modules.c	Thu Oct  2 16:23:25 2008
@@ -179,7 +179,7 @@
     {
       GimpConfigWriter *writer;
       GString          *str;
-      gchar            *p;
+      const gchar      *p;
       gchar            *filename;
       GError           *error = NULL;
 

Modified: branches/soc-2008-text/app/core/gimp.c
==============================================================================
--- branches/soc-2008-text/app/core/gimp.c	(original)
+++ branches/soc-2008-text/app/core/gimp.c	Thu Oct  2 16:23:25 2008
@@ -186,6 +186,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;
@@ -621,6 +623,8 @@
 
   gimp_plug_in_manager_restore (gimp->plug_in_manager,
                                 gimp_get_user_context (gimp), status_callback);
+
+  gimp->restored = TRUE;
 }
 
 static gboolean
@@ -853,6 +857,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-text/app/core/gimp.h
==============================================================================
--- branches/soc-2008-text/app/core/gimp.h	(original)
+++ branches/soc-2008-text/app/core/gimp.h	Thu Oct  2 16:23:25 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;
@@ -150,6 +152,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-text/app/core/gimpbrush.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpbrush.c	(original)
+++ branches/soc-2008-text/app/core/gimpbrush.c	Thu Oct  2 16:23:25 2008
@@ -48,36 +48,36 @@
 };
 
 
-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);
 
 
 G_DEFINE_TYPE (GimpBrush, gimp_brush, GIMP_TYPE_DATA)
@@ -335,7 +335,7 @@
                           brush->mask->height);
 }
 
-static gchar *
+static const gchar *
 gimp_brush_get_extension (GimpData *data)
 {
   return GIMP_BRUSH_FILE_EXTENSION;

Modified: branches/soc-2008-text/app/core/gimpbrushgenerated.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpbrushgenerated.c	(original)
+++ branches/soc-2008-text/app/core/gimpbrushgenerated.c	Thu Oct  2 16:23:25 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-text/app/core/gimpchannel.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpchannel.c	(original)
+++ branches/soc-2008-text/app/core/gimpchannel.c	Thu Oct  2 16:23:25 2008
@@ -1245,6 +1245,7 @@
                        gboolean     push_undo)
 {
   PixelRegion maskPR;
+  guchar      bg = OPAQUE_OPACITY;
 
   if (push_undo)
     gimp_channel_push_undo (channel,
@@ -1258,7 +1259,7 @@
                      0, 0,
                      gimp_item_width  (GIMP_ITEM (channel)),
                      gimp_item_height (GIMP_ITEM (channel)), TRUE);
-  clear_region (&maskPR);
+  color_region (&maskPR, &bg);
 
   /*  we know the bounds  */
   channel->bounds_known = TRUE;

Modified: branches/soc-2008-text/app/core/gimpcurve.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpcurve.c	(original)
+++ branches/soc-2008-text/app/core/gimpcurve.c	Thu Oct  2 16:23:25 2008
@@ -19,7 +19,6 @@
 #include "config.h"
 
 #include <stdlib.h>
-#include <string.h>
 
 #include <glib-object.h>
 
@@ -48,69 +47,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 +357,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 +425,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 +502,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;
 }
 
 
@@ -977,7 +973,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.
@@ -1004,8 +1000,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;
@@ -1013,8 +1008,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;
@@ -1025,13 +1019,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-text/app/core/gimpdata.h
==============================================================================
--- branches/soc-2008-text/app/core/gimpdata.h	(original)
+++ branches/soc-2008-text/app/core/gimpdata.h	Thu Oct  2 16:23:25 2008
@@ -67,13 +67,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-text/app/core/gimpdrawable-shadow.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpdrawable-shadow.c	(original)
+++ branches/soc-2008-text/app/core/gimpdrawable-shadow.c	Thu Oct  2 16:23:25 2008
@@ -39,8 +39,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-text/app/core/gimpgradient.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpgradient.c	(original)
+++ branches/soc-2008-text/app/core/gimpgradient.c	Thu Oct  2 16:23:25 2008
@@ -38,34 +38,34 @@
 #define EPSILON 1e-10
 
 
-static void       gimp_gradient_finalize         (GObject           *object);
+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,
@@ -293,7 +293,7 @@
   return standard_gradient;
 }
 
-static gchar *
+static const gchar *
 gimp_gradient_get_extension (GimpData *data)
 {
   return GIMP_GRADIENT_FILE_EXTENSION;

Modified: branches/soc-2008-text/app/core/gimpimage.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpimage.c	(original)
+++ branches/soc-2008-text/app/core/gimpimage.c	Thu Oct  2 16:23:25 2008
@@ -2862,29 +2862,12 @@
 
   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 (g_object_is_floating (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);
@@ -3096,20 +3079,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;
     }
 
@@ -3118,20 +3103,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;
     }
 
@@ -3218,19 +3205,9 @@
 
   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 (g_object_is_floating (channel), FALSE);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (channel)) == image,
+                        FALSE);
 
   active_channel = gimp_image_get_active_channel (image);
 
@@ -3324,20 +3301,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;
     }
 
@@ -3349,39 +3328,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;
     }
 
@@ -3393,23 +3364,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"));
 }
@@ -3469,19 +3430,9 @@
 
   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 (g_object_is_floating (vectors), FALSE);
+  g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (vectors)) == image,
+                        FALSE);
 
   active_vectors = gimp_image_get_active_vectors (image);
 
@@ -3562,20 +3513,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;
     }
 
@@ -3587,39 +3540,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;
     }
 
@@ -3631,23 +3575,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-text/app/core/gimpimage.h
==============================================================================
--- branches/soc-2008-text/app/core/gimpimage.h	(original)
+++ branches/soc-2008-text/app/core/gimpimage.h	Thu Oct  2 16:23:25 2008
@@ -472,9 +472,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,
@@ -492,11 +494,13 @@
                                                   GimpChannel        *channel);
 
 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,
@@ -512,11 +516,13 @@
                                                   GimpVectors        *vectors);
 
 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-text/app/core/gimplayer.c
==============================================================================
--- branches/soc-2008-text/app/core/gimplayer.c	(original)
+++ branches/soc-2008-text/app/core/gimplayer.c	Thu Oct  2 16:23:25 2008
@@ -538,7 +538,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);
         }
     }
 
@@ -1235,31 +1235,27 @@
 }
 
 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 (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;
     }
 
@@ -1268,8 +1264,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;
     }
 

Modified: branches/soc-2008-text/app/core/gimplayer.h
==============================================================================
--- branches/soc-2008-text/app/core/gimplayer.h	(original)
+++ branches/soc-2008-text/app/core/gimplayer.h	Thu Oct  2 16:23:25 2008
@@ -103,7 +103,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-text/app/core/gimplayermaskundo.c
==============================================================================
--- branches/soc-2008-text/app/core/gimplayermaskundo.c	(original)
+++ branches/soc-2008-text/app/core/gimplayermaskundo.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/core/gimppalette-load.c
==============================================================================
--- branches/soc-2008-text/app/core/gimppalette-load.c	(original)
+++ branches/soc-2008-text/app/core/gimppalette-load.c	Thu Oct  2 16:23:25 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-text/app/core/gimppalette.c
==============================================================================
--- branches/soc-2008-text/app/core/gimppalette.c	(original)
+++ branches/soc-2008-text/app/core/gimppalette.c	Thu Oct  2 16:23:25 2008
@@ -40,35 +40,35 @@
 
 /*  local function prototypes  */
 
-static void       gimp_palette_finalize         (GObject           *object);
+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 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);
 
 
 G_DEFINE_TYPE (GimpPalette, gimp_palette, GIMP_TYPE_DATA)
@@ -289,7 +289,7 @@
   return standard_palette;
 }
 
-static gchar *
+static const gchar *
 gimp_palette_get_extension (GimpData *data)
 {
   return GIMP_PALETTE_FILE_EXTENSION;

Modified: branches/soc-2008-text/app/core/gimppattern.c
==============================================================================
--- branches/soc-2008-text/app/core/gimppattern.c	(original)
+++ branches/soc-2008-text/app/core/gimppattern.c	Thu Oct  2 16:23:25 2008
@@ -34,22 +34,23 @@
 #include "gimp-intl.h"
 
 
-static void       gimp_pattern_finalize        (GObject       *object);
+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 const gchar * gimp_pattern_get_extension   (GimpData      *data);
+static GimpData    * gimp_pattern_duplicate       (GimpData      *data);
 
 
 G_DEFINE_TYPE (GimpPattern, gimp_pattern, GIMP_TYPE_DATA)
@@ -160,7 +161,7 @@
                           pattern->mask->height);
 }
 
-static gchar *
+static const gchar *
 gimp_pattern_get_extension (GimpData *data)
 {
   return GIMP_PATTERN_FILE_EXTENSION;

Modified: branches/soc-2008-text/app/core/gimptemplate.c
==============================================================================
--- branches/soc-2008-text/app/core/gimptemplate.c	(original)
+++ branches/soc-2008-text/app/core/gimptemplate.c	Thu Oct  2 16:23:25 2008
@@ -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,

Modified: branches/soc-2008-text/app/core/gimptemplate.h
==============================================================================
--- branches/soc-2008-text/app/core/gimptemplate.h	(original)
+++ branches/soc-2008-text/app/core/gimptemplate.h	Thu Oct  2 16:23:25 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-text/app/dialogs/about-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/about-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/about-dialog.c	Thu Oct  2 16:23:25 2008
@@ -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);
 

Modified: branches/soc-2008-text/app/dialogs/authors.xsl
==============================================================================
--- branches/soc-2008-text/app/dialogs/authors.xsl	(original)
+++ branches/soc-2008-text/app/dialogs/authors.xsl	Thu Oct  2 16:23:25 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-text/app/dialogs/dialogs.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/dialogs.c	(original)
+++ branches/soc-2008-text/app/dialogs/dialogs.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/dialogs/image-new-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/image-new-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/image-new-dialog.c	Thu Oct  2 16:23:25 2008
@@ -245,6 +245,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-text/app/dialogs/keyboard-shortcuts-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/keyboard-shortcuts-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/keyboard-shortcuts-dialog.c	Thu Oct  2 16:23:25 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-text/app/dialogs/tips-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/tips-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/tips-dialog.c	Thu Oct  2 16:23:25 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-text/app/display/display-enums.c
==============================================================================
--- branches/soc-2008-text/app/display/display-enums.c	(original)
+++ branches/soc-2008-text/app/display/display-enums.c	Thu Oct  2 16:23:25 2008
@@ -158,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-text/app/display/display-enums.h
==============================================================================
--- branches/soc-2008-text/app/display/display-enums.h	(original)
+++ branches/soc-2008-text/app/display/display-enums.h	Thu Oct  2 16:23:25 2008
@@ -81,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-text/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.c	Thu Oct  2 16:23:25 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);
@@ -1016,11 +1047,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:

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-dnd.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-dnd.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-dnd.c	Thu Oct  2 16:23:25 2008
@@ -33,6 +33,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 +157,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 +197,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 +209,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,23 +249,14 @@
 
   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);
 
@@ -224,6 +266,9 @@
 
       gimp_display_shell_dnd_flush (shell, image);
     }
+
+  if (new_image)
+    gimp_image_undo_enable (image);
 }
 
 static void
@@ -515,8 +560,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,14 +569,7 @@
       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_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_display_shell_dnd_position_item (shell, new_item);
 
       gimp_image_add_layer (dest_image, new_layer, -1);
 
@@ -550,43 +586,62 @@
                                 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);
-
-      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);
+      if (! new_image)
+        gimp_display_shell_dnd_position_item (shell, new_item);
 
       gimp_image_add_layer (image, new_layer, -1);
 
@@ -594,4 +649,7 @@
 
       gimp_display_shell_dnd_flush (shell, image);
     }
+
+  if (new_image)
+    gimp_image_undo_enable (image);
 }

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/display/gimpdisplayshell-scale.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-scale.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-scale.c	Thu Oct  2 16:23:25 2008
@@ -70,7 +70,8 @@
                                                           gdouble           new_scale,
                                                           gdouble           current_scale,
                                                           gint             *x,
-                                                          gint             *y);
+                                                          gint             *y,
+                                                          GimpZoomFocus     zoom_focus);
 
 static gdouble   img2real                                (GimpDisplayShell *shell,
                                                           gboolean          xdir,
@@ -334,7 +335,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 +377,8 @@
                                                    real_new_scale,
                                                    current_scale,
                                                    &x,
-                                                   &y);
+                                                   &y,
+                                                   zoom_focus);
 
           gimp_display_shell_scale_to (shell, real_new_scale, x, y);
 
@@ -438,7 +441,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 +517,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);
 }
 
@@ -883,7 +894,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;
@@ -949,23 +961,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;
+
+    case GIMP_ZOOM_FOCUS_BEST_GUESS:
+    default:
+      {
+        gboolean within_horizontally, within_vertically;
+        gboolean stops_horizontally, stops_vertically;
 
-    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);
+        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;
-  }
+        *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-text/app/display/gimpdisplayshell-scale.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-scale.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-scale.h	Thu Oct  2 16:23:25 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-text/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-scroll.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-scroll.c	Thu Oct  2 16:23:25 2008
@@ -405,7 +405,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);

Modified: branches/soc-2008-text/app/display/gimpdisplayshell.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell.c	Thu Oct  2 16:23:25 2008
@@ -173,9 +173,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 +343,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 +827,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;

Modified: branches/soc-2008-text/app/display/gimpnavigationeditor.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpnavigationeditor.c	(original)
+++ branches/soc-2008-text/app/display/gimpnavigationeditor.c	Thu Oct  2 16:23:25 2008
@@ -278,7 +278,7 @@
     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;
@@ -534,7 +534,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);
     }
 }
 
@@ -588,8 +591,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-text/app/display/gimpstatusbar.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpstatusbar.c	(original)
+++ branches/soc-2008-text/app/display/gimpstatusbar.c	Thu Oct  2 16:23:25 2008
@@ -1386,7 +1386,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-text/app/gegl/gimpbrightnesscontrastconfig.c
==============================================================================
--- branches/soc-2008-text/app/gegl/gimpbrightnesscontrastconfig.c	(original)
+++ branches/soc-2008-text/app/gegl/gimpbrightnesscontrastconfig.c	Thu Oct  2 16:23:25 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-text/app/gegl/gimpcurvesconfig.c
==============================================================================
--- branches/soc-2008-text/app/gegl/gimpcurvesconfig.c	(original)
+++ branches/soc-2008-text/app/gegl/gimpcurvesconfig.c	Thu Oct  2 16:23:25 2008
@@ -21,8 +21,6 @@
 
 #include "config.h"
 
-#include <string.h>
-
 #include <gegl.h>
 #include <glib/gstdio.h>
 
@@ -207,14 +205,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 +332,6 @@
                         flags);
     }
 
-  g_object_notify (G_OBJECT (dest), "curve");
-
   dest_config->channel = src_config->channel;
 
   g_object_notify (G_OBJECT (dest), "channel");

Modified: branches/soc-2008-text/app/gegl/gimplevelsconfig.c
==============================================================================
--- branches/soc-2008-text/app/gegl/gimplevelsconfig.c	(original)
+++ branches/soc-2008-text/app/gegl/gimplevelsconfig.c	Thu Oct  2 16:23:25 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-text/app/gegl/gimpoperationhuesaturation.c
==============================================================================
--- branches/soc-2008-text/app/gegl/gimpoperationhuesaturation.c	(original)
+++ branches/soc-2008-text/app/gegl/gimpoperationhuesaturation.c	Thu Oct  2 16:23:25 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-text/app/gimp-log.c
==============================================================================
--- branches/soc-2008-text/app/gimp-log.c	(original)
+++ branches/soc-2008-text/app/gimp-log.c	Thu Oct  2 16:23:25 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-text/app/gimp-log.h
==============================================================================
--- branches/soc-2008-text/app/gimp-log.h	(original)
+++ branches/soc-2008-text/app/gimp-log.h	Thu Oct  2 16:23:25 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-text/app/gui/gimpdbusservice.c
==============================================================================
--- branches/soc-2008-text/app/gui/gimpdbusservice.c	(original)
+++ branches/soc-2008-text/app/gui/gimpdbusservice.c	Thu Oct  2 16:23:25 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-text/app/gui/gui-unique.c
==============================================================================
--- branches/soc-2008-text/app/gui/gui-unique.c	(original)
+++ branches/soc-2008-text/app/gui/gui-unique.c	Thu Oct  2 16:23:25 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-text/app/gui/gui.c
==============================================================================
--- branches/soc-2008-text/app/gui/gui.c	(original)
+++ branches/soc-2008-text/app/gui/gui.c	Thu Oct  2 16:23:25 2008
@@ -192,6 +192,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 +203,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 +514,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-text/app/gui/splash.c
==============================================================================
--- branches/soc-2008-text/app/gui/splash.c	(original)
+++ branches/soc-2008-text/app/gui/splash.c	Thu Oct  2 16:23:25 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-text/app/menus/menus.c
==============================================================================
--- branches/soc-2008-text/app/menus/menus.c	(original)
+++ branches/soc-2008-text/app/menus/menus.c	Thu Oct  2 16:23:25 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-text/app/menus/windows-menu.c
==============================================================================
--- branches/soc-2008-text/app/menus/windows-menu.c	(original)
+++ branches/soc-2008-text/app/menus/windows-menu.c	Thu Oct  2 16:23:25 2008
@@ -27,6 +27,7 @@
 #include "config/gimpguiconfig.h"
 
 #include "core/gimp.h"
+#include "core/gimpimage.h"
 #include "core/gimplist.h"
 #include "core/gimpviewable.h"
 
@@ -66,6 +67,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 +189,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 +212,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 +353,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-text/app/paint-funcs/scale-region.c
==============================================================================
--- branches/soc-2008-text/app/paint-funcs/scale-region.c	(original)
+++ branches/soc-2008-text/app/paint-funcs/scale-region.c	Thu Oct  2 16:23:25 2008
@@ -34,6 +34,8 @@
 #include "paint-funcs.h"
 #include "scale-region.h"
 
+#include "gimp-log.h"
+
 
 #define NUM_TILES(w,h) ((((w) + (TILE_WIDTH - 1)) / TILE_WIDTH) *  \
                         (((h) + (TILE_HEIGHT - 1)) / TILE_HEIGHT))
@@ -62,34 +64,60 @@
                                                 gpointer               progress_data,
                                                 gint                  *progress,
                                                 gint                   max_progress);
-static void           interpolate_nearest      (TileManager   *srcTM,
+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 gdouble  xfrac,
-                                                const gdouble  yfrac,
+                                                const gint     bytes,
                                                 guchar        *pixel);
-static void           interpolate_bilinear     (PixelSurround *surround,
+static void           decimate_average_y       (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,
+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,
-                                                const gint     bytes,
                                                 guchar        *pixel);
-static void           decimate_gauss           (PixelSurround *surround,
+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           decimate_average         (PixelSurround *surround,
+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);
@@ -109,29 +137,6 @@
                                                 const gdouble  xfrac,
                                                 const gdouble  yfrac,
                                                 guchar        *pixel);
-static inline void    gaussian_lanczos2        (const guchar  *src,
-                                                const gint     x,
-                                                const gint     y,
-                                                const gint     bytes,
-                                                const gint     stride,
-                                                guchar        *pixel);
-static inline void    decimate_lanczos2        (PixelSurround *surround,
-                                                const gint     x0,
-                                                const gint     y0,
-                                                const gint     bytes,
-                                                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    gaussian_decimate        (const guchar  *src,
-                                                const gint     x,
-                                                const gint     y,
-                                                const gint     bytes,
-                                                const gint     stride,
-                                                guchar        *pixel);
 static inline gdouble cubic_spline_fit         (const gdouble  dx,
                                                 const gdouble  x1,
                                                 const gdouble  y1,
@@ -223,14 +228,14 @@
       *levely -= 1;
     }
 
-  while (scalex < 0.5)
+  while (scalex < 0.5 && width > 1)
     {
       scalex  *= 2;
       width   /= 2;
       *levelx += 1;
     }
 
-  while (scaley < 0.5)
+  while (scaley < 0.5 && height > 1)
     {
       scaley  *= 2;
       height  *= 2;
@@ -330,7 +335,11 @@
   gint         levely       = 0;
 
   /* determine scaling levels */
-  scale_determine_levels (srcPR, dstPR, &levelx, &levely);
+  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)
@@ -392,8 +401,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);
@@ -408,8 +417,8 @@
       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);
@@ -423,8 +432,8 @@
       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);
@@ -459,16 +468,17 @@
   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 (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;
-  const gboolean  decimate   = (src_width  == 2 * dst_width ||
-                                src_height == 2 * dst_height);
   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)
     {
@@ -537,28 +547,19 @@
                   break;
 
                 case GIMP_INTERPOLATION_LINEAR:
-                  if (decimate)
-                    decimate_average (surround, sx0, sy0, bytes, pixel);
-                  else
-                    interpolate_bilinear (surround,
-                                          sx0, sy0, xfrac, yfrac, bytes, pixel);
+                  interpolate_bilinear (surround,
+                                        sx0, sy0, xfrac, yfrac, bytes, pixel);
                   break;
 
                 case GIMP_INTERPOLATION_CUBIC:
-                  if (decimate)
-                    decimate_gauss (surround, sx0, sy0, bytes, pixel);
-                  else
-                    interpolate_cubic (surround,
-                                       sx0, sy0, xfrac, yfrac, bytes, pixel);
+                  interpolate_cubic (surround,
+                                     sx0, sy0, xfrac, yfrac, bytes, pixel);
                   break;
 
                 case GIMP_INTERPOLATION_LANCZOS:
-                  if (decimate)
-                    decimate_lanczos2 (surround, sx0, sy0, bytes, pixel);
-                  else
-                    interpolate_lanczos3 (surround,
-                                          sx0, sy0, xfrac, yfrac, bytes, pixel,
-                                          kernel_lookup);
+                  interpolate_lanczos3 (surround,
+                                        sx0, sy0, xfrac, yfrac, bytes, pixel,
+                                        kernel_lookup);
                   break;
                 }
 
@@ -584,13 +585,195 @@
     pixel_surround_destroy (surround);
 }
 
+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;
+
+          for (x = region.x; x < x1; x++)
+            {
+              decimate_average_xy (surround, x * 2, sy, bytes, pixel);
+
+              pixel += region.bytes;
+            }
+
+          row += region.rowstride;
+        }
+
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 16 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
+        }
+    }
+
+  pixel_surround_destroy (surround);
+}
+
+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;
+
+      for (y = region.y; y < y1; y++)
+        {
+          guchar *pixel = row;
+          gint    x;
+
+          for (x = region.x; x < x1; x++)
+            {
+              decimate_average_x (surround, x * 2, y, bytes, pixel);
+
+              pixel += region.bytes;
+            }
+
+          row += region.rowstride;
+        }
+
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 32 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
+        }
+    }
+
+  pixel_surround_destroy (surround);
+}
+
+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;
+
+          for (x = region.x; x < x1; x++)
+            {
+              decimate_average_y (surround, x, sy, bytes, pixel);
+
+              pixel += region.bytes;
+            }
+
+          row += region.rowstride;
+        }
+
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 32 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
+        }
+    }
+
+  pixel_surround_destroy (surround);
+}
+
 static void inline
-pixel_average (const guchar *p1,
-               const guchar *p2,
-               const guchar *p3,
-               const guchar *p4,
-               guchar       *p,
-               const gint    bytes)
+pixel_average4 (const guchar *p1,
+                const guchar *p2,
+                const guchar *p3,
+                const guchar *p4,
+                guchar       *p,
+                const gint    bytes)
 {
   switch (bytes)
     {
@@ -668,276 +851,118 @@
     }
 }
 
-static void
-decimate_gauss (PixelSurround *surround,
-                const gint     x0,
-                const gint     y0,
-                const gint     bytes,
-                guchar        *pixel)
+static void inline
+pixel_average2 (const guchar *p1,
+                const guchar *p2,
+                guchar       *p,
+                const gint    bytes)
 {
-  gint          stride;
-  const guchar *src = pixel_surround_lock (surround, x0 - 1, y0 - 1, &stride);
-  guchar        pixel1[4];
-  guchar        pixel2[4];
-  guchar        pixel3[4];
-  guchar        pixel4[4];
-
-  gaussian_decimate (src, 0, 0, bytes, stride, pixel1);
-  gaussian_decimate (src, 1, 0, bytes, stride, pixel2);
-  gaussian_decimate (src, 0, 1, bytes, stride, pixel3);
-  gaussian_decimate (src, 1, 1, bytes, stride, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, bytes);
-}
-
-static inline void
-gaussian_decimate (const guchar *src,
-                   const gint    x,
-                   const gint    y,
-                   const gint    bytes,
-                   const gint    stride,
-                   guchar       *pixel)
-{
-  const guchar *s0 = src + x * bytes + y * stride;
-  const guchar *s1 = s0 + stride;
-  const guchar *s2 = s1 + stride;
-  guint         sum;
-  guint         alphasum;
-  gint          b;
-
   switch (bytes)
     {
     case 1:
-      sum  = (s0[0]     + s0[1] * 2 + s0[2]     +
-              s1[0] * 2 + s1[1] * 4 + s1[2] * 2 +
-              s2[0]     + s2[1] * 2 + s2[2]);
-
-      pixel[0] = (sum + 8) >> 4;
+      p[0] = (p1[0] + p2[0] + 1) >> 1;
       break;
 
     case 2:
-      alphasum = (s0[1]     + s0[3] * 2 + s0[5]     +
-                  s1[1] * 2 + s1[3] * 4 + s1[5] * 2 +
-                  s2[1]     + s2[3] * 2 + s2[5]);
+      {
+        guint a = p1[1] + p2[1];
 
-      if (alphasum > 0)
-        {
-          sum = (s0[0] * s0[1]     + s0[2] * s0[3] * 2 + s0[4] * s0[5]     +
-                 s1[0] * s1[1] * 2 + s1[2] * s1[3] * 4 + s1[4] * s1[5] * 2 +
-                 s2[0] * s2[1]     + s2[2] * s2[3] * 2 + s2[4] * s2[5]);
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = 0;
+            break;
 
-          pixel[0] = (sum + (alphasum >> 1)) / alphasum;
-          pixel[1] = (alphasum + 8) >> 4;
-        }
-      else
-        {
-          pixel[0] = pixel[1] = 0;
-        }
+          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 = (s0[b]     + s0[3 + b] * 2 + s0[6 + b]     +
-                 s1[b] * 2 + s1[3 + b] * 4 + s1[6 + b] * 2 +
-                 s2[b]     + s2[3 + b] * 2 + s2[6 + b]);
-
-          pixel[b] = (sum + 8) >> 4;
-        }
+      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  = (s0[3]     + s0[7] * 2 + s0[11]     +
-                   s1[3] * 2 + s1[7] * 4 + s1[11] * 2 +
-                   s2[3]     + s2[7] * 2 + s2[11]);
+      {
+        guint a = p1[3] + p2[3];
 
-      if (alphasum > 0)
-        {
-          for (b = 0; b < 3; b++)
-            {
-              sum = (s0[b] * s0[3]     + s0[4 + b] * s0[7] * 2 + s0[8 + b] * s0[11]     +
-                     s1[b] * s1[3] * 2 + s1[4 + b] * s1[7] * 4 + s1[8 + b] * s1[11] * 2 +
-                     s2[b] * s2[3]     + s2[4 + b] * s2[7] * 2 + s2[8 + b] * s2[11]);
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = p[2] = p[3] = 0;
+            break;
 
-              pixel[b] = (sum + (alphasum >> 1)) / alphasum;
-            }
+          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;
 
-          pixel[3] = (alphasum + 8) >> 4;
-        }
-      else
-        {
-          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
-        }
+          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 inline void
-decimate_lanczos2 (PixelSurround *surround,
-                   const gint     x0,
-                   const gint     y0,
-                   const gint     bytes,
-                   guchar        *pixel)
+static void
+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 - 2, y0 - 2, &stride);
-  guchar        pixel1[4];
-  guchar        pixel2[4];
-  guchar        pixel3[4];
-  guchar        pixel4[4];
-
-  gaussian_lanczos2 (src, 0, 0, bytes, stride, pixel1);
-  gaussian_lanczos2 (src, 1, 0, bytes, stride, pixel2);
-  gaussian_lanczos2 (src, 0, 1, bytes, stride, pixel3);
-  gaussian_lanczos2 (src, 1, 1, bytes, stride, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, bytes);
-}
-
-static inline void
-gaussian_lanczos2 (const guchar *src,
-                   const gint    x,
-                   const gint    y,
-                   const gint    bytes,
-                   const gint    stride,
-                   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 *s0 = src + x * bytes + y * stride;
-  const guchar *s1 = s0 + stride;
-  const guchar *s2 = s1 + stride;
-  const guchar *s3 = s2 + stride;
-  const guchar *s4 = s3 + stride;
-  gdouble       sum;
-  gdouble       alphasum;
-  gdouble       alpha;
-  gint          b;
-
-  switch (bytes)
-    {
-    case 1:
-      sum  = s0[0]       + s0[1] *  -9 + s0[2] * -16 + s0[3] *  -9 + s0[4];
-      sum += s1[0] *  -9 + s1[1] *  81 + s1[2] * 144 + s1[3] *  81 + s1[4] * -9;
-      sum += s2[0] * -16 + s2[1] * 144 + s2[2] * 256 + s2[3] * 144 + s2[4] * -16;
-      sum += s3[0] *  -9 + s3[1] *  81 + s3[2] * 144 + s3[3] *  81 + s3[4] * -9;
-      sum += s4[0]       + s4[1] *  -9 + s4[2] * -16 + s4[3] *  -9 + s4[4];
-
-      sum /= 1024;
-
-      pixel[0] = CLAMP (sum, 0, 255);
-      break;
-
-    case 2:
-      alphasum =  s0[1]       + s0[3] *  -9 + s0[5] * -16 + s0[7] *  -9 + s0[9];
-      alphasum += s1[1] *  -9 + s1[3] *  81 + s1[5] * 144 + s1[7] *  81 + s1[9] * -9;
-      alphasum += s2[1] * -16 + s2[3] * 144 + s2[5] * 256 + s2[7] * 144 + s2[9] * -16;
-      alphasum += s3[1] *  -9 + s3[3] *  81 + s3[5] * 144 + s3[7] *  81 + s3[9] * -9;
-      alphasum += s4[1]       + s4[3] *  -9 + s4[5] * -16 + s4[7] *  -9 + s4[9];
-
-      if (alphasum > 0)
-        {
-          sum =  (s0[0] * s0[1]       + s0[2] * s0[3] *  -9 +
-                  s0[4] * s0[5] * -16 + s0[6] * s0[7] *  -9 + s0[8] * s0[9]);
-          sum += (s1[0] * s1[1] *  -9 + s1[2] * s1[3] *  81 +
-                  s1[4] * s1[5] * 144 + s1[6] * s1[7] *  81 + s1[8] * s1[9] * -9);
-          sum += (s2[0] * s2[1] * -16 + s2[2] * s2[3] * 144 +
-                  s2[4] * s2[5] * 256 + s2[6] * s2[7] * 144 + s2[8] * s2[9] * -16);
-          sum += (s3[0] * s3[1] *  -9 + s3[2] * s3[3] *  81 +
-                  s3[4] * s3[5] * 144 + s3[6] * s3[7] *  81 + s3[8] * s3[9] * -9);
-          sum += (s4[0] * s4[1] +       s4[2] * s4[3] *  -9 +
-                  s4[4] * s4[5] * -16 + s4[6] * s4[7] *  -9 + s4[8] * s4[9]);
-
-          sum /= alphasum;
-          alpha = alphasum / 1024;
-
-          pixel[0] = CLAMP (sum, 0, 255);
-          pixel[1] = CLAMP (alpha, 0, 255);
-        }
-      else
-        {
-          pixel[0] = pixel[1] = 0;
-        }
-      break;
-
-    case 3:
-      for (b = 0; b < 3; b++)
-        {
-          sum =  s0[b]       + s0[3 + b] *  -9 + s0[6 + b] * -16 + s0[9 + b] *  -9 + s0[12 + b];
-          sum += s1[b] *  -9 + s1[3 + b] *  81 + s1[6 + b] * 144 + s1[9 + b] *  81 + s1[12 + b] * -9;
-          sum += s2[b] * -16 + s2[3 + b] * 144 + s2[6 + b] * 256 + s2[9 + b] * 144 + s2[12 + b] * -16;
-          sum += s3[b] *  -9 + s3[3 + b] *  81 + s3[6 + b] * 144 + s3[9 + b] *  81 + s3[12 + b] * -9;
-          sum += s4[b]       + s4[3 + b] *  -9 + s4[6 + b] * -16 + s4[9 + b] *  -9 + s4[12 + b];
-
-          sum /= 1024;
-
-          pixel[b] = CLAMP (sum, 0, 255);
-        }
-      break;
-
-    case 4:
-      alphasum =  s0[3]       + s0[7] *  -9 + s0[11] * -16 + s0[15] *  -9 + s0[19];
-      alphasum += s1[3] *  -9 + s1[7] *  81 + s1[11] * 144 + s1[15] *  81 + s1[19] * -9;
-      alphasum += s2[3] * -16 + s2[7] * 144 + s2[11] * 256 + s2[15] * 144 + s2[19] * -16;
-      alphasum += s3[3] * -9  + s3[7] *  81 + s3[11] * 144 + s3[15] *  81 + s3[19] * -9;
-      alphasum += s4[3]       + s4[7] *  -9 + s4[11] * -16 + s4[15] *  -9 + s4[19];
-
-      if (alphasum > 0)
-        {
-          for (b = 0; b < 3; b++)
-            {
-              sum =  (s0[0  + b] * s0[3]        + s0[ 4 + b] * s0[ 7] * -9 +
-                      s0[8  + b] * s0[11] * -16 + s0[12 + b] * s0[15] * -9 +
-                      s0[16 + b] * s0[19]);
-              sum += (s1[0  + b] * s1[3]  *  -9 + s1[ 4 + b] * s1[ 7] * 81 +
-                      s1[8  + b] * s1[11] * 144 + s1[12 + b] * s1[15] * 81 +
-                      s1[16 + b] * s1[19] * -9);
-              sum += (s2[0  + b] * s2[3]  * -16 + s2[ 4 + b] * s2[ 7] * 144 +
-                      s2[8  + b] * s2[11] * 256 + s2[12 + b] * s2[15] * 144 +
-                      s2[16 + b] * s2[19] * -16);
-              sum += (s3[0  + b] * s3[3]  * -9  + s3[ 4 + b] * s3[ 7] * 81 +
-                      s3[8  + b] * s3[11] * 144 + s3[12 + b] * s3[15] * 81 +
-                      s3[16 + b] * s3[19] * -9);
-              sum += (s4[0  + b] * s4[3]        + s4[ 4 + b] * s4[7]  * -9 +
-                      s4[8  + b] * s4[11] * -16 + s4[12 + b] * s4[15] * -9 +
-                      s4[16 + b] * s4[19]);
-
-              sum /= alphasum;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
 
-              pixel[b] = CLAMP (sum, 0, 255);
-            }
+  pixel_average4 (src, src + bytes, src + stride, src + stride + bytes,
+                  pixel, bytes);
+}
 
-          alpha = alphasum / 1024;
+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[3] = CLAMP (alpha, 0, 255);
-        }
-      else
-        {
-          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
-        }
-      break;
-    }
+  pixel_average2 (src, src + bytes, pixel, bytes);
 }
 
 static void
-decimate_average (PixelSurround *surround,
-                  const gint     x0,
-                  const gint     y0,
-                  const gint     bytes,
-                  guchar        *pixel)
+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 (src, src + bytes, src + stride, src + stride + bytes,
-                 pixel, bytes);
+  pixel_average2 (src, src + stride, pixel, bytes);
 }
 
 static inline gdouble

Modified: branches/soc-2008-text/app/paint/gimpbrushcore.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimpbrushcore.c	(original)
+++ branches/soc-2008-text/app/paint/gimpbrushcore.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/paint/gimppaintcore-stroke.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimppaintcore-stroke.c	(original)
+++ branches/soc-2008-text/app/paint/gimppaintcore-stroke.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/pdb/drawable-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/drawable-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/drawable-cmds.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/pdb/gimppdb-utils.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gimppdb-utils.c	(original)
+++ branches/soc-2008-text/app/pdb/gimppdb-utils.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/pdb/gimppdb-utils.h
==============================================================================
--- branches/soc-2008-text/app/pdb/gimppdb-utils.h	(original)
+++ branches/soc-2008-text/app/pdb/gimppdb-utils.h	Thu Oct  2 16:23:25 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-text/app/pdb/image-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/image-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/image-cmds.c	Thu Oct  2 16:23:25 2008
@@ -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,7 +910,7 @@
 
   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))
@@ -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);
+      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,7 +1103,7 @@
 
   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));
         }
@@ -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);
+      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,7 +1245,7 @@
 
   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));
         }
@@ -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);
+      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-text/app/pdb/internal-procs.c
==============================================================================
--- branches/soc-2008-text/app/pdb/internal-procs.c	(original)
+++ branches/soc-2008-text/app/pdb/internal-procs.c	Thu Oct  2 16:23:25 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 591 procedures registered total */
+/* 593 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)

Modified: branches/soc-2008-text/app/pdb/layer-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/layer-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/layer-cmds.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/pdb/paths-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/paths-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/paths-cmds.c	Thu Oct  2 16:23:25 2008
@@ -303,7 +303,7 @@
           g_free (points);
 
           if (vectors)
-            gimp_image_add_vectors (image, vectors, 0);
+            success = gimp_image_add_vectors (image, vectors, 0);
           else
             success = FALSE;
         }

Modified: branches/soc-2008-text/app/pdb/selection-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/selection-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/selection-cmds.c	Thu Oct  2 16:23:25 2008
@@ -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-text/app/plug-in/gimpplugin.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimpplugin.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimpplugin.c	Thu Oct  2 16:23:25 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      |

Modified: branches/soc-2008-text/app/plug-in/gimpplugindebug.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimpplugindebug.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimpplugindebug.c	Thu Oct  2 16:23:25 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-text/app/plug-in/gimpplugindebug.h
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimpplugindebug.h	(original)
+++ branches/soc-2008-text/app/plug-in/gimpplugindebug.h	Thu Oct  2 16:23:25 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-text/app/plug-in/gimppluginprocedure.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginprocedure.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginprocedure.c	Thu Oct  2 16:23:25 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:

Modified: branches/soc-2008-text/app/plug-in/gimppluginshm.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginshm.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginshm.c	Thu Oct  2 16:23:25 2008
@@ -60,10 +60,6 @@
 
 #define USE_WIN32_SHM 1
 
-#ifndef INVALID_FILE_HANDLE
-#define INVALID_FILE_HANDLE ((HANDLE) 0xFFFFFFFF)
-#endif
-
 #endif /* G_OS_WIN32 || G_WITH_CYGWIN */
 
 #include "plug-in-types.h"
@@ -146,7 +142,7 @@
     g_snprintf (fileMapName, sizeof (fileMapName), "GIMP%d.SHM", pid);
 
     /* Create the file mapping into paging space */
-    shm->shm_handle = CreateFileMapping (INVALID_FILE_HANDLE, NULL,
+    shm->shm_handle = CreateFileMapping (INVALID_HANDLE_VALUE, NULL,
                                          PAGE_READWRITE, 0,
                                          TILE_MAP_SIZE,
                                          fileMapName);

Modified: branches/soc-2008-text/app/plug-in/plug-in-menu-path.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/plug-in-menu-path.c	(original)
+++ branches/soc-2008-text/app/plug-in/plug-in-menu-path.c	Thu Oct  2 16:23:25 2008
@@ -43,27 +43,28 @@
 
 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"         },
+  { "<Image>/File/Acquire",           NULL, "<Image>/File/Create/Acquire"         },
+  { "<Image>/File/New",               NULL, "<Image>/File/Create"                 },
+  { NULL, NULL, NULL                                                              }
 };
 
 

Modified: branches/soc-2008-text/app/tools/gimpcolorbalancetool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcolorbalancetool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpcolorbalancetool.c	Thu Oct  2 16:23:25 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-text/app/tools/gimpcroptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcroptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpcroptool.c	Thu Oct  2 16:23:25 2008
@@ -338,7 +338,7 @@
  * gimp_crop_tool_rectangle_change_complete:
  * @rectangle:
  *
- * Returns: 
+ * Returns:
  **/
 static gboolean
 gimp_crop_tool_rectangle_change_complete (GimpRectangleTool *rectangle)

Modified: branches/soc-2008-text/app/tools/gimpcurvestool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcurvestool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpcurvestool.c	Thu Oct  2 16:23:25 2008
@@ -566,13 +566,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);
+        }
     }
 }
 

Modified: branches/soc-2008-text/app/tools/gimpgegltool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpgegltool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpgegltool.c	Thu Oct  2 16:23:25 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"
+  };
+  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);
@@ -628,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-text/app/tools/gimphuesaturationtool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimphuesaturationtool.c	(original)
+++ branches/soc-2008-text/app/tools/gimphuesaturationtool.c	Thu Oct  2 16:23:25 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-text/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpimagemaptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpimagemaptool.c	Thu Oct  2 16:23:25 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-text/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimpimagemaptool.h	(original)
+++ branches/soc-2008-text/app/tools/gimpimagemaptool.h	Thu Oct  2 16:23:25 2008
@@ -43,6 +43,7 @@
 
   GeglNode              *operation;
   GObject               *config;
+  GObject               *default_config;
   GimpImageMapApplyFunc  apply_func;
   gpointer               apply_data;
 

Modified: branches/soc-2008-text/app/tools/gimplevelstool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimplevelstool.c	(original)
+++ branches/soc-2008-text/app/tools/gimplevelstool.c	Thu Oct  2 16:23:25 2008
@@ -698,14 +698,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

Modified: branches/soc-2008-text/app/tools/gimprectangleselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimprectangleselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimprectangleselecttool.c	Thu Oct  2 16:23:25 2008
@@ -135,6 +135,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);
@@ -426,15 +428,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);
 
@@ -453,6 +449,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);
     }
@@ -582,18 +580,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;
 
@@ -606,11 +600,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,
@@ -667,6 +659,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:
@@ -785,14 +792,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-text/app/tools/gimprectangletool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimprectangletool.c	(original)
+++ branches/soc-2008-text/app/tools/gimprectangletool.c	Thu Oct  2 16:23:25 2008
@@ -1094,7 +1094,7 @@
           aspect_text = g_strdup_printf ("  (%.2f:1)", w / (gdouble) h);
 
           gimp_tool_push_status_coords (tool, display,
-                                        GIMP_CURSOR_PRECISION_PIXEL_CENTER,
+                                        GIMP_CURSOR_PRECISION_PIXEL_BORDER,
                                         _("Rectangle: "),
                                         w, " Ã ", h, aspect_text);
           g_free (aspect_text);
@@ -1990,7 +1990,7 @@
 
   /* initialize the statusbar display */
   gimp_tool_push_status_coords (tool, tool->display,
-                                GIMP_CURSOR_PRECISION_PIXEL_CENTER,
+                                GIMP_CURSOR_PRECISION_PIXEL_BORDER,
                                 _("Rectangle: "), 0, " Ã ", 0, NULL);
 
   gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), tool->display);

Modified: branches/soc-2008-text/app/tools/gimptexttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptexttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimptexttool.c	Thu Oct  2 16:23:25 2008
@@ -204,7 +204,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"),
@@ -1029,6 +1031,26 @@
                                       GIMP_ITEM (text_tool->layer));
       text_tool->handle_rectangle_change_complete = TRUE;
     }
+
+  /* if the text has changed, (probably because of an undo), we put
+     the new text into the text buffer */
+  if (strcmp (pspec->name, "text") == 0)
+    {
+      g_signal_handlers_block_by_func (text_tool->proxy,
+                                       gimp_text_tool_text_buffer_changed,
+                                       text_tool);
+
+      gtk_text_buffer_set_text (text_tool->text_buffer, text->text, -1);
+
+      g_signal_handlers_unblock_by_func (text_tool->proxy,
+                                         gimp_text_tool_text_buffer_changed,
+                                         text_tool);
+
+      /* force change of cursor and selection display */
+      gimp_text_tool_update_layout (text_tool);
+/*       gimp_text_tool_update_proxy (text_tool); */
+      return;
+    }
 }
 
 static gboolean
@@ -1739,7 +1761,7 @@
 
       text_tool->text_box_fixed = TRUE;
 
-      if (! text || ! text->text || (text->text[0] == NULL))
+      if (! text || ! text->text || (text->text[0] == 0))
         {
           /*
            * we can't set properties for the text layer, because
@@ -1929,6 +1951,7 @@
   layout = text_tool->layout->layout;
   line_iter = pango_layout_get_iter (layout);
   i = 0;
+
   /* Invert the selected letters by inverting all
    * lines containing selected letters, then
    * invert the unselected letters on these lines
@@ -1988,27 +2011,26 @@
 static void
 gimp_text_tool_draw (GimpDrawTool *draw_tool)
 {
-  GimpTextTool   *text_tool = GIMP_TEXT_TOOL (draw_tool);
-  GimpTool   *tool = GIMP_TOOL (draw_tool);
-  GdkRectangle    cliprect;
-  gint            width, height;
-  gint            x1, x2, y1, y2;
-  GtkTextIter     start;
-
-  GValue value = { 0, };
-
+  GimpTextTool     *text_tool   = GIMP_TEXT_TOOL (draw_tool);
+  GimpTool         *tool        = GIMP_TOOL (draw_tool);
+  GimpDisplayShell *shell;
+  GdkRectangle      cliprect;
+  gint              width, height;
+  gint              x1, x2, y1, y2;
+  GtkTextIter       start;
 
-  g_value_init (&value, G_TYPE_BOOLEAN);
-  g_value_set_boolean (&value, TRUE);
-  g_object_set_property (G_OBJECT(text_tool), "narrow-mode",
-                                    &value);
+  g_object_set (text_tool,
+                "narrow-mode", TRUE,
+                NULL);
 
   gimp_rectangle_tool_draw (draw_tool);
 
   if (!text_tool->layer) return;
   if (!text_tool->layer->text) return;
-  /* There will be no layout if the function is called from the wrong place*/
-  if (!text_tool->layout) gimp_text_tool_update_layout (text_tool);
+
+  /* There will be no layout if the function is called from the wrong place */
+  if (! text_tool->layout)
+    gimp_text_tool_update_layout (text_tool);
 
   g_object_get (text_tool,
                 "x1", &x1,
@@ -2016,7 +2038,8 @@
                 "x2", &x2,
                 "y2", &y2,
                 NULL);
-  /*Turn on clipping for text-cursor and selections*/
+
+  /* Turn on clipping for text-cursor and selections */
   cliprect.x = x1;
   cliprect.width = x2 - x1;
   cliprect.y = y1;
@@ -2072,7 +2095,8 @@
       gimp_text_tool_draw_text_selection (draw_tool);
     }
   /* Turn off clipping when done*/
-  gimp_canvas_set_clip_rect (GIMP_CANVAS (GIMP_DISPLAY_SHELL (tool->display->shell)->canvas),
+  shell = GIMP_DISPLAY_SHELL (tool->display->shell);
+  gimp_canvas_set_clip_rect (GIMP_CANVAS (shell->canvas),
                              GIMP_CANVAS_STYLE_XOR, NULL);
 }
 
@@ -2137,17 +2161,21 @@
                                     gtk_text_buffer_get_insert (text_tool->text_buffer));
 
   if (gtk_text_buffer_get_has_selection (text_tool->text_buffer))
-    gtk_text_buffer_delete_selection (text_tool->text_buffer, TRUE, TRUE);
+    {
+      gtk_text_buffer_delete_selection (text_tool->text_buffer, TRUE, TRUE);
+    }
   else
     gtk_text_buffer_backspace (text_tool->text_buffer, &cursor, TRUE, TRUE);
 }
 
 static void
 gimp_text_tool_enter_text (GimpTextTool *text_tool,
-                           const gchar *str)
+                           const gchar  *str)
 {
   if (gtk_text_buffer_get_has_selection (text_tool->text_buffer))
-    gtk_text_buffer_delete_selection (text_tool->text_buffer, TRUE, TRUE);
+    {
+      gtk_text_buffer_delete_selection (text_tool->text_buffer, TRUE, TRUE);
+    }
   gtk_text_buffer_insert_at_cursor (text_tool->text_buffer, str, -1);
 }
 
@@ -2164,7 +2192,8 @@
                                      GtkTextMark   *mark,
                                      GimpTextTool  *text_tool)
 {
-  gimp_text_tool_update_proxy (text_tool);
+  gimp_text_tool_update_layout (text_tool);
+/*   gimp_text_tool_update_proxy (text_tool); */
 }
 
 static void
@@ -2173,7 +2202,7 @@
   GimpItem       *item;
   GimpImage      *image;
 
-  if (!text_tool->text)
+  if (! text_tool->text)
     {
       gimp_text_tool_update_proxy (text_tool);
       return;

Modified: branches/soc-2008-text/app/tools/gimptransformtool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptransformtool.c	(original)
+++ branches/soc-2008-text/app/tools/gimptransformtool.c	Thu Oct  2 16:23:25 2008
@@ -361,6 +361,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  */
@@ -487,9 +489,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;

Modified: branches/soc-2008-text/app/widgets/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/widgets/Makefile.am	(original)
+++ branches/soc-2008-text/app/widgets/Makefile.am	Thu Oct  2 16:23:25 2008
@@ -20,6 +20,8 @@
 	widgets-types.h			\
 	gimpaction.c			\
 	gimpaction.h			\
+	gimpactioneditor.c		\
+	gimpactioneditor.h		\
 	gimpactionfactory.c		\
 	gimpactionfactory.h		\
 	gimpactiongroup.c		\

Modified: branches/soc-2008-text/app/widgets/gimpactionview.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpactionview.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpactionview.c	Thu Oct  2 16:23:25 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-text/app/widgets/gimpactionview.h
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpactionview.h	(original)
+++ branches/soc-2008-text/app/widgets/gimpactionview.h	Thu Oct  2 16:23:25 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-text/app/widgets/gimpcontainertreeview.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpcontainertreeview.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpcontainertreeview.c	Thu Oct  2 16:23:25 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-text/app/widgets/gimpcontrollereditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpcontrollereditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpcontrollereditor.c	Thu Oct  2 16:23:25 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-text/app/widgets/gimpdialogfactory.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpdialogfactory.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpdialogfactory.c	Thu Oct  2 16:23:25 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-text/app/widgets/gimpdialogfactory.h
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpdialogfactory.h	(original)
+++ branches/soc-2008-text/app/widgets/gimpdialogfactory.h	Thu Oct  2 16:23:25 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-text/app/widgets/gimpdock.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpdock.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpdock.c	Thu Oct  2 16:23:25 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
@@ -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

Modified: branches/soc-2008-text/app/widgets/gimpdockable.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpdockable.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpdockable.c	Thu Oct  2 16:23:25 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);
 

Modified: branches/soc-2008-text/app/widgets/gimphelp-ids.h
==============================================================================
--- branches/soc-2008-text/app/widgets/gimphelp-ids.h	(original)
+++ branches/soc-2008-text/app/widgets/gimphelp-ids.h	Thu Oct  2 16:23:25 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-text/app/widgets/gimpnavigationview.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpnavigationview.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpnavigationview.c	Thu Oct  2 16:23:25 2008
@@ -90,6 +90,12 @@
 static void     gimp_navigation_view_transform      (GimpNavigationView *nav_view);
 static void     gimp_navigation_view_draw_marker    (GimpNavigationView *nav_view,
                                                      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)
@@ -201,43 +207,6 @@
   return TRUE;
 }
 
-static void
-gimp_navigation_view_get_ratio (const 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);
-}
-
-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);
-}
-
 void
 gimp_navigation_view_grab_pointer (GimpNavigationView *nav_view)
 {
@@ -465,6 +434,64 @@
   return FALSE;
 }
 
+
+/*  public functions  */
+
+void
+gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
+                                 gdouble             x,
+                                 gdouble             y,
+                                 gdouble             width,
+                                 gdouble             height)
+{
+  GimpView *view;
+
+  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
+
+  view = GIMP_VIEW (nav_view);
+
+  g_return_if_fail (view->renderer->viewable);
+
+  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);
+
+  /* Marker changed, redraw */
+  gtk_widget_queue_draw (GTK_WIDGET (view));
+}
+
+void
+gimp_navigation_view_set_motion_offset (GimpNavigationView *view,
+                                        gint                motion_offset_x,
+                                        gint                motion_offset_y)
+{
+  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+  view->motion_offset_x = motion_offset_x;
+  view->motion_offset_y = motion_offset_y;
+}
+
+void
+gimp_navigation_view_get_local_marker (GimpNavigationView *view,
+                                       gint               *x,
+                                       gint               *y,
+                                       gint               *width,
+                                       gint               *height)
+{
+  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+  if (x)      *x      = view->p_x;
+  if (y)      *y      = view->p_y;
+  if (width)  *width  = view->p_width;
+  if (height) *height = view->p_height;
+}
+
+
+/*  private functions  */
+
 static void
 gimp_navigation_view_transform (GimpNavigationView *nav_view)
 {
@@ -511,54 +538,39 @@
     }
 }
 
-void
-gimp_navigation_view_set_marker (GimpNavigationView *nav_view,
-                                 gdouble             x,
-                                 gdouble             y,
-                                 gdouble             width,
-                                 gdouble             height)
+static void
+gimp_navigation_view_move_to (GimpNavigationView *nav_view,
+                              gint                tx,
+                              gint                ty)
 {
-  GimpView *view;
-
-  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
-
-  view = GIMP_VIEW (nav_view);
+  GimpView  *view = GIMP_VIEW (nav_view);
+  gdouble    ratiox, ratioy;
+  gdouble    x, y;
 
-  g_return_if_fail (view->renderer->viewable);
+  if (! view->renderer->viewable)
+    return;
 
-  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_get_ratio (nav_view, &ratiox, &ratioy);
 
-  gimp_navigation_view_transform (nav_view);
+  x = tx / ratiox;
+  y = ty / ratioy;
 
-  /* Marker changed, invalidate */
-  gimp_view_renderer_invalidate (view->renderer);
+  g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
+                 x, y, nav_view->width, nav_view->height);
 }
 
-void
-gimp_navigation_view_set_motion_offset (GimpNavigationView *view,
-                                        gint                motion_offset_x,
-                                        gint                motion_offset_y)
+static void
+gimp_navigation_view_get_ratio (GimpNavigationView *nav_view,
+                                gdouble            *ratiox,
+                                gdouble            *ratioy)
 {
-  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
-
-  view->motion_offset_x = motion_offset_x;
-  view->motion_offset_y = motion_offset_y;
-}
+  GimpView  *view = GIMP_VIEW (nav_view);
+  GimpImage *image;
 
-void
-gimp_navigation_view_get_local_marker (GimpNavigationView *view,
-                                       gint               *x,
-                                       gint               *y,
-                                       gint               *width,
-                                       gint               *height)
-{
-  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+  image = GIMP_IMAGE (view->renderer->viewable);
 
-  if (x)      *x      = view->p_x;
-  if (y)      *y      = view->p_y;
-  if (width)  *width  = view->p_width;
-  if (height) *height = view->p_height;
+  *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-text/app/widgets/gimpwidgets-utils.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpwidgets-utils.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpwidgets-utils.c	Thu Oct  2 16:23:25 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-text/app/widgets/gimpwidgets-utils.h
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpwidgets-utils.h	(original)
+++ branches/soc-2008-text/app/widgets/gimpwidgets-utils.h	Thu Oct  2 16:23:25 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-text/app/widgets/gtkscalebutton.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gtkscalebutton.c	(original)
+++ branches/soc-2008-text/app/widgets/gtkscalebutton.c	Thu Oct  2 16:23:25 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-text/app/widgets/widgets-types.h
==============================================================================
--- branches/soc-2008-text/app/widgets/widgets-types.h	(original)
+++ branches/soc-2008-text/app/widgets/widgets-types.h	Thu Oct  2 16:23:25 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-text/app/xcf/xcf-load.c
==============================================================================
--- branches/soc-2008-text/app/xcf/xcf-load.c	(original)
+++ branches/soc-2008-text/app/xcf/xcf-load.c	Thu Oct  2 16:23:25 2008
@@ -1019,7 +1019,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... */

Modified: branches/soc-2008-text/authors.xml
==============================================================================
--- branches/soc-2008-text/authors.xml	(original)
+++ branches/soc-2008-text/authors.xml	Thu Oct  2 16:23:25 2008
@@ -16,11 +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>
@@ -37,7 +39,7 @@
   <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>
@@ -52,7 +54,7 @@
   <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="author" last-active="2.6">Alexia Death</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>
@@ -60,14 +62,14 @@
   <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>
@@ -88,12 +90,12 @@
   <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>
@@ -104,6 +106,7 @@
   <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>
@@ -139,9 +142,10 @@
   <contributor role="author" last-active="2.4">Frederic Leroy</contributor>
   <contributor role="author" last-active="1.2">Raph Levien</contributor>
   <contributor role="author" last-active="1.0">Wing Tung Leung</contributor>
-  <contributor role="author" last-active="2.6">LightningIsMyName</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>
@@ -184,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>
@@ -201,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>
@@ -221,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>
@@ -239,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-text/configure.in
==============================================================================
--- branches/soc-2008-text/configure.in	(original)
+++ branches/soc-2008-text/configure.in	Thu Oct  2 16:23:25 2008
@@ -7,30 +7,30 @@
 #   GIMP_INTERFACE_AGE += 1;
 
 m4_define([gimp_major_version], [2])
-m4_define([gimp_minor_version], [5])
-m4_define([gimp_micro_version], [4])
+m4_define([gimp_minor_version], [6])
+m4_define([gimp_micro_version], [1])
 m4_define([gimp_real_version],
           [gimp_major_version.gimp_minor_version.gimp_micro_version])
 m4_define([gimp_version], [gimp_real_version])
-m4_define([gimp_interface_age], [0])
+m4_define([gimp_interface_age], [1])
 m4_define([gimp_binary_age],
           [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.6.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.6])
 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.6])
 
 m4_define([gimp_unstable],
           m4_if(m4_eval(gimp_minor_version % 2), [1], [yes], [no]))
@@ -1151,13 +1151,14 @@
 
 AC_ARG_WITH(libmng,  [  --without-libmng        build without MNG support])
 
-have_libmng=yes
+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)"
@@ -1408,22 +1409,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
@@ -1860,7 +1865,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"
@@ -2016,7 +2021,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-text/data/images/gimp-splash.png
==============================================================================
Binary files. No diff available.

Modified: branches/soc-2008-text/devel-docs/app/Makefile.am
==============================================================================
--- branches/soc-2008-text/devel-docs/app/Makefile.am	(original)
+++ branches/soc-2008-text/devel-docs/app/Makefile.am	Thu Oct  2 16:23:25 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-text/devel-docs/app/app-sections.txt
==============================================================================
--- branches/soc-2008-text/devel-docs/app/app-sections.txt	(original)
+++ branches/soc-2008-text/devel-docs/app/app-sections.txt	Thu Oct  2 16:23:25 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
@@ -2584,6 +2588,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
@@ -2619,6 +2636,7 @@
 gimp_canvas_set_custom_gc
 gimp_canvas_set_stipple_index
 gimp_canvas_set_bg_color
+gimp_canvas_scroll
 <SUBSECTION Standard>
 GimpCanvasClass
 GIMP_CANVAS
@@ -2784,7 +2802,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
@@ -2898,19 +2915,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>
@@ -3450,8 +3470,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
@@ -4062,6 +4082,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
@@ -4342,7 +4363,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>
@@ -5002,6 +5022,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
@@ -5357,6 +5379,7 @@
 <TITLE>GimpActionView</TITLE>
 GimpActionView
 gimp_action_view_new
+gimp_action_view_set_filter
 <SUBSECTION Standard>
 GimpActionViewClass
 GIMP_ACTION_VIEW
@@ -5829,6 +5852,7 @@
 <TITLE>GimpContainerTreeView</TITLE>
 GimpContainerTreeView
 gimp_container_tree_view_new
+gimp_container_tree_view_connect_name_edited
 <SUBSECTION Standard>
 GimpContainerTreeViewClass
 GIMP_CONTAINER_TREE_VIEW
@@ -7115,6 +7139,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
@@ -8009,6 +8035,7 @@
 <FILE>gimphistogram</FILE>
 GimpHistogram
 gimp_histogram_new
+gimp_histogram_duplicate
 gimp_histogram_ref
 gimp_histogram_unref
 gimp_histogram_calculate
@@ -8102,7 +8129,9 @@
 <SECTION>
 <FILE>pixel-surround</FILE>
 PixelSurround
+PixelSurroundMode
 pixel_surround_new
+pixel_surround_set_bg
 pixel_surround_lock
 pixel_surround_release
 pixel_surround_destroy
@@ -9034,12 +9063,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
@@ -9519,6 +9550,7 @@
 shade_region
 copy_region
 copy_region_nocow
+clear_region
 add_alpha_region
 flatten_region
 extract_alpha_region
@@ -9715,6 +9747,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
@@ -9793,6 +9826,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
@@ -9865,7 +9900,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>
@@ -10049,12 +10084,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
@@ -10348,6 +10381,7 @@
 <SECTION>
 <FILE>gimphelp</FILE>
 gimp_help_show
+gimp_help_user_manual_is_installed
 </SECTION>
 
 <SECTION>
@@ -10911,6 +10945,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
@@ -11019,6 +11054,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-text/devel-docs/app/app.types
==============================================================================
--- branches/soc-2008-text/devel-docs/app/app.types	(original)
+++ branches/soc-2008-text/devel-docs/app/app.types	Thu Oct  2 16:23:25 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
@@ -281,8 +282,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-text/devel-docs/libgimp/libgimp-sections.txt
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimp/libgimp-sections.txt	(original)
+++ branches/soc-2008-text/devel-docs/libgimp/libgimp-sections.txt	Thu Oct  2 16:23:25 2008
@@ -520,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
@@ -596,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

Modified: branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpimage.sgml
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpimage.sgml	(original)
+++ branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpimage.sgml	Thu Oct  2 16:23:25 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-text/devel-docs/libgimp/tmpl/gimplayer.sgml
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimp/tmpl/gimplayer.sgml	(original)
+++ branches/soc-2008-text/devel-docs/libgimp/tmpl/gimplayer.sgml	Thu Oct  2 16:23:25 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-text/devel-docs/release-howto.txt
==============================================================================
--- branches/soc-2008-text/devel-docs/release-howto.txt	(original)
+++ branches/soc-2008-text/devel-docs/release-howto.txt	Thu Oct  2 16:23:25 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-text/devel-docs/tools/shadow.c
==============================================================================
--- branches/soc-2008-text/devel-docs/tools/shadow.c	(original)
+++ branches/soc-2008-text/devel-docs/tools/shadow.c	Thu Oct  2 16:23:25 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-text/docs/gimprc.5.in
==============================================================================
--- branches/soc-2008-text/docs/gimprc.5.in	(original)
+++ branches/soc-2008-text/docs/gimprc.5.in	Thu Oct  2 16:23:25 2008
@@ -208,8 +208,8 @@
 
 .TP
 (default-image
-    (width 610)
-    (height 377)
+    (width 640)
+    (height 400)
     (unit pixels)
     (xresolution 72.000000)
     (yresolution 72.000000)
@@ -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-text/etc/gimprc
==============================================================================
--- branches/soc-2008-text/etc/gimprc	(original)
+++ branches/soc-2008-text/etc/gimprc	Thu Oct  2 16:23:25 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)
@@ -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-text/libgimp/gimp.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.c	(original)
+++ branches/soc-2008-text/libgimp/gimp.c	Thu Oct  2 16:23:25 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-text/libgimp/gimp.def
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.def	(original)
+++ branches/soc-2008-text/libgimp/gimp.def	Thu Oct  2 16:23:25 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

Modified: branches/soc-2008-text/libgimp/gimp.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.h	(original)
+++ branches/soc-2008-text/libgimp/gimp.h	Thu Oct  2 16:23:25 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-text/libgimp/gimpexport.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimpexport.c	(original)
+++ branches/soc-2008-text/libgimp/gimpexport.c	Thu Oct  2 16:23:25 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-text/libgimp/gimpimage.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimpimage.c	(original)
+++ branches/soc-2008-text/libgimp/gimpimage.c	Thu Oct  2 16:23:25 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-text/libgimp/gimpimage_pdb.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimpimage_pdb.c	(original)
+++ branches/soc-2008-text/libgimp/gimpimage_pdb.c	Thu Oct  2 16:23:25 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-text/libgimp/gimpimage_pdb.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimpimage_pdb.h	(original)
+++ branches/soc-2008-text/libgimp/gimpimage_pdb.h	Thu Oct  2 16:23:25 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-text/libgimp/gimplayer_pdb.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimplayer_pdb.c	(original)
+++ branches/soc-2008-text/libgimp/gimplayer_pdb.c	Thu Oct  2 16:23:25 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-text/libgimp/gimplayer_pdb.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimplayer_pdb.h	(original)
+++ branches/soc-2008-text/libgimp/gimplayer_pdb.h	Thu Oct  2 16:23:25 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-text/libgimp/gimpprocview.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimpprocview.c	(original)
+++ branches/soc-2008-text/libgimp/gimpprocview.c	Thu Oct  2 16:23:25 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-text/libgimp/gimpprocview.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimpprocview.h	(original)
+++ branches/soc-2008-text/libgimp/gimpprocview.h	Thu Oct  2 16:23:25 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-text/libgimp/gimpselection_pdb.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimpselection_pdb.c	(original)
+++ branches/soc-2008-text/libgimp/gimpselection_pdb.c	Thu Oct  2 16:23:25 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-text/libgimpbase/gimpbasetypes.h
==============================================================================
--- branches/soc-2008-text/libgimpbase/gimpbasetypes.h	(original)
+++ branches/soc-2008-text/libgimpbase/gimpbasetypes.h	Thu Oct  2 16:23:25 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-text/libgimpbase/gimpreloc.c
==============================================================================
--- branches/soc-2008-text/libgimpbase/gimpreloc.c	(original)
+++ branches/soc-2008-text/libgimpbase/gimpreloc.c	Thu Oct  2 16:23:25 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-text/libgimpconfig/gimpconfig-utils.c
==============================================================================
--- branches/soc-2008-text/libgimpconfig/gimpconfig-utils.c	(original)
+++ branches/soc-2008-text/libgimpconfig/gimpconfig-utils.c	Thu Oct  2 16:23:25 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-text/menus/Makefile.am
==============================================================================
--- branches/soc-2008-text/menus/Makefile.am	(original)
+++ branches/soc-2008-text/menus/Makefile.am	Thu Oct  2 16:23:25 2008
@@ -52,7 +52,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-text/menus/image-menu.xml.in
==============================================================================
--- branches/soc-2008-text/menus/image-menu.xml.in	(original)
+++ branches/soc-2008-text/menus/image-menu.xml.in	Thu Oct  2 16:23:25 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>
@@ -29,8 +29,6 @@
         <menuitem action="debug-dump-items" />
         <menuitem action="debug-dump-managers" />
         <menuitem action="debug-dump-attached-data" />
-        <separator />
-        <menuitem action="debug-use-gegl" />
       </menu>
 
       <separator />
@@ -488,6 +486,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-text/modules/color-selector-wheel.c
==============================================================================
--- branches/soc-2008-text/modules/color-selector-wheel.c	(original)
+++ branches/soc-2008-text/modules/color-selector-wheel.c	Thu Oct  2 16:23:25 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-text/plug-ins/color-rotate/color-rotate-callbacks.c
==============================================================================
--- branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.c	(original)
+++ branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.c	Thu Oct  2 16:23:25 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-text/plug-ins/color-rotate/color-rotate-callbacks.h
==============================================================================
--- branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.h	(original)
+++ branches/soc-2008-text/plug-ins/color-rotate/color-rotate-callbacks.h	Thu Oct  2 16:23:25 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-text/plug-ins/common/animation-play.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/animation-play.c	(original)
+++ branches/soc-2008-text/plug-ins/common/animation-play.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/curve-bend.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/curve-bend.c	(original)
+++ branches/soc-2008-text/plug-ins/common/curve-bend.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/displace.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/displace.c	(original)
+++ branches/soc-2008-text/plug-ins/common/displace.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/edge-dog.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/edge-dog.c	(original)
+++ branches/soc-2008-text/plug-ins/common/edge-dog.c	Thu Oct  2 16:23:25 2008
@@ -158,6 +158,7 @@
   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)
@@ -250,6 +262,7 @@
         {
           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.");
         }
@@ -257,6 +270,13 @@
       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-text/plug-ins/common/file-header.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/file-header.c	(original)
+++ branches/soc-2008-text/plug-ins/common/file-header.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/file-psp.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/file-psp.c	(original)
+++ branches/soc-2008-text/plug-ins/common/file-psp.c	Thu Oct  2 16:23:25 2008
@@ -681,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",
@@ -859,8 +859,8 @@
                           guint     total_len,
                           PSPimage *ia)
 {
-  long data_start;
-  guchar buf[4];
+  long    data_start;
+  guchar  buf[4];
   guint16 keyword;
   guint32 length;
 
@@ -894,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);
@@ -1082,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",
@@ -1117,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",
@@ -1140,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",
@@ -1638,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);
 
@@ -1707,7 +1707,7 @@
   return 0;
 }
 
-static gchar *
+static const gchar *
 compression_name (gint compression)
 {
   switch (compression)

Modified: branches/soc-2008-text/plug-ins/common/file-raw.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/file-raw.c	(original)
+++ branches/soc-2008-text/plug-ins/common/file-raw.c	Thu Oct  2 16:23:25 2008
@@ -213,7 +213,7 @@
   static GimpParam   values[2];
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
-  GError            *error  = NULL; 
+  GError            *error  = NULL;
   gint32             image_id;
   gint32             drawable_id;
 
@@ -970,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);
 
@@ -1041,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);
 
@@ -1054,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);
 
@@ -1067,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-text/plug-ins/common/file-xbm.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/file-xbm.c	(original)
+++ branches/soc-2008-text/plug-ins/common/file-xbm.c	Thu Oct  2 16:23:25 2008
@@ -93,32 +93,32 @@
 
 /* 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,
-                                          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);
+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 =
@@ -629,8 +629,8 @@
 
 /* Match a string with a file. */
 static gint
-match (FILE  *fp,
-       gchar *s)
+match (FILE        *fp,
+       const gchar *s)
 {
   gint c;
 
@@ -704,25 +704,24 @@
 }
 
 
-static gint
+static gint32
 load_image (const gchar  *filename,
             GError      **error)
 {
   GimpPixelRgn  pixel_rgn;
   GimpDrawable *drawable;
-
-  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;
+  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[] =
   {
@@ -970,15 +969,15 @@
   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)

Modified: branches/soc-2008-text/plug-ins/common/file-xpm.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/file-xpm.c	(original)
+++ branches/soc-2008-text/plug-ins/common/file-xpm.c	Thu Oct  2 16:23:25 2008
@@ -570,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;
     }

Modified: branches/soc-2008-text/plug-ins/common/filter-pack.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/filter-pack.c	(original)
+++ branches/soc-2008-text/plug-ins/common/filter-pack.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/guillotine.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/guillotine.c	(original)
+++ branches/soc-2008-text/plug-ins/common/guillotine.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/hot.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/hot.c	(original)
+++ branches/soc-2008-text/plug-ins/common/hot.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/lcms.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/lcms.c	(original)
+++ branches/soc-2008-text/plug-ins/common/lcms.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/mail.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/mail.c	(original)
+++ branches/soc-2008-text/plug-ins/common/mail.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/nova.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/nova.c	(original)
+++ branches/soc-2008-text/plug-ins/common/nova.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/sample-colorize.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/sample-colorize.c	(original)
+++ branches/soc-2008-text/plug-ins/common/sample-colorize.c	Thu Oct  2 16:23:25 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-text/plug-ins/common/screenshot.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/screenshot.c	(original)
+++ branches/soc-2008-text/plug-ins/common/screenshot.c	Thu Oct  2 16:23:25 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-text/plug-ins/file-fits/fits-io.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-fits/fits-io.c	(original)
+++ branches/soc-2008-text/plug-ins/file-fits/fits-io.c	Thu Oct  2 16:23:25 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-text/plug-ins/file-fits/fits-io.h
==============================================================================
--- branches/soc-2008-text/plug-ins/file-fits/fits-io.h	(original)
+++ branches/soc-2008-text/plug-ins/file-fits/fits-io.h	Thu Oct  2 16:23:25 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-text/plug-ins/file-fits/fits.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-fits/fits.c	(original)
+++ branches/soc-2008-text/plug-ins/file-fits/fits.c	Thu Oct  2 16:23:25 2008
@@ -710,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-text/plug-ins/file-jpeg/jpeg-save.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.c	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.c	Thu Oct  2 16:23:25 2008
@@ -52,13 +52,14 @@
 
 #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
@@ -263,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;
@@ -393,8 +395,11 @@
 
   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)
+  if (subsampling != 1 && subsampling != 3)
     cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
 
   if (jsvals.progressive)
@@ -402,9 +407,9 @@
       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;
@@ -414,7 +419,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;
@@ -423,7 +428,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;
@@ -432,7 +437,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;
@@ -812,8 +817,6 @@
   GtkTextBuffer *text_buffer;
   GtkWidget     *scrolled_window;
   GtkWidget     *button;
-
-  GimpImageType  dtype;
   gchar         *text;
 
 
@@ -1080,10 +1083,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);
@@ -1091,19 +1098,27 @@
 
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
 
-  gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), jsvals.subsmp,
+  gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
+                              gimp_drawable_is_rgb (drawable_ID_global) ?
+                              jsvals.subsmp : JPEG_SUPSAMPLING_1x1_1x1_1x1,
                               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), 2);
+
       gtk_widget_set_sensitive (combo, FALSE);
     }
 
@@ -1233,6 +1248,7 @@
   gchar        *def_str;
   JpegSaveVals  tmpvals;
   gint          num_fields;
+  gint          subsampling;
 
   jsvals.quality          = DEFAULT_QUALITY;
   jsvals.smoothing        = DEFAULT_SMOOTHING;
@@ -1268,7 +1284,7 @@
                        &tmpvals.smoothing,
                        &tmpvals.optimize,
                        &tmpvals.progressive,
-                       &tmpvals.subsmp,
+                       &subsampling,
                        &tmpvals.baseline,
                        &tmpvals.restart,
                        &tmpvals.dct,
@@ -1277,6 +1293,8 @@
                        &tmpvals.save_thumbnail,
                        &tmpvals.save_xmp);
 
+  tmpvals.subsmp = subsampling;
+
   if (num_fields == 12)
     memcpy (&jsvals, &tmpvals, sizeof (tmpvals));
 }
@@ -1292,7 +1310,7 @@
                              jsvals.smoothing,
                              jsvals.optimize,
                              jsvals.progressive,
-                             jsvals.subsmp,
+                             (gint) jsvals.subsmp,
                              jsvals.baseline,
                              jsvals.restart,
                              jsvals.dct,
@@ -1346,8 +1364,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);
 }
@@ -1371,11 +1393,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-text/plug-ins/file-jpeg/jpeg-save.h
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.h	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg-save.h	Thu Oct  2 16:23:25 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;

Modified: branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.c	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.c	Thu Oct  2 16:23:25 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-text/plug-ins/file-jpeg/jpeg-settings.h
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.h	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg-settings.h	Thu Oct  2 16:23:25 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-text/plug-ins/file-jpeg/jpeg.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg.c	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg.c	Thu Oct  2 16:23:25 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 =
@@ -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)
@@ -441,7 +441,9 @@
                   jsvals.use_orig_quality = TRUE;
                 }
 
-              if (orig_subsmp == 2 || (orig_subsmp > 0 && jsvals.subsmp == 0))
+              if (orig_subsmp == JPEG_SUPSAMPLING_1x1_1x1_1x1 ||
+                  (orig_subsmp > JPEG_SUPSAMPLING_1x1_1x1_1x1 &&
+                   jsvals.subsmp == JPEG_SUPSAMPLING_1x1_1x1_1x1))
                 jsvals.subsmp = orig_subsmp;
             }
           break;

Modified: branches/soc-2008-text/plug-ins/file-jpeg/jpeg.h
==============================================================================
--- branches/soc-2008-text/plug-ins/file-jpeg/jpeg.h	(original)
+++ branches/soc-2008-text/plug-ins/file-jpeg/jpeg.h	Thu Oct  2 16:23:25 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,7 +57,7 @@
 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;
 
 

Modified: branches/soc-2008-text/plug-ins/file-psd/psd-load.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-psd/psd-load.c	(original)
+++ branches/soc-2008-text/plug-ins/file-psd/psd-load.c	Thu Oct  2 16:23:25 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,
@@ -958,7 +962,6 @@
 {
   PSDchannel          **lyr_chn;
   guchar               *pixels;
-  guint16               comp_mode;
   guint16               alpha_chn;
   guint16               user_mask_chn;
   guint16               layer_channels;
@@ -1089,16 +1092,21 @@
                                 lyr_chn[cidx]->columns,
                                 lyr_chn[cidx]->rows);
 
-              if (fread (&comp_mode, 2, 1, f) < 1)
+              /* Only read channel data if there is more data than
+               * what compression method that is used
+               */
+              if (lyr_a[lidx]->chn_info[cidx].data_len > COMP_MODE_SIZE)
                 {
-                  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);
+                  guint16 comp_mode;
+
+                  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);
 
-              if (lyr_a[lidx]->chn_info[cidx].data_len - 2 > 0)
-                {
                   switch (comp_mode)
                     {
                       case PSD_COMP_RAW:        /* Planar raw data */
@@ -1137,6 +1145,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;
@@ -1431,7 +1440,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;

Modified: branches/soc-2008-text/plug-ins/file-psd/psd-save.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-psd/psd-save.c	(original)
+++ branches/soc-2008-text/plug-ins/file-psd/psd-save.c	Thu Oct  2 16:23:25 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 */
 
@@ -187,6 +190,8 @@
                                     glong         *ChanLenPosition,
                                     gint32         rowlenOffset);
 
+static gint32 create_merged_image  (gint32         imageID);
+
 
 const GimpPlugInInfo PLUG_IN_INFO =
 {
@@ -692,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");
@@ -820,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 */
@@ -834,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]);
@@ -1047,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 */
@@ -1254,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);
@@ -1267,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)");
@@ -1423,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 */
@@ -1452,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\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);
-    }
+  IFDBG printf ("\t\tWriting compressed image data\n");
+  write_pixel_data (fd, PSDImageData.merged_layer,
+                    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--)
     {
@@ -1494,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,
@@ -1513,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);
@@ -1606,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-text/plug-ins/file-uri/uri-backend-wget.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-uri/uri-backend-wget.c	(original)
+++ branches/soc-2008-text/plug-ins/file-uri/uri-backend-wget.c	Thu Oct  2 16:23:25 2008
@@ -91,7 +91,7 @@
 
   if (pipe (p) != 0)
     {
-      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    "pipe() failed: %s", g_strerror (errno));
       return FALSE;
     }
@@ -101,7 +101,7 @@
 
   if ((pid = fork()) < 0)
     {
-      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,,
+      g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    "fork() failed: %s", g_strerror (errno));
       return FALSE;
     }
@@ -316,7 +316,7 @@
 
       /*  Switch to byte parsing wget's output...  */
 
-      while (1)
+      while (TRUE)
         {
           dot = fgetc (input);
 

Modified: branches/soc-2008-text/plug-ins/file-xjt/xjt.c
==============================================================================
--- branches/soc-2008-text/plug-ins/file-xjt/xjt.c	(original)
+++ branches/soc-2008-text/plug-ins/file-xjt/xjt.c	Thu Oct  2 16:23:25 2008
@@ -3064,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);

Modified: branches/soc-2008-text/plug-ins/flame/rect.c
==============================================================================
--- branches/soc-2008-text/plug-ins/flame/rect.c	(original)
+++ branches/soc-2008-text/plug-ins/flame/rect.c	Thu Oct  2 16:23:25 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-text/plug-ins/gfig/gfig-dobject.h
==============================================================================
--- branches/soc-2008-text/plug-ins/gfig/gfig-dobject.h	(original)
+++ branches/soc-2008-text/plug-ins/gfig/gfig-dobject.h	Thu Oct  2 16:23:25 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-text/plug-ins/gfig/gfig-style.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gfig/gfig-style.c	(original)
+++ branches/soc-2008-text/plug-ins/gfig/gfig-style.c	Thu Oct  2 16:23:25 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-text/plug-ins/gimpressionist/gimpressionist.h
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h	Thu Oct  2 16:23:25 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-text/plug-ins/gimpressionist/presets.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/presets.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/presets.c	Thu Oct  2 16:23:25 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-text/plug-ins/gimpressionist/utils.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/utils.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/utils.c	Thu Oct  2 16:23:25 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-text/plug-ins/gradient-flare/gradient-flare.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gradient-flare/gradient-flare.c	(original)
+++ branches/soc-2008-text/plug-ins/gradient-flare/gradient-flare.c	Thu Oct  2 16:23:25 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;
@@ -4712,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-text/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-text/plug-ins/help-browser/dialog.c	(original)
+++ branches/soc-2008-text/plug-ins/help-browser/dialog.c	Thu Oct  2 16:23:25 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-text/plug-ins/ifs-compose/ifs-compose-storage.c
==============================================================================
--- branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose-storage.c	(original)
+++ branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose-storage.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_cern_lex.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_cern_lex.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_cern_lex.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_cern_parse.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_cern_parse.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_cern_parse.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_csim_lex.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_csim_lex.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_csim_lex.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_csim_parse.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_csim_parse.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_csim_parse.c	Thu Oct  2 16:23:25 2008
@@ -1260,7 +1260,7 @@
 #endif
 #endif
 {
-  
+
   int yystate;
   int yyn;
   int yyresult;

Modified: branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_default_dialog.h
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.h	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.h	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_ncsa_lex.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_lex.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_lex.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_ncsa_parse.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_parse.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_ncsa_parse.c	Thu Oct  2 16:23:25 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-text/plug-ins/imagemap/imap_object.h
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_object.h	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_object.h	Thu Oct  2 16:23:25 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-text/plug-ins/map-object/map-object-ui.c
==============================================================================
--- branches/soc-2008-text/plug-ins/map-object/map-object-ui.c	(original)
+++ branches/soc-2008-text/plug-ins/map-object/map-object-ui.c	Thu Oct  2 16:23:25 2008
@@ -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-text/plug-ins/print/print-draw-page.c
==============================================================================
--- branches/soc-2008-text/plug-ins/print/print-draw-page.c	(original)
+++ branches/soc-2008-text/plug-ins/print/print-draw-page.c	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/gimpfu.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpfu.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpfu.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/gimpshelf.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpshelf.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpshelf.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/gimpthumbmodule.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpthumbmodule.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpthumbmodule.c	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/gimpui.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpui.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpui.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/gimpuimodule.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpuimodule.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpuimodule.c	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/foggify.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/foggify.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/foggify.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/palette-offset.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-offset.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-offset.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/palette-sort.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-sort.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-sort.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/palette-to-gradient.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-to-gradient.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/palette-to-gradient.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/py-slice.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/py-slice.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/py-slice.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/pyconsole.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/pyconsole.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/pyconsole.py	Thu Oct  2 16:23:25 2008
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 #
 #   pyconsole.py
 #

Modified: branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/plug-ins/python-eval.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-eval.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-eval.py	Thu Oct  2 16:23:25 2008
@@ -24,7 +24,7 @@
         import sys
         code = sys.stdin
     exec code in globals()
- 
+
 register(
         "python-fu-eval",
         "Evaluate Python code",

Modified: branches/soc-2008-text/plug-ins/pygimp/plug-ins/whirlpinch.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/whirlpinch.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/whirlpinch.py	Thu Oct  2 16:23:25 2008
@@ -197,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-text/plug-ins/pygimp/pygimp-colors.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c	Thu Oct  2 16:23:25 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-text/plug-ins/pygimp/pygimp-drawable.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/pygimp-drawable.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/pygimp-drawable.c	Thu Oct  2 16:23:25 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,7 +143,7 @@
 
     ensure_drawable(self);
 
-    if(row < 0 || row >= self->drawable->ntile_rows || 
+    if(row < 0 || row >= self->drawable->ntile_rows ||
        col < 0 || col >= self->drawable->ntile_cols) {
         Py_INCREF(Py_None);
         return Py_None;
@@ -890,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},
@@ -1388,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-text/plug-ins/pygimp/pygimp-image.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/pygimp-image.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/pygimp-image.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/Makefile.am
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/Makefile.am	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/Makefile.am	Thu Oct  2 16:23:25 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,6 +34,9 @@
 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		\
@@ -45,12 +47,16 @@
 	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
 
@@ -64,8 +70,6 @@
 	$(libgimpbase)		\
 	$(libtinyscheme)	\
 	$(libftx)		\
-	$(libre)		\
-	$(REGEXREPL)		\
 	$(GTK_LIBS)		\
 	$(SOCKET_LIBS)		\
 	$(WINSOCK_LIBS)		\

Modified: branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scheme-wrapper.h
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.h	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scheme-wrapper.h	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/script-fu-console.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c	Thu Oct  2 16:23:25 2008
@@ -595,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,
@@ -612,6 +615,8 @@
                                        console);
         }
 
+      gimp_plugin_set_pdb_error_handler (GIMP_PDB_ERROR_HANDLER_INTERNAL);
+
       g_string_free (output, TRUE);
 
       gimp_displays_flush ();

Modified: branches/soc-2008-text/plug-ins/script-fu/script-fu-eval.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-eval.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-eval.c	Thu Oct  2 16:23:25 2008
@@ -44,7 +44,7 @@
 
   run_mode = params[0].data.d_int32;
 
-  set_run_mode_constant (run_mode);
+  ts_set_run_mode (run_mode);
 
   switch (run_mode)
     {

Modified: branches/soc-2008-text/plug-ins/script-fu/script-fu-interface.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-interface.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-interface.c	Thu Oct  2 16:23:25 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"
 
@@ -109,7 +110,7 @@
  */
 
 static SFInterface       *sf_interface = NULL;  /*  there can only be at most
-                                                 *  oneinteractive interface
+                                                 *  one interactive interface
                                                  */
 
 static GimpPDBStatusType  sf_status    = GIMP_PDB_SUCCESS;
@@ -156,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
         {
@@ -178,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 =
@@ -216,29 +218,8 @@
 
   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);
-
-      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");
-
-  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);
 
@@ -254,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,
@@ -279,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);
@@ -288,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;
@@ -297,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;
+
+        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 (script->arg_values[i].sfa_adjustment.adj,
+          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)
         {
@@ -620,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:
@@ -642,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!
    */
@@ -770,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:
@@ -794,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:
@@ -845,73 +794,41 @@
             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 (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);
 
@@ -923,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:
@@ -939,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:
@@ -958,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-text/plug-ins/script-fu/script-fu-scripts.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.c	Thu Oct  2 16:23:25 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,28 +55,28 @@
  *  Local Functions
  */
 
-static gboolean  script_fu_run_command    (const gchar            *command);
-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);
 
 
 /*
@@ -131,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;
 
-  args = g_new0 (GimpParamDef, script->num_args + 1);
+  /*  Create a new script  */
+  script = script_fu_script_new (name,
+                                 menu_label,
+                                 blurb,
+                                 author,
+                                 copyright,
+                                 date,
+                                 image_types,
+                                 n_args);
 
-  args[0].type        = GIMP_PDB_INT32;
-  args[0].name        = "run-mode";
-  args[0].description = "Interactive, non-interactive";
+  for (i = 0; i < script->n_args; i++)
+    {
+      SFArg *arg = &script->args[i];
 
-  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);
+      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);
 
-  if (script->num_args > 0)
-    {
-      for (i = 0; i < script->num_args; i++)
+          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 (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)
         {
-          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;
+
+            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);
 
-                  script->arg_defaults[i].sfa_file.filename =
-                    g_strdup (sc->vptr->string_value (sc->vptr->pair_car (a)));
+              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);
 
-  script_fu_menu_map (script);
+  if (script->menu_label[0] == '<')
+    {
+      gchar *mapped = script_fu_menu_map (script->menu_label);
+
+      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));
@@ -626,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)
@@ -643,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);
@@ -654,35 +551,34 @@
   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)
-{
-  g_message (_("Error while executing\n%s\n\n%s"), command, msg);
-}
-
 
 /*  private functions  */
 
 static gboolean
-script_fu_run_command (const gchar *command)
+script_fu_run_command (const gchar  *command,
+                       GError      **error)
 {
-  GString  *output  = g_string_new ("");
+  GString  *output;
   gboolean  success = FALSE;
 
-  output = g_string_new ("");
+  output = g_string_new (NULL);
   ts_register_output_func (ts_gstring_output_func, output);
 
   if (ts_interpret_string (command))
     {
-      script_fu_error_msg (command, output->str);
+      g_set_error (error, 0, 0, "%s", output->str);
     }
   else
     {
@@ -700,13 +596,25 @@
 {
   if (gimp_datafiles_check_extension (file_data->filename, ".scm"))
     {
-      gchar   *escaped = script_fu_strescape (file_data->filename);
-      gchar   *command;
+      gchar  *escaped = script_fu_strescape (file_data->filename);
+      gchar  *command;
+      GError *error   = NULL;
 
       command = g_strdup_printf ("(load \"%s\")", escaped);
       g_free (escaped);
 
-      script_fu_run_command (command);
+      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
@@ -721,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,
@@ -732,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;
@@ -779,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
@@ -903,9 +686,16 @@
                        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;
@@ -921,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)
         {
@@ -930,11 +720,11 @@
             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)
               {
                 status = script_fu_interface (script, min_args);
                 break;
@@ -946,230 +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;
-              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];
-
-                  g_string_append_c (s, ' ');
+                  status                  = GIMP_PDB_EXECUTION_ERROR;
+                  *nreturn_vals           = 2;
+                  values[1].type          = GIMP_PDB_STRING;
+                  values[1].data.d_string = error->message;
 
-                  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  */
-              script_fu_run_command (command);
-
               g_free (command);
             }
           break;
 
         case GIMP_RUN_WITH_LAST_VALS:
           {
-            GString *s;
-            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  */
-            script_fu_run_command (command);
-
             g_free (command);
           }
           break;
@@ -1220,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
@@ -1337,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
@@ -1369,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-text/plug-ins/script-fu/script-fu-scripts.h
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.h	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-scripts.h	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/script-fu-server.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-server.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-server.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/script-fu-text-console.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-text-console.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-text-console.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/script-fu-types.h
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-types.h	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-types.h	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/script-fu.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu.c	Thu Oct  2 16:23:25 2008
@@ -197,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);
@@ -307,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-text/plug-ins/script-fu/scripts/3d-outline.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/3d-outline.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/3d-outline.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/3dTruchet.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/3dTruchet.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/3dTruchet.scm	Thu Oct  2 16:23:25 2008
@@ -236,4 +236,4 @@
 )
 
 (script-fu-menu-register "script-fu-3dtruchet"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/add-bevel.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/add-bevel.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/add-bevel.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-glow-arrow.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-arrow.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-arrow.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-glow-bar.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bar.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bar.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-glow-bullet.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bullet.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-bullet.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-glow-button.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-button.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-button.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-glow-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-glow-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/alien-neon-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/alien-neon-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/alien-neon-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/basic1-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/basic1-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/basic1-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/basic2-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/basic2-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/basic2-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/beveled-button.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-button.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-button.scm	Thu Oct  2 16:23:25 2008
@@ -158,4 +158,4 @@
 )
 
 (script-fu-menu-register "script-fu-button00"
-                         "<Image>/File/New/Buttons")
+                         "<Image>/File/Create/Buttons")

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-arrow.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-bullet.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/beveled-pattern-button.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-button.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-button.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/beveled-pattern-heading.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-heading.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-heading.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/beveled-pattern-hrule.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/blended-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/blended-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/blended-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/bovinated-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/bovinated-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/bovinated-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/camo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/camo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/camo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/carved-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/carved-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/carved-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/chalk.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/chalk.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/chalk.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/chip-away.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/chip-away.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/chip-away.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/chrome-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/chrome-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/chrome-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/comic-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/comic-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/comic-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/coolmetal-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/coolmetal-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/coolmetal-logo.scm	Thu Oct  2 16:23:25 2008
@@ -187,4 +187,4 @@
 )
 
 (script-fu-menu-register "script-fu-cool-metal-logo"
-                         "<Image>/File/New/Logos")
+                         "<Image>/File/Create/Logos")

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/crystal-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/crystal-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/crystal-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/flatland.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/flatland.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/flatland.scm	Thu Oct  2 16:23:25 2008
@@ -73,4 +73,4 @@
 )
 
 (script-fu-menu-register "script-fu-flatland"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/gimp-headers.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-headers.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-headers.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/gimp-labels.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-labels.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/gimp-labels.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/glossy.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/glossy.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/glossy.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/glowing-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/glowing-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/glowing-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/gradient-bevel-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/gradient-bevel-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/gradient-bevel-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/i26-gunya2.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/i26-gunya2.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/i26-gunya2.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/land.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/land.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/land.scm	Thu Oct  2 16:23:25 2008
@@ -87,4 +87,4 @@
 )
 
 (script-fu-menu-register "script-fu-land"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/neon-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/neon-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/neon-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/news-text.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/news-text.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/news-text.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/pupi-button.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/pupi-button.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/pupi-button.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/rendermap.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/rendermap.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/rendermap.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/sota-chrome-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/sota-chrome-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/sota-chrome-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/speed-text.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/speed-text.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/speed-text.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/starscape-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/starscape-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/starscape-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/swirltile.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/swirltile.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/swirltile.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/swirly-pattern.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/swirly-pattern.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/swirly-pattern.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/t-o-p-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/t-o-p-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/t-o-p-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/text-circle.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/text-circle.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/text-circle.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/textured-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/textured-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/textured-logo.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/title-header.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/title-header.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/title-header.scm	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/scripts/truchet.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/truchet.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/truchet.scm	Thu Oct  2 16:23:25 2008
@@ -169,4 +169,4 @@
 )
 
 (script-fu-menu-register "script-fu-truchet"
-                         "<Image>/File/New/Patterns")
+                         "<Image>/File/Create/Patterns")

Modified: branches/soc-2008-text/plug-ins/script-fu/tinyscheme/CHANGES
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/tinyscheme/CHANGES	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/tinyscheme/CHANGES	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/tinyscheme/dynload.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/tinyscheme/dynload.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/tinyscheme/dynload.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/tinyscheme/scheme.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.c	Thu Oct  2 16:23:25 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-text/plug-ins/script-fu/tinyscheme/scheme.h
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.h	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/tinyscheme/scheme.h	Thu Oct  2 16:23:25 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-text/plug-ins/twain/tw_func.c
==============================================================================
--- branches/soc-2008-text/plug-ins/twain/tw_func.c	(original)
+++ branches/soc-2008-text/plug-ins/twain/tw_func.c	Thu Oct  2 16:23:25 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-text/plug-ins/twain/tw_util.c
==============================================================================
--- branches/soc-2008-text/plug-ins/twain/tw_util.c	(original)
+++ branches/soc-2008-text/plug-ins/twain/tw_util.c	Thu Oct  2 16:23:25 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-text/plug-ins/twain/tw_win.c
==============================================================================
--- branches/soc-2008-text/plug-ins/twain/tw_win.c	(original)
+++ branches/soc-2008-text/plug-ins/twain/tw_win.c	Thu Oct  2 16:23:25 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-text/plug-ins/twain/twain.c
==============================================================================
--- branches/soc-2008-text/plug-ins/twain/twain.c	(original)
+++ branches/soc-2008-text/plug-ins/twain/twain.c	Thu Oct  2 16:23:25 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-text/plug-ins/twain/twain.h
==============================================================================
--- branches/soc-2008-text/plug-ins/twain/twain.h	(original)
+++ branches/soc-2008-text/plug-ins/twain/twain.h	Thu Oct  2 16:23:25 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-text/plug-ins/win-snap/winsnap.c
==============================================================================
--- branches/soc-2008-text/plug-ins/win-snap/winsnap.c	(original)
+++ branches/soc-2008-text/plug-ins/win-snap/winsnap.c	Thu Oct  2 16:23:25 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-text/po-libgimp/LINGUAS
==============================================================================
--- branches/soc-2008-text/po-libgimp/LINGUAS	(original)
+++ branches/soc-2008-text/po-libgimp/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -51,7 +51,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 tr
 uk

Modified: branches/soc-2008-text/po-plug-ins/LINGUAS
==============================================================================
--- branches/soc-2008-text/po-plug-ins/LINGUAS	(original)
+++ branches/soc-2008-text/po-plug-ins/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -48,7 +48,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 tr
 uk

Modified: branches/soc-2008-text/po-python/LINGUAS
==============================================================================
--- branches/soc-2008-text/po-python/LINGUAS	(original)
+++ branches/soc-2008-text/po-python/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -48,7 +48,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 tr
 uk

Modified: branches/soc-2008-text/po-script-fu/LINGUAS
==============================================================================
--- branches/soc-2008-text/po-script-fu/LINGUAS	(original)
+++ branches/soc-2008-text/po-script-fu/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -50,7 +50,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 tr
 uk

Modified: branches/soc-2008-text/po-tips/LINGUAS
==============================================================================
--- branches/soc-2008-text/po-tips/LINGUAS	(original)
+++ branches/soc-2008-text/po-tips/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -45,7 +45,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 uk
 vi

Modified: branches/soc-2008-text/po/LINGUAS
==============================================================================
--- branches/soc-2008-text/po/LINGUAS	(original)
+++ branches/soc-2008-text/po/LINGUAS	Thu Oct  2 16:23:25 2008
@@ -55,7 +55,7 @@
 sk
 sl
 sr
-sr Latn
+sr latin
 sv
 th
 tr

Modified: branches/soc-2008-text/po/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po/POTFILES.in	(original)
+++ branches/soc-2008-text/po/POTFILES.in	Thu Oct  2 16:23:25 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-text/themes/Default/gtkrc
==============================================================================
--- branches/soc-2008-text/themes/Default/gtkrc	(original)
+++ branches/soc-2008-text/themes/Default/gtkrc	Thu Oct  2 16:23:25 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"
@@ -94,8 +95,8 @@
   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-text/themes/Small/gtkrc
==============================================================================
--- branches/soc-2008-text/themes/Small/gtkrc	(original)
+++ branches/soc-2008-text/themes/Small/gtkrc	Thu Oct  2 16:23:25 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"
@@ -99,8 +102,8 @@
   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-text/tools/Makefile.am
==============================================================================
--- branches/soc-2008-text/tools/Makefile.am	(original)
+++ branches/soc-2008-text/tools/Makefile.am	Thu Oct  2 16:23:25 2008
@@ -13,15 +13,15 @@
 noinst_PROGRAMS = test-clipboard
 
 EXTRA_PROGRAMS = \
-	gimp-remote-2.5	\
+	gimp-remote-2.6	\
 	kernelgen
 
-gimp_remote_2_5_SOURCES = \
+gimp_remote_2_6_SOURCES = \
 	gimp-remote.c	\
 	gimp-remote.h	\
 	gimp-remote-x11.c
 
-gimp_remote_2_5_LDADD = \
+gimp_remote_2_6_LDADD = \
 	$(GTK_LIBS)	\
 	$(XMU_LIBS)
 

Modified: branches/soc-2008-text/tools/defcheck.py
==============================================================================
--- branches/soc-2008-text/tools/defcheck.py	(original)
+++ branches/soc-2008-text/tools/defcheck.py	Thu Oct  2 16:23:25 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-text/tools/gimppath2svg.py
==============================================================================
--- branches/soc-2008-text/tools/gimppath2svg.py	(original)
+++ branches/soc-2008-text/tools/gimppath2svg.py	Thu Oct  2 16:23:25 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-text/tools/gimptool.c
==============================================================================
--- branches/soc-2008-text/tools/gimptool.c	(original)
+++ branches/soc-2008-text/tools/gimptool.c	Thu Oct  2 16:23:25 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-text/tools/pdbgen/pdb/drawable.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/drawable.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/drawable.pdb	Thu Oct  2 16:23:25 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-text/tools/pdbgen/pdb/image.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/image.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/image.pdb	Thu Oct  2 16:23:25 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,7 +1009,7 @@
 
     $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))
@@ -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);
+  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,7 +1217,7 @@
     %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));
     }
@@ -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);
+  else
+    success = FALSE;
 }
 CODE
     );
@@ -1213,7 +1281,7 @@
 
     $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));
     }
@@ -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);
+  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-text/tools/pdbgen/pdb/layer.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/layer.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/layer.pdb	Thu Oct  2 16:23:25 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-text/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/paths.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/paths.pdb	Thu Oct  2 16:23:25 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);
       else
         success = FALSE;
     }

Modified: branches/soc-2008-text/tools/pdbgen/pdb/selection.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/selection.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/selection.pdb	Thu Oct  2 16:23:25 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]