gimp r26819 - in branches/soc-2008-text: . app app/actions app/base app/config app/dialogs app/display app/file app/paint app/paint-funcs app/pdb app/plug-in app/text app/tools app/widgets app/xcf devel-docs devel-docs/libgimp devel-docs/libgimp/tmpl devel-docs/libgimpbase devel-docs/libgimpbase/tmpl docs etc libgimp libgimpbase libgimpwidgets menus modules po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default/images tools tools/pdbgen tools/pdbgen/pdb



Author: danedde
Date: Fri Aug 29 18:50:27 2008
New Revision: 26819
URL: http://svn.gnome.org/viewvc/gimp?rev=26819&view=rev

Log:
2008-08-29  Daniel Eddeland <danedde svn gnome org>

	Merged 26402:26806 from trunk



Added:
   branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c
      - copied unchanged from r26806, /trunk/app/display/gimpdisplayshell-scale-dialog.c
   branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.h
      - copied unchanged from r26806, /trunk/app/display/gimpdisplayshell-scale-dialog.h
   branches/soc-2008-text/modules/color-selector-cmyk-lcms.c
      - copied unchanged from r26806, /trunk/modules/color-selector-cmyk-lcms.c
   branches/soc-2008-text/modules/color-selector-cmyk.c
      - copied unchanged from r26806, /trunk/modules/color-selector-cmyk.c
   branches/soc-2008-text/modules/color-selector-water.c
      - copied unchanged from r26806, /trunk/modules/color-selector-water.c
   branches/soc-2008-text/modules/color-selector-wheel.c
      - copied unchanged from r26806, /trunk/modules/color-selector-wheel.c
   branches/soc-2008-text/modules/controller-dx-dinput.c
      - copied unchanged from r26806, /trunk/modules/controller-dx-dinput.c
   branches/soc-2008-text/modules/controller-dx-input.c
      - copied unchanged from r26806, /trunk/modules/controller-dx-dinput.c
   branches/soc-2008-text/modules/controller-linux-input.c
      - copied unchanged from r26806, /trunk/modules/controller-linux-input.c
   branches/soc-2008-text/modules/controller-midi.c
      - copied unchanged from r26806, /trunk/modules/controller-midi.c
   branches/soc-2008-text/modules/display-filter-color-blind.c
      - copied unchanged from r26806, /trunk/modules/display-filter-color-blind.c
   branches/soc-2008-text/modules/display-filter-gamma.c
      - copied unchanged from r26806, /trunk/modules/display-filter-gamma.c
   branches/soc-2008-text/modules/display-filter-high-contrast.c
      - copied unchanged from r26806, /trunk/modules/display-filter-high-contrast.c
   branches/soc-2008-text/modules/display-filter-lcms.c
      - copied unchanged from r26806, /trunk/modules/display-filter-lcms.c
   branches/soc-2008-text/modules/display-filter-proof.c
      - copied unchanged from r26806, /trunk/modules/display-filter-proof.c
Removed:
   branches/soc-2008-text/app/display/gimpdisplayshell-private.h
   branches/soc-2008-text/modules/cdisplay_colorblind.c
   branches/soc-2008-text/modules/cdisplay_gamma.c
   branches/soc-2008-text/modules/cdisplay_highcontrast.c
   branches/soc-2008-text/modules/cdisplay_lcms.c
   branches/soc-2008-text/modules/cdisplay_proof.c
   branches/soc-2008-text/modules/colorsel_cmyk.c
   branches/soc-2008-text/modules/colorsel_cmyk_lcms.c
   branches/soc-2008-text/modules/colorsel_triangle.c
   branches/soc-2008-text/modules/colorsel_water.c
   branches/soc-2008-text/modules/controller_dx_dinput.c
   branches/soc-2008-text/modules/controller_linux_input.c
   branches/soc-2008-text/modules/controller_midi.c
   branches/soc-2008-text/themes/Default/images/stock-gegl.png
   branches/soc-2008-text/themes/Default/images/stock-user-gegl-16.svg
   branches/soc-2008-text/themes/Default/images/stock-user-gegl.svg
Modified:
   branches/soc-2008-text/AUTHORS
   branches/soc-2008-text/ChangeLog
   branches/soc-2008-text/HACKING
   branches/soc-2008-text/INSTALL
   branches/soc-2008-text/Makefile.am
   branches/soc-2008-text/NEWS
   branches/soc-2008-text/app/Makefile.am
   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/documents-actions.c
   branches/soc-2008-text/app/actions/edit-actions.c
   branches/soc-2008-text/app/actions/edit-commands.c
   branches/soc-2008-text/app/actions/edit-commands.h
   branches/soc-2008-text/app/actions/file-commands.c
   branches/soc-2008-text/app/actions/layers-actions.c
   branches/soc-2008-text/app/actions/layers-commands.c
   branches/soc-2008-text/app/actions/layers-commands.h
   branches/soc-2008-text/app/actions/view-commands.c
   branches/soc-2008-text/app/base/pixel-surround.c
   branches/soc-2008-text/app/base/pixel-surround.h
   branches/soc-2008-text/app/base/tile-manager.c
   branches/soc-2008-text/app/base/tile-private.h
   branches/soc-2008-text/app/base/tile-pyramid.c
   branches/soc-2008-text/app/base/tile.c
   branches/soc-2008-text/app/config/gimpbaseconfig.c
   branches/soc-2008-text/app/config/gimpcoreconfig.c
   branches/soc-2008-text/app/config/gimpguiconfig.c
   branches/soc-2008-text/app/config/gimpguiconfig.h
   branches/soc-2008-text/app/config/gimprc-blurbs.h
   branches/soc-2008-text/app/dialogs/dialogs.c
   branches/soc-2008-text/app/dialogs/image-scale-dialog.c
   branches/soc-2008-text/app/dialogs/layer-options-dialog.c
   branches/soc-2008-text/app/dialogs/offset-dialog.c
   branches/soc-2008-text/app/dialogs/preferences-dialog.c
   branches/soc-2008-text/app/dialogs/resize-dialog.c
   branches/soc-2008-text/app/display/Makefile.am
   branches/soc-2008-text/app/display/display-enums.c
   branches/soc-2008-text/app/display/display-enums.h
   branches/soc-2008-text/app/display/gimpcanvas.c
   branches/soc-2008-text/app/display/gimpcanvas.h
   branches/soc-2008-text/app/display/gimpdisplay-handlers.c
   branches/soc-2008-text/app/display/gimpdisplayshell-appearance.c
   branches/soc-2008-text/app/display/gimpdisplayshell-appearance.h
   branches/soc-2008-text/app/display/gimpdisplayshell-autoscroll.c
   branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.c
   branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.h
   branches/soc-2008-text/app/display/gimpdisplayshell-cursor.c
   branches/soc-2008-text/app/display/gimpdisplayshell-cursor.h
   branches/soc-2008-text/app/display/gimpdisplayshell-draw.c
   branches/soc-2008-text/app/display/gimpdisplayshell-draw.h
   branches/soc-2008-text/app/display/gimpdisplayshell-handlers.c
   branches/soc-2008-text/app/display/gimpdisplayshell-render.c
   branches/soc-2008-text/app/display/gimpdisplayshell-render.h
   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-scroll.h
   branches/soc-2008-text/app/display/gimpdisplayshell-transform.c
   branches/soc-2008-text/app/display/gimpdisplayshell-transform.h
   branches/soc-2008-text/app/display/gimpdisplayshell.c
   branches/soc-2008-text/app/display/gimpdisplayshell.h
   branches/soc-2008-text/app/display/gimpnavigationeditor.c
   branches/soc-2008-text/app/display/gimpstatusbar.c
   branches/soc-2008-text/app/display/gimpstatusbar.h
   branches/soc-2008-text/app/file/file-save.c
   branches/soc-2008-text/app/main.c
   branches/soc-2008-text/app/paint-funcs/paint-funcs.c
   branches/soc-2008-text/app/paint-funcs/scale-region.c
   branches/soc-2008-text/app/paint/gimppaintcore-stroke.c
   branches/soc-2008-text/app/paint/gimppaintcore.c
   branches/soc-2008-text/app/paint/gimpperspectiveclone.c
   branches/soc-2008-text/app/paint/gimpperspectiveclone.h
   branches/soc-2008-text/app/paint/gimpsourcecore.c
   branches/soc-2008-text/app/pdb/brush-cmds.c
   branches/soc-2008-text/app/pdb/brush-select-cmds.c
   branches/soc-2008-text/app/pdb/brushes-cmds.c
   branches/soc-2008-text/app/pdb/buffer-cmds.c
   branches/soc-2008-text/app/pdb/channel-cmds.c
   branches/soc-2008-text/app/pdb/color-cmds.c
   branches/soc-2008-text/app/pdb/context-cmds.c
   branches/soc-2008-text/app/pdb/convert-cmds.c
   branches/soc-2008-text/app/pdb/display-cmds.c
   branches/soc-2008-text/app/pdb/drawable-cmds.c
   branches/soc-2008-text/app/pdb/drawable-transform-cmds.c
   branches/soc-2008-text/app/pdb/edit-cmds.c
   branches/soc-2008-text/app/pdb/fileops-cmds.c
   branches/soc-2008-text/app/pdb/floating-sel-cmds.c
   branches/soc-2008-text/app/pdb/font-select-cmds.c
   branches/soc-2008-text/app/pdb/fonts-cmds.c
   branches/soc-2008-text/app/pdb/gimppdb.c
   branches/soc-2008-text/app/pdb/gimppdberror.h
   branches/soc-2008-text/app/pdb/gimpprocedure.c
   branches/soc-2008-text/app/pdb/gimpprocedure.h
   branches/soc-2008-text/app/pdb/gimprc-cmds.c
   branches/soc-2008-text/app/pdb/gradient-cmds.c
   branches/soc-2008-text/app/pdb/gradient-select-cmds.c
   branches/soc-2008-text/app/pdb/gradients-cmds.c
   branches/soc-2008-text/app/pdb/grid-cmds.c
   branches/soc-2008-text/app/pdb/guides-cmds.c
   branches/soc-2008-text/app/pdb/help-cmds.c
   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/message-cmds.c
   branches/soc-2008-text/app/pdb/misc-cmds.c
   branches/soc-2008-text/app/pdb/paint-tools-cmds.c
   branches/soc-2008-text/app/pdb/palette-cmds.c
   branches/soc-2008-text/app/pdb/palette-select-cmds.c
   branches/soc-2008-text/app/pdb/palettes-cmds.c
   branches/soc-2008-text/app/pdb/parasite-cmds.c
   branches/soc-2008-text/app/pdb/paths-cmds.c
   branches/soc-2008-text/app/pdb/pattern-cmds.c
   branches/soc-2008-text/app/pdb/pattern-select-cmds.c
   branches/soc-2008-text/app/pdb/patterns-cmds.c
   branches/soc-2008-text/app/pdb/plug-in-cmds.c
   branches/soc-2008-text/app/pdb/procedural-db-cmds.c
   branches/soc-2008-text/app/pdb/progress-cmds.c
   branches/soc-2008-text/app/pdb/selection-cmds.c
   branches/soc-2008-text/app/pdb/selection-tools-cmds.c
   branches/soc-2008-text/app/pdb/text-layer-cmds.c
   branches/soc-2008-text/app/pdb/text-tool-cmds.c
   branches/soc-2008-text/app/pdb/transform-tools-cmds.c
   branches/soc-2008-text/app/pdb/undo-cmds.c
   branches/soc-2008-text/app/pdb/unit-cmds.c
   branches/soc-2008-text/app/pdb/vectors-cmds.c
   branches/soc-2008-text/app/plug-in/gimpplugin-message.c
   branches/soc-2008-text/app/plug-in/gimpplugin-progress.c
   branches/soc-2008-text/app/plug-in/gimpplugin.c
   branches/soc-2008-text/app/plug-in/gimpplugin.h
   branches/soc-2008-text/app/plug-in/gimppluginmanager-call.c
   branches/soc-2008-text/app/plug-in/gimppluginmanager-call.h
   branches/soc-2008-text/app/plug-in/gimppluginprocedure.c
   branches/soc-2008-text/app/plug-in/gimppluginprocedure.h
   branches/soc-2008-text/app/plug-in/gimppluginprocframe.c
   branches/soc-2008-text/app/plug-in/gimppluginprocframe.h
   branches/soc-2008-text/app/plug-in/gimptemporaryprocedure.c
   branches/soc-2008-text/app/text/gimptext.c
   branches/soc-2008-text/app/text/gimptextlayout-render.c
   branches/soc-2008-text/app/tools/gimpaligntool.c
   branches/soc-2008-text/app/tools/gimpblendtool.c
   branches/soc-2008-text/app/tools/gimpbycolorselecttool.c
   branches/soc-2008-text/app/tools/gimpcolortool.c
   branches/soc-2008-text/app/tools/gimpcroptool.c
   branches/soc-2008-text/app/tools/gimpcurvestool.h
   branches/soc-2008-text/app/tools/gimpdrawtool.c
   branches/soc-2008-text/app/tools/gimpeditselectiontool.c
   branches/soc-2008-text/app/tools/gimpfliptool.c
   branches/soc-2008-text/app/tools/gimpforegroundselecttool.c
   branches/soc-2008-text/app/tools/gimpfreeselecttool.c
   branches/soc-2008-text/app/tools/gimpgegltool.c
   branches/soc-2008-text/app/tools/gimpimagemaptool.c
   branches/soc-2008-text/app/tools/gimpiscissorstool.c
   branches/soc-2008-text/app/tools/gimplevelstool.c
   branches/soc-2008-text/app/tools/gimpmovetool.c
   branches/soc-2008-text/app/tools/gimppaintoptions-gui.c
   branches/soc-2008-text/app/tools/gimppainttool.c
   branches/soc-2008-text/app/tools/gimpperspectiveclonetool.c
   branches/soc-2008-text/app/tools/gimpperspectiveclonetool.h
   branches/soc-2008-text/app/tools/gimprectangleselecttool.c
   branches/soc-2008-text/app/tools/gimprectangletool.c
   branches/soc-2008-text/app/tools/gimprotatetool.c
   branches/soc-2008-text/app/tools/gimpsheartool.c
   branches/soc-2008-text/app/tools/gimptexttool.c
   branches/soc-2008-text/app/tools/gimptool.c
   branches/soc-2008-text/app/tools/gimptool.h
   branches/soc-2008-text/app/tools/gimptoolcontrol.c
   branches/soc-2008-text/app/tools/gimptoolcontrol.h
   branches/soc-2008-text/app/tools/gimptransformtool.c
   branches/soc-2008-text/app/tools/gimpvectortool.c
   branches/soc-2008-text/app/widgets/gimpaction.c
   branches/soc-2008-text/app/widgets/gimpcolormapeditor.c
   branches/soc-2008-text/app/widgets/gimpdockable.c
   branches/soc-2008-text/app/widgets/gimphelp-ids.h
   branches/soc-2008-text/app/widgets/gimphistogrameditor.c
   branches/soc-2008-text/app/widgets/gimpnavigationview.c
   branches/soc-2008-text/app/widgets/gimppaletteeditor.c
   branches/soc-2008-text/app/widgets/gimpradioaction.c
   branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c
   branches/soc-2008-text/app/widgets/gimpstringaction.c
   branches/soc-2008-text/app/widgets/gimptoggleaction.c
   branches/soc-2008-text/app/widgets/gimptoolbox.c
   branches/soc-2008-text/app/widgets/gimpuimanager.c
   branches/soc-2008-text/app/xcf/xcf.c
   branches/soc-2008-text/authors.xml
   branches/soc-2008-text/autogen.sh
   branches/soc-2008-text/configure.in
   branches/soc-2008-text/devel-docs/ChangeLog
   branches/soc-2008-text/devel-docs/libgimp/libgimp-sections.txt
   branches/soc-2008-text/devel-docs/libgimp/tmpl/gimp.sgml
   branches/soc-2008-text/devel-docs/libgimp/tmpl/gimplayer.sgml
   branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpplugin.sgml
   branches/soc-2008-text/devel-docs/libgimpbase/libgimpbase-sections.txt
   branches/soc-2008-text/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
   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/gimpenums.c.tail
   branches/soc-2008-text/libgimp/gimplayer_pdb.c
   branches/soc-2008-text/libgimp/gimplayer_pdb.h
   branches/soc-2008-text/libgimp/gimppixelrgn.c
   branches/soc-2008-text/libgimp/gimpplugin_pdb.c
   branches/soc-2008-text/libgimp/gimpplugin_pdb.h
   branches/soc-2008-text/libgimpbase/gimpbase.def
   branches/soc-2008-text/libgimpbase/gimpbaseenums.c
   branches/soc-2008-text/libgimpbase/gimpbaseenums.h
   branches/soc-2008-text/libgimpwidgets/gimpscrolledpreview.c
   branches/soc-2008-text/libgimpwidgets/gimpscrolledpreview.h
   branches/soc-2008-text/libgimpwidgets/gimpwidgets.c
   branches/soc-2008-text/menus/image-menu.xml.in
   branches/soc-2008-text/menus/layers-menu.xml
   branches/soc-2008-text/modules/Makefile.am
   branches/soc-2008-text/po-libgimp/ChangeLog
   branches/soc-2008-text/po-libgimp/Makefile.in.in
   branches/soc-2008-text/po-libgimp/POTFILES.in
   branches/soc-2008-text/po-libgimp/POTFILES.skip
   branches/soc-2008-text/po-libgimp/ar.po
   branches/soc-2008-text/po-libgimp/de.po
   branches/soc-2008-text/po-libgimp/eu.po
   branches/soc-2008-text/po-libgimp/gl.po
   branches/soc-2008-text/po-libgimp/ja.po
   branches/soc-2008-text/po-libgimp/km.po
   branches/soc-2008-text/po-libgimp/ru.po
   branches/soc-2008-text/po-libgimp/sv.po
   branches/soc-2008-text/po-plug-ins/ChangeLog
   branches/soc-2008-text/po-plug-ins/Makefile.in.in
   branches/soc-2008-text/po-plug-ins/POTFILES.in
   branches/soc-2008-text/po-plug-ins/POTFILES.skip
   branches/soc-2008-text/po-plug-ins/ar.po
   branches/soc-2008-text/po-plug-ins/de.po
   branches/soc-2008-text/po-plug-ins/gl.po
   branches/soc-2008-text/po-plug-ins/ja.po
   branches/soc-2008-text/po-plug-ins/km.po
   branches/soc-2008-text/po-plug-ins/ru.po
   branches/soc-2008-text/po-plug-ins/sv.po
   branches/soc-2008-text/po-python/ChangeLog
   branches/soc-2008-text/po-python/Makefile.in.in
   branches/soc-2008-text/po-python/POTFILES.skip
   branches/soc-2008-text/po-python/eu.po
   branches/soc-2008-text/po-python/ja.po
   branches/soc-2008-text/po-python/km.po
   branches/soc-2008-text/po-python/ru.po
   branches/soc-2008-text/po-script-fu/ChangeLog
   branches/soc-2008-text/po-script-fu/Makefile.in.in
   branches/soc-2008-text/po-script-fu/POTFILES.in
   branches/soc-2008-text/po-script-fu/POTFILES.skip
   branches/soc-2008-text/po-script-fu/ar.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/ja.po
   branches/soc-2008-text/po-script-fu/km.po
   branches/soc-2008-text/po-script-fu/ru.po
   branches/soc-2008-text/po-tips/ChangeLog
   branches/soc-2008-text/po-tips/Makefile.in.in
   branches/soc-2008-text/po-tips/POTFILES.skip
   branches/soc-2008-text/po-tips/ar.po
   branches/soc-2008-text/po-tips/fi.po
   branches/soc-2008-text/po-tips/ja.po
   branches/soc-2008-text/po-tips/km.po
   branches/soc-2008-text/po/ChangeLog
   branches/soc-2008-text/po/POTFILES.in
   branches/soc-2008-text/po/POTFILES.skip
   branches/soc-2008-text/po/ar.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/fr.po
   branches/soc-2008-text/po/gl.po
   branches/soc-2008-text/po/ja.po
   branches/soc-2008-text/po/km.po
   branches/soc-2008-text/po/pl.po
   branches/soc-2008-text/po/ru.po
   branches/soc-2008-text/po/sv.po
   branches/soc-2008-text/tools/Makefile.am
   branches/soc-2008-text/tools/pdbgen/app.pl
   branches/soc-2008-text/tools/pdbgen/enums.pl
   branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/gradient.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/plug_in.pdb
   branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb

Modified: branches/soc-2008-text/AUTHORS
==============================================================================
--- branches/soc-2008-text/AUTHORS	(original)
+++ branches/soc-2008-text/AUTHORS	Fri Aug 29 18:50:27 2008
@@ -14,6 +14,7 @@
  Henrik Brix Andersen
  Karl-Johan Andersson
  Nicola Archibald
+ Luis Barrancos
  John Beale
  Zach Beane
  Tom Bech
@@ -35,6 +36,7 @@
  Winston Chang
  Stephane Chauveau
  Zbigniew Chyla
+ Lars-Peter Clausen
  Branko Collin
  Ed Connel
  Piers Cornwell
@@ -42,13 +44,17 @@
  Daniel Cotting
  Jay Cox
  Kevin Cozens
+ Michael Deal
+ Alexia Death
  Brian Degenhardt
  Karine Delvare
+ Aurore Derriennic
  Andreas Dilger
  Austin Donnelly
  Scott Draves
  Daniel Dunbar
  Misha Dynin
+ Daniel Eddeland
  Daniel Egger
  Morton Eriksen
  Larry Ewing
@@ -76,6 +82,7 @@
  Pavel Grinfeld
  Dov Grobgeld
  Michael Hammel
+ Marcus Heese
  Robert Helgesson
  James Henstridge
  Eric Hernes
@@ -83,6 +90,7 @@
  Christoph Hoegl
  Wolfgang Hofer
  Alan Horkan
+ Daniel Hornung
  Jan HubiÄka
  Ben Jackson
  Tim Janik
@@ -106,6 +114,7 @@
  Marco Lamberto
  Jens Lautenbacher
  Laramie Leavitt
+ Tom Lechner
  Elliot Lee
  Marc Lehmann
  Ray Lehtiniemi
@@ -113,12 +122,14 @@
  Frederic Leroy
  Raph Levien
  Wing Tung Leung
+ LightningIsMyName
  Adrian Likins
  Tor Lillqvist
  Ingo LÃtkebohle
  Josh MacDonald
  Ed Mackey
  Vidar Madsen
+ Luidnel Maignan
  Ian Main
  Kjartan Maraas
  John Marshall

Modified: branches/soc-2008-text/HACKING
==============================================================================
--- branches/soc-2008-text/HACKING	(original)
+++ branches/soc-2008-text/HACKING	Fri Aug 29 18:50:27 2008
@@ -38,7 +38,7 @@
 Basically this does the following for you:
 
     gimp/trunk$ aclocal-1.9; libtoolize; automake-1.9 -a;
-    gimp/trunk$ autoconf; glib-gettextize; intltoolize
+    gimp/trunk$ autoconf; intltoolize --automake
 
 The above commands create the "configure" script.  Now you can run the
 configure script in gimp/trunk to create all the Makefiles.

Modified: branches/soc-2008-text/INSTALL
==============================================================================
--- branches/soc-2008-text/INSTALL	(original)
+++ branches/soc-2008-text/INSTALL	Fri Aug 29 18:50:27 2008
@@ -59,8 +59,9 @@
 
   8. 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: libpng,
-     libjpeg, libpoppler, libtiff, webkit, libmng, librsvg, libwmf.
+     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
      present. You will also need PyGTK and the respective development

Modified: branches/soc-2008-text/Makefile.am
==============================================================================
--- branches/soc-2008-text/Makefile.am	(original)
+++ branches/soc-2008-text/Makefile.am	Fri Aug 29 18:50:27 2008
@@ -70,8 +70,7 @@
 	config.h.win32		\
 	gimp-zip.in		\
 	gimpdefs.msc		\
-	makefile.msc		\
-	mkinstalldirs
+	makefile.msc
 
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc

Modified: branches/soc-2008-text/NEWS
==============================================================================
--- branches/soc-2008-text/NEWS	(original)
+++ branches/soc-2008-text/NEWS	Fri Aug 29 18:50:27 2008
@@ -7,11 +7,48 @@
 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 dockable dialog for managing Color tool settings
+ - 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

Modified: branches/soc-2008-text/app/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/Makefile.am	(original)
+++ branches/soc-2008-text/app/Makefile.am	Fri Aug 29 18:50:27 2008
@@ -69,7 +69,7 @@
 	wilber.ico
 
 if OS_WIN32
-win32_ldflags = -mwindows -Wl,--large-address-aware
+win32_ldflags = -mwindows $(WIN32_LARGE_ADDRESS_AWARE)
 endif
 
 if USE_BINRELOC

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	Fri Aug 29 18:50:27 2008
@@ -24,6 +24,8 @@
 
 #include "actions-types.h"
 
+#include "core/gimp.h"
+
 #include "widgets/gimpactiongroup.h"
 
 #include "debug-actions.h"
@@ -57,8 +59,32 @@
     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)
 {
@@ -66,6 +92,15 @@
   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	Fri Aug 29 18:50:27 2008
@@ -146,6 +146,18 @@
   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	Fri Aug 29 18:50:27 2008
@@ -35,6 +35,8 @@
                                               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	Fri Aug 29 18:50:27 2008
@@ -173,7 +173,7 @@
     "gimp-image-list|gimp-image-grid",
     GIMP_HELP_IMAGE_DIALOG },
 
-  { "dialogs-document-history", GTK_STOCK_OPEN,
+  { "dialogs-document-history", "document-open-recent",
     N_("Document Histor_y"), "",
     N_("Open the document history dialog"),
     "gimp-document-list|gimp-document-grid",

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

Modified: branches/soc-2008-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	Fri Aug 29 18:50:27 2008
@@ -118,7 +118,7 @@
 
   { "edit-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
     N_("Copy _Visible"), "<control><shift>C",
-    N_("Copy the selected region to the clipboard"),
+    N_("Copy what is visible in the the selected region"),
     G_CALLBACK (edit_copy_visible_cmd_callback),
     GIMP_HELP_EDIT_COPY_VISIBLE },
 
@@ -146,6 +146,12 @@
     G_CALLBACK (edit_paste_as_new_cmd_callback),
     GIMP_HELP_EDIT_PASTE_AS_NEW },
 
+  { "edit-paste-as-new-layer", NULL,
+    N_("New _Layer"), NULL,
+    N_("Create a new layer from the content of the clipboard"),
+    G_CALLBACK (edit_paste_as_new_layer_cmd_callback),
+    GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER },
+
   { "edit-named-cut", GTK_STOCK_CUT,
     N_("Cu_t Named..."), "",
     N_("Move the selected pixels to a named buffer"),
@@ -314,21 +320,22 @@
   g_free (redo_name);
   g_free (fade_name);
 
-  SET_SENSITIVE ("edit-cut",          drawable);
-  SET_SENSITIVE ("edit-copy",         drawable);
-  SET_SENSITIVE ("edit-copy-visible", image);
+  SET_SENSITIVE ("edit-cut",                drawable);
+  SET_SENSITIVE ("edit-copy",               drawable);
+  SET_SENSITIVE ("edit-copy-visible",       image);
   /*             "edit-paste" is always enabled  */
-  SET_SENSITIVE ("edit-paste-into",   image);
+  SET_SENSITIVE ("edit-paste-as-new-layer", image);
+  SET_SENSITIVE ("edit-paste-into",         image);
 
   SET_SENSITIVE ("edit-named-cut",          drawable);
   SET_SENSITIVE ("edit-named-copy",         drawable);
   SET_SENSITIVE ("edit-named-copy-visible", drawable);
   SET_SENSITIVE ("edit-named-paste",        image);
 
-  SET_SENSITIVE ("edit-clear",        drawable);
-  SET_SENSITIVE ("edit-fill-fg",      drawable);
-  SET_SENSITIVE ("edit-fill-bg",      drawable);
-  SET_SENSITIVE ("edit-fill-pattern", drawable);
+  SET_SENSITIVE ("edit-clear",              drawable);
+  SET_SENSITIVE ("edit-fill-fg",            drawable);
+  SET_SENSITIVE ("edit-fill-bg",            drawable);
+  SET_SENSITIVE ("edit-fill-pattern",       drawable);
 
 #undef SET_LABEL
 #undef SET_SENSITIVE

Modified: branches/soc-2008-text/app/actions/edit-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/edit-commands.c	(original)
+++ branches/soc-2008-text/app/actions/edit-commands.c	Fri Aug 29 18:50:27 2008
@@ -32,6 +32,7 @@
 #include "core/gimpbuffer.h"
 #include "core/gimpcontainer.h"
 #include "core/gimpdrawable.h"
+#include "core/gimplayer.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-undo.h"
 
@@ -300,14 +301,47 @@
 
       image = gimp_edit_paste_as_new (gimp, action_data_get_image (data),
                                       buffer);
+      g_object_unref (buffer);
 
       if (image)
         {
           gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0);
           g_object_unref (image);
         }
+    }
+  else
+    {
+      gimp_message (gimp, NULL, GIMP_MESSAGE_WARNING,
+                    _("There is no image data in the clipboard to paste."));
+    }
+}
+
+void
+edit_paste_as_new_layer_cmd_callback (GtkAction *action,
+                                      gpointer   data)
+{
+  Gimp       *gimp;
+  GimpImage  *image;
+  GimpBuffer *buffer;
+  return_if_no_gimp (gimp, data);
+  return_if_no_image (image, data);
+
+  buffer = gimp_clipboard_get_buffer (gimp);
 
+  if (buffer)
+    {
+      GimpLayer *layer;
+
+      layer = gimp_layer_new_from_tiles (gimp_buffer_get_tiles (buffer),
+                                         image,
+                                         gimp_image_base_type_with_alpha (image),
+                                         _("Clipboard"),
+                                         GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
       g_object_unref (buffer);
+
+      gimp_image_add_layer (image, layer, -1);
+
+      gimp_image_flush (image);
     }
   else
     {

Modified: branches/soc-2008-text/app/actions/edit-commands.h
==============================================================================
--- branches/soc-2008-text/app/actions/edit-commands.h	(original)
+++ branches/soc-2008-text/app/actions/edit-commands.h	Fri Aug 29 18:50:27 2008
@@ -44,6 +44,8 @@
                                              gpointer   data);
 void   edit_paste_as_new_cmd_callback       (GtkAction *action,
                                              gpointer   data);
+void   edit_paste_as_new_layer_cmd_callback (GtkAction *action,
+                                             gpointer   data);
 void   edit_named_cut_cmd_callback          (GtkAction *action,
                                              gpointer   data);
 void   edit_named_copy_cmd_callback         (GtkAction *action,

Modified: branches/soc-2008-text/app/actions/file-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/file-commands.c	(original)
+++ branches/soc-2008-text/app/actions/file-commands.c	Fri Aug 29 18:50:27 2008
@@ -195,6 +195,7 @@
   GimpImage    *image;
   GtkWidget    *widget;
   GimpSaveMode  save_mode;
+  const gchar  *uri;
   gboolean      saved = FALSE;
   return_if_no_display (display, data);
   return_if_no_widget (widget, data);
@@ -206,24 +207,25 @@
   if (! gimp_image_get_active_drawable (image))
     return;
 
+  uri = gimp_object_get_name (GIMP_OBJECT (image));
+
   switch (save_mode)
     {
     case GIMP_SAVE_MODE_SAVE:
     case GIMP_SAVE_MODE_SAVE_AND_CLOSE:
-      /*  Only save if the image has been modified  */
-      if (image->dirty ||
-          ! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag)
+      /*  Only save if the image has been modified, or if it is new.  */
+      if ((image->dirty ||
+           ! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) ||
+          uri == NULL)
         {
-          const gchar         *uri;
-          GimpPlugInProcedure *save_proc = NULL;
-
-          uri       = gimp_object_get_name (GIMP_OBJECT (image));
-          save_proc = gimp_image_get_save_proc (image);
+          GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
 
           if (uri && ! save_proc)
-            save_proc =
-              file_procedure_find (image->gimp->plug_in_manager->save_procs,
-                                   uri, NULL);
+            {
+              save_proc =
+                file_procedure_find (image->gimp->plug_in_manager->save_procs,
+                                     uri, NULL);
+            }
 
           if (uri && save_proc)
             {
@@ -287,6 +289,8 @@
         }
       else
         {
+          gimp_message (image->gimp, G_OBJECT (display),
+                        GIMP_MESSAGE_INFO, _("No changes need to be saved"));
           saved = TRUE;
           break;
         }

Modified: branches/soc-2008-text/app/actions/layers-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/layers-actions.c	(original)
+++ branches/soc-2008-text/app/actions/layers-actions.c	Fri Aug 29 18:50:27 2008
@@ -82,6 +82,12 @@
     G_CALLBACK (layers_new_last_vals_cmd_callback),
     GIMP_HELP_LAYER_NEW },
 
+  { "layers-new-from-visible", NULL,
+    N_("New from _Visible"), NULL,
+    N_("Create a new layer from what is visible in this image"),
+    G_CALLBACK (layers_new_from_visible_cmd_callback),
+    GIMP_HELP_LAYER_NEW_FROM_VISIBLE },
+
   { "layers-duplicate", GIMP_STOCK_DUPLICATE,
     N_("D_uplicate Layer"), "<control><shift>D",
     N_("Create a duplicate of the layer and add it to the image"),
@@ -510,28 +516,29 @@
 #define SET_ACTIVE(action,condition) \
         gimp_action_group_set_action_active (group, action, (condition) != 0)
 
-  SET_VISIBLE   ("layers-text-tool",       text_layer && !ac);
-  SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
+  SET_VISIBLE   ("layers-text-tool",        text_layer && !ac);
+  SET_SENSITIVE ("layers-edit-attributes",  layer && !fs && !ac);
 
-  SET_SENSITIVE ("layers-new",             image);
-  SET_SENSITIVE ("layers-new-last-values", image);
-  SET_SENSITIVE ("layers-duplicate",       layer && !fs && !ac);
-  SET_SENSITIVE ("layers-delete",          layer && !ac);
-
-  SET_SENSITIVE ("layers-select-top",      layer && !fs && !ac && prev);
-  SET_SENSITIVE ("layers-select-bottom",   layer && !fs && !ac && next);
-  SET_SENSITIVE ("layers-select-previous", layer && !fs && !ac && prev);
-  SET_SENSITIVE ("layers-select-next",     layer && !fs && !ac && next);
-
-  SET_SENSITIVE ("layers-raise",           layer && !fs && !ac && prev);
-  SET_SENSITIVE ("layers-raise-to-top",    layer && !fs && !ac && prev);
-  SET_SENSITIVE ("layers-lower",           layer && !fs && !ac && next);
-  SET_SENSITIVE ("layers-lower-to-bottom", layer && !fs && !ac && next);
-
-  SET_SENSITIVE ("layers-anchor",          layer &&  fs && !ac);
-  SET_SENSITIVE ("layers-merge-down",      layer && !fs && !ac && next);
-  SET_SENSITIVE ("layers-merge-layers",    layer && !fs && !ac);
-  SET_SENSITIVE ("layers-flatten-image",   layer && !fs && !ac);
+  SET_SENSITIVE ("layers-new",              image);
+  SET_SENSITIVE ("layers-new-last-values",  image);
+  SET_SENSITIVE ("layers-new-from-visible", image);
+  SET_SENSITIVE ("layers-duplicate",        layer && !fs && !ac);
+  SET_SENSITIVE ("layers-delete",           layer && !ac);
+
+  SET_SENSITIVE ("layers-select-top",       layer && !fs && !ac && prev);
+  SET_SENSITIVE ("layers-select-bottom",    layer && !fs && !ac && next);
+  SET_SENSITIVE ("layers-select-previous",  layer && !fs && !ac && prev);
+  SET_SENSITIVE ("layers-select-next",      layer && !fs && !ac && next);
+
+  SET_SENSITIVE ("layers-raise",            layer && !fs && !ac && prev);
+  SET_SENSITIVE ("layers-raise-to-top",     layer && !fs && !ac && prev);
+  SET_SENSITIVE ("layers-lower",            layer && !fs && !ac && next);
+  SET_SENSITIVE ("layers-lower-to-bottom",  layer && !fs && !ac && next);
+
+  SET_SENSITIVE ("layers-anchor",           layer &&  fs && !ac);
+  SET_SENSITIVE ("layers-merge-down",       layer && !fs && !ac && next);
+  SET_SENSITIVE ("layers-merge-layers",     layer && !fs && !ac);
+  SET_SENSITIVE ("layers-flatten-image",    layer && !fs && !ac);
 
   SET_VISIBLE   ("layers-text-discard",             text_layer && !ac);
   SET_VISIBLE   ("layers-text-to-vectors",          text_layer && !ac);

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	Fri Aug 29 18:50:27 2008
@@ -41,6 +41,7 @@
 #include "core/gimplayer.h"
 #include "core/gimplayer-floating-sel.h"
 #include "core/gimplayermask.h"
+#include "core/gimpprojection.h"
 #include "core/gimptoolinfo.h"
 #include "core/gimpundostack.h"
 #include "core/gimpprogress.h"
@@ -335,6 +336,27 @@
 }
 
 void
+layers_new_from_visible_cmd_callback (GtkAction *action,
+                                      gpointer   data)
+{
+  GimpImage      *image;
+  GimpLayer      *layer;
+  GimpProjection *projection;
+  return_if_no_image (image, data);
+
+  projection = gimp_image_get_projection (image);
+
+  layer = gimp_layer_new_from_tiles (gimp_projection_get_tiles (projection),
+                                     image,
+                                     gimp_image_base_type_with_alpha (image),
+                                     _("Visible"),
+                                     GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
+  gimp_image_add_layer (image, layer, -1);
+
+  gimp_image_flush (image);
+}
+
+void
 layers_select_cmd_callback (GtkAction *action,
                             gint       value,
                             gpointer   data)

Modified: branches/soc-2008-text/app/actions/layers-commands.h
==============================================================================
--- branches/soc-2008-text/app/actions/layers-commands.h	(original)
+++ branches/soc-2008-text/app/actions/layers-commands.h	Fri Aug 29 18:50:27 2008
@@ -24,10 +24,13 @@
                                                gpointer     data);
 void   layers_edit_attributes_cmd_callback    (GtkAction   *action,
                                                gpointer     data);
+
 void   layers_new_cmd_callback                (GtkAction   *action,
                                                gpointer     data);
 void   layers_new_last_vals_cmd_callback      (GtkAction   *action,
                                                gpointer     data);
+void   layers_new_from_visible_cmd_callback   (GtkAction   *action,
+                                               gpointer     data);
 
 void   layers_select_cmd_callback             (GtkAction   *action,
                                                gint         value,

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	Fri Aug 29 18:50:27 2008
@@ -38,6 +38,8 @@
 #include "display/gimpdisplayshell-appearance.h"
 #include "display/gimpdisplayshell-filter-dialog.h"
 #include "display/gimpdisplayshell-scale.h"
+#include "display/gimpdisplayshell-scale-dialog.h"
+#include "display/gimpdisplayshell-scroll.h"
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimpcolordialog.h"
@@ -631,9 +633,12 @@
                                gpointer   data)
 {
   GimpDisplay *display;
+  GimpDisplayShell *shell;
   return_if_no_display (display, data);
 
-  gimp_display_shell_scale_shrink_wrap (GIMP_DISPLAY_SHELL (display->shell),
+  shell = GIMP_DISPLAY_SHELL (display->shell);
+
+  gimp_display_shell_scale_shrink_wrap (shell,
                                         FALSE);
 }
 

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

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

Modified: branches/soc-2008-text/app/base/tile-manager.c
==============================================================================
--- branches/soc-2008-text/app/base/tile-manager.c	(original)
+++ branches/soc-2008-text/app/base/tile-manager.c	Fri Aug 29 18:50:27 2008
@@ -33,6 +33,9 @@
 #include "tile-private.h"
 
 
+static void  tile_manager_allocate_tiles (TileManager *tm);
+
+
 GType
 gimp_tile_manager_get_type (void)
 {
@@ -151,13 +154,8 @@
                   gboolean     wantread,
                   gboolean     wantwrite)
 {
-  Tile **tiles;
-  Tile **tile_ptr;
-  gint   ntiles;
-  gint   nrows, ncols;
-  gint   right_tile;
-  gint   bottom_tile;
-  gint   i, j, k;
+  Tile *tile;
+  gint  ntiles;
 
   g_return_val_if_fail (tm != NULL, NULL);
 
@@ -167,46 +165,16 @@
     return NULL;
 
   if (! tm->tiles)
-    {
-      tm->tiles = g_new (Tile *, ntiles);
-      tiles = tm->tiles;
-
-      nrows = tm->ntile_rows;
-      ncols = tm->ntile_cols;
-
-      right_tile  = tm->width  - ((ncols - 1) * TILE_WIDTH);
-      bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
-
-      for (i = 0, k = 0; i < nrows; i++)
-        {
-          for (j = 0; j < ncols; j++, k++)
-            {
-              Tile *new = tile_new (tm->bpp);
+    tile_manager_allocate_tiles (tm);
 
-              tile_attach (new, tm, k);
-
-              if (j == (ncols - 1))
-                new->ewidth = right_tile;
-
-              if (i == (nrows - 1))
-                new->eheight = bottom_tile;
-
-              new->size = new->ewidth * new->eheight * new->bpp;
-
-              tiles[k] = new;
-            }
-        }
-    }
-
-  tile_ptr = &tm->tiles[tile_num];
+  tile = tm->tiles[tile_num];
 
   if (G_UNLIKELY (wantwrite && ! wantread))
     g_warning ("WRITE-ONLY TILE... UNTESTED!");
 
 #ifdef DEBUG_TILE_MANAGER
-  if (G_UNLIKELY ((*tile_ptr)->share_count && (*tile_ptr)->write_count))
-    g_printerr (">> MEEPITY %d,%d <<\n",
-                (*tile_ptr)->share_count, (*tile_ptr)->write_count);
+  if (G_UNLIKELY (tile->share_count && tile->write_count))
+    g_printerr (">> MEEPITY %d,%d <<\n", tile->share_count, tile->write_count);
 #endif
 
   if (wantread)
@@ -221,59 +189,59 @@
               tm->cached_num  = -1;
             }
 
-          if ((*tile_ptr)->share_count > 1)
+          if (tile->share_count > 1)
             {
               /* Copy-on-write required */
-              Tile *new = tile_new ((*tile_ptr)->bpp);
+              Tile *new = tile_new (tile->bpp);
 
-              new->ewidth  = (*tile_ptr)->ewidth;
-              new->eheight = (*tile_ptr)->eheight;
-              new->valid   = (*tile_ptr)->valid;
+              new->ewidth  = tile->ewidth;
+              new->eheight = tile->eheight;
+              new->valid   = tile->valid;
 
               new->size    = new->ewidth * new->eheight * new->bpp;
               new->data    = g_new (guchar, new->size);
 
-              if ((*tile_ptr)->rowhint)
+              if (tile->rowhint)
                 {
                   tile_allocate_rowhints (new);
 
-                  memcpy (new->rowhint, (*tile_ptr)->rowhint,
+                  memcpy (new->rowhint, tile->rowhint,
                           new->eheight * sizeof (TileRowHint));
                 }
 
-              if ((*tile_ptr)->data)
+              if (tile->data)
                 {
-                  memcpy (new->data, (*tile_ptr)->data, new->size);
+                  memcpy (new->data, tile->data, new->size);
                 }
               else
                 {
-                  tile_lock (*tile_ptr);
-                  memcpy (new->data, (*tile_ptr)->data, new->size);
-                  tile_release (*tile_ptr, FALSE);
+                  tile_lock (tile);
+                  memcpy (new->data, tile->data, new->size);
+                  tile_release (tile, FALSE);
                 }
 
-              tile_detach (*tile_ptr, tm, tile_num);
-
+              tile_detach (tile, tm, tile_num);
               tile_attach (new, tm, tile_num);
-              *tile_ptr = new;
+
+              tile = new;
+              tm->tiles[tile_num] = tile;
             }
 
-          (*tile_ptr)->write_count++;
-          (*tile_ptr)->dirty = TRUE;
+          tile->write_count++;
+          tile->dirty = TRUE;
         }
 #ifdef DEBUG_TILE_MANAGER
       else
         {
-          if (G_UNLIKELY ((*tile_ptr)->write_count))
-            g_printerr ("STINK! r/o on r/w tile (%d)\n",
-                        (*tile_ptr)->write_count);
+          if (G_UNLIKELY (tile->write_count))
+            g_printerr ("STINK! r/o on r/w tile (%d)\n", tile->write_count);
         }
 #endif
 
-      tile_lock (*tile_ptr);
+      tile_lock (tile);
     }
 
-  return *tile_ptr;
+  return tile;
 }
 
 Tile *
@@ -319,6 +287,43 @@
 }
 
 static void
+tile_manager_allocate_tiles (TileManager *tm)
+{
+  Tile       **tiles;
+  const gint   nrows       = tm->ntile_rows;
+  const gint   ncols       = tm->ntile_cols;
+  const gint   right_tile  = tm->width  - ((ncols - 1) * TILE_WIDTH);
+  const gint   bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
+  gint         i, j, k;
+
+  g_assert (tm->tiles == NULL);
+
+  tiles = g_new (Tile *, nrows * ncols);
+
+  for (i = 0, k = 0; i < nrows; i++)
+    {
+      for (j = 0; j < ncols; j++, k++)
+        {
+          Tile *new = tile_new (tm->bpp);
+
+          tile_attach (new, tm, k);
+
+          if (j == (ncols - 1))
+            new->ewidth = right_tile;
+
+          if (i == (nrows - 1))
+            new->eheight = bottom_tile;
+
+          new->size = new->ewidth * new->eheight * new->bpp;
+
+          tiles[k] = new;
+        }
+    }
+
+  tm->tiles = tiles;
+}
+
+static void
 tile_manager_invalidate_tile (TileManager  *tm,
                               gint          tile_num)
 {
@@ -335,26 +340,25 @@
       tm->cached_num  = -1;
     }
 
+  if (tile->listhead)
+    tile_cache_flush (tile);
+
   if (G_UNLIKELY (tile->share_count > 1))
     {
-      /* This tile is shared.  Replace it with a new, invalid tile. */
+      /* This tile is shared.  Replace it with a new invalid tile. */
       Tile *new = tile_new (tile->bpp);
 
-      g_print ("invalidating shared tile (executing buggy code!!!)\n");
-
       new->ewidth  = tile->ewidth;
       new->eheight = tile->eheight;
       new->size    = tile->size;
 
       tile_detach (tile, tm, tile_num);
-
       tile_attach (new, tm, tile_num);
+
       tile = new;
+      tm->tiles[tile_num] = tile;
     }
 
-  if (tile->listhead)
-    tile_cache_flush (tile);
-
   tile->valid = FALSE;
 
   if (tile->data)
@@ -391,20 +395,12 @@
                        gint         ypixel,
                        Tile        *srctile)
 {
-  gint num;
-
   g_return_if_fail (tm != NULL);
   g_return_if_fail (srctile != NULL);
 
-  num = tile_manager_get_tile_num (tm, xpixel, ypixel);
-
-  if (G_UNLIKELY (num < 0))
-    {
-      g_warning ("%s: tile coordinates out of range.", G_STRLOC);
-      return;
-    }
-
-  tile_manager_map (tm, num, srctile);
+  tile_manager_map (tm,
+                    tile_manager_get_tile_num (tm, xpixel, ypixel),
+                    srctile);
 }
 
 void
@@ -412,63 +408,21 @@
                   gint         tile_num,
                   Tile        *srctile)
 {
-  Tile **tiles;
-  Tile **tile_ptr;
-  gint   ntiles;
-  gint   nrows, ncols;
-  gint   right_tile;
-  gint   bottom_tile;
-  gint   i, j, k;
+  Tile *tile;
 
   g_return_if_fail (tm != NULL);
   g_return_if_fail (srctile != NULL);
-
-  ntiles = tm->ntile_rows * tm->ntile_cols;
-
-  if (G_UNLIKELY ((tile_num < 0) || (tile_num >= ntiles)))
-    {
-      g_warning ("%s: tile out of range", G_STRLOC);
-      return;
-    }
+  g_return_if_fail (tile_num >= 0);
+  g_return_if_fail (tile_num < tm->ntile_rows * tm->ntile_cols);
 
   if (G_UNLIKELY (! tm->tiles))
     {
       g_warning ("%s: empty tile level - initializing", G_STRLOC);
 
-      tm->tiles = g_new (Tile *, ntiles);
-      tiles = tm->tiles;
-
-      nrows = tm->ntile_rows;
-      ncols = tm->ntile_cols;
-
-      right_tile  = tm->width  - ((ncols - 1) * TILE_WIDTH);
-      bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
-
-      for (i = 0, k = 0; i < nrows; i++)
-        {
-          for (j = 0; j < ncols; j++, k++)
-            {
-              Tile *new = tile_new (tm->bpp);
-
-#ifdef DEBUG_TILE_MANAGER
-              g_printerr (",");
-#endif
-              tile_attach (new, tm, k);
-
-              if (j == (ncols - 1))
-                new->ewidth = right_tile;
-
-              if (i == (nrows - 1))
-                new->eheight = bottom_tile;
-
-              new->size = new->ewidth * new->eheight * new->bpp;
-
-              tiles[k] = new;
-            }
-        }
+      tile_manager_allocate_tiles (tm);
     }
 
-  tile_ptr = &tm->tiles[tile_num];
+  tile = tm->tiles[tile_num];
 
 #ifdef DEBUG_TILE_MANAGER
   g_printerr (")");
@@ -477,15 +431,15 @@
   if (G_UNLIKELY (! srctile->valid))
     g_warning("%s: srctile not validated yet!  please report", G_STRLOC);
 
-  if (G_UNLIKELY ((*tile_ptr)->ewidth  != srctile->ewidth  ||
-                  (*tile_ptr)->eheight != srctile->eheight ||
-                  (*tile_ptr)->bpp     != srctile->bpp))
+  if (G_UNLIKELY (tile->ewidth  != srctile->ewidth  ||
+                  tile->eheight != srctile->eheight ||
+                  tile->bpp     != srctile->bpp))
     {
       g_warning ("%s: nonconformant map (%p -> %p)",
-                 G_STRLOC, srctile, *tile_ptr);
+                 G_STRLOC, srctile, tile);
     }
 
-  tile_detach (*tile_ptr, tm, tile_num);
+  tile_detach (tile, tm, tile_num);
 
 #ifdef DEBUG_TILE_MANAGER
   g_printerr (">");
@@ -496,7 +450,8 @@
 #endif
 
   tile_attach (srctile, tm, tile_num);
-  *tile_ptr = srctile;
+
+  tm->tiles[tile_num] = srctile;
 
 #ifdef DEBUG_TILE_MANAGER
   g_printerr ("}\n");
@@ -626,17 +581,12 @@
   return memsize;
 }
 
-void
-tile_manager_get_tile_coordinates (TileManager *tm,
-                                   Tile        *tile,
-                                   gint        *x,
-                                   gint        *y)
+static inline gint
+tile_manager_locate_tile (TileManager *tm,
+                          Tile        *tile)
 {
   TileLink *tl;
 
-  g_return_if_fail (tm != NULL);
-  g_return_if_fail (x != NULL && y != NULL);
-
   for (tl = tile->tlink; tl; tl = tl->next)
     {
       if (tl->tm == tm)
@@ -646,11 +596,10 @@
   if (G_UNLIKELY (tl == NULL))
     {
       g_warning ("%s: tile not attached to manager", G_STRLOC);
-      return;
+      return 0;
     }
 
-  *x = TILE_WIDTH * (tl->tile_num % tm->ntile_cols);
-  *y = TILE_HEIGHT * (tl->tile_num / tm->ntile_cols);
+  return tl->tile_num;
 }
 
 void
@@ -659,15 +608,35 @@
                                gint        *tile_col,
                                gint        *tile_row)
 {
-  gint tile_x;
-  gint tile_y;
+  gint tile_num;
+
+  g_return_if_fail (tm != NULL);
+  g_return_if_fail (tile != NULL);
+  g_return_if_fail (tile_col != NULL && tile_row != NULL);
+
+  tile_num = tile_manager_locate_tile (tm, tile);
+
+  *tile_col = tile_num % tm->ntile_cols;
+  *tile_row = tile_num / tm->ntile_cols;
+}
+
+void
+tile_manager_get_tile_coordinates (TileManager *tm,
+                                   Tile        *tile,
+                                   gint        *x,
+                                   gint        *y)
+{
+  gint tile_col;
+  gint tile_row;
 
-  g_return_if_fail (tm && tile && tile_col && tile_row);
+  g_return_if_fail (tm != NULL);
+  g_return_if_fail (tile != NULL);
+  g_return_if_fail (x != NULL && y != NULL);
 
-  tile_manager_get_tile_coordinates (tm, tile, &tile_x, &tile_y);
+  tile_manager_get_tile_col_row (tm, tile, &tile_col, &tile_row);
 
-  *tile_col = tile_x / TILE_WIDTH;
-  *tile_row = tile_y / TILE_HEIGHT;
+  *x = TILE_WIDTH  * tile_col;
+  *y = TILE_HEIGHT * tile_row;
 }
 
 void
@@ -710,21 +679,21 @@
   for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
     for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
       {
-        Tile         *t = tile_manager_get_tile (tm, x, y, TRUE, FALSE);
-        const guchar *s = tile_data_pointer (t, x, y);
-        guchar       *d = buffer + stride * (y - y1) + tm->bpp * (x - x1);
+        Tile         *tile = tile_manager_get_tile (tm, x, y, TRUE, FALSE);
+        const guchar *s    = TILE_DATA_POINTER (tile, x, y);
+        guchar       *d    = buffer + stride * (y - y1) + tm->bpp * (x - x1);
         guint         rows, cols;
         guint         srcstride;
 
-        rows = tile_eheight (t) - y % TILE_HEIGHT;
+        rows = tile->eheight - y % TILE_HEIGHT;
         if (rows > (y2 - y + 1))
           rows = y2 - y + 1;
 
-        cols = tile_ewidth (t) - x % TILE_WIDTH;
+        cols = tile->ewidth - x % TILE_WIDTH;
         if (cols > (x2 - x + 1))
           cols = x2 - x + 1;
 
-        srcstride = tile_ewidth (t) * tile_bpp (t);
+        srcstride = tile->ewidth * tile->bpp;
 
         while (rows--)
           {
@@ -734,7 +703,7 @@
             d += stride;
           }
 
-        tile_release (t, FALSE);
+        tile_release (tile, FALSE);
       }
 }
 
@@ -752,21 +721,21 @@
   for (y = y1; y <= y2; y += TILE_HEIGHT - (y % TILE_HEIGHT))
     for (x = x1; x <= x2; x += TILE_WIDTH - (x % TILE_WIDTH))
       {
-        Tile         *t = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
-        const guchar *s = buffer + stride * (y - y1) + tm->bpp * (x - x1);
-        guchar       *d = tile_data_pointer (t, x, y);
+        Tile         *tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
+        const guchar *s    = buffer + stride * (y - y1) + tm->bpp * (x - x1);
+        guchar       *d    = TILE_DATA_POINTER (tile, x, y);
         guint         rows, cols;
         guint         dststride;
 
-        rows = tile_eheight (t) - y % TILE_HEIGHT;
+        rows = tile->eheight - y % TILE_HEIGHT;
         if (rows > (y2 - y + 1))
           rows = y2 - y + 1;
 
-        cols = tile_ewidth (t) - x % TILE_WIDTH;
+        cols = tile->ewidth - x % TILE_WIDTH;
         if (cols > (x2 - x + 1))
           cols = x2 - x + 1;
 
-        dststride = tile_ewidth (t) * tile_bpp (t);
+        dststride = tile->ewidth * tile->bpp;
 
         while (rows--)
           {
@@ -776,7 +745,7 @@
             d += dststride;
           }
 
-        tile_release (t, TRUE);
+        tile_release (tile, TRUE);
       }
 }
 
@@ -786,50 +755,49 @@
                    gint         y,
                    guchar      *buffer)
 {
-  if (x >= 0 && y >= 0 && x < tm->width && y < tm->height)
-    {
-      gint num = tile_manager_get_tile_num (tm, x, y);
+  const gint num = tile_manager_get_tile_num (tm, x, y);
 
-      if (num != tm->cached_num)    /* must fetch a new tile */
-        {
-          Tile *tile;
-
-          if (tm->cached_tile)
-            tile_release (tm->cached_tile, FALSE);
+  if (num < 0)
+    return;
 
-          tm->cached_num  = -1;
-          tm->cached_tile = NULL;
+  if (num != tm->cached_num)    /* must fetch a new tile */
+    {
+      Tile *tile;
 
-          /*  use a temporary variable instead of assigning to
-           *  tm->cached_tile directly to make sure tm->cached_num
-           *  and tm->cached_tile are always in a consistent state.
-           *  (the requested tile might be invalid and needs to be
-           *  validated, which would call tile_manager_get() recursively,
-           *  which in turn would clear the cached tile) See bug #472770.
-           */
-          tile = tile_manager_get (tm, num, TRUE, FALSE);
+      if (tm->cached_tile)
+        tile_release (tm->cached_tile, FALSE);
 
-          tm->cached_num  = num;
-          tm->cached_tile = tile;
-        }
+      tm->cached_num  = -1;
+      tm->cached_tile = NULL;
 
-      if (tm->cached_tile)
-        {
-          const guchar *src = tile_data_pointer (tm->cached_tile, x, y);
+      /*  use a temporary variable instead of assigning to
+       *  tm->cached_tile directly to make sure tm->cached_num
+       *  and tm->cached_tile are always in a consistent state.
+       *  (the requested tile might be invalid and needs to be
+       *  validated, which would call tile_manager_get() recursively,
+       *  which in turn would clear the cached tile) See bug #472770.
+       */
+      tile = tile_manager_get (tm, num, TRUE, FALSE);
 
-           switch (tm->bpp)
-             {
-             case 4:
-               *buffer++ = *src++;
-             case 3:
-               *buffer++ = *src++;
-             case 2:
-               *buffer++ = *src++;
-             case 1:
-               *buffer++ = *src++;
-             }
-        }
+      tm->cached_num  = num;
+      tm->cached_tile = tile;
     }
+
+  {
+    const guchar *src = TILE_DATA_POINTER (tm->cached_tile, x, y);
+
+    switch (tm->bpp)
+      {
+      case 4:
+        *buffer++ = *src++;
+      case 3:
+        *buffer++ = *src++;
+      case 2:
+        *buffer++ = *src++;
+      case 1:
+        *buffer++ = *src++;
+      }
+  }
 }
 
 void
@@ -839,7 +807,7 @@
                     const guchar *buffer)
 {
   Tile   *tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
-  guchar *dest = tile_data_pointer (tile, x, y);
+  guchar *dest = TILE_DATA_POINTER (tile, x, y);
 
   switch (tm->bpp)
     {

Modified: branches/soc-2008-text/app/base/tile-private.h
==============================================================================
--- branches/soc-2008-text/app/base/tile-private.h	(original)
+++ branches/soc-2008-text/app/base/tile-private.h	Fri Aug 29 18:50:27 2008
@@ -71,10 +71,17 @@
 
   TileLink *tlink;
 
-  Tile     *next;
-  Tile     *prev;       /* List pointers for the tile cache lists */
+  Tile     *next;       /* List pointers for the tile cache lists */
+  Tile     *prev;
   gpointer  listhead;   /* Pointer to the head of the list this tile is on */
 };
 
 
+/*  tile_data_pointer() as a macro so that it can be inlined  */
+
+#define TILE_DATA_POINTER(tile,x,y) \
+  ((tile)->data + \
+   (((y) % TILE_HEIGHT) * (tile)->ewidth + ((x) % TILE_WIDTH)) * (tile)->bpp)
+
+
 #endif /* __TILE_PRIVATE_H__ */

Modified: branches/soc-2008-text/app/base/tile-pyramid.c
==============================================================================
--- branches/soc-2008-text/app/base/tile-pyramid.c	(original)
+++ branches/soc-2008-text/app/base/tile-pyramid.c	Fri Aug 29 18:50:27 2008
@@ -315,7 +315,7 @@
 
 /**
  * tile_pyramid_get_memsize:
- * @pyramid:   a #TilePyramid
+ * @pyramid: a #TilePyramid
  *
  * Return value: size of memory allocated for the @pyramid
  **/
@@ -333,7 +333,6 @@
   return memsize;
 }
 
-/*  private functions  */
 
 /* This function make sure that levels are allocated up to the level
  * it returns. The return value may be smaller than the level that
@@ -382,9 +381,9 @@
   return pyramid->top_level;
 }
 
-/* This method is used to validate a pyramid tile from the base level.
- * It needs to pre-multiply the alpha channel because upper levels are
- * pre-multiplied.
+/* This method is used to validate a pyramid tile from four tiles on
+ * the base level.  It needs to pre-multiply the alpha channel because
+ * upper levels are pre-multiplied.
  */
 static void
 tile_pyramid_validate_tile (TileManager *tm,
@@ -441,9 +440,9 @@
       }
 }
 
-/* Average the src tile to one quarter of the destination tile.
- * The source tile doesn't have pre-multiplied alpha, but the
- * destination tile does.
+/* Average the src tile to one quarter of the destination tile.  The
+ * source tile doesn't have pre-multiplied alpha, but the destination
+ * tile does.
  */
 static void
 tile_pyramid_write_quarter (Tile       *dest,

Modified: branches/soc-2008-text/app/base/tile.c
==============================================================================
--- branches/soc-2008-text/app/base/tile.c	(original)
+++ branches/soc-2008-text/app/base/tile.c	Fri Aug 29 18:50:27 2008
@@ -53,7 +53,7 @@
 #endif
 
 
-static void tile_destroy (Tile *tile);
+static void  tile_destroy (Tile *tile);
 
 
 Tile *
@@ -257,7 +257,7 @@
              void *tm,
              gint  tile_num)
 {
-  TileLink *tmp;
+  TileLink *new;
 
   if ((tile->share_count > 0) && (! tile->valid))
     {
@@ -277,13 +277,13 @@
 #endif
 
   /* link this tile into the tile's tilelink chain */
-  tmp = g_slice_new (TileLink);
+  new = g_slice_new (TileLink);
 
-  tmp->tm       = tm;
-  tmp->tile_num = tile_num;
-  tmp->next     = tile->tlink;
+  new->tm       = tm;
+  new->tile_num = tile_num;
+  new->next     = tile->tlink;
 
-  tile->tlink = tmp;
+  tile->tlink = new;
 }
 
 void
@@ -333,9 +333,7 @@
                    gint  xoff,
                    gint  yoff)
 {
-  gsize offset = (yoff % TILE_HEIGHT) * tile->ewidth + (xoff % TILE_WIDTH);
-
-  return (gpointer) (tile->data + offset * tile->bpp);
+  return TILE_DATA_POINTER (tile, xoff, yoff);
 }
 
 gint

Modified: branches/soc-2008-text/app/config/gimpbaseconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpbaseconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpbaseconfig.c	Fri Aug 29 18:50:27 2008
@@ -103,7 +103,7 @@
                                  GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
                                     "tile-cache-size", TILE_CACHE_SIZE_BLURB,
-                                    0, MIN (G_MAXULONG, GIMP_MAX_MEMSIZE),
+                                    0, MIN (G_MAXSIZE, GIMP_MAX_MEMSIZE),
                                     1 << 30, /* 1GB */
                                     GIMP_PARAM_STATIC_STRINGS |
                                     GIMP_CONFIG_PARAM_CONFIRM);

Modified: branches/soc-2008-text/app/config/gimpcoreconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpcoreconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpcoreconfig.c	Fri Aug 29 18:50:27 2008
@@ -363,9 +363,8 @@
   /*  not serialized  */
   g_object_class_install_property (object_class, PROP_USE_GEGL,
                                    g_param_spec_boolean ("use-gegl",
-                                                         "Use GEGL",
-                                                         "Use GEGL",
-                                                         TRUE,
+                                                         "Use GEGL", NULL,
+                                                         FALSE,
                                                          GIMP_PARAM_READWRITE |
                                                          G_PARAM_CONSTRUCT));
 }

Modified: branches/soc-2008-text/app/config/gimpguiconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpguiconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpguiconfig.c	Fri Aug 29 18:50:27 2008
@@ -70,6 +70,7 @@
   PROP_TOOLBOX_COLOR_AREA,
   PROP_TOOLBOX_FOO_AREA,
   PROP_TOOLBOX_IMAGE_AREA,
+  PROP_TOOLBOX_WILBER,
   PROP_THEME_PATH,
   PROP_THEME,
   PROP_USE_HELP,
@@ -124,7 +125,7 @@
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TRUST_DIRTY_FLAG,
                                     "trust-dirty-flag",
                                     TRUST_DIRTY_FLAG_BLURB,
-                                    FALSE,
+                                    TRUE,
                                     GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_DEVICE_STATUS,
                                     "save-device-status",
@@ -196,6 +197,11 @@
                                     TOOLBOX_IMAGE_AREA_BLURB,
                                     FALSE,
                                     GIMP_PARAM_STATIC_STRINGS);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TOOLBOX_WILBER,
+                                    "toolbox-wilber",
+                                    TOOLBOX_WILBER_BLURB,
+                                    TRUE,
+                                    GIMP_PARAM_STATIC_STRINGS);
   path = gimp_config_build_data_path ("themes");
   GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
                                  "theme-path", THEME_PATH_BLURB,
@@ -347,7 +353,10 @@
     case PROP_TOOLBOX_IMAGE_AREA:
       gui_config->toolbox_image_area = g_value_get_boolean (value);
       break;
-    case PROP_THEME_PATH:
+    case PROP_TOOLBOX_WILBER:
+      gui_config->toolbox_wilber = g_value_get_boolean (value);
+      break;
+     case PROP_THEME_PATH:
       g_free (gui_config->theme_path);
       gui_config->theme_path = g_value_dup_string (value);
       break;
@@ -462,6 +471,9 @@
     case PROP_TOOLBOX_IMAGE_AREA:
       g_value_set_boolean (value, gui_config->toolbox_image_area);
       break;
+    case PROP_TOOLBOX_WILBER:
+      g_value_set_boolean (value, gui_config->toolbox_wilber);
+      break;
     case PROP_THEME_PATH:
       g_value_set_string (value, gui_config->theme_path);
       break;

Modified: branches/soc-2008-text/app/config/gimpguiconfig.h
==============================================================================
--- branches/soc-2008-text/app/config/gimpguiconfig.h	(original)
+++ branches/soc-2008-text/app/config/gimpguiconfig.h	Fri Aug 29 18:50:27 2008
@@ -58,6 +58,7 @@
   gboolean             toolbox_color_area;
   gboolean             toolbox_foo_area;
   gboolean             toolbox_image_area;
+  gboolean             toolbox_wilber;
   gchar               *theme_path;
   gchar               *theme;
   gboolean             use_help;

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

Modified: branches/soc-2008-text/app/dialogs/dialogs.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/dialogs.c	(original)
+++ branches/soc-2008-text/app/dialogs/dialogs.c	Fri Aug 29 18:50:27 2008
@@ -168,7 +168,7 @@
             GIMP_HELP_TOOLS_DIALOG, GIMP_VIEW_SIZE_SMALL),
   LISTGRID (buffer, N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
             GIMP_HELP_BUFFER_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
-  LISTGRID (document, N_("History"), N_("Document History"), GTK_STOCK_OPEN,
+  LISTGRID (document, N_("History"), N_("Document History"), "document-open-recent",
             GIMP_HELP_DOCUMENT_DIALOG, GIMP_VIEW_SIZE_LARGE),
   LISTGRID (template, N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE,
             GIMP_HELP_TEMPLATE_DIALOG, GIMP_VIEW_SIZE_SMALL),

Modified: branches/soc-2008-text/app/dialogs/image-scale-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/image-scale-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/image-scale-dialog.c	Fri Aug 29 18:50:27 2008
@@ -171,7 +171,7 @@
       break;
 
     case GIMP_IMAGE_SCALE_OK:
-      /* If all is well, return directly after scaling image. */
+      gtk_widget_hide (widget);
       dialog->callback (dialog->dialog,
                         GIMP_VIEWABLE (dialog->image),
                         dialog->width,
@@ -275,6 +275,7 @@
 
   if (response_id == GTK_RESPONSE_OK)
     {
+      gtk_widget_hide (dialog->dialog);
       dialog->callback (dialog->dialog,
                         GIMP_VIEWABLE (dialog->image),
                         dialog->width,

Modified: branches/soc-2008-text/app/dialogs/layer-options-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/layer-options-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/layer-options-dialog.c	Fri Aug 29 18:50:27 2008
@@ -150,7 +150,7 @@
 
       /*  The size sizeentry  */
       spinbutton = gimp_spin_button_new (&adjustment,
-                                         1, 1, 1, 1, 10, 1,
+                                         1, 1, 1, 1, 10, 0,
                                          1, 2);
       gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
 

Modified: branches/soc-2008-text/app/dialogs/offset-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/offset-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/offset-dialog.c	Fri Aug 29 18:50:27 2008
@@ -162,7 +162,7 @@
   gtk_widget_show (vbox);
 
   spinbutton = gimp_spin_button_new (&adjustment,
-                                     1, 1, 1, 1, 10, 1,
+                                     1, 1, 1, 1, 10, 0,
                                      1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
 

Modified: branches/soc-2008-text/app/dialogs/preferences-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/preferences-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/preferences-dialog.c	Fri Aug 29 18:50:27 2008
@@ -511,10 +511,10 @@
                             G_CALLBACK (gtk_widget_destroy),
                             input_dialog);
 
-  g_signal_connect (input_dialog, "enable_device",
+  g_signal_connect (input_dialog, "enable-device",
                     G_CALLBACK (prefs_input_dialog_able_callback),
                     NULL);
-  g_signal_connect (input_dialog, "disable_device",
+  g_signal_connect (input_dialog, "disable-device",
                     G_CALLBACK (prefs_input_dialog_able_callback),
                     NULL);
 

Modified: branches/soc-2008-text/app/dialogs/resize-dialog.c
==============================================================================
--- branches/soc-2008-text/app/dialogs/resize-dialog.c	(original)
+++ branches/soc-2008-text/app/dialogs/resize-dialog.c	Fri Aug 29 18:50:27 2008
@@ -204,7 +204,7 @@
 
   /*  the offset sizeentry  */
   spinbutton = gimp_spin_button_new (&adjustment,
-                                     1, 1, 1, 1, 10, 1,
+                                     1, 1, 1, 1, 10, 0,
                                      1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH);
 

Modified: branches/soc-2008-text/app/display/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/display/Makefile.am	(original)
+++ branches/soc-2008-text/app/display/Makefile.am	Fri Aug 29 18:50:27 2008
@@ -45,13 +45,14 @@
 	gimpdisplayshell-icon.h			\
 	gimpdisplayshell-preview.c		\
 	gimpdisplayshell-preview.h		\
-	gimpdisplayshell-private.h		\
 	gimpdisplayshell-progress.c		\
 	gimpdisplayshell-progress.h		\
 	gimpdisplayshell-render.c		\
 	gimpdisplayshell-render.h		\
 	gimpdisplayshell-scale.c		\
 	gimpdisplayshell-scale.h		\
+	gimpdisplayshell-scale-dialog.c		\
+	gimpdisplayshell-scale-dialog.h		\
 	gimpdisplayshell-scroll.c		\
 	gimpdisplayshell-scroll.h		\
 	gimpdisplayshell-selection.c		\

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	Fri Aug 29 18:50:27 2008
@@ -39,6 +39,36 @@
 }
 
 GType
+gimp_cursor_precision_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_CURSOR_PRECISION_PIXEL_CENTER, "GIMP_CURSOR_PRECISION_PIXEL_CENTER", "pixel-center" },
+    { GIMP_CURSOR_PRECISION_PIXEL_BORDER, "GIMP_CURSOR_PRECISION_PIXEL_BORDER", "pixel-border" },
+    { GIMP_CURSOR_PRECISION_SUBPIXEL, "GIMP_CURSOR_PRECISION_SUBPIXEL", "subpixel" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_CURSOR_PRECISION_PIXEL_CENTER, "GIMP_CURSOR_PRECISION_PIXEL_CENTER", NULL },
+    { GIMP_CURSOR_PRECISION_PIXEL_BORDER, "GIMP_CURSOR_PRECISION_PIXEL_BORDER", NULL },
+    { GIMP_CURSOR_PRECISION_SUBPIXEL, "GIMP_CURSOR_PRECISION_SUBPIXEL", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpCursorPrecision", values);
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_canvas_padding_mode_get_type (void)
 {
   static const GEnumValue values[] =

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	Fri Aug 29 18:50:27 2008
@@ -32,6 +32,18 @@
 } GimpCursorMode;
 
 
+#define GIMP_TYPE_CURSOR_PRECISION (gimp_cursor_precision_get_type ())
+
+GType gimp_cursor_precision_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_CURSOR_PRECISION_PIXEL_CENTER,
+  GIMP_CURSOR_PRECISION_PIXEL_BORDER,
+  GIMP_CURSOR_PRECISION_SUBPIXEL
+} GimpCursorPrecision;
+
+
 #define GIMP_TYPE_CANVAS_PADDING_MODE (gimp_canvas_padding_mode_get_type ())
 
 GType gimp_canvas_padding_mode_get_type (void) G_GNUC_CONST;

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

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

Modified: branches/soc-2008-text/app/display/gimpdisplay-handlers.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplay-handlers.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplay-handlers.c	Fri Aug 29 18:50:27 2008
@@ -76,9 +76,10 @@
 
   g_object_ref (image);
 
-  g_signal_connect (image->projection, "update",
+  g_signal_connect (gimp_image_get_projection (image), "update",
                     G_CALLBACK (gimp_display_update_handler),
                     display);
+
   g_signal_connect (image, "flush",
                     G_CALLBACK (gimp_display_flush_handler),
                     display);
@@ -95,17 +96,20 @@
   g_return_if_fail (GIMP_IS_DISPLAY (display));
   g_return_if_fail (GIMP_IS_IMAGE (display->image));
 
-  g_signal_handlers_disconnect_by_func (display->image,
+  image = display->image;
+
+  g_signal_handlers_disconnect_by_func (image,
                                         gimp_display_saved_handler,
                                         display);
-  g_signal_handlers_disconnect_by_func (display->image,
+  g_signal_handlers_disconnect_by_func (image,
                                         gimp_display_flush_handler,
                                         display);
-  g_signal_handlers_disconnect_by_func (display->image->projection,
+
+  g_signal_handlers_disconnect_by_func (gimp_image_get_projection (image),
                                         gimp_display_update_handler,
                                         display);
 
-  display->image->disp_count--;
+  image->disp_count--;
 
 #if 0
   g_print ("%s: image->ref_count before unrefing: %d\n",
@@ -116,7 +120,6 @@
    *  that listens for image removals and then iterates the display list
    *  to find a valid display.
    */
-  image = display->image;
   display->image = NULL;
 
   g_object_unref (image);
@@ -151,12 +154,9 @@
                             GimpDisplay *display)
 {
   GtkWidget *statusbar = GIMP_DISPLAY_SHELL (display->shell)->statusbar;
-  gchar     *filename;
-
-  filename = file_utils_uri_display_name (uri);
-
-  gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GTK_STOCK_SAVE,
-                            _("Image saved to '%s'"), filename);
+  gchar     *filename  = file_utils_uri_display_name (uri);
 
+  gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GIMP_MESSAGE_INFO,
+                            GTK_STOCK_SAVE, _("Image saved to '%s'"), filename);
   g_free (filename);
 }

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-appearance.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-appearance.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-appearance.c	Fri Aug 29 18:50:27 2008
@@ -126,7 +126,7 @@
 }
 
 gboolean
-gimp_display_shell_get_fullscreen (GimpDisplayShell *shell)
+gimp_display_shell_get_fullscreen (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -160,7 +160,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_menubar (GimpDisplayShell *shell)
+gimp_display_shell_get_show_menubar (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -208,7 +208,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_rulers (GimpDisplayShell *shell)
+gimp_display_shell_get_show_rulers (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -266,7 +266,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_scrollbars (GimpDisplayShell *shell)
+gimp_display_shell_get_show_scrollbars (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -294,7 +294,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_statusbar (GimpDisplayShell *shell)
+gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -322,7 +322,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_selection (GimpDisplayShell *shell)
+gimp_display_shell_get_show_selection (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -350,7 +350,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_layer (GimpDisplayShell *shell)
+gimp_display_shell_get_show_layer (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -367,7 +367,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_transform (GimpDisplayShell *shell)
+gimp_display_shell_get_show_transform (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -399,7 +399,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_guides (GimpDisplayShell *shell)
+gimp_display_shell_get_show_guides (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -431,7 +431,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_grid (GimpDisplayShell *shell)
+gimp_display_shell_get_show_grid (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -463,7 +463,7 @@
 }
 
 gboolean
-gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell)
+gimp_display_shell_get_show_sample_points (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -488,7 +488,7 @@
 }
 
 gboolean
-gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell)
+gimp_display_shell_get_snap_to_grid (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -513,7 +513,7 @@
 }
 
 gboolean
-gimp_display_shell_get_snap_to_guides (GimpDisplayShell *shell)
+gimp_display_shell_get_snap_to_guides (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -538,7 +538,7 @@
 }
 
 gboolean
-gimp_display_shell_get_snap_to_canvas (GimpDisplayShell *shell)
+gimp_display_shell_get_snap_to_canvas (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -563,7 +563,7 @@
 }
 
 gboolean
-gimp_display_shell_get_snap_to_vectors (GimpDisplayShell *shell)
+gimp_display_shell_get_snap_to_vectors (const GimpDisplayShell *shell)
 {
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
 
@@ -630,9 +630,9 @@
 }
 
 void
-gimp_display_shell_get_padding (GimpDisplayShell      *shell,
-                                GimpCanvasPaddingMode *padding_mode,
-                                GimpRGB               *padding_color)
+gimp_display_shell_get_padding (const GimpDisplayShell *shell,
+                                GimpCanvasPaddingMode  *padding_mode,
+                                GimpRGB                *padding_color)
 {
   GimpDisplayOptions *options;
 

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-appearance.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-appearance.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-appearance.h	Fri Aug 29 18:50:27 2008
@@ -20,74 +20,74 @@
 #define __GIMP_DISPLAY_SHELL_APPEARANCE_H__
 
 
-void       gimp_display_shell_appearance_update      (GimpDisplayShell *shell);
+void       gimp_display_shell_appearance_update      (GimpDisplayShell       *shell);
 
-void       gimp_display_shell_set_fullscreen         (GimpDisplayShell *shell,
-                                                      gboolean          fullscreen);
-gboolean   gimp_display_shell_get_fullscreen         (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_menubar       (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_menubar       (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_rulers        (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_rulers        (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_scrollbars    (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_scrollbars    (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_statusbar     (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_statusbar     (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_selection     (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_selection     (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_layer         (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_layer         (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_transform     (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_transform     (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_grid          (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_grid          (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_guides        (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_guides        (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_snap_to_grid       (GimpDisplayShell *shell,
-                                                      gboolean          snap);
-gboolean   gimp_display_shell_get_snap_to_grid       (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell,
-                                                      gboolean          show);
-gboolean   gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_snap_to_guides     (GimpDisplayShell *shell,
-                                                      gboolean          snap);
-gboolean   gimp_display_shell_get_snap_to_guides     (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_snap_to_canvas     (GimpDisplayShell *shell,
-                                                      gboolean          snap);
-gboolean   gimp_display_shell_get_snap_to_canvas     (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_snap_to_vectors    (GimpDisplayShell *shell,
-                                                      gboolean          snap);
-gboolean   gimp_display_shell_get_snap_to_vectors    (GimpDisplayShell *shell);
-
-void       gimp_display_shell_set_padding            (GimpDisplayShell *shell,
-                                                      GimpCanvasPaddingMode  mode,
-                                                      const GimpRGB    *color);
-void       gimp_display_shell_get_padding            (GimpDisplayShell *shell,
-                                                      GimpCanvasPaddingMode *mode,
-                                                      GimpRGB          *color);
+void       gimp_display_shell_set_fullscreen         (GimpDisplayShell       *shell,
+                                                      gboolean                fullscreen);
+gboolean   gimp_display_shell_get_fullscreen         (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_menubar       (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_menubar       (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_rulers        (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_rulers        (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_scrollbars    (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_scrollbars    (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_statusbar     (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_statusbar     (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_selection     (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_selection     (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_layer         (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_layer         (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_transform     (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_transform     (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_grid          (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_grid          (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_guides        (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_guides        (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_snap_to_grid       (GimpDisplayShell       *shell,
+                                                      gboolean                snap);
+gboolean   gimp_display_shell_get_snap_to_grid       (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_show_sample_points (GimpDisplayShell       *shell,
+                                                      gboolean                show);
+gboolean   gimp_display_shell_get_show_sample_points (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_snap_to_guides     (GimpDisplayShell       *shell,
+                                                      gboolean                snap);
+gboolean   gimp_display_shell_get_snap_to_guides     (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_snap_to_canvas     (GimpDisplayShell       *shell,
+                                                      gboolean                snap);
+gboolean   gimp_display_shell_get_snap_to_canvas     (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_snap_to_vectors    (GimpDisplayShell       *shell,
+                                                      gboolean                snap);
+gboolean   gimp_display_shell_get_snap_to_vectors    (const GimpDisplayShell *shell);
+
+void       gimp_display_shell_set_padding            (GimpDisplayShell       *shell,
+                                                      GimpCanvasPaddingMode   mode,
+                                                      const GimpRGB          *color);
+void       gimp_display_shell_get_padding            (const GimpDisplayShell *shell,
+                                                      GimpCanvasPaddingMode  *mode,
+                                                      GimpRGB                *color);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_APPEARANCE_H__ */

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-autoscroll.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-autoscroll.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-autoscroll.c	Fri Aug 29 18:50:27 2008
@@ -26,7 +26,6 @@
 #include "gimpdisplayshell.h"
 #include "gimpdisplayshell-autoscroll.h"
 #include "gimpdisplayshell-coords.h"
-#include "gimpdisplayshell-private.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-transform.h"
 
@@ -131,14 +130,22 @@
 
   if (dx || dy)
     {
-      GimpDisplay *display     = shell->display;
-      GimpTool    *active_tool = tool_manager_get_active (display->gimp);
+      GimpDisplay *display         = shell->display;
+      GimpTool    *active_tool     = tool_manager_get_active (display->gimp);
+      gint         scroll_amount_x = AUTOSCROLL_DX * dx;
+      gint         scroll_amount_y = AUTOSCROLL_DX * dy;
 
       info->time += AUTOSCROLL_DT;
 
-      gimp_display_shell_scroll_private (shell,
-                                         AUTOSCROLL_DX * (gdouble) dx,
-                                         AUTOSCROLL_DX * (gdouble) dy);
+      gimp_display_shell_scroll_unoverscrollify (shell,
+                                                 scroll_amount_x,
+                                                 scroll_amount_y,
+                                                 &scroll_amount_x,
+                                                 &scroll_amount_y);
+
+      gimp_display_shell_scroll (shell,
+                                 scroll_amount_x,
+                                 scroll_amount_y);
 
       gimp_display_shell_untransform_coordinate (shell,
                                                  &device_coords,

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	Fri Aug 29 18:50:27 2008
@@ -67,7 +67,6 @@
 #include "gimpdisplayshell-draw.h"
 #include "gimpdisplayshell-layer-select.h"
 #include "gimpdisplayshell-preview.h"
-#include "gimpdisplayshell-private.h"
 #include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-selection.h"
@@ -283,6 +282,8 @@
           gint    offset_x;
           gint    offset_y;
 
+          /* FIXMEEEEE!!! */
+
           /*  multiply the zoom_factor with the ratio of the new and
            *  old canvas diagonals
            */
@@ -303,9 +304,57 @@
       shell->disp_width  = allocation->width;
       shell->disp_height = allocation->height;
 
-      gimp_display_shell_scroll_clamp_offsets (shell);
-      gimp_display_shell_scale_setup (shell);
+      /* When we size-allocate due to resize of the top level window,
+       * we want some additional logic. Don't apply it on
+       * zoom_on_resize though.
+       */
+      if (shell->size_allocate_from_configure_event &&
+          ! shell->zoom_on_resize)
+        {
+          gboolean center_horizontally;
+          gboolean center_vertically;
+          gint     target_offset_x;
+          gint     target_offset_y;
+          gint     sw;
+          gint     sh;
+
+          gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+          center_horizontally = sw <= shell->disp_width;
+          center_vertically   = sh <= shell->disp_height;
+
+          gimp_display_shell_scroll_center_image (shell,
+                                                  center_horizontally,
+                                                  center_vertically);
+
+          /* This is basically the best we can do before we get an
+           * API for storing the image offset at the start of an
+           * image window resize using the mouse
+           */
+          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);
+        }
+
+      gimp_display_shell_scroll_clamp_and_update (shell);
+
       gimp_display_shell_scaled (shell);
+
+      /* Reset */
+      shell->size_allocate_from_configure_event = FALSE;
     }
 }
 
@@ -967,13 +1016,11 @@
             switch (direction)
               {
               case GDK_SCROLL_UP:
-                gimp_display_shell_scale_to (shell, GIMP_ZOOM_IN, 0.0,
-                                             sevent->x, sevent->y);
+                gimp_display_shell_scale (shell, GIMP_ZOOM_IN, 0.0);
                 break;
 
               case GDK_SCROLL_DOWN:
-                gimp_display_shell_scale_to (shell, GIMP_ZOOM_OUT, 0.0,
-                                             sevent->x, sevent->y);
+                gimp_display_shell_scale (shell, GIMP_ZOOM_OUT, 0.0);
                 break;
 
               default:
@@ -1117,11 +1164,11 @@
 
         if (shell->scrolling)
           {
-            gimp_display_shell_scroll_private (shell,
-                                               (shell->scroll_start_x - mevent->x -
-                                                shell->offset_x),
-                                               (shell->scroll_start_y - mevent->y -
-                                                shell->offset_y));
+            gimp_display_shell_scroll (shell,
+                                       (shell->scroll_start_x - mevent->x -
+                                        shell->offset_x),
+                                       (shell->scroll_start_y - mevent->y -
+                                        shell->offset_y));
           }
         else if (state & GDK_BUTTON1_MASK)
           {
@@ -1495,11 +1542,21 @@
     }
 
   if (update_sw_cursor)
-    gimp_display_shell_update_cursor (shell,
-                                      (gint) display_coords.x,
-                                      (gint) display_coords.y,
-                                      (gint) image_coords.x,
-                                      (gint) image_coords.y);
+    {
+      GimpCursorPrecision precision = GIMP_CURSOR_PRECISION_PIXEL_CENTER;
+
+      active_tool = tool_manager_get_active (gimp);
+
+      if (active_tool)
+        precision = gimp_tool_control_get_precision (active_tool->control);
+
+      gimp_display_shell_update_cursor (shell,
+                                        precision,
+                                        (gint) display_coords.x,
+                                        (gint) display_coords.y,
+                                        image_coords.x,
+                                        image_coords.y);
+    }
 
   return return_val;
 }
@@ -1678,20 +1735,20 @@
 gimp_display_shell_vscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll_private (shell,
-                                     0,
-                                     gtk_adjustment_get_value (adjustment) -
-                                     shell->offset_y);
+  gimp_display_shell_scroll (shell,
+                             0,
+                             gtk_adjustment_get_value (adjustment) -
+                             shell->offset_y);
 }
 
 static void
 gimp_display_shell_hscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll_private (shell,
-                                     gtk_adjustment_get_value (adjustment) -
-                                     shell->offset_x,
-                                     0);
+  gimp_display_shell_scroll (shell,
+                             gtk_adjustment_get_value (adjustment) -
+                             shell->offset_x,
+                             0);
 }
 
 static gboolean
@@ -1708,7 +1765,7 @@
       (scroll == GTK_SCROLL_PAGE_FORWARD))
     return FALSE;
 
-  gimp_display_shell_setup_hscrollbar_with_value (shell, value);
+  gimp_display_shell_scroll_setup_hscrollbar (shell, value);
 
   gtk_adjustment_changed (shell->hsbdata);
 
@@ -1729,7 +1786,7 @@
       (scroll == GTK_SCROLL_PAGE_FORWARD))
     return FALSE;
 
-  gimp_display_shell_setup_vscrollbar_with_value (shell, value);
+  gimp_display_shell_scroll_setup_vscrollbar (shell, value);
 
   gtk_adjustment_changed (shell->vsbdata);
 

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-callbacks.h	Fri Aug 29 18:50:27 2008
@@ -20,20 +20,6 @@
 #define __GIMP_DISPLAY_SHELL_CALLBACKS_H__
 
 
-#define GIMP_DISPLAY_SHELL_CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK            | \
-                                              GDK_POINTER_MOTION_MASK      | \
-                                              GDK_POINTER_MOTION_HINT_MASK | \
-                                              GDK_BUTTON_PRESS_MASK        | \
-                                              GDK_BUTTON_RELEASE_MASK      | \
-                                              GDK_STRUCTURE_MASK           | \
-                                              GDK_ENTER_NOTIFY_MASK        | \
-                                              GDK_LEAVE_NOTIFY_MASK        | \
-                                              GDK_FOCUS_CHANGE_MASK        | \
-                                              GDK_KEY_PRESS_MASK           | \
-                                              GDK_KEY_RELEASE_MASK         | \
-                                              GDK_PROXIMITY_OUT_MASK)
-
-
 gboolean   gimp_display_shell_events                  (GtkWidget        *widget,
                                                        GdkEvent         *event,
                                                        GimpDisplayShell *shell);

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-cursor.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-cursor.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-cursor.c	Fri Aug 29 18:50:27 2008
@@ -117,11 +117,12 @@
 }
 
 void
-gimp_display_shell_update_cursor (GimpDisplayShell *shell,
-                                  gint              display_x,
-                                  gint              display_y,
-                                  gint              image_x,
-                                  gint              image_y)
+gimp_display_shell_update_cursor (GimpDisplayShell    *shell,
+                                  GimpCursorPrecision  precision,
+                                  gint                 display_x,
+                                  gint                 display_y,
+                                  gdouble              image_x,
+                                  gdouble              image_y)
 {
   GimpDialogFactory *factory;
   GimpSessionInfo   *session_info;
@@ -159,7 +160,7 @@
    *  possibly snapped...
    */
   gimp_statusbar_update_cursor (GIMP_STATUSBAR (shell->statusbar),
-                                image_x, image_y);
+                                precision, image_x, image_y);
 
   factory = gimp_dialog_factory_from_name ("dock");
   session_info = gimp_dialog_factory_find_session_info (factory,

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-cursor.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-cursor.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-cursor.h	Fri Aug 29 18:50:27 2008
@@ -20,21 +20,22 @@
 #define __GIMP_DISPLAY_SHELL_CURSOR_H__
 
 
-void   gimp_display_shell_set_cursor            (GimpDisplayShell   *shell,
-                                                 GimpCursorType      cursor_type,
-                                                 GimpToolCursorType  tool_cursor,
-                                                 GimpCursorModifier  modifier);
-void   gimp_display_shell_unset_cursor          (GimpDisplayShell   *shell);
-void   gimp_display_shell_set_override_cursor   (GimpDisplayShell   *shell,
-                                                 GimpCursorType      cursor_type);
-void   gimp_display_shell_unset_override_cursor (GimpDisplayShell   *shell);
+void   gimp_display_shell_set_cursor            (GimpDisplayShell    *shell,
+                                                 GimpCursorType       cursor_type,
+                                                 GimpToolCursorType   tool_cursor,
+                                                 GimpCursorModifier   modifier);
+void   gimp_display_shell_unset_cursor          (GimpDisplayShell    *shell);
+void   gimp_display_shell_set_override_cursor   (GimpDisplayShell    *shell,
+                                                 GimpCursorType       cursor_type);
+void   gimp_display_shell_unset_override_cursor (GimpDisplayShell    *shell);
 
-void   gimp_display_shell_update_cursor         (GimpDisplayShell   *shell,
-                                                 gint                display_x,
-                                                 gint                display_y,
-                                                 gint                image_x,
-                                                 gint                image_y);
-void   gimp_display_shell_clear_cursor          (GimpDisplayShell   *shell);
+void   gimp_display_shell_update_cursor         (GimpDisplayShell    *shell,
+                                                 GimpCursorPrecision  precision,
+                                                 gint                 display_x,
+                                                 gint                 display_y,
+                                                 gdouble              image_x,
+                                                 gdouble              image_y);
+void   gimp_display_shell_clear_cursor          (GimpDisplayShell    *shell);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_CURSOR_H__ */

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-draw.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-draw.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-draw.c	Fri Aug 29 18:50:27 2008
@@ -48,6 +48,7 @@
 #include "gimpdisplayshell-appearance.h"
 #include "gimpdisplayshell-draw.h"
 #include "gimpdisplayshell-render.h"
+#include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-transform.h"
 
@@ -63,10 +64,72 @@
 
 /*  public functions  */
 
+/**
+ * gimp_display_shell_get_scaled_image_size:
+ * @shell:
+ * @w:
+ * @h:
+ *
+ * Gets the size of the rendered image after it has been scaled.
+ *
+ **/
 void
-gimp_display_shell_draw_guide (GimpDisplayShell *shell,
-                               GimpGuide        *guide,
-                               gboolean          active)
+gimp_display_shell_draw_get_scaled_image_size (const GimpDisplayShell *shell,
+                                               gint                   *w,
+                                               gint                   *h)
+{
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  gimp_display_shell_draw_get_scaled_image_size_for_scale (shell,
+                                                           gimp_zoom_model_get_factor (shell->zoom),
+                                                           w,
+                                                           h);
+}
+
+/**
+ * gimp_display_shell_draw_get_scaled_image_size_for_scale:
+ * @shell:
+ * @scale:
+ * @w:
+ * @h:
+ *
+ **/
+void
+gimp_display_shell_draw_get_scaled_image_size_for_scale (const GimpDisplayShell *shell,
+                                                         gdouble                 scale,
+                                                         gint                   *w,
+                                                         gint                   *h)
+{
+  GimpProjection *proj;
+  TileManager    *tiles;
+  gdouble         scale_x;
+  gdouble         scale_y;
+  gint            level;
+  gint            level_width;
+  gint            level_height;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+  g_return_if_fail (GIMP_IS_IMAGE (shell->display->image));
+
+  proj = gimp_image_get_projection (shell->display->image);
+
+  gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
+
+  level = gimp_projection_get_level (proj, scale_x, scale_y);
+
+  tiles = gimp_projection_get_tiles_at_level (proj, level, NULL);
+
+  level_width  = tile_manager_width (tiles);
+  level_height = tile_manager_height (tiles);
+
+  if (w) *w = PROJ_ROUND (level_width  * (scale_x * (1 << level)));
+  if (h) *h = PROJ_ROUND (level_height * (scale_y * (1 << level)));
+}
+
+void
+gimp_display_shell_draw_guide (const GimpDisplayShell *shell,
+                               GimpGuide              *guide,
+                               gboolean                active)
 {
   gint  position;
   gint  x1, y1, x2, y2;
@@ -108,7 +171,7 @@
 }
 
 void
-gimp_display_shell_draw_guides (GimpDisplayShell *shell)
+gimp_display_shell_draw_guides (const GimpDisplayShell *shell)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -340,9 +403,9 @@
 }
 
 void
-gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
-                                      GimpSamplePoint  *sample_point,
-                                      gboolean          active)
+gimp_display_shell_draw_sample_point (const GimpDisplayShell *shell,
+                                      GimpSamplePoint        *sample_point,
+                                      gboolean                active)
 {
   GimpCanvasStyle style;
   gdouble         x, y;
@@ -406,7 +469,7 @@
 }
 
 void
-gimp_display_shell_draw_sample_points (GimpDisplayShell *shell)
+gimp_display_shell_draw_sample_points (const GimpDisplayShell *shell)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -425,8 +488,8 @@
 }
 
 void
-gimp_display_shell_draw_vector (GimpDisplayShell *shell,
-                                GimpVectors      *vectors)
+gimp_display_shell_draw_vector (const GimpDisplayShell *shell,
+                                GimpVectors            *vectors)
 {
   GimpStroke *stroke = NULL;
 
@@ -464,7 +527,7 @@
 }
 
 void
-gimp_display_shell_draw_vectors (GimpDisplayShell *shell)
+gimp_display_shell_draw_vectors (const GimpDisplayShell *shell)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -486,7 +549,7 @@
 }
 
 void
-gimp_display_shell_draw_cursor (GimpDisplayShell *shell)
+gimp_display_shell_draw_cursor (const GimpDisplayShell *shell)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -496,11 +559,11 @@
 }
 
 void
-gimp_display_shell_draw_area (GimpDisplayShell *shell,
-                              gint              x,
-                              gint              y,
-                              gint              w,
-                              gint              h)
+gimp_display_shell_draw_area (const GimpDisplayShell *shell,
+                              gint                    x,
+                              gint                    y,
+                              gint                    w,
+                              gint                    h)
 {
   gint sx, sy;
   gint sw, sh;
@@ -510,8 +573,8 @@
   if (! shell->display->image)
     return;
 
-  gimp_display_shell_get_scaled_viewport_offset (shell, &sx, &sy);
-  gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell, &sx, &sy);
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
 
   /*  check if the passed in area intersects with
    *  both the display and the image
@@ -552,9 +615,9 @@
               dx = MIN (x2 - j, GIMP_DISPLAY_RENDER_BUF_WIDTH);
               dy = MIN (y2 - i, GIMP_DISPLAY_RENDER_BUF_HEIGHT);
 
-              gimp_display_shell_get_disp_offset (shell,
-                                                  &disp_xoffset,
-                                                  &disp_yoffset);
+              gimp_display_shell_scroll_get_disp_offset (shell,
+                                                         &disp_xoffset,
+                                                         &disp_yoffset);
 
               gimp_display_shell_render (shell,
                                          j - disp_xoffset,

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-draw.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-draw.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-draw.h	Fri Aug 29 18:50:27 2008
@@ -20,31 +20,39 @@
 #define __GIMP_DISPLAY_SHELL_DRAW_H__
 
 
-void   gimp_display_shell_draw_guide         (GimpDisplayShell   *shell,
-                                              GimpGuide          *guide,
-                                              gboolean            active);
-void   gimp_display_shell_draw_guides        (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_grid          (GimpDisplayShell   *shell,
-                                              const GdkRectangle *area);
-void   gimp_display_shell_draw_pen           (GimpDisplayShell   *shell,
-                                              const GimpVector2  *points,
-                                              gint                num_points,
-                                              GimpContext        *context,
-                                              GimpActiveColor     color,
-                                              gint                width);
-void   gimp_display_shell_draw_sample_point  (GimpDisplayShell   *shell,
-                                              GimpSamplePoint    *sample_point,
-                                              gboolean            active);
-void   gimp_display_shell_draw_sample_points (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_vector        (GimpDisplayShell   *shell,
-                                              GimpVectors        *vectors);
-void   gimp_display_shell_draw_vectors       (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_cursor        (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_area          (GimpDisplayShell   *shell,
-                                              gint                x,
-                                              gint                y,
-                                              gint                w,
-                                              gint                h);
+void   gimp_display_shell_draw_get_scaled_image_size (const GimpDisplayShell *shell,
+                                                      gint                   *w,
+                                                      gint                   *h);
+void   gimp_display_shell_draw_get_scaled_image_size_for_scale
+                                                     (const GimpDisplayShell *shell,
+                                                      gdouble                 scale,
+                                                      gint                   *w,
+                                                      gint                   *h);
+void   gimp_display_shell_draw_guide                 (const GimpDisplayShell *shell,
+                                                      GimpGuide              *guide,
+                                                      gboolean                active);
+void   gimp_display_shell_draw_guides                (const GimpDisplayShell *shell);
+void   gimp_display_shell_draw_grid                  (GimpDisplayShell       *shell,
+                                                      const GdkRectangle     *area);
+void   gimp_display_shell_draw_pen                   (GimpDisplayShell       *shell,
+                                                      const GimpVector2      *points,
+                                                      gint                    num_points,
+                                                      GimpContext            *context,
+                                                      GimpActiveColor         color,
+                                                      gint                    width);
+void   gimp_display_shell_draw_sample_point          (const GimpDisplayShell *shell,
+                                                      GimpSamplePoint        *sample_point,
+                                                      gboolean                active);
+void   gimp_display_shell_draw_sample_points         (const GimpDisplayShell *shell);
+void   gimp_display_shell_draw_vector                (const GimpDisplayShell *shell,
+                                                      GimpVectors            *vectors);
+void   gimp_display_shell_draw_vectors               (const GimpDisplayShell *shell);
+void   gimp_display_shell_draw_cursor                (const GimpDisplayShell *shell);
+void   gimp_display_shell_draw_area                  (const GimpDisplayShell *shell,
+                                                      gint                    x,
+                                                      gint                    y,
+                                                      gint                    w,
+                                                      gint                    h);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_DRAW_H__ */

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-handlers.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-handlers.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-handlers.c	Fri Aug 29 18:50:27 2008
@@ -70,6 +70,8 @@
                                                             (GimpImage        *image,
                                                              gint              previous_origin_x,
                                                              gint              previous_origin_y,
+                                                             gint              previous_width,
+                                                             gint              previous_height,
                                                              GimpDisplayShell *shell);
 static void   gimp_display_shell_resolution_changed_handler (GimpImage        *image,
                                                              GimpDisplayShell *shell);
@@ -422,7 +424,11 @@
 
   if (shell->dot_for_dot)
     {
-      gimp_display_shell_scale_setup (shell);
+      if (shell->unit != GIMP_UNIT_PIXEL)
+        {
+          gimp_display_shell_scale_update_rulers (shell);
+        }
+
       gimp_display_shell_scaled (shell);
     }
   else
@@ -481,9 +487,26 @@
 }
 
 static void
+gimp_display_shell_image_size_starts_to_fit (GimpDisplayShell *shell,
+                                             gint              previous_width,
+                                             gint              previous_height,
+                                             gint              new_width,
+                                             gint              new_height,
+                                             gboolean         *horizontally,
+                                             gboolean         *vertically)
+{
+  *horizontally = SCALEX (shell, previous_width)  >  shell->disp_width  &&
+                  SCALEX (shell, new_width)       <= shell->disp_width;
+  *vertically   = SCALEY (shell, previous_height) >  shell->disp_height &&
+                  SCALEY (shell, new_height)      <= shell->disp_height;
+}
+
+static void
 gimp_display_shell_size_changed_detailed_handler (GimpImage        *image,
                                                   gint              previous_origin_x,
                                                   gint              previous_origin_y,
+                                                  gint              previous_width,
+                                                  gint              previous_height,
                                                   GimpDisplayShell *shell)
 {
   if (shell->display->config->resize_windows_on_resize)
@@ -492,21 +515,29 @@
        * has change size
        */
       gimp_display_shell_shrink_wrap (shell, FALSE);
-      gimp_display_shell_center_image_on_next_size_allocate (shell);
     }
   else
     {
-      gint scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
-      gint scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
+      GimpImage *image;
+      gboolean   horizontally, vertically;
+      gint       scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
+      gint       scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
+
+      image = GIMP_IMAGE (shell->display->image);
+
+      gimp_display_shell_image_size_starts_to_fit (shell,
+                                                   previous_width,
+                                                   previous_height,
+                                                   gimp_image_get_width (image),
+                                                   gimp_image_get_height (image),
+                                                   &horizontally,
+                                                   &vertically);
+
+      gimp_display_shell_scroll_set_offset (shell,
+                                            shell->offset_x + scaled_previous_origin_x,
+                                            shell->offset_y + scaled_previous_origin_y);
 
-      /* Note that we can't use gimp_display_shell_scroll_private() here
-       * because that would expose the image twice, causing unwanted
-       * flicker.
-       */
-      gimp_display_shell_scale_by_values (shell, gimp_zoom_model_get_factor (shell->zoom),
-                                          shell->offset_x + scaled_previous_origin_x,
-                                          shell->offset_y + scaled_previous_origin_y,
-                                          FALSE);
+      gimp_display_shell_scroll_center_image (shell, horizontally, vertically);
     }
 }
 
@@ -631,7 +662,8 @@
 
   if (! shell->dot_for_dot)
     {
-      gimp_display_shell_scale_setup (shell);
+      gimp_display_shell_scroll_clamp_and_update (shell);
+
       gimp_display_shell_scaled (shell);
 
       gimp_display_shell_expose_full (shell);

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-render.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-render.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-render.c	Fri Aug 29 18:50:27 2008
@@ -64,49 +64,49 @@
 
 struct _RenderInfo
 {
-  GimpDisplayShell *shell;
-  TileManager      *src_tiles;
-  const guchar     *src;
-  guchar           *dest;
-  gboolean          src_is_premult;
-  gint              x, y;
-  gint              w, h;
-  gdouble           scalex;
-  gdouble           scaley;
-  gint              src_x;
-  gint              src_y;
-  gint              dest_bpp;
-  gint              dest_bpl;
-  gint              dest_width;
+  const GimpDisplayShell *shell;
+  TileManager            *src_tiles;
+  const guchar           *src;
+  guchar                 *dest;
+  gboolean                src_is_premult;
+  gint                    x, y;
+  gint                    w, h;
+  gdouble                 scalex;
+  gdouble                 scaley;
+  gint                    src_x;
+  gint                    src_y;
+  gint                    dest_bpp;
+  gint                    dest_bpl;
+  gint                    dest_width;
 
-  gint              zoom_quality;
+  gint                    zoom_quality;
 
   /* Bresenham helpers */
-  gint              x_dest_inc; /* amount to increment for each dest. pixel  */
-  gint              x_src_dec;  /* amount to decrement for each source pixel */
-  gint64            dx_start;   /* pixel fraction for first pixel            */
-
-  gint              y_dest_inc;
-  gint              y_src_dec;
-  gint64            dy_start;
-
-  gint              footprint_x;
-  gint              footprint_y;
-  gint              footshift_x;
-  gint              footshift_y;
+  gint                    x_dest_inc; /* amount to increment for each dest. pixel  */
+  gint                    x_src_dec;  /* amount to decrement for each source pixel */
+  gint64                  dx_start;   /* pixel fraction for first pixel            */
+
+  gint                    y_dest_inc;
+  gint                    y_src_dec;
+  gint64                  dy_start;
+
+  gint                    footprint_x;
+  gint                    footprint_y;
+  gint                    footshift_x;
+  gint                    footshift_y;
 
-  gint64            dy;
+  gint64                  dy;
 };
 
-static void  gimp_display_shell_render_info_scale   (RenderInfo       *info,
-                                                     GimpDisplayShell *shell,
-                                                     TileManager      *tiles,
-                                                     gint              level,
-                                                     gboolean          is_premult);
-
-static void  gimp_display_shell_render_setup_notify (GObject          *config,
-                                                     GParamSpec       *param_spec,
-                                                     Gimp             *gimp);
+static void  gimp_display_shell_render_info_scale   (RenderInfo             *info,
+                                                     const GimpDisplayShell *shell,
+                                                     TileManager            *tiles,
+                                                     gint                    level,
+                                                     gboolean                is_premult);
+
+static void  gimp_display_shell_render_setup_notify (GObject                *config,
+                                                     GParamSpec             *param_spec,
+                                                     Gimp                   *gimp);
 
 
 static guchar *tile_buf    = NULL;
@@ -189,20 +189,20 @@
 
 /*  Render Image functions  */
 
-static void           render_image_rgb_a         (RenderInfo       *info);
-static void           render_image_gray_a        (RenderInfo       *info);
+static void           render_image_rgb_a         (RenderInfo             *info);
+static void           render_image_gray_a        (RenderInfo             *info);
 
-static const guchar * render_image_tile_fault    (RenderInfo       *info);
+static const guchar * render_image_tile_fault    (RenderInfo             *info);
 
 
-static void  gimp_display_shell_render_highlight (GimpDisplayShell *shell,
-                                                  gint              x,
-                                                  gint              y,
-                                                  gint              w,
-                                                  gint              h,
-                                                  GdkRectangle     *highlight);
-static void  gimp_display_shell_render_mask      (GimpDisplayShell *shell,
-                                                  RenderInfo       *info);
+static void  gimp_display_shell_render_highlight (const GimpDisplayShell *shell,
+                                                  gint                    x,
+                                                  gint                    y,
+                                                  gint                    w,
+                                                  gint                    h,
+                                                  GdkRectangle           *highlight);
+static void  gimp_display_shell_render_mask      (const GimpDisplayShell *shell,
+                                                  RenderInfo             *info);
 
 
 /*****************************************************************/
@@ -213,12 +213,12 @@
 /*****************************************************************/
 
 void
-gimp_display_shell_render (GimpDisplayShell *shell,
-                           gint              x,
-                           gint              y,
-                           gint              w,
-                           gint              h,
-                           GdkRectangle     *highlight)
+gimp_display_shell_render (const GimpDisplayShell *shell,
+                           gint                    x,
+                           gint                    y,
+                           gint                    w,
+                           gint                    h,
+                           GdkRectangle           *highlight)
 {
   GimpProjection *projection;
   GimpImage      *image;
@@ -231,9 +231,10 @@
   g_return_if_fail (w > 0 && h > 0);
 
   image = shell->display->image;
-  projection = image->projection;
 
-  gimp_display_shell_get_render_start_offset (shell, &offset_x, &offset_y);
+  projection = gimp_image_get_projection (image);
+
+  gimp_display_shell_scroll_get_render_start_offset (shell, &offset_x, &offset_y);
 
   /* Initialize RenderInfo with values that don't change during the
    * call of this function.
@@ -319,8 +320,8 @@
     gint disp_xoffset, disp_yoffset;
     gint offset_x, offset_y;
 
-    gimp_display_shell_get_disp_offset (shell, &disp_xoffset, &disp_yoffset);
-    gimp_display_shell_get_render_start_offset (shell, &offset_x, &offset_y);
+    gimp_display_shell_scroll_get_disp_offset (shell, &disp_xoffset, &disp_yoffset);
+    gimp_display_shell_scroll_get_render_start_offset (shell, &offset_x, &offset_y);
 
     gimp_canvas_draw_rgb (GIMP_CANVAS (shell->canvas), GIMP_CANVAS_STYLE_RENDER,
                         x + disp_xoffset, y + disp_yoffset,
@@ -342,19 +343,19 @@
 /*  This function highlights the given area by dimming all pixels outside. */
 
 static void
-gimp_display_shell_render_highlight (GimpDisplayShell *shell,
-                                     gint              x,
-                                     gint              y,
-                                     gint              w,
-                                     gint              h,
-                                     GdkRectangle     *highlight)
+gimp_display_shell_render_highlight (const GimpDisplayShell *shell,
+                                     gint                    x,
+                                     gint                    y,
+                                     gint                    w,
+                                     gint                    h,
+                                     GdkRectangle           *highlight)
 {
   guchar       *buf  = shell->render_buf;
   GdkRectangle  rect;
   gint          offset_x;
   gint          offset_y;
 
-  gimp_display_shell_get_render_start_offset (shell, &offset_x, &offset_y);
+  gimp_display_shell_scroll_get_render_start_offset (shell, &offset_x, &offset_y);
 
   rect.x      = x + offset_x;
   rect.y      = y + offset_y;
@@ -406,8 +407,8 @@
 }
 
 static void
-gimp_display_shell_render_mask (GimpDisplayShell *shell,
-                                RenderInfo       *info)
+gimp_display_shell_render_mask (const GimpDisplayShell *shell,
+                                RenderInfo             *info)
 {
   gint y, ye;
   gint x, xe;
@@ -591,11 +592,11 @@
 }
 
 static void
-gimp_display_shell_render_info_scale (RenderInfo       *info,
-                                      GimpDisplayShell *shell,
-                                      TileManager      *tiles,
-                                      gint              level,
-                                      gboolean          is_premult)
+gimp_display_shell_render_info_scale (RenderInfo             *info,
+                                      const GimpDisplayShell *shell,
+                                      TileManager            *tiles,
+                                      gint                    level,
+                                      gboolean                is_premult)
 {
   info->src_tiles      = tiles;
   info->src_is_premult = is_premult;
@@ -958,8 +959,6 @@
       src[8] = src[5];  /* reusing existing pixel data */
     }
 
-
-
   if (tile[0])
     {
       src[0] = tile_data_pointer (tile[0], info->src_x - 1, info->src_y - 1);

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-render.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-render.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-render.h	Fri Aug 29 18:50:27 2008
@@ -20,15 +20,15 @@
 #define __GIMP_DISPLAY_SHELL_RENDER_H__
 
 
-void   gimp_display_shell_render_init (Gimp             *gimp);
-void   gimp_display_shell_render_exit (Gimp             *gimp);
+void   gimp_display_shell_render_init (Gimp                   *gimp);
+void   gimp_display_shell_render_exit (Gimp                   *gimp);
 
-void   gimp_display_shell_render      (GimpDisplayShell *shell,
-                                       gint              x,
-                                       gint              y,
-                                       gint              w,
-                                       gint              h,
-                                       GdkRectangle     *highlight);
+void   gimp_display_shell_render      (const GimpDisplayShell *shell,
+                                       gint                    x,
+                                       gint                    y,
+                                       gint                    w,
+                                       gint                    h,
+                                       GdkRectangle           *highlight);
 
 
 #endif  /*  __GIMP_DISPLAY_SHELL_RENDER_H__  */

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	Fri Aug 29 18:50:27 2008
@@ -18,12 +18,9 @@
 
 #include "config.h"
 
-#include <stdlib.h>
-
 #include <gtk/gtk.h>
 
 #include "libgimpmath/gimpmath.h"
-#include "libgimpwidgets/gimpwidgets.h"
 
 #include "display-types.h"
 
@@ -33,89 +30,95 @@
 #include "core/gimpimage.h"
 #include "core/gimpunit.h"
 
-#include "widgets/gimphelp-ids.h"
-#include "widgets/gimpviewabledialog.h"
-
 #include "gimpdisplay.h"
 #include "gimpdisplayshell.h"
-#include "gimpdisplayshell-private.h"
+#include "gimpdisplayshell-draw.h"
 #include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-title.h"
+#include "gimpdisplayshell-transform.h"
 
-#include "gimp-intl.h"
-
-
-#define SCALE_TIMEOUT 1
 
-#define SCALE_EPSILON 0.0001
+#define SCALE_TIMEOUT             2
+#define SCALE_EPSILON             0.0001
+#define ALMOST_CENTERED_THRESHOLD 2
 
 #define SCALE_EQUALS(a,b) (fabs ((a) - (b)) < SCALE_EPSILON)
 
 
-typedef struct
-{
-  GimpDisplayShell *shell;
-  GimpZoomModel    *model;
-  GtkObject        *scale_adj;
-  GtkObject        *num_adj;
-  GtkObject        *denom_adj;
-} ScaleDialogData;
-
-
 /*  local function prototypes  */
 
-static void gimp_display_shell_scale_dialog_response (GtkWidget        *widget,
-                                                      gint              response_id,
-                                                      ScaleDialogData  *dialog);
-static void gimp_display_shell_scale_dialog_free     (ScaleDialogData  *dialog);
-
-static void    update_zoom_values                    (GtkAdjustment    *adj,
-                                                      ScaleDialogData  *dialog);
-static gdouble img2real                              (GimpDisplayShell *shell,
-                                                      gboolean          xdir,
-                                                      gdouble           a);
+static void      gimp_display_shell_scale_to             (GimpDisplayShell *shell,
+                                                          gdouble           scale,
+                                                          gint              viewport_x,
+                                                          gint              viewport_y);
+
+static gboolean  gimp_display_shell_scale_image_starts_to_fit
+                                                         (GimpDisplayShell *shell,
+                                                          gdouble           new_scale,
+                                                          gdouble           current_scale,
+                                                          gboolean         *vertically,
+                                                          gboolean         *horizontally);
+static void      gimp_display_shell_scale_viewport_coord_almost_centered
+                                                         (GimpDisplayShell *shell,
+                                                          gint              x,
+                                                          gint              y,
+                                                          gboolean         *horizontally,
+                                                          gboolean         *vertically);
+
+static void      gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
+                                                          gdouble           new_scale,
+                                                          gdouble           current_scale,
+                                                          gint             *x,
+                                                          gint             *y);
+
+static gdouble   img2real                                (GimpDisplayShell *shell,
+                                                          gboolean          xdir,
+                                                          gdouble           a);
 
 
 /*  public functions  */
 
 /**
- * gimp_display_shell_scale_setup:
+ * gimp_display_shell_update_scrollbars_and_rulers:
  * @shell: the #GimpDisplayShell
  *
- * Prepares the display for drawing the image at current scale and offset.
- * This preparation involves, for example, setting up scrollbars and rulers.
  **/
 void
-gimp_display_shell_scale_setup (GimpDisplayShell *shell)
+gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
 {
-  GimpImage *image;
-  gfloat     sw, sh;
-  gint       image_width;
-  gint       image_height;
-
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
   if (! shell->display)
     return;
 
+  gimp_display_shell_scale_update_scrollbars (shell);
+  gimp_display_shell_scale_update_rulers (shell);
+}
+
+/**
+ * gimp_display_shell_scale_update_scrollbars:
+ * @shell:
+ *
+ **/
+void
+gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell)
+{
+  GimpImage *image;
+  gint       image_width;
+  gint       image_height;
+
   image = shell->display->image;
 
   if (image)
     {
       image_width  = gimp_image_get_width  (image);
       image_height = gimp_image_get_height (image);
-
-      sw = SCALEX (shell, image_width);
-      sh = SCALEY (shell, image_height);
     }
   else
     {
       image_width  = shell->disp_width;
       image_height = shell->disp_height;
-
-      sw = image_width;
-      sh = image_height;
     }
 
 
@@ -125,7 +128,7 @@
   shell->hsbdata->page_size      = shell->disp_width;
   shell->hsbdata->page_increment = shell->disp_width / 2;
 
-  gimp_display_shell_setup_hscrollbar_with_value (shell, shell->offset_x);
+  gimp_display_shell_scroll_setup_hscrollbar (shell, shell->offset_x);
 
   gtk_adjustment_changed (shell->hsbdata);
 
@@ -136,89 +139,110 @@
   shell->vsbdata->page_size      = shell->disp_height;
   shell->vsbdata->page_increment = shell->disp_height / 2;
 
-  gimp_display_shell_setup_vscrollbar_with_value (shell, shell->offset_y);
+  gimp_display_shell_scroll_setup_vscrollbar (shell, shell->offset_y);
 
   gtk_adjustment_changed (shell->vsbdata);
+}
 
+/**
+ * gimp_display_shell_scale_update_rulers:
+ * @shell:
+ *
+ **/
+void
+gimp_display_shell_scale_update_rulers (GimpDisplayShell *shell)
+{
+  GimpImage *image;
+  gint       image_width;
+  gint       image_height;
+  gdouble    horizontal_lower;
+  gdouble    horizontal_upper;
+  gdouble    horizontal_max_size;
+  gdouble    vertical_lower;
+  gdouble    vertical_upper;
+  gdouble    vertical_max_size;
+  gint       scaled_viewport_offset_x;
+  gint       scaled_viewport_offset_y;
 
-  /* Setup rulers */
-  {
-    gdouble horizontal_lower;
-    gdouble horizontal_upper;
-    gdouble horizontal_max_size;
-    gdouble vertical_lower;
-    gdouble vertical_upper;
-    gdouble vertical_max_size;
-    gint    scaled_viewport_offset_x;
-    gint    scaled_viewport_offset_y;
+  image = shell->display->image;
 
+  if (image)
+    {
+      image_width  = gimp_image_get_width  (image);
+      image_height = gimp_image_get_height (image);
+    }
+  else
+    {
+      image_width  = shell->disp_width;
+      image_height = shell->disp_height;
+    }
 
-    /* Initialize values */
 
-    horizontal_lower = 0;
-    vertical_lower   = 0;
+  /* Initialize values */
 
-    if (image)
-      {
-        horizontal_upper    = img2real (shell, TRUE,
-					FUNSCALEX (shell, shell->disp_width));
-        horizontal_max_size = img2real (shell, TRUE,
-					MAX (image_width, image_height));
-
-        vertical_upper      = img2real (shell, FALSE,
-					FUNSCALEY (shell, shell->disp_height));
-        vertical_max_size   = img2real (shell, FALSE,
-					MAX (image_width, image_height));
-      }
-    else
-      {
-        horizontal_upper    = image_width;
-        horizontal_max_size = MAX (image_width, image_height);
+  horizontal_lower = 0;
+  vertical_lower   = 0;
 
-        vertical_upper      = image_height;
-        vertical_max_size   = MAX (image_width, image_height);
-      }
+  if (image)
+    {
+      horizontal_upper    = img2real (shell, TRUE,
+                                      FUNSCALEX (shell, shell->disp_width));
+      horizontal_max_size = img2real (shell, TRUE,
+                                      MAX (image_width, image_height));
+
+      vertical_upper      = img2real (shell, FALSE,
+                                      FUNSCALEY (shell, shell->disp_height));
+      vertical_max_size   = img2real (shell, FALSE,
+                                      MAX (image_width, image_height));
+    }
+  else
+    {
+      horizontal_upper    = image_width;
+      horizontal_max_size = MAX (image_width, image_height);
+
+      vertical_upper      = image_height;
+      vertical_max_size   = MAX (image_width, image_height);
+    }
 
 
-    /* Adjust due to scrolling */
+  /* Adjust due to scrolling */
 
-    gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                   &scaled_viewport_offset_x,
-                                                   &scaled_viewport_offset_y);
-
-    horizontal_lower -= img2real (shell, TRUE,
-                                  FUNSCALEX (shell,
-					     (gdouble) scaled_viewport_offset_x));
-    horizontal_upper -= img2real (shell, TRUE,
-                                  FUNSCALEX (shell,
-					     (gdouble) scaled_viewport_offset_x));
-
-    vertical_lower   -= img2real (shell, FALSE,
-                                  FUNSCALEY (shell,
-					     (gdouble) scaled_viewport_offset_y));
-    vertical_upper   -= img2real (shell, FALSE,
-                                  FUNSCALEY (shell,
-					     (gdouble) scaled_viewport_offset_y));
-
-
-    /* Finally setup the actual rulers */
-
-    gimp_ruler_set_range (GIMP_RULER (shell->hrule),
-                          horizontal_lower,
-                          horizontal_upper,
-                          horizontal_max_size);
-
-    gimp_ruler_set_unit  (GIMP_RULER (shell->hrule),
-                          shell->unit);
-
-    gimp_ruler_set_range (GIMP_RULER (shell->vrule),
-                          vertical_lower,
-                          vertical_upper,
-                          vertical_max_size);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
 
-    gimp_ruler_set_unit  (GIMP_RULER (shell->vrule),
-                          shell->unit);
-  }
+  horizontal_lower -= img2real (shell, TRUE,
+                                FUNSCALEX (shell,
+                                           (gdouble) scaled_viewport_offset_x));
+  horizontal_upper -= img2real (shell, TRUE,
+                                FUNSCALEX (shell,
+                                           (gdouble) scaled_viewport_offset_x));
+
+  vertical_lower   -= img2real (shell, FALSE,
+                                FUNSCALEY (shell,
+                                           (gdouble) scaled_viewport_offset_y));
+  vertical_upper   -= img2real (shell, FALSE,
+                                FUNSCALEY (shell,
+                                           (gdouble) scaled_viewport_offset_y));
+
+
+  /* Finally setup the actual rulers */
+
+  gimp_ruler_set_range (GIMP_RULER (shell->hrule),
+                        horizontal_lower,
+                        horizontal_upper,
+                        horizontal_max_size);
+
+  gimp_ruler_set_unit  (GIMP_RULER (shell->hrule),
+                        shell->unit);
+
+  gimp_ruler_set_range (GIMP_RULER (shell->vrule),
+                        vertical_lower,
+                        vertical_upper,
+                        vertical_max_size);
+
+  gimp_ruler_set_unit  (GIMP_RULER (shell->vrule),
+                        shell->unit);
 }
 
 /**
@@ -303,117 +327,80 @@
  * @zoom_type: whether to zoom in, our or to a specific scale
  * @scale:     ignored unless @zoom_type == %GIMP_ZOOM_TO
  *
- * This function calls gimp_display_shell_scale_to(). It tries to be
- * smart whether to use the position of the mouse pointer or the
- * center of the display as coordinates.
+ * This function figures out the context of the zoom and behaves
+ * appropriatley thereafter.
+ *
  **/
 void
 gimp_display_shell_scale (GimpDisplayShell *shell,
                           GimpZoomType      zoom_type,
                           gdouble           new_scale)
 {
-  GdkEvent *event;
-  gint      x, y;
+  gint    x, y;
+  gdouble current_scale;
+  gdouble real_new_scale;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (shell->canvas != NULL);
 
-  if (zoom_type == GIMP_ZOOM_TO &&
-      SCALE_EQUALS (new_scale, gimp_zoom_model_get_factor (shell->zoom)))
-    return;
-
-  x = shell->disp_width  / 2;
-  y = shell->disp_height / 2;
-
-  /*  Center on the mouse position instead of the display center if
-   *  one of the following conditions are fulfilled and pointer is
-   *  within the canvas:
-   *
-   *   (1) there's no current event (the action was triggered by an
-   *       input controller)
-   *   (2) the event originates from the canvas (a scroll event)
-   *   (3) the event originates from the shell (a key press event)
-   *
-   *  Basically the only situation where we don't want to center on
-   *  mouse position is if the action is being called from a menu.
-   */
+  current_scale = gimp_zoom_model_get_factor (shell->zoom);
 
-  event = gtk_get_current_event ();
+  if (zoom_type != GIMP_ZOOM_TO)
+    {
+      real_new_scale = gimp_zoom_model_zoom_step (zoom_type, current_scale);
+    }
+  else
+    {
+      real_new_scale = new_scale;
+    }
 
-  if (! event ||
-      gtk_get_event_widget (event) == shell->canvas ||
-      gtk_get_event_widget (event) == GTK_WIDGET (shell))
-    {
-      gint canvas_pointer_x;
-      gint canvas_pointer_y;
-
-      gtk_widget_get_pointer (shell->canvas,
-                              &canvas_pointer_x,
-                              &canvas_pointer_y);
-
-      if (canvas_pointer_x >= 0 &&
-          canvas_pointer_y >= 0 &&
-          canvas_pointer_x < shell->disp_width &&
-          canvas_pointer_y < shell->disp_height)
+  if (! SCALE_EQUALS (real_new_scale, current_scale))
+    {
+      if (shell->display->config->resize_windows_on_zoom)
         {
-          x = canvas_pointer_x;
-          y = canvas_pointer_y;
+          /* If the window is resized on zoom, simply do the zoom and
+           * get things rolling
+           */
+          gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, real_new_scale);
+          gimp_display_shell_shrink_wrap (shell, FALSE);
+        }
+      else
+        {
+          gboolean starts_fitting_horizontally;
+          gboolean starts_fitting_vertically;
+          gboolean almost_centered_horizontally;
+          gboolean almost_centered_vertically;
+
+          gimp_display_shell_scale_get_zoom_focus (shell,
+                                                   real_new_scale,
+                                                   current_scale,
+                                                   &x,
+                                                   &y);
+
+          gimp_display_shell_scale_to (shell, real_new_scale, x, y);
+
+
+          /* If an image axis started to fit due to zooming out or if
+           * the focus point is as good as in the center, center on
+           * that axis
+           */
+          gimp_display_shell_scale_image_starts_to_fit (shell,
+                                                        real_new_scale,
+                                                        current_scale,
+                                                        &starts_fitting_horizontally,
+                                                        &starts_fitting_vertically);
+          gimp_display_shell_scale_viewport_coord_almost_centered (shell,
+                                                                   x,
+                                                                   y,
+                                                                   &almost_centered_horizontally,
+                                                                   &almost_centered_vertically);
+          gimp_display_shell_scroll_center_image (shell,
+                                                  starts_fitting_horizontally ||
+                                                  almost_centered_horizontally,
+                                                  starts_fitting_vertically ||
+                                                  almost_centered_vertically);
         }
     }
-
-  gimp_display_shell_scale_to (shell, zoom_type, new_scale, x, y);
-}
-
-/**
- * gimp_display_shell_scale_to:
- * @shell:     the #GimpDisplayShell
- * @zoom_type: whether to zoom in, out or to a specified scale
- * @scale:     ignored unless @zoom_type == %GIMP_ZOOM_TO
- * @x:         x screen coordinate
- * @y:         y screen coordinate
- *
- * This function changes the scale (zoom ratio) of the display shell.
- * It either zooms in / out one step (%GIMP_ZOOM_IN / %GIMP_ZOOM_OUT)
- * or sets the scale to the zoom ratio passed as @scale (%GIMP_ZOOM_TO).
- *
- * The display offsets are adjusted so that the point specified by @x
- * and @y doesn't change it's position on screen (if possible). You
- * would typically pass either the display center or the mouse
- * position here.
- **/
-void
-gimp_display_shell_scale_to (GimpDisplayShell *shell,
-                             GimpZoomType      zoom_type,
-                             gdouble           scale,
-                             gdouble           x,
-                             gdouble           y)
-{
-  gdouble current;
-  gdouble offset_x;
-  gdouble offset_y;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-
-  if (! shell->display)
-    return;
-
-  current = gimp_zoom_model_get_factor (shell->zoom);
-
-  offset_x = shell->offset_x + x;
-  offset_y = shell->offset_y + y;
-
-  offset_x /= current;
-  offset_y /= current;
-
-  if (zoom_type != GIMP_ZOOM_TO)
-    scale = gimp_zoom_model_zoom_step (zoom_type, current);
-
-  offset_x *= scale;
-  offset_y *= scale;
-
-  gimp_display_shell_scale_by_values (shell, scale,
-                                      offset_x - x, offset_y - y,
-                                      shell->display->config->resize_windows_on_zoom);
 }
 
 /**
@@ -452,7 +439,40 @@
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
   gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
-  gimp_display_shell_center_image (shell, TRUE, TRUE);
+  gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
+}
+
+/**
+ * gimp_display_shell_scale_image_is_within_viewport:
+ * @shell:
+ *
+ * Returns: %TRUE if the (scaled) image is smaller than and within the
+ *          viewport.
+ **/
+gboolean
+gimp_display_shell_scale_image_is_within_viewport (GimpDisplayShell *shell,
+                                                   gboolean         *horizontally,
+                                                   gboolean         *vertically)
+{
+  gint     sw, sh;
+  gboolean horizontally_dummy, vertically_dummy;
+
+  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
+
+  if (! horizontally) horizontally = &horizontally_dummy;
+  if (! vertically)   vertically   = &vertically_dummy;
+
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+  *horizontally = sw              <= shell->disp_width       &&
+                  shell->offset_x <= 0                       &&
+                  shell->offset_x >= sw - shell->disp_width;
+
+  *vertically   = sh              <= shell->disp_height      &&
+                  shell->offset_y <= 0                       &&
+                  shell->offset_y >= sh - shell->disp_height;
+
+  return *vertically && *horizontally;
 }
 
 /**
@@ -491,97 +511,32 @@
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
   gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
-  gimp_display_shell_center_image (shell, TRUE, TRUE);
+  gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
 }
 
 /**
- * gimp_display_shell_center_image:
+ * gimp_display_shell_scale_handle_zoom_revert:
  * @shell:
- * @horizontally:
- * @vertically:
- *
- * Centers the image in the display shell on the desired axes.
  *
+ * Handle the updating of the Revert Zoom variables.
  **/
 void
-gimp_display_shell_center_image (GimpDisplayShell *shell,
-                                 gboolean          horizontally,
-                                 gboolean          vertically)
+gimp_display_shell_scale_handle_zoom_revert (GimpDisplayShell *shell)
 {
-  gint sw, sh;
-  gint target_offset_x, target_offset_y;
+  guint now;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  if (! shell->display)
-    return;
-
-  target_offset_x = shell->offset_x;
-  target_offset_y = shell->offset_y;
-
-  gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
-
-  if (horizontally)
-    {
-      if (sw < shell->disp_width)
-        {
-          target_offset_x = -(shell->disp_width - sw) / 2;
-        }
-      else
-        {
-          target_offset_x = (sw - shell->disp_width) / 2;
-        }
-    }
+  now = time (NULL);
 
-  if (vertically)
+  if (now - shell->last_scale_time >= SCALE_TIMEOUT)
     {
-      if (sh < shell->disp_height)
-        {
-          target_offset_y = -(shell->disp_height - sh) / 2;
-        }
-      else
-        {
-          target_offset_y = (sh - shell->disp_height) / 2;
-        }
+      shell->last_scale    = gimp_zoom_model_get_factor (shell->zoom);
+      shell->last_offset_x = shell->offset_x;
+      shell->last_offset_y = shell->offset_y;
     }
 
-  /* Note that we can't use gimp_display_shell_scroll_private() here
-   * because that would expose the image twice, causing unwanted
-   * flicker.
-   */
-  gimp_display_shell_scale_by_values (shell, gimp_zoom_model_get_factor (shell->zoom),
-                                      target_offset_x, target_offset_y,
-                                      shell->display->config->resize_windows_on_zoom);
-}
-
-static void
-gimp_display_shell_size_allocate_center_image_callback (GimpDisplayShell *shell,
-                                                        GtkAllocation    *allocation,
-                                                        GtkWidget        *canvas)
-{
-  gimp_display_shell_center_image (shell, TRUE, TRUE);
-
-  g_signal_handlers_disconnect_by_func (canvas,
-                                        gimp_display_shell_size_allocate_center_image_callback,
-                                        shell);
-}
-
-/**
- * gimp_display_shell_center_image_on_next_size_allocate:
- * @shell:
- *
- * Centers the image in the display as soon as the canvas has got its
- * new size
- *
- **/
-void
-gimp_display_shell_center_image_on_next_size_allocate (GimpDisplayShell *shell)
-{
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-
-  g_signal_connect_swapped (shell->canvas, "size-allocate",
-                            G_CALLBACK (gimp_display_shell_size_allocate_center_image_callback),
-                            shell);
+  shell->last_scale_time = now;
 }
 
 /**
@@ -603,8 +558,6 @@
                                     gint              offset_y,
                                     gboolean          resize_window)
 {
-  guint now;
-
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
   /*  Abort early if the values are all setup already. We don't
@@ -615,18 +568,7 @@
       shell->offset_y == offset_y)
     return;
 
-  /* remember the current scale and offsets to allow reverting the scaling */
-
-  now = time (NULL);
-
-  if (now - shell->last_scale_time > SCALE_TIMEOUT)
-    {
-      shell->last_scale    = gimp_zoom_model_get_factor (shell->zoom);
-      shell->last_offset_x = shell->offset_x;
-      shell->last_offset_y = shell->offset_y;
-    }
-
-  shell->last_scale_time = now;
+  gimp_display_shell_scale_handle_zoom_revert (shell);
 
   /* freeze the active tool */
   gimp_display_shell_pause (shell);
@@ -682,8 +624,7 @@
   if (resize_window)
     gimp_display_shell_shrink_wrap (shell, grow_only);
 
-  gimp_display_shell_scroll_clamp_offsets (shell);
-  gimp_display_shell_scale_setup (shell);
+  gimp_display_shell_scroll_clamp_and_update (shell);
   gimp_display_shell_scaled (shell);
 
   gimp_display_shell_expose_full (shell);
@@ -692,6 +633,32 @@
   gimp_display_shell_resume (shell);
 }
 
+/**
+ * gimp_display_shell_calculate_scale_x_and_y:
+ * @shell:
+ * @scale:
+ * @scale_x:
+ * @scale_y:
+ *
+ **/
+void
+gimp_display_shell_calculate_scale_x_and_y (const GimpDisplayShell *shell,
+                                            gdouble                 scale,
+                                            gdouble                *scale_x,
+                                            gdouble                *scale_y)
+{
+  gdouble xres;
+  gdouble yres;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+  g_return_if_fail (GIMP_IS_IMAGE (shell->display->image));
+
+  gimp_image_get_resolution (shell->display->image, &xres, &yres);
+
+  if (scale_x) *scale_x = scale * SCREEN_XRES (shell) / xres;
+  if (scale_y) *scale_y = scale * SCREEN_YRES (shell) / yres;
+}
+
 void
 gimp_display_shell_set_initial_scale (GimpDisplayShell *shell,
                                       gdouble           scale,
@@ -769,225 +736,235 @@
 }
 
 /**
- * gimp_display_shell_scale_dialog:
- * @shell: the #GimpDisplayShell
+ * gimp_display_shell_scale_to:
+ * @shell:
+ * @scale:
+ * @viewport_x:
+ * @viewport_y:
  *
- * Constructs and displays a dialog allowing the user to enter a custom display
- * scale.
+ * Zooms. The display offsets are adjusted so that the point specified
+ * by @x and @y doesn't change it's position on screen.
  **/
-void
-gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
+static void
+gimp_display_shell_scale_to (GimpDisplayShell *shell,
+                             gdouble           scale,
+                             gint              viewport_x,
+                             gint              viewport_y)
 {
-  ScaleDialogData *data;
-  GimpImage       *image;
-  GtkWidget       *hbox;
-  GtkWidget       *table;
-  GtkWidget       *spin;
-  GtkWidget       *label;
-  gint             num, denom, row;
+  gdouble scale_x, scale_y;
+  gdouble image_focus_x, image_focus_y;
+  gint    target_offset_x, target_offset_y;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  if (shell->scale_dialog)
-    {
-      gtk_window_present (GTK_WINDOW (shell->scale_dialog));
-      return;
-    }
-
-  if (SCALE_EQUALS (shell->other_scale, 0.0))
-    {
-      /* other_scale not yet initialized */
-      shell->other_scale = gimp_zoom_model_get_factor (shell->zoom);
-    }
-
-  image = shell->display->image;
+  if (! shell->display)
+    return;
 
-  data = g_slice_new (ScaleDialogData);
+  gimp_display_shell_untransform_xy_f (shell,
+                                       viewport_x,
+                                       viewport_y,
+                                       &image_focus_x,
+                                       &image_focus_y,
+                                       FALSE);
 
-  data->shell = shell;
-  data->model = g_object_new (GIMP_TYPE_ZOOM_MODEL,
-                              "value", fabs (shell->other_scale),
-                              NULL);
-
-  shell->scale_dialog =
-    gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
-                              gimp_get_user_context (shell->display->gimp),
-                              _("Zoom Ratio"), "display_scale",
-                              GTK_STOCK_ZOOM_100,
-                              _("Select Zoom Ratio"),
-                              GTK_WIDGET (shell),
-                              gimp_standard_help_func,
-                              GIMP_HELP_VIEW_ZOOM_OTHER,
-
-                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                              GTK_STOCK_OK,     GTK_RESPONSE_OK,
-
-                              NULL);
-
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (shell->scale_dialog),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
-
-  g_object_weak_ref (G_OBJECT (shell->scale_dialog),
-                     (GWeakNotify) gimp_display_shell_scale_dialog_free, data);
-  g_object_weak_ref (G_OBJECT (shell->scale_dialog),
-                     (GWeakNotify) g_object_unref, data->model);
-
-  g_object_add_weak_pointer (G_OBJECT (shell->scale_dialog),
-                             (gpointer) &shell->scale_dialog);
-
-  gtk_window_set_transient_for (GTK_WINDOW (shell->scale_dialog),
-                                GTK_WINDOW (shell));
-  gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->scale_dialog), TRUE);
-
-  g_signal_connect (shell->scale_dialog, "response",
-                    G_CALLBACK (gimp_display_shell_scale_dialog_response),
-                    data);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_container_set_border_width (GTK_CONTAINER (table), 12);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 6);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 6);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (shell->scale_dialog)->vbox),
-                     table);
-  gtk_widget_show (table);
-
-  row = 0;
-
-  hbox = gtk_hbox_new (FALSE, 6);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
-                             _("Zoom ratio:"), 0.0, 0.5,
-                             hbox, 1, FALSE);
-
-  gimp_zoom_model_get_fraction (data->model, &num, &denom);
-
-  spin = gimp_spin_button_new (&data->num_adj,
-                               num, 1, 256,
-                               1, 8, 1, 1, 0);
-  gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
-  gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
-  gtk_widget_show (spin);
-
-  label = gtk_label_new (":");
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-  gtk_widget_show (label);
-
-  spin = gimp_spin_button_new (&data->denom_adj,
-                               denom, 1, 256,
-                               1, 8, 1, 1, 0);
-  gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
-  gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
-  gtk_widget_show (spin);
-
-  hbox = gtk_hbox_new (FALSE, 6);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
-                             _("Zoom:"), 0.0, 0.5,
-                             hbox, 1, FALSE);
-
-  spin = gimp_spin_button_new (&data->scale_adj,
-                               fabs (shell->other_scale) * 100,
-                               100.0 / 256.0, 25600.0,
-                               10, 50, 0, 1, 2);
-  gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
-  gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
-  gtk_widget_show (spin);
-
-  label = gtk_label_new ("%");
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-  gtk_widget_show (label);
-
-  g_signal_connect (data->scale_adj, "value-changed",
-                    G_CALLBACK (update_zoom_values), data);
-  g_signal_connect (data->num_adj, "value-changed",
-                    G_CALLBACK (update_zoom_values), data);
-  g_signal_connect (data->denom_adj, "value-changed",
-                    G_CALLBACK (update_zoom_values), data);
+  gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
 
-  gtk_widget_show (shell->scale_dialog);
-}
+  target_offset_x = scale_x * image_focus_x - viewport_x;
+  target_offset_y = scale_y * image_focus_y - viewport_y;
 
+  /* Note that we never come here if we need to
+   * resize_windows_on_zoom
+   */
+  gimp_display_shell_scale_by_values (shell,
+                                      scale,
+                                      target_offset_x,
+                                      target_offset_y,
+                                      FALSE);
+}
+
+static gboolean
+gimp_display_shell_scale_image_starts_to_fit (GimpDisplayShell *shell,
+                                              gdouble           new_scale,
+                                              gdouble           current_scale,
+                                              gboolean         *vertically,
+                                              gboolean         *horizontally)
+{
+  gboolean vertically_dummy;
+  gboolean horizontally_dummy;
 
-/*  private functions  */
+  if (! vertically)   vertically   = &vertically_dummy;
+  if (! horizontally) horizontally = &horizontally_dummy;
 
-static void
-gimp_display_shell_scale_dialog_response (GtkWidget       *widget,
-                                          gint             response_id,
-                                          ScaleDialogData *dialog)
-{
-  if (response_id == GTK_RESPONSE_OK)
+  /* The image can only start to fit if we zoom out */
+  if (new_scale > current_scale)
     {
-      gdouble scale;
-
-      scale = gtk_adjustment_get_value (GTK_ADJUSTMENT (dialog->scale_adj));
-
-      gimp_display_shell_scale (dialog->shell, GIMP_ZOOM_TO, scale / 100.0);
+      *vertically   = FALSE;
+      *horizontally = FALSE;
     }
   else
     {
-      /*  need to emit "scaled" to get the menu updated  */
-      gimp_display_shell_scaled (dialog->shell);
+      gint current_scale_width;
+      gint current_scale_height;
+      gint new_scale_width;
+      gint new_scale_height;
+
+      gimp_display_shell_draw_get_scaled_image_size_for_scale (shell,
+                                                               current_scale,
+                                                               &current_scale_width,
+                                                               &current_scale_height);
+
+      gimp_display_shell_draw_get_scaled_image_size_for_scale (shell,
+                                                               new_scale,
+                                                               &new_scale_width,
+                                                               &new_scale_height);
+
+      *vertically   = (current_scale_width  >  shell->disp_width &&
+                       new_scale_width      <= shell->disp_width);
+      *horizontally = (current_scale_height >  shell->disp_height &&
+                       new_scale_height     <= shell->disp_height);
     }
 
-  dialog->shell->other_scale = - fabs (dialog->shell->other_scale);
+  return *vertically && *horizontally;
+}
 
-  gtk_widget_destroy (dialog->shell->scale_dialog);
+static gboolean
+gimp_display_shell_scale_image_stops_to_fit (GimpDisplayShell *shell,
+                                             gdouble           new_scale,
+                                             gdouble           current_scale,
+                                             gboolean         *vertically,
+                                             gboolean         *horizontally)
+{
+  return gimp_display_shell_scale_image_starts_to_fit (shell,
+                                                       current_scale,
+                                                       new_scale,
+                                                       vertically,
+                                                       horizontally);
 }
 
+/**
+ * gimp_display_shell_scale_viewport_coord_almost_centered:
+ * @shell:
+ * @x:
+ * @y:
+ * @horizontally:
+ * @vertically:
+ *
+ **/
 static void
-gimp_display_shell_scale_dialog_free (ScaleDialogData *dialog)
+gimp_display_shell_scale_viewport_coord_almost_centered (GimpDisplayShell *shell,
+                                                         gint              x,
+                                                         gint              y,
+                                                         gboolean         *horizontally,
+                                                         gboolean         *vertically)
 {
-  g_slice_free (ScaleDialogData, dialog);
+  gint center_x = shell->disp_width  / 2;
+  gint center_y = shell->disp_height / 2;
+
+  *horizontally = x > center_x - ALMOST_CENTERED_THRESHOLD &&
+                  x < center_x + ALMOST_CENTERED_THRESHOLD;
+
+  *vertically   = y > center_y - ALMOST_CENTERED_THRESHOLD &&
+                  y < center_y + ALMOST_CENTERED_THRESHOLD;
 }
 
+/**
+ * gimp_display_shell_scale_get_zoom_focus:
+ * @shell:
+ * @new_scale:
+ * @x:
+ * @y:
+ *
+ * Calculates the viewport coordinate to focus on when zooming
+ * independently for each axis.
+ **/
 static void
-update_zoom_values (GtkAdjustment   *adj,
-                    ScaleDialogData *dialog)
+gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
+                                         gdouble           new_scale,
+                                         gdouble           current_scale,
+                                         gint             *x,
+                                         gint             *y)
 {
-  gint    num, denom;
-  gdouble scale;
-
-  g_signal_handlers_block_by_func (GTK_ADJUSTMENT (dialog->scale_adj),
-                                   G_CALLBACK (update_zoom_values),
-                                   dialog);
+  gint image_center_x, image_center_y;
+  gint other_x, other_y;
 
-  g_signal_handlers_block_by_func (GTK_ADJUSTMENT (dialog->num_adj),
-                                   G_CALLBACK (update_zoom_values),
-                                   dialog);
+  /* Calculate stops-to-fit focus point */
+  {
+    gint sw, sh;
 
-  g_signal_handlers_block_by_func (GTK_ADJUSTMENT (dialog->denom_adj),
-                                   G_CALLBACK (update_zoom_values),
-                                   dialog);
+    gimp_display_shell_draw_get_scaled_image_size (shell,
+                                                   &sw,
+                                                   &sh);
+    image_center_x = -shell->offset_x + sw / 2;
+    image_center_y = -shell->offset_y + sh / 2;
+  }
 
-  if (GTK_OBJECT (adj) == dialog->scale_adj)
-    {
-      scale = gtk_adjustment_get_value (GTK_ADJUSTMENT (dialog->scale_adj));
+  /* Calculate other focus point */
+  {
+    GdkEvent *event;
+    gboolean  event_looks_sane;
+    gboolean  cursor_within_canvas;
+    gint      canvas_pointer_x, canvas_pointer_y;
+
+    /*  Center on the mouse position instead of the display center if
+     *  one of the following conditions are fulfilled and pointer is
+     *  within the canvas:
+     *
+     *   (1) there's no current event (the action was triggered by an
+     *       input controller)
+     *   (2) the event originates from the canvas (a scroll event)
+     *   (3) the event originates from the shell (a key press event)
+     *
+     *  Basically the only situation where we don't want to center on
+     *  mouse position is if the action is being called from a menu.
+     */
+
+    event = gtk_get_current_event ();
+
+    event_looks_sane = ! event ||
+                       gtk_get_event_widget (event) == shell->canvas ||
+                       gtk_get_event_widget (event) == GTK_WIDGET (shell);
+
+
+    gtk_widget_get_pointer (shell->canvas,
+                            &canvas_pointer_x,
+                            &canvas_pointer_y);
+
+    cursor_within_canvas = canvas_pointer_x >= 0 &&
+                           canvas_pointer_y >= 0 &&
+                           canvas_pointer_x <  shell->disp_width &&
+                           canvas_pointer_y <  shell->disp_height;
 
-      gimp_zoom_model_zoom (dialog->model, GIMP_ZOOM_TO, scale / 100.0);
-      gimp_zoom_model_get_fraction (dialog->model, &num, &denom);
 
-      gtk_adjustment_set_value (GTK_ADJUSTMENT (dialog->num_adj), num);
-      gtk_adjustment_set_value (GTK_ADJUSTMENT (dialog->denom_adj), denom);
-    }
-  else   /* fraction adjustments */
-    {
-      scale = (gtk_adjustment_get_value (GTK_ADJUSTMENT (dialog->num_adj)) /
-               gtk_adjustment_get_value (GTK_ADJUSTMENT (dialog->denom_adj)));
-      gtk_adjustment_set_value (GTK_ADJUSTMENT (dialog->scale_adj),
-                                scale * 100);
-    }
+    if (event_looks_sane && cursor_within_canvas)
+      {
+        other_x = canvas_pointer_x;
+        other_y = canvas_pointer_y;
+      }
+    else
+      {
+        other_x = shell->disp_width  / 2;
+        other_y = shell->disp_height / 2;
+      }
+  }
 
-  g_signal_handlers_unblock_by_func (GTK_ADJUSTMENT (dialog->scale_adj),
-                                     G_CALLBACK (update_zoom_values),
-                                     dialog);
+  /* Decide which one to use for each axis */
+  {
+    gboolean within_horizontally, within_vertically;
+    gboolean stops_horizontally, stops_vertically;
 
-  g_signal_handlers_unblock_by_func (GTK_ADJUSTMENT (dialog->num_adj),
-                                     G_CALLBACK (update_zoom_values),
-                                     dialog);
+    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);
 
-  g_signal_handlers_unblock_by_func (GTK_ADJUSTMENT (dialog->denom_adj),
-                                     G_CALLBACK (update_zoom_values),
-                                     dialog);
+    *x = within_horizontally && ! stops_horizontally ? image_center_x : other_x;
+    *y = within_vertically   && ! stops_vertically   ? image_center_y : other_y;
+  }
 }
 
 /* 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	Fri Aug 29 18:50:27 2008
@@ -20,46 +20,44 @@
 #define __GIMP_DISPLAY_SHELL_SCALE_H__
 
 
-void   gimp_display_shell_scale_setup           (GimpDisplayShell *shell);
-
-gboolean gimp_display_shell_scale_revert        (GimpDisplayShell *shell);
-gboolean gimp_display_shell_scale_can_revert    (GimpDisplayShell *shell);
-
-void   gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
-                                                 gboolean          dot_for_dot);
-
-void   gimp_display_shell_scale                 (GimpDisplayShell *shell,
-                                                 GimpZoomType      zoom_type,
-                                                 gdouble           scale);
-void   gimp_display_shell_scale_to              (GimpDisplayShell *shell,
-                                                 GimpZoomType      zoom_type,
-                                                 gdouble           scale,
-                                                 gdouble           x,
-                                                 gdouble           y);
-void   gimp_display_shell_scale_fit_in          (GimpDisplayShell *shell);
-void   gimp_display_shell_scale_fill            (GimpDisplayShell *shell);
-void   gimp_display_shell_center_image          (GimpDisplayShell *shell,
-                                                 gboolean          horizontally,
-                                                 gboolean          vertically);
-void   gimp_display_shell_center_image_on_next_size_allocate
-                                                (GimpDisplayShell *shell);
-void   gimp_display_shell_scale_by_values       (GimpDisplayShell *shell,
-                                                 gdouble           scale,
-                                                 gint              offset_x,
-                                                 gint              offset_y,
-                                                 gboolean          resize_window);
-void   gimp_display_shell_scale_shrink_wrap     (GimpDisplayShell *shell,
-                                                 gboolean          grow_only);
-
-void   gimp_display_shell_scale_resize          (GimpDisplayShell *shell,
-                                                 gboolean          resize_window,
-                                                 gboolean          grow_only);
-void   gimp_display_shell_set_initial_scale     (GimpDisplayShell *shell,
-                                                 gdouble           scale,
-                                                 gint             *display_width,
-                                                 gint             *display_height);
-
-void   gimp_display_shell_scale_dialog          (GimpDisplayShell *shell);
+void     gimp_display_shell_update_scrollbars_and_rulers   (GimpDisplayShell       *shell);
+void     gimp_display_shell_scale_update_scrollbars        (GimpDisplayShell       *shell);
+void     gimp_display_shell_scale_update_rulers            (GimpDisplayShell       *shell);
+
+gboolean gimp_display_shell_scale_revert                   (GimpDisplayShell       *shell);
+gboolean gimp_display_shell_scale_can_revert               (GimpDisplayShell       *shell);
+
+void     gimp_display_shell_scale_set_dot_for_dot          (GimpDisplayShell       *shell,
+                                                            gboolean                dot_for_dot);
+
+void     gimp_display_shell_scale                          (GimpDisplayShell       *shell,
+                                                            GimpZoomType            zoom_type,
+                                                            gdouble                 scale);
+void     gimp_display_shell_scale_fit_in                   (GimpDisplayShell       *shell);
+gboolean gimp_display_shell_scale_image_is_within_viewport (GimpDisplayShell       *shell,
+                                                            gboolean               *horizontally,
+                                                            gboolean               *vertically);
+void     gimp_display_shell_scale_fill                     (GimpDisplayShell       *shell);
+void     gimp_display_shell_scale_handle_zoom_revert       (GimpDisplayShell       *shell);
+void     gimp_display_shell_scale_by_values                (GimpDisplayShell       *shell,
+                                                            gdouble                 scale,
+                                                            gint                    offset_x,
+                                                            gint                    offset_y,
+                                                            gboolean                resize_window);
+void     gimp_display_shell_scale_shrink_wrap              (GimpDisplayShell       *shell,
+                                                            gboolean                grow_only);
+
+void     gimp_display_shell_scale_resize                   (GimpDisplayShell       *shell,
+                                                            gboolean                resize_window,
+                                                            gboolean                grow_only);
+void     gimp_display_shell_calculate_scale_x_and_y        (const GimpDisplayShell  *shell,
+                                                            gdouble                  scale,
+                                                            gdouble                 *scale_x,
+                                                            gdouble                 *scale_y);
+void     gimp_display_shell_set_initial_scale              (GimpDisplayShell        *shell,
+                                                            gdouble                  scale,
+                                                            gint                    *display_width,
+                                                            gint                    *display_height);
 
 
 #endif  /*  __GIMP_DISPLAY_SHELL_SCALE_H__  */

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	Fri Aug 29 18:50:27 2008
@@ -33,19 +33,29 @@
 #include "core/gimpimage.h"
 #include "core/gimpprojection.h"
 
+#include "gimpcanvas.h"
 #include "gimpdisplay.h"
 #include "gimpdisplay-foreach.h"
 #include "gimpdisplayshell.h"
-#include "gimpdisplayshell-private.h"
+#include "gimpdisplayshell-draw.h"
 #include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 
 
-#define OVERPAN_FACTOR 0.5
+#define OVERPAN_FACTOR      0.5
+#define MINIMUM_STEP_AMOUNT 1.0
+
+
+typedef struct
+{
+  GimpDisplayShell *shell;
+  gboolean          vertically;
+  gboolean          horizontally;
+} SizeAllocateCallbackData;
 
 
 /**
- * gimp_display_shell_center_around_image_coordinate:
+ * gimp_display_shell_scroll_center_image_coordinate:
  * @shell:
  * @image_x:
  * @image_y:
@@ -54,7 +64,7 @@
  *
  **/
 void
-gimp_display_shell_center_around_image_coordinate (GimpDisplayShell       *shell,
+gimp_display_shell_scroll_center_image_coordinate (GimpDisplayShell       *shell,
                                                    gdouble                 image_x,
                                                    gdouble                 image_y)
 {
@@ -69,21 +79,24 @@
   offset_to_apply_x = scaled_image_x - shell->disp_width  / 2 - shell->offset_x;
   offset_to_apply_y = scaled_image_y - shell->disp_height / 2 - shell->offset_y;
 
-  gimp_display_shell_scroll_private (shell,
-                                     offset_to_apply_x,
-                                     offset_to_apply_y);
+  gimp_display_shell_scroll (shell,
+                             offset_to_apply_x,
+                             offset_to_apply_y);
 }
 
 void
-gimp_display_shell_scroll_private (GimpDisplayShell *shell,
-                                   gint              x_offset,
-                                   gint              y_offset)
+gimp_display_shell_scroll (GimpDisplayShell *shell,
+                           gint              x_offset,
+                           gint              y_offset)
 {
   gint old_x;
   gint old_y;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
+  if (x_offset == 0 && y_offset == 0)
+    return;
+
   old_x = shell->offset_x;
   old_y = shell->offset_y;
 
@@ -108,13 +121,10 @@
       shell->offset_x += x_offset;
       shell->offset_y += y_offset;
 
-      gdk_window_scroll (shell->canvas->window, -x_offset, -y_offset);
-
-      /*  Make sure expose events are processed before scrolling again  */
-      gdk_window_process_updates (shell->canvas->window, FALSE);
+      gimp_canvas_scroll (GIMP_CANVAS (shell->canvas), -x_offset, -y_offset);
 
       /*  Update scrollbars and rulers  */
-      gimp_display_shell_scale_setup (shell);
+      gimp_display_shell_update_scrollbars_and_rulers (shell);
 
       gimp_display_shell_resume (shell);
 
@@ -123,6 +133,35 @@
 }
 
 void
+gimp_display_shell_scroll_set_offset (GimpDisplayShell *shell,
+                                      gint              offset_x,
+                                      gint              offset_y)
+{
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (shell->offset_x == offset_x &&
+      shell->offset_y == offset_y)
+    return;
+
+  gimp_display_shell_scale_handle_zoom_revert (shell);
+
+  /* freeze the active tool */
+  gimp_display_shell_pause (shell);
+
+  shell->offset_x = offset_x;
+  shell->offset_y = offset_y;
+
+  gimp_display_shell_scroll_clamp_and_update (shell);
+
+  gimp_display_shell_scrolled (shell);
+
+  gimp_display_shell_expose_full (shell);
+
+  /* re-enable the active tool */
+  gimp_display_shell_resume (shell);
+}
+
+void
 gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@@ -205,7 +244,177 @@
 }
 
 /**
- * gimp_display_shell_get_scaled_viewport:
+ * gimp_display_shell_scroll_clamp_and_update:
+ * @shell:
+ *
+ * Helper function for calling two functions that are commonly called
+ * in pairs.
+ **/
+void
+gimp_display_shell_scroll_clamp_and_update (GimpDisplayShell *shell)
+{
+  gimp_display_shell_scroll_clamp_offsets (shell);
+  gimp_display_shell_update_scrollbars_and_rulers (shell);
+}
+
+/**
+ * gimp_display_shell_scroll_unoverscrollify:
+ * @shell:
+ * @in_offset_x:
+ * @in_offset_y:
+ * @out_offset_x:
+ * @out_offset_y:
+ *
+ * Takes a scroll offset and returns the offset that will not result
+ * in a scroll beyond the image border. If the image is already
+ * overscrolled, the return value is 0 for that given axis.
+ *
+ **/
+void
+gimp_display_shell_scroll_unoverscrollify (GimpDisplayShell *shell,
+                                           gint              in_offset_x,
+                                           gint              in_offset_y,
+                                           gint             *out_offset_x,
+                                           gint             *out_offset_y)
+{
+  gint sw, sh;
+  gint out_offset_x_dummy, out_offset_y_dummy;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (! out_offset_x) out_offset_x = &out_offset_x_dummy;
+  if (! out_offset_y) out_offset_y = &out_offset_y_dummy;
+
+  *out_offset_x = in_offset_x;
+  *out_offset_y = in_offset_y;
+
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+  if (in_offset_x < 0)
+    {
+      *out_offset_x = MAX (in_offset_x,
+                           MIN (0, 0 - shell->offset_x));
+    }
+  else if (in_offset_x > 0)
+    {
+      gint min_offset = sw - shell->disp_width;
+
+      *out_offset_x = MIN (in_offset_x,
+                           MAX (0, min_offset - shell->offset_x));
+    }
+
+  if (in_offset_y < 0)
+    {
+      *out_offset_y = MAX (in_offset_y,
+                           MIN (0, 0 - shell->offset_y));
+    }
+  else if (in_offset_y > 0)
+    {
+      gint min_offset = sh - shell->disp_height;
+
+      *out_offset_y = MIN (in_offset_y,
+                           MAX (0, min_offset - shell->offset_y));
+    }
+}
+
+/**
+ * gimp_display_shell_scroll_center_image:
+ * @shell:
+ * @horizontally:
+ * @vertically:
+ *
+ * Centers the image in the display shell on the desired axes.
+ *
+ **/
+void
+gimp_display_shell_scroll_center_image (GimpDisplayShell *shell,
+                                        gboolean          horizontally,
+                                        gboolean          vertically)
+{
+  gint sw, sh;
+  gint target_offset_x, target_offset_y;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (! shell->display ||
+      ! shell->display->image ||
+      (! vertically && ! horizontally))
+    return;
+
+  target_offset_x = shell->offset_x;
+  target_offset_y = shell->offset_y;
+
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+  if (horizontally)
+    {
+      target_offset_x = (sw - shell->disp_width) / 2;
+    }
+
+  if (vertically)
+    {
+      target_offset_y = (sh - shell->disp_height) / 2;
+    }
+
+  gimp_display_shell_scroll_set_offset (shell,
+                                        target_offset_x,
+                                        target_offset_y);
+}
+
+static void
+gimp_display_shell_scroll_center_image_callback (GtkWidget                *canvas,
+                                                 GtkAllocation            *allocation,
+                                                 SizeAllocateCallbackData *data)
+{
+  gimp_display_shell_scroll_center_image (data->shell,
+                                          data->horizontally,
+                                          data->vertically);
+
+  g_signal_handlers_disconnect_by_func (canvas,
+                                        gimp_display_shell_scroll_center_image_callback,
+                                        data);
+
+  g_slice_free (SizeAllocateCallbackData, data);
+}
+
+/**
+ * gimp_display_shell_scroll_center_image_on_next_size_allocate:
+ * @shell:
+ *
+ * Centers the image in the display as soon as the canvas has got its
+ * new size.
+ *
+ * Only call this if you are sure the canvas size will change.
+ * (Otherwise the signal connection and centering will lurk until the
+ * canvas size is changed e.g. by toggling the rulers.)
+ *
+ **/
+void
+gimp_display_shell_scroll_center_image_on_next_size_allocate (GimpDisplayShell *shell,
+                                                              gboolean          horizontally,
+                                                              gboolean          vertically)
+{
+  SizeAllocateCallbackData *data;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  data = g_slice_new (SizeAllocateCallbackData);
+
+  if (data)
+    {
+      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);
+    }
+
+}
+
+/**
+ * gimp_display_shell_scroll_get_scaled_viewport:
  * @shell:
  * @x:
  * @y:
@@ -217,20 +426,20 @@
  *
  **/
 void
-gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
-                                        gint                   *x,
-                                        gint                   *y,
-                                        gint                   *w,
-                                        gint                   *h)
+gimp_display_shell_scroll_get_scaled_viewport (const GimpDisplayShell *shell,
+                                               gint                   *x,
+                                               gint                   *y,
+                                               gint                   *w,
+                                               gint                   *h)
 {
   gint scaled_viewport_offset_x;
   gint scaled_viewport_offset_y;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
   if (x) *x = -scaled_viewport_offset_x;
   if (y) *y = -scaled_viewport_offset_y;
   if (w) *w =  shell->disp_width;
@@ -238,7 +447,7 @@
 }
 
 /**
- * gimp_display_shell_get_viewport:
+ * gimp_display_shell_scroll_get_viewport:
  * @shell:
  * @x:
  * @y:
@@ -249,11 +458,11 @@
  *
  **/
 void
-gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
-                                 gdouble                *x,
-                                 gdouble                *y,
-                                 gdouble                *w,
-                                 gdouble                *h)
+gimp_display_shell_scroll_get_viewport (const GimpDisplayShell *shell,
+                                        gdouble                *x,
+                                        gdouble                *y,
+                                        gdouble                *w,
+                                        gdouble                *h)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -264,7 +473,7 @@
 }
 
 /**
- * gimp_display_shell_get_scaled_viewport_offset:
+ * gimp_display_shell_scroll_get_scaled_viewport_offset:
  * @shell:
  * @x:
  * @y:
@@ -273,9 +482,9 @@
  *
  **/
 void
-gimp_display_shell_get_scaled_viewport_offset (const GimpDisplayShell *shell,
-                                               gint                   *x,
-                                               gint                   *y)
+gimp_display_shell_scroll_get_scaled_viewport_offset (const GimpDisplayShell *shell,
+                                                      gint                   *x,
+                                                      gint                   *y)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -284,43 +493,7 @@
 }
 
 /**
- * gimp_display_shell_get_scaled_image_size:
- * @shell:
- * @w:
- * @h:
- *
- * Gets the size of the rendered image after it has been scaled.
- *
- **/
-void
-gimp_display_shell_get_scaled_image_size (const GimpDisplayShell *shell,
-                                          gint                   *w,
-                                          gint                   *h)
-{
-  GimpProjection *proj;
-  TileManager    *tiles;
-  gint            level;
-  gint            level_width;
-  gint            level_height;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-  g_return_if_fail (GIMP_IS_IMAGE (shell->display->image));
-
-  proj = shell->display->image->projection;
-
-  level = gimp_projection_get_level (proj, shell->scale_x, shell->scale_y);
-
-  tiles = gimp_projection_get_tiles_at_level (proj, level, NULL);
-
-  level_width  = tile_manager_width (tiles);
-  level_height = tile_manager_height (tiles);
-
-  if (w) *w = PROJ_ROUND (level_width  * (shell->scale_x * (1 << level)));
-  if (h) *h = PROJ_ROUND (level_height * (shell->scale_y * (1 << level)));
-}
-
-/**
- * gimp_display_shell_get_disp_offset:
+ * gimp_display_shell_scroll_get_disp_offset:
  * @shell:
  * @disp_xoffset:
  * @disp_yoffset:
@@ -330,9 +503,9 @@
  *
  **/
 void
-gimp_display_shell_get_disp_offset (const GimpDisplayShell *shell,
-                                    gint                   *disp_xoffset,
-                                    gint                   *disp_yoffset)
+gimp_display_shell_scroll_get_disp_offset (const GimpDisplayShell *shell,
+                                           gint                   *disp_xoffset,
+                                           gint                   *disp_yoffset)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -362,7 +535,7 @@
 }
 
 /**
- * gimp_display_shell_get_render_start_offset:
+ * gimp_display_shell_scroll_get_render_start_offset:
  * @shell:
  * @offset_x:
  * @offset_y:
@@ -372,9 +545,9 @@
  *
  **/
 void
-gimp_display_shell_get_render_start_offset (const GimpDisplayShell *shell,
-                                            gint                   *offset_x,
-                                            gint                   *offset_y)
+gimp_display_shell_scroll_get_render_start_offset (const GimpDisplayShell *shell,
+                                                   gint                   *offset_x,
+                                                   gint                   *offset_y)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -383,7 +556,7 @@
 }
 
 /**
- * gimp_display_shell_setup_hscrollbar_with_value:
+ * gimp_display_shell_scroll_setup_hscrollbar:
  * @shell:
  * @value:
  *
@@ -391,8 +564,8 @@
  *
  **/
 void
-gimp_display_shell_setup_hscrollbar_with_value (GimpDisplayShell *shell,
-                                                gdouble           value)
+gimp_display_shell_scroll_setup_hscrollbar (GimpDisplayShell *shell,
+                                            gdouble           value)
 {
   gint sw;
 
@@ -402,7 +575,7 @@
       ! shell->display->image)
     return;
 
-  gimp_display_shell_get_scaled_image_size (shell, &sw, NULL);
+  gimp_display_shell_draw_get_scaled_image_size (shell, &sw, NULL);
 
   if (shell->disp_width < sw)
     {
@@ -421,11 +594,11 @@
                                    sw + (shell->disp_width - sw) / 2);
     }
 
-  shell->hsbdata->step_increment = MAX (shell->scale_x, 1.0);
+  shell->hsbdata->step_increment = MAX (shell->scale_x, MINIMUM_STEP_AMOUNT);
 }
 
 /**
- * gimp_display_shell_setup_vscrollbar_with_value:
+ * gimp_display_shell_scroll_setup_vscrollbar:
  * @shell:
  * @value:
  *
@@ -433,8 +606,8 @@
  *
  **/
 void
-gimp_display_shell_setup_vscrollbar_with_value (GimpDisplayShell *shell,
-                                                gdouble           value)
+gimp_display_shell_scroll_setup_vscrollbar (GimpDisplayShell *shell,
+                                            gdouble           value)
 {
   gint sh;
 
@@ -444,7 +617,7 @@
       ! shell->display->image)
     return;
 
-  gimp_display_shell_get_scaled_image_size (shell, NULL, &sh);
+  gimp_display_shell_draw_get_scaled_image_size (shell, NULL, &sh);
 
   if (shell->disp_height < sh)
     {
@@ -463,5 +636,5 @@
                                    sh + (shell->disp_height - sh) / 2);
     }
 
-  shell->vsbdata->step_increment = MAX (shell->scale_y, 1.0);
+  shell->vsbdata->step_increment = MAX (shell->scale_y, MINIMUM_STEP_AMOUNT);
 }

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-scroll.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-scroll.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-scroll.h	Fri Aug 29 18:50:27 2008
@@ -20,44 +20,52 @@
 #define __GIMP_DISPLAY_SHELL_SCROLL_H__
 
 
-void   gimp_display_shell_center_around_image_coordinate (GimpDisplayShell       *shell,
-                                                          gdouble                 image_x,
-                                                          gdouble                 image_y);
-
-void   gimp_display_shell_scroll_clamp_offsets           (GimpDisplayShell       *shell);
-
-void   gimp_display_shell_get_scaled_viewport            (const GimpDisplayShell *shell,
-                                                          gint                   *x,
-                                                          gint                   *y,
-                                                          gint                   *w,
-                                                          gint                   *h);
-
-void   gimp_display_shell_get_viewport                   (const GimpDisplayShell *shell,
-                                                          gdouble                *x,
-                                                          gdouble                *y,
-                                                          gdouble                *w,
-                                                          gdouble                *h);
-
-void   gimp_display_shell_get_scaled_viewport_offset     (const GimpDisplayShell *shell,
-                                                          gint                   *x,
-                                                          gint                   *y);
-
-void   gimp_display_shell_get_scaled_image_size          (const GimpDisplayShell *shell,
-                                                          gint                   *w,
-                                                          gint                   *h);
-
-void   gimp_display_shell_get_disp_offset                (const GimpDisplayShell *shell,
-                                                          gint                   *disp_xoffset,
-                                                          gint                   *disp_yoffset);
-
-void   gimp_display_shell_get_render_start_offset        (const GimpDisplayShell *shell,
-                                                          gint                   *offset_x,
-                                                          gint                   *offset_y);
-
-void   gimp_display_shell_setup_hscrollbar_with_value    (GimpDisplayShell       *shell,
-                                                          gdouble                 value);
-void   gimp_display_shell_setup_vscrollbar_with_value    (GimpDisplayShell       *shell,
-                                                          gdouble                 value);
+void   gimp_display_shell_scroll_center_image_coordinate    (GimpDisplayShell       *shell,
+                                                             gdouble                 image_x,
+                                                             gdouble                 image_y);
+void   gimp_display_shell_scroll                            (GimpDisplayShell       *shell,
+                                                             gint                    x_offset,
+                                                             gint                    y_offset);
+void   gimp_display_shell_scroll_set_offset                 (GimpDisplayShell       *shell,
+                                                             gint                    offset_x,
+                                                             gint                    offset_y);
+void   gimp_display_shell_scroll_clamp_offsets              (GimpDisplayShell       *shell);
+void   gimp_display_shell_scroll_clamp_and_update           (GimpDisplayShell       *shell);
+void   gimp_display_shell_scroll_unoverscrollify            (GimpDisplayShell       *shell,
+                                                             gint                    in_offset_x,
+                                                             gint                    in_offset_y,
+                                                             gint                   *out_offset_x,
+                                                             gint                   *out_offset_y);
+void   gimp_display_shell_scroll_center_image               (GimpDisplayShell       *shell,
+                                                             gboolean                horizontally,
+                                                             gboolean                vertically);
+void   gimp_display_shell_scroll_center_image_on_next_size_allocate
+                                                            (GimpDisplayShell       *shell,
+                                                             gboolean                horizontally,
+                                                             gboolean                vertically);
+void   gimp_display_shell_scroll_get_scaled_viewport        (const GimpDisplayShell *shell,
+                                                             gint                   *x,
+                                                             gint                   *y,
+                                                             gint                   *w,
+                                                             gint                   *h);
+void   gimp_display_shell_scroll_get_viewport               (const GimpDisplayShell *shell,
+                                                             gdouble                *x,
+                                                             gdouble                *y,
+                                                             gdouble                *w,
+                                                             gdouble                *h);
+void   gimp_display_shell_scroll_get_scaled_viewport_offset (const GimpDisplayShell *shell,
+                                                             gint                   *x,
+                                                             gint                   *y);
+void   gimp_display_shell_scroll_get_disp_offset            (const GimpDisplayShell *shell,
+                                                             gint                   *disp_xoffset,
+                                                             gint                   *disp_yoffset);
+void   gimp_display_shell_scroll_get_render_start_offset    (const GimpDisplayShell *shell,
+                                                             gint                   *offset_x,
+                                                             gint                   *offset_y);
+void   gimp_display_shell_scroll_setup_hscrollbar           (GimpDisplayShell       *shell,
+                                                             gdouble                 value);
+void   gimp_display_shell_scroll_setup_vscrollbar           (GimpDisplayShell       *shell,
+                                                             gdouble                 value);
 
 
 #endif  /*  __GIMP_DISPLAY_SHELL_SCROLL_H__  */

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-transform.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-transform.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-transform.c	Fri Aug 29 18:50:27 2008
@@ -45,9 +45,9 @@
  * objects can be rendered at the correct points on the display.
  **/
 void
-gimp_display_shell_transform_coordinate (GimpDisplayShell *shell,
-                                         GimpCoords       *image_coords,
-                                         GimpCoords       *display_coords)
+gimp_display_shell_transform_coordinate (const GimpDisplayShell *shell,
+                                         GimpCoords             *image_coords,
+                                         GimpCoords             *display_coords)
 {
   gint scaled_viewport_offset_x;
   gint scaled_viewport_offset_y;
@@ -61,9 +61,9 @@
   display_coords->x = SCALEX (shell, image_coords->x);
   display_coords->y = SCALEY (shell, image_coords->y);
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
 
   display_coords->x += scaled_viewport_offset_x;
   display_coords->y += scaled_viewport_offset_y;
@@ -79,9 +79,9 @@
  * points on the display can be mapped to points in the image.
  **/
 void
-gimp_display_shell_untransform_coordinate (GimpDisplayShell *shell,
-                                           GimpCoords       *display_coords,
-                                           GimpCoords       *image_coords)
+gimp_display_shell_untransform_coordinate (const GimpDisplayShell *shell,
+                                           GimpCoords             *display_coords,
+                                           GimpCoords             *image_coords)
 {
   gint scaled_viewport_offset_x;
   gint scaled_viewport_offset_y;
@@ -92,9 +92,9 @@
 
   *image_coords = *display_coords;
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
 
   image_coords->x = display_coords->x - scaled_viewport_offset_x;
   image_coords->y = display_coords->y - scaled_viewport_offset_y;
@@ -104,12 +104,12 @@
 }
 
 void
-gimp_display_shell_transform_xy (GimpDisplayShell *shell,
-                                 gdouble           x,
-                                 gdouble           y,
-                                 gint             *nx,
-                                 gint             *ny,
-                                 gboolean          use_offsets)
+gimp_display_shell_transform_xy (const GimpDisplayShell *shell,
+                                 gdouble                 x,
+                                 gdouble                 y,
+                                 gint                   *nx,
+                                 gint                   *ny,
+                                 gboolean                use_offsets)
 {
   gint   scaled_viewport_offset_x;
   gint   scaled_viewport_offset_y;
@@ -136,9 +136,9 @@
   tx = ((gint64) x * shell->x_src_dec) / shell->x_dest_inc;
   ty = ((gint64) y * shell->y_src_dec) / shell->y_dest_inc;
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
   tx += scaled_viewport_offset_x;
   ty += scaled_viewport_offset_y;
 
@@ -165,13 +165,13 @@
  * in the image.
  **/
 void
-gimp_display_shell_untransform_xy (GimpDisplayShell *shell,
-                                   gint              x,
-                                   gint              y,
-                                   gint             *nx,
-                                   gint             *ny,
-                                   gboolean          round,
-                                   gboolean          use_offsets)
+gimp_display_shell_untransform_xy (const GimpDisplayShell *shell,
+                                   gint                    x,
+                                   gint                    y,
+                                   gint                   *nx,
+                                   gint                   *ny,
+                                   gboolean                round,
+                                   gboolean                use_offsets)
 {
   gint   scaled_viewport_offset_x;
   gint   scaled_viewport_offset_y;
@@ -192,9 +192,9 @@
       gimp_item_offsets (item, &offset_x, &offset_y);
     }
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
   tx = (gint64) x - scaled_viewport_offset_x;
   ty = (gint64) y - scaled_viewport_offset_y;
 
@@ -225,12 +225,12 @@
  * except that it returns its results as doubles rather than ints.
  **/
 void
-gimp_display_shell_transform_xy_f  (GimpDisplayShell *shell,
-                                    gdouble           x,
-                                    gdouble           y,
-                                    gdouble          *nx,
-                                    gdouble          *ny,
-                                    gboolean          use_offsets)
+gimp_display_shell_transform_xy_f  (const GimpDisplayShell *shell,
+                                    gdouble                 x,
+                                    gdouble                 y,
+                                    gdouble                *nx,
+                                    gdouble                *ny,
+                                    gboolean                use_offsets)
 {
   gint scaled_viewport_offset_x;
   gint scaled_viewport_offset_y;
@@ -249,9 +249,9 @@
       gimp_item_offsets (item, &offset_x, &offset_y);
     }
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
 
   *nx = SCALEX (shell, x + offset_x) + scaled_viewport_offset_x;
   *ny = SCALEY (shell, y + offset_y) + scaled_viewport_offset_y;
@@ -272,12 +272,12 @@
  * ints, and consequently there is no option related to rounding.
  **/
 void
-gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell,
-                                     gdouble           x,
-                                     gdouble           y,
-                                     gdouble          *nx,
-                                     gdouble          *ny,
-                                     gboolean          use_offsets)
+gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
+                                     gdouble                 x,
+                                     gdouble                 y,
+                                     gdouble                *nx,
+                                     gdouble                *ny,
+                                     gboolean                use_offsets)
 {
   gint scaled_viewport_offset_x;
   gint scaled_viewport_offset_y;
@@ -296,9 +296,9 @@
       gimp_item_offsets (item, &offset_x, &offset_y);
     }
 
-  gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                 &scaled_viewport_offset_x,
-                                                 &scaled_viewport_offset_y);
+  gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                        &scaled_viewport_offset_x,
+                                                        &scaled_viewport_offset_y);
 
   *nx = (x - scaled_viewport_offset_x) / shell->scale_x - offset_x;
   *ny = (y - scaled_viewport_offset_y) / shell->scale_y - offset_y;
@@ -317,11 +317,11 @@
  * objects can be rendered at the correct points on the display.
  **/
 void
-gimp_display_shell_transform_points (GimpDisplayShell  *shell,
-                                     const GimpVector2 *points,
-                                     GdkPoint          *coords,
-                                     gint               n_points,
-                                     gboolean           use_offsets)
+gimp_display_shell_transform_points (const GimpDisplayShell *shell,
+                                     const GimpVector2      *points,
+                                     GdkPoint               *coords,
+                                     gint                    n_points,
+                                     gboolean                use_offsets)
 {
   gint offset_x = 0;
   gint offset_y = 0;
@@ -347,9 +347,9 @@
       x = x * shell->x_src_dec / shell->x_dest_inc;
       y = y * shell->y_src_dec / shell->y_dest_inc;
 
-      gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                     &scaled_viewport_offset_x,
-                                                     &scaled_viewport_offset_y);
+      gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                            &scaled_viewport_offset_x,
+                                                            &scaled_viewport_offset_y);
 
       coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
                            G_MININT, G_MAXINT);
@@ -371,11 +371,11 @@
  * objects can be rendered at the correct points on the display.
  **/
 void
-gimp_display_shell_transform_coords (GimpDisplayShell *shell,
-                                     const GimpCoords *image_coords,
-                                     GdkPoint         *disp_coords,
-                                     gint              n_coords,
-                                     gboolean          use_offsets)
+gimp_display_shell_transform_coords (const GimpDisplayShell *shell,
+                                     const GimpCoords       *image_coords,
+                                     GdkPoint               *disp_coords,
+                                     gint                    n_coords,
+                                     gboolean                use_offsets)
 {
   gint offset_x = 0;
   gint offset_y = 0;
@@ -401,9 +401,9 @@
       x = x * shell->x_src_dec / shell->x_dest_inc;
       y = y * shell->y_src_dec / shell->y_dest_inc;
 
-      gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                     &scaled_viewport_offset_x,
-                                                     &scaled_viewport_offset_y);
+      gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                            &scaled_viewport_offset_x,
+                                                            &scaled_viewport_offset_y);
 
       disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
                                 G_MININT, G_MAXINT);
@@ -425,11 +425,11 @@
  * objects can be rendered at the correct points on the display.
  **/
 void
-gimp_display_shell_transform_segments (GimpDisplayShell *shell,
-                                       const BoundSeg   *src_segs,
-                                       GdkSegment       *dest_segs,
-                                       gint              n_segs,
-                                       gboolean          use_offsets)
+gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
+                                       const BoundSeg         *src_segs,
+                                       GdkSegment             *dest_segs,
+                                       gint                    n_segs,
+                                       gboolean                use_offsets)
 {
   gint offset_x = 0;
   gint offset_y = 0;
@@ -462,9 +462,9 @@
       y1 = (y1 * shell->y_src_dec) / shell->y_dest_inc;
       y2 = (y2 * shell->y_src_dec) / shell->y_dest_inc;
 
-      gimp_display_shell_get_scaled_viewport_offset (shell,
-                                                     &scaled_viewport_offset_x,
-                                                     &scaled_viewport_offset_y);
+      gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
+                                                            &scaled_viewport_offset_x,
+                                                            &scaled_viewport_offset_y);
 
       dest_segs[i].x1 = CLAMP (x1 + scaled_viewport_offset_x,
                                G_MININT, G_MAXINT);
@@ -489,11 +489,11 @@
  * that corresponds to the display viewport.
  **/
 void
-gimp_display_shell_untransform_viewport (GimpDisplayShell *shell,
-                                         gint             *x,
-                                         gint             *y,
-                                         gint             *width,
-                                         gint             *height)
+gimp_display_shell_untransform_viewport (const GimpDisplayShell *shell,
+                                         gint                   *x,
+                                         gint                   *y,
+                                         gint                   *width,
+                                         gint                   *height)
 {
   gint x1, y1, x2, y2;
 

Modified: branches/soc-2008-text/app/display/gimpdisplayshell-transform.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-transform.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-transform.h	Fri Aug 29 18:50:27 2008
@@ -20,61 +20,61 @@
 #define __GIMP_DISPLAY_SHELL_TRANSFORM_H__
 
 
-void  gimp_display_shell_transform_coordinate   (GimpDisplayShell *shell,
-                                                 GimpCoords       *image_coords,
-                                                 GimpCoords       *display_coords);
-void  gimp_display_shell_untransform_coordinate (GimpDisplayShell *shell,
-                                                 GimpCoords       *display_coords,
-                                                 GimpCoords       *image_coords);
-
-void  gimp_display_shell_transform_xy         (GimpDisplayShell  *shell,
-                                               gdouble            x,
-                                               gdouble            y,
-                                               gint              *nx,
-                                               gint              *ny,
-                                               gboolean           use_offsets);
-void  gimp_display_shell_untransform_xy       (GimpDisplayShell  *shell,
-                                               gint               x,
-                                               gint               y,
-                                               gint              *nx,
-                                               gint              *ny,
-                                               gboolean           round,
-                                               gboolean           use_offsets);
-
-void  gimp_display_shell_transform_xy_f       (GimpDisplayShell  *shell,
-                                               gdouble            x,
-                                               gdouble            y,
-                                               gdouble           *nx,
-                                               gdouble           *ny,
-                                               gboolean           use_offsets);
-void  gimp_display_shell_untransform_xy_f     (GimpDisplayShell  *shell,
-                                               gdouble            x,
-                                               gdouble            y,
-                                               gdouble           *nx,
-                                               gdouble           *ny,
-                                               gboolean           use_offsets);
-
-void  gimp_display_shell_transform_points     (GimpDisplayShell  *shell,
-                                               const GimpVector2 *points,
-                                               GdkPoint          *coords,
-                                               gint               n_points,
-                                               gboolean           use_offsets);
-void  gimp_display_shell_transform_coords     (GimpDisplayShell  *shell,
-                                               const GimpCoords  *image_coords,
-                                               GdkPoint          *disp_coords,
-                                               gint               n_coords,
-                                               gboolean           use_offsets);
-void  gimp_display_shell_transform_segments   (GimpDisplayShell  *shell,
-                                               const BoundSeg    *src_segs,
-                                               GdkSegment        *dest_segs,
-                                               gint               n_segs,
-                                               gboolean           use_offsets);
-
-void  gimp_display_shell_untransform_viewport (GimpDisplayShell  *shell,
-                                               gint              *x,
-                                               gint              *y,
-                                               gint              *width,
-                                               gint              *height);
+void  gimp_display_shell_transform_coordinate   (const GimpDisplayShell *shell,
+                                                 GimpCoords             *image_coords,
+                                                 GimpCoords             *display_coords);
+void  gimp_display_shell_untransform_coordinate (const GimpDisplayShell *shell,
+                                                 GimpCoords             *display_coords,
+                                                 GimpCoords             *image_coords);
+
+void  gimp_display_shell_transform_xy           (const GimpDisplayShell *shell,
+                                                 gdouble                 x,
+                                                 gdouble                 y,
+                                                 gint                   *nx,
+                                                 gint                   *ny,
+                                                 gboolean                use_offsets);
+void  gimp_display_shell_untransform_xy         (const GimpDisplayShell *shell,
+                                                 gint                    x,
+                                                 gint                    y,
+                                                 gint                   *nx,
+                                                 gint                   *ny,
+                                                 gboolean                round,
+                                                 gboolean                use_offsets);
+
+void  gimp_display_shell_transform_xy_f         (const GimpDisplayShell *shell,
+                                                 gdouble                 x,
+                                                 gdouble                 y,
+                                                 gdouble                *nx,
+                                                 gdouble                *ny,
+                                                 gboolean                use_offsets);
+void  gimp_display_shell_untransform_xy_f       (const GimpDisplayShell *shell,
+                                                 gdouble                 x,
+                                                 gdouble                 y,
+                                                 gdouble                *nx,
+                                                 gdouble                *ny,
+                                                 gboolean                use_offsets);
+
+void  gimp_display_shell_transform_points       (const GimpDisplayShell *shell,
+                                                 const GimpVector2      *points,
+                                                 GdkPoint               *coords,
+                                                 gint                    n_points,
+                                                 gboolean                use_offsets);
+void  gimp_display_shell_transform_coords       (const GimpDisplayShell *shell,
+                                                 const GimpCoords       *image_coords,
+                                                 GdkPoint               *disp_coords,
+                                                 gint                    n_coords,
+                                                 gboolean                use_offsets);
+void  gimp_display_shell_transform_segments     (const GimpDisplayShell *shell,
+                                                 const BoundSeg         *src_segs,
+                                                 GdkSegment             *dest_segs,
+                                                 gint                    n_segs,
+                                                 gboolean                use_offsets);
+
+void  gimp_display_shell_untransform_viewport   (const GimpDisplayShell *shell,
+                                                 gint                   *x,
+                                                 gint                   *y,
+                                                 gint                   *width,
+                                                 gint                   *height);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_TRANSFORM_H__ */

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	Fri Aug 29 18:50:27 2008
@@ -67,6 +67,7 @@
 #include "gimpdisplayshell-cursor.h"
 #include "gimpdisplayshell-dnd.h"
 #include "gimpdisplayshell-draw.h"
+#include "gimpdisplayshell-draw.h"
 #include "gimpdisplayshell-filter.h"
 #include "gimpdisplayshell-handlers.h"
 #include "gimpdisplayshell-progress.h"
@@ -116,6 +117,8 @@
                                                     GdkScreen        *previous);
 static gboolean  gimp_display_shell_delete_event   (GtkWidget        *widget,
                                                     GdkEventAny      *aevent);
+static gboolean  gimp_display_shell_configure_event(GtkWidget        *widget,
+                                                    GdkEventConfigure*cevent);
 static gboolean
              gimp_display_shell_window_state_event (GtkWidget        *widget,
                                                     GdkEventWindowState *event);
@@ -210,6 +213,7 @@
   widget_class->unrealize          = gimp_display_shell_unrealize;
   widget_class->screen_changed     = gimp_display_shell_screen_changed;
   widget_class->delete_event       = gimp_display_shell_delete_event;
+  widget_class->configure_event    = gimp_display_shell_configure_event;
   widget_class->window_state_event = gimp_display_shell_window_state_event;
   widget_class->popup_menu         = gimp_display_shell_popup_menu;
   widget_class->style_set          = gimp_display_shell_style_set;
@@ -325,6 +329,8 @@
   shell->zoom_on_resize         = FALSE;
   shell->show_transform_preview = FALSE;
 
+  shell->size_allocate_from_configure_event = FALSE;
+
   shell->options                = g_object_new (GIMP_TYPE_DISPLAY_OPTIONS, NULL);
   shell->fullscreen_options     = g_object_new (GIMP_TYPE_DISPLAY_OPTIONS_FULLSCREEN, NULL);
   shell->no_image_options       = g_object_new (GIMP_TYPE_DISPLAY_OPTIONS_NO_IMAGE, NULL);
@@ -575,6 +581,36 @@
 }
 
 static gboolean
+gimp_display_shell_configure_event (GtkWidget         *widget,
+                                    GdkEventConfigure *cevent)
+{
+  GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
+  gint              current_width;
+  gint              current_height;
+
+  /* Grab the size before we run the parent implementation */
+  current_width  = widget->allocation.width;
+  current_height = widget->allocation.height;
+
+  /* Run the parent implementation */
+  if (GTK_WIDGET_CLASS (parent_class)->configure_event)
+    GTK_WIDGET_CLASS (parent_class)->configure_event (widget, cevent);
+
+  /* If the window size has changed, make sure additoinal logic is run
+   * on size-allocate
+   */
+  if (shell->display        &&
+      shell->display->image &&
+      (cevent->width  != current_width ||
+       cevent->height != current_height))
+    {
+      shell->size_allocate_from_configure_event = TRUE;
+    }
+
+  return TRUE;
+}
+
+static gboolean
 gimp_display_shell_window_state_event (GtkWidget           *widget,
                                        GdkEventWindowState *event)
 {
@@ -717,6 +753,21 @@
   return NULL;
 }
 
+static void
+gimp_display_shell_zoom_button_callback (GimpDisplayShell *shell,
+                                         GtkWidget        *zoom_button)
+{
+  shell->zoom_on_resize =
+    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (zoom_button));
+
+  if (shell->zoom_on_resize &&
+      gimp_display_shell_scale_image_is_within_viewport (shell, NULL, NULL))
+    {
+      /* Implicitly make a View -> Fit Image in Window */
+      gimp_display_shell_scale_fit_in (shell);
+    }
+}
+
 
 /*  public functions  */
 
@@ -969,6 +1020,7 @@
                            GIMP_HELP_IMAGE_WINDOW_ORIGIN);
 
   shell->canvas = gimp_canvas_new (display->config);
+  gtk_widget_set_size_request (shell->canvas, shell_width, shell_height);
 
   gimp_display_shell_dnd_init (shell);
   gimp_display_shell_selection_init (shell);
@@ -1007,12 +1059,6 @@
   gtk_widget_set_extension_events (shell->hrule, GDK_EXTENSION_EVENTS_ALL);
   gtk_widget_set_extension_events (shell->vrule, GDK_EXTENSION_EVENTS_ALL);
 
-  /*  the canvas  */
-  gtk_widget_set_size_request (shell->canvas, shell_width, shell_height);
-  gtk_widget_set_events (shell->canvas, GIMP_DISPLAY_SHELL_CANVAS_EVENT_MASK);
-  gtk_widget_set_extension_events (shell->canvas, GDK_EXTENSION_EVENTS_ALL);
-  GTK_WIDGET_SET_FLAGS (shell->canvas, GTK_CAN_FOCUS);
-
   g_signal_connect (shell->canvas, "realize",
                     G_CALLBACK (gimp_display_shell_canvas_realize),
                     shell);
@@ -1078,9 +1124,9 @@
                            _("Zoom image when window size changes"),
                            GIMP_HELP_IMAGE_WINDOW_ZOOM_FOLLOW_BUTTON);
 
-  g_signal_connect (shell->zoom_button, "toggled",
-                    G_CALLBACK (gimp_toggle_button_update),
-                    &shell->zoom_on_resize);
+  g_signal_connect_swapped (shell->zoom_button, "toggled",
+                            G_CALLBACK (gimp_display_shell_zoom_button_callback),
+                            shell);
 
   /*  create the contents of the lower_hbox  *********************************/
 
@@ -1205,8 +1251,13 @@
     {
       gimp_display_shell_connect (shell);
 
-      /* after connecting to the image we want to center it */
-      gimp_display_shell_center_image_on_next_size_allocate (shell);
+      /* After connecting to the image we want to center it. Since we
+       * not even finnished creating the display shell, we can safely
+       * assume we will get a size-allocate later.
+       */
+      gimp_display_shell_scroll_center_image_on_next_size_allocate (shell,
+                                                                    TRUE,
+                                                                    TRUE);
     }
   else
     {
@@ -1246,7 +1297,8 @@
 
   gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
 
-  gimp_display_shell_scale_setup (shell);
+  gimp_display_shell_scroll_clamp_and_update (shell);
+
   gimp_display_shell_scaled (shell);
 
   gimp_display_shell_expose_full (shell);
@@ -1297,11 +1349,6 @@
 
   gimp_display_shell_selection_control (shell, GIMP_SELECTION_OFF);
 
-  gimp_display_shell_scale (shell, GIMP_ZOOM_TO, 1.0);
-  gimp_display_shell_scroll_clamp_offsets (shell);
-  gimp_display_shell_scale_setup (shell);
-  gimp_display_shell_scaled (shell);
-
   gimp_display_shell_unset_cursor (shell);
 
   gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
@@ -1325,35 +1372,6 @@
     gimp_ui_manager_update (shell->popup_manager, shell->display);
 }
 
-static void
-gimp_display_shell_center_image_callback (GimpDisplayShell *shell,
-                                          GtkAllocation    *allocation,
-                                          GtkWidget        *canvas)
-{
-  gint     sw, sh;
-  gboolean center_horizontally;
-  gboolean center_vertically;
-
-  gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
-
-  /* We only want to center on the axes on which the image is smaller
-   * than the display canvas. If it is larger, it will be centered on
-   * that axis later, and if we center on all axis unconditionally, we
-   * end up with the wrong centering if the image is larger than the
-   * display canvas.
-   */
-  center_horizontally = sw < shell->disp_width;
-  center_vertically   = sh < shell->disp_height;
-
-  gimp_display_shell_center_image (shell,
-                                   center_horizontally,
-                                   center_vertically);
-
-  g_signal_handlers_disconnect_by_func (canvas,
-                                        gimp_display_shell_center_image_callback,
-                                        shell);
-}
-
 static gboolean
 gimp_display_shell_fill_idle (GimpDisplayShell *shell)
 {
@@ -1389,14 +1407,12 @@
 
   gimp_help_set_help_data (shell->canvas, NULL, NULL);
 
-  /* Not pretty, but we need to center the image as soon as the canvas
-   * has got its new size allocated. The centering will be wrong if we
-   * do it too early, and if we do it too late flickering will occur
-   * due to the image being rendered twice.
+  /* A size-allocate will always occur because the scrollbars will
+   * become visible forcing the canvas to become smaller
    */
-  g_signal_connect_swapped (shell->canvas, "size-allocate",
-                            G_CALLBACK (gimp_display_shell_center_image_callback),
-                            shell);
+  gimp_display_shell_scroll_center_image_on_next_size_allocate (shell,
+                                                                TRUE,
+                                                                TRUE);
 
   shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW,
                                          (GSourceFunc) gimp_display_shell_fill_idle,
@@ -1420,16 +1436,10 @@
 
   if (image)
     {
-      gdouble xres;
-      gdouble yres;
-
-      gimp_image_get_resolution (image, &xres, &yres);
-
-      shell->scale_x = (gimp_zoom_model_get_factor (shell->zoom) *
-                        SCREEN_XRES (shell) / xres);
-
-      shell->scale_y = (gimp_zoom_model_get_factor (shell->zoom) *
-                        SCREEN_YRES (shell) / yres);
+      gimp_display_shell_calculate_scale_x_and_y (shell,
+                                                  gimp_zoom_model_get_factor (shell->zoom),
+                                                  &shell->scale_x,
+                                                  &shell->scale_y);
 
       shell->x_dest_inc = gimp_image_get_width  (image);
       shell->y_dest_inc = gimp_image_get_height (image);
@@ -1474,7 +1484,8 @@
     {
       shell->unit = unit;
 
-      gimp_display_shell_scale_setup (shell);
+      gimp_display_shell_scale_update_rulers (shell);
+
       gimp_display_shell_scaled (shell);
 
       g_object_notify (G_OBJECT (shell), "unit");
@@ -1884,6 +1895,12 @@
 
       gtk_window_resize (GTK_WINDOW (shell), width, height);
     }
+
+  /* A wrap always means that we should center the image too. If the
+   * window changes size another center will be done in
+   * GimpDisplayShell::configure_event().
+   */
+  gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
 }
 
 /**

Modified: branches/soc-2008-text/app/display/gimpdisplayshell.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell.h	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell.h	Fri Aug 29 18:50:27 2008
@@ -168,6 +168,8 @@
   gboolean           zoom_on_resize;
   gboolean           show_transform_preview;
 
+  gboolean           size_allocate_from_configure_event;
+
   GimpDisplayOptions *options;
   GimpDisplayOptions *fullscreen_options;
   GimpDisplayOptions *no_image_options;

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	Fri Aug 29 18:50:27 2008
@@ -53,47 +53,44 @@
 #include "gimp-intl.h"
 
 
-#define BORDER_PEN_WIDTH  3
+static void        gimp_navigation_editor_docked_iface_init (GimpDockedInterface  *iface);
 
+static void        gimp_navigation_editor_destroy           (GtkObject            *object);
 
-static void   gimp_navigation_editor_docked_iface_init (GimpDockedInterface  *iface);
+static void        gimp_navigation_editor_set_context       (GimpDocked           *docked,
+                                                             GimpContext          *context);
 
-static void   gimp_navigation_editor_destroy           (GtkObject            *object);
-
-static void   gimp_navigation_editor_set_context       (GimpDocked           *docked,
-                                                        GimpContext          *context);
-
-static GtkWidget * gimp_navigation_editor_new_private  (GimpMenuFactory      *menu_factory,
-                                                        GimpDisplayShell     *shell);
-
-static void     gimp_navigation_editor_set_shell       (GimpNavigationEditor *view,
-                                                        GimpDisplayShell     *shell);
-static gboolean gimp_navigation_editor_button_release  (GtkWidget            *widget,
-                                                        GdkEventButton       *bevent,
-                                                        GimpDisplayShell     *shell);
-static void   gimp_navigation_editor_marker_changed    (GimpNavigationView   *view,
-                                                        gdouble               x,
-                                                        gdouble               y,
-                                                        gdouble               width,
-                                                        gdouble               height,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_zoom              (GimpNavigationView   *view,
-                                                        GimpZoomType          direction,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_scroll            (GimpNavigationView   *view,
-                                                        GdkScrollDirection    direction,
-                                                        GimpNavigationEditor  *editor);
-
-static void   gimp_navigation_editor_zoom_adj_changed  (GtkAdjustment        *adj,
-                                                        GimpNavigationEditor *editor);
-
-static void   gimp_navigation_editor_shell_scaled      (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_shell_scrolled    (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_shell_reconnect   (GimpDisplayShell     *shell,
-                                                        GimpNavigationEditor *editor);
-static void   gimp_navigation_editor_update_marker     (GimpNavigationEditor *editor);
+static GtkWidget * gimp_navigation_editor_new_private       (GimpMenuFactory      *menu_factory,
+                                                             GimpDisplayShell     *shell);
+
+static void        gimp_navigation_editor_set_shell         (GimpNavigationEditor *editor,
+                                                             GimpDisplayShell     *shell);
+static gboolean    gimp_navigation_editor_button_release    (GtkWidget            *widget,
+                                                             GdkEventButton       *bevent,
+                                                             GimpDisplayShell     *shell);
+static void        gimp_navigation_editor_marker_changed    (GimpNavigationView   *view,
+                                                             gdouble               x,
+                                                             gdouble               y,
+                                                             gdouble               width,
+                                                             gdouble               height,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_zoom              (GimpNavigationView   *view,
+                                                             GimpZoomType          direction,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_scroll            (GimpNavigationView   *view,
+                                                             GdkScrollDirection    direction,
+                                                             GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_zoom_adj_changed  (GtkAdjustment        *adj,
+                                                             GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_shell_scaled      (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_scrolled    (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_reconnect   (GimpDisplayShell     *shell,
+                                                             GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_update_marker     (GimpNavigationEditor *editor);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpNavigationEditor, gimp_navigation_editor,
@@ -230,11 +227,8 @@
   GimpNavigationView   *view;
   GdkScreen            *screen;
   gint                  x, y;
-  gint                  x_org, y_org;
-  gint                  view_marker_x;
-  gint                  view_marker_y;
-  gint                  view_marker_width;
-  gint                  view_marker_height;
+  gint                  view_marker_x, view_marker_y;
+  gint                  view_marker_width, view_marker_height;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (GTK_IS_WIDGET (widget));
@@ -267,57 +261,72 @@
       editor = GIMP_NAVIGATION_EDITOR (gtk_bin_get_child (GTK_BIN (bin)));
     }
 
-  screen = gtk_widget_get_screen (widget);
-
-  gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
-
   view = GIMP_NAVIGATION_VIEW (editor->view);
 
-  /* decide where to put the popup */
-  gdk_window_get_origin (widget->window, &x_org, &y_org);
+  /* Set poup screen */
+  screen = gtk_widget_get_screen (widget);
+  gtk_window_set_screen (GTK_WINDOW (shell->nav_popup), screen);
 
   gimp_navigation_view_get_local_marker (view,
                                          &view_marker_x,
                                          &view_marker_y,
                                          &view_marker_width,
                                          &view_marker_height);
+  /* Position the popup */
+  {
+    gint x_origin, y_origin;
+    gint popup_width, popup_height;
+    gint border_width, border_height;
+    gint screen_click_x, screen_click_y;
+    
+    gdk_window_get_origin (widget->window, &x_origin, &y_origin);
+
+    screen_click_x = x_origin + click_x;
+    screen_click_y = y_origin + click_y;
+    border_width   = style->xthickness * 4;
+    border_height  = style->ythickness * 4;
+    popup_width    = GIMP_VIEW (view)->renderer->width  - border_width;
+    popup_height   = GIMP_VIEW (view)->renderer->height - border_height;
+
+    x = screen_click_x -
+        border_width -
+        view_marker_x -
+        view_marker_width / 2;
+
+    y = screen_click_y -
+        border_height -
+        view_marker_y -
+        view_marker_height / 2;
+
+    /* When the image is zoomed out and overscrolled, the above
+     * calculation risks positioning the popup far far away from the
+     * click coordinate. We don't want that, so perform some clamping.
+     */
+    x = CLAMP (x, screen_click_x - popup_width,  screen_click_x);
+    y = CLAMP (y, screen_click_y - popup_height, screen_click_y);
+
+    /* If the popup doesn't fit into the screen, we have a problem.
+     * We move the popup onscreen and risk that the pointer is not
+     * in the square representing the viewable area anymore. Moving
+     * the pointer will make the image scroll by a large amount,
+     * but then it works as usual. Probably better than a popup that
+     * is completely unusable in the lower right of the screen.
+     *
+     * Warping the pointer would be another solution ...
+     */
+    x = CLAMP (x, 0, gdk_screen_get_width (screen)  - popup_width);
+    y = CLAMP (y, 0, gdk_screen_get_height (screen) - popup_height);
 
-  x = (x_org + click_x -
-       view_marker_x -
-       0.5 * (view_marker_width  - BORDER_PEN_WIDTH) -
-       2   * style->xthickness);
-
-  y = (y_org + click_y -
-       view_marker_y -
-       0.5 * (view_marker_height - BORDER_PEN_WIDTH) -
-       2   * style->ythickness);
-
-  /* If the popup doesn't fit into the screen, we have a problem.
-   * We move the popup onscreen and risk that the pointer is not
-   * in the square representing the viewable area anymore. Moving
-   * the pointer will make the image scroll by a large amount,
-   * but then it works as usual. Probably better than a popup that
-   * is completely unusable in the lower right of the screen.
-   *
-   * Warping the pointer would be another solution ...
-   */
-
-  x = CLAMP (x, 0, (gdk_screen_get_width (screen)  -
-                    GIMP_VIEW (view)->renderer->width  -
-                    4 * style->xthickness));
-  y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
-                    GIMP_VIEW (view)->renderer->height -
-                    4 * style->ythickness));
+    gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
+  }
 
-  gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
   gtk_widget_show (shell->nav_popup);
-
   gdk_flush ();
 
   /* fill in then grab pointer */
   gimp_navigation_view_set_motion_offset (view,
-                                          0.5 * (view_marker_width  - BORDER_PEN_WIDTH),
-                                          0.5 * (view_marker_height - BORDER_PEN_WIDTH));
+                                          view_marker_width  / 2,
+                                          view_marker_height / 2);
   gimp_navigation_view_grab_pointer (view);
 }
 
@@ -510,7 +519,7 @@
     {
       GimpDisplayShell *shell = editor->shell;
 
-      gimp_display_shell_center_around_image_coordinate (shell,
+      gimp_display_shell_scroll_center_image_coordinate (shell,
                                                          x + width / 2,
                                                          y + height / 2);
     }
@@ -660,7 +669,7 @@
       gdouble             x, y;
       gdouble             w, h;
 
-      gimp_display_shell_get_viewport (shell, &x, &y, &w, &h);
+      gimp_display_shell_scroll_get_viewport (shell, &x, &y, &w, &h);
 
       gimp_navigation_view_set_marker (view, x, y, w, h);
     }

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	Fri Aug 29 18:50:27 2008
@@ -164,8 +164,9 @@
   statusbar->temp_context_id =
     gimp_statusbar_get_context_id (statusbar, "gimp-statusbar-temp");
 
-  statusbar->cursor_format_str[0] = '\0';
-  statusbar->length_format_str[0] = '\0';
+  statusbar->cursor_format_str[0]   = '\0';
+  statusbar->cursor_format_str_f[0] = '\0';
+  statusbar->length_format_str[0]   = '\0';
 
   statusbar->progress_active      = FALSE;
   statusbar->progress_shown       = FALSE;
@@ -496,8 +497,8 @@
   const gchar   *stock_id;
   gboolean       handle_msg = FALSE;
 
-  /*  don't accept a message if we are already displaying one  */
-  if (statusbar->temp_timeout_id)
+  /*  don't accept a message if we are already displaying a more severe one  */
+  if (statusbar->temp_timeout_id && statusbar->temp_severity > severity)
     return FALSE;
 
   /*  we can only handle short one-liners  */
@@ -536,7 +537,7 @@
   g_object_unref (layout);
 
   if (handle_msg)
-    gimp_statusbar_push_temp (statusbar, stock_id, "%s", message);
+    gimp_statusbar_push_temp (statusbar, severity, stock_id, "%s", message);
 
   return handle_msg;
 }
@@ -792,14 +793,15 @@
 }
 
 void
-gimp_statusbar_push_coords (GimpStatusbar *statusbar,
-                            const gchar   *context,
-                            const gchar   *stock_id,
-                            const gchar   *title,
-                            gdouble        x,
-                            const gchar   *separator,
-                            gdouble        y,
-                            const gchar   *help)
+gimp_statusbar_push_coords (GimpStatusbar       *statusbar,
+                            const gchar         *context,
+                            const gchar         *stock_id,
+                            GimpCursorPrecision  precision,
+                            const gchar         *title,
+                            gdouble              x,
+                            const gchar         *separator,
+                            gdouble              y,
+                            const gchar         *help)
 {
   GimpDisplayShell *shell;
 
@@ -812,16 +814,46 @@
 
   shell = statusbar->shell;
 
+  switch (precision)
+    {
+    case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
+      x = RINT (x + 0.5);
+      y = RINT (y + 0.5);
+      break;
+
+    case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
+      x = RINT (x);
+      y = RINT (y);
+      break;
+
+    case GIMP_CURSOR_PRECISION_SUBPIXEL:
+      break;
+    }
+
   if (shell->unit == GIMP_UNIT_PIXEL)
     {
-      gimp_statusbar_push (statusbar, context,
-                           stock_id,
-                           statusbar->cursor_format_str,
-                           title,
-                           (gint) RINT (x),
-                           separator,
-                           (gint) RINT (y),
-                           help);
+      if (precision == GIMP_CURSOR_PRECISION_SUBPIXEL)
+        {
+          gimp_statusbar_push (statusbar, context,
+                               stock_id,
+                               statusbar->cursor_format_str_f,
+                               title,
+                               x,
+                               separator,
+                               y,
+                               help);
+        }
+      else
+        {
+          gimp_statusbar_push (statusbar, context,
+                               stock_id,
+                               statusbar->cursor_format_str,
+                               title,
+                               (gint) RINT (x),
+                               separator,
+                               (gint) RINT (y),
+                               help);
+        }
     }
   else /* show real world units */
     {
@@ -1030,33 +1062,37 @@
 }
 
 void
-gimp_statusbar_push_temp (GimpStatusbar *statusbar,
-                          const gchar   *stock_id,
-                          const gchar   *format,
+gimp_statusbar_push_temp (GimpStatusbar       *statusbar,
+                          GimpMessageSeverity  severity,
+                          const gchar         *stock_id,
+                          const gchar         *format,
                           ...)
 {
   va_list args;
 
-  g_return_if_fail (GIMP_IS_STATUSBAR (statusbar));
-  g_return_if_fail (format != NULL);
-
   va_start (args, format);
-  gimp_statusbar_push_temp_valist (statusbar, stock_id, format, args);
+  gimp_statusbar_push_temp_valist (statusbar, severity, stock_id, format, args);
   va_end (args);
 }
 
 void
-gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
-                                 const gchar   *stock_id,
-                                 const gchar   *format,
-                                 va_list        args)
+gimp_statusbar_push_temp_valist (GimpStatusbar       *statusbar,
+                                 GimpMessageSeverity  severity,
+                                 const gchar         *stock_id,
+                                 const gchar         *format,
+                                 va_list              args)
 {
   GimpStatusbarMsg *msg = NULL;
   gchar            *message;
 
   g_return_if_fail (GIMP_IS_STATUSBAR (statusbar));
+  g_return_if_fail (severity <= GIMP_MESSAGE_WARNING);
   g_return_if_fail (format != NULL);
 
+  /*  don't accept a message if we are already displaying a more severe one  */
+  if (statusbar->temp_timeout_id && statusbar->temp_severity > severity)
+    return;
+
   message = gimp_statusbar_vprintf (format, args);
 
   if (statusbar->temp_timeout_id)
@@ -1066,6 +1102,8 @@
     g_timeout_add (MESSAGE_TIMEOUT,
                    (GSourceFunc) gimp_statusbar_temp_timeout, statusbar);
 
+  statusbar->temp_severity = severity;
+
   if (statusbar->messages)
     {
       msg = statusbar->messages->data;
@@ -1126,13 +1164,12 @@
 }
 
 void
-gimp_statusbar_update_cursor (GimpStatusbar *statusbar,
-                              gdouble        x,
-                              gdouble        y)
+gimp_statusbar_update_cursor (GimpStatusbar       *statusbar,
+                              GimpCursorPrecision  precision,
+                              gdouble              x,
+                              gdouble              y)
 {
   GimpDisplayShell *shell;
-  GtkTreeModel     *model;
-  GimpUnitStore    *store;
   gchar             buffer[CURSOR_LEN];
 
   g_return_if_fail (GIMP_IS_STATUSBAR (statusbar));
@@ -1152,19 +1189,46 @@
       gtk_widget_set_sensitive (statusbar->cursor_label, TRUE);
     }
 
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
-  store = GIMP_UNIT_STORE (model);
+  switch (precision)
+    {
+    case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
+      x = RINT (x + 0.5);
+      y = RINT (y + 0.5);
+      break;
+
+    case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
+      x = RINT (x);
+      y = RINT (y);
+      break;
 
-  gimp_unit_store_set_pixel_values (store, x, y);
+    case GIMP_CURSOR_PRECISION_SUBPIXEL:
+      break;
+    }
 
   if (shell->unit == GIMP_UNIT_PIXEL)
     {
-      g_snprintf (buffer, sizeof (buffer),
-                  statusbar->cursor_format_str,
-                  "", (gint) RINT (x), ", ", (gint) RINT (y), "");
+      if (precision == GIMP_CURSOR_PRECISION_SUBPIXEL)
+        {
+          g_snprintf (buffer, sizeof (buffer),
+                      statusbar->cursor_format_str_f,
+                      "", x, ", ", y, "");
+        }
+      else
+        {
+          g_snprintf (buffer, sizeof (buffer),
+                      statusbar->cursor_format_str,
+                      "", (gint) RINT (x), ", ", (gint) RINT (y), "");
+        }
     }
   else /* show real world units */
     {
+      GtkTreeModel  *model;
+      GimpUnitStore *store;
+
+      model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
+      store = GIMP_UNIT_STORE (model);
+
+      gimp_unit_store_set_pixel_values (store, x, y);
       gimp_unit_store_get_values (store, shell->unit, &x, &y);
 
       g_snprintf (buffer, sizeof (buffer),
@@ -1269,6 +1333,9 @@
       g_snprintf (statusbar->cursor_format_str,
                   sizeof (statusbar->cursor_format_str),
                   "%%s%%d%%s%%d%%s");
+      g_snprintf (statusbar->cursor_format_str_f,
+                  sizeof (statusbar->cursor_format_str_f),
+                  "%%s%%.1f%%s%%.1f%%s");
       g_snprintf (statusbar->length_format_str,
                   sizeof (statusbar->length_format_str),
                   "%%s%%d%%s");
@@ -1280,13 +1347,15 @@
                   "%%s%%.%df%%s%%.%df%%s",
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit),
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit));
+      strcpy (statusbar->cursor_format_str_f, statusbar->cursor_format_str);
       g_snprintf (statusbar->length_format_str,
                   sizeof (statusbar->length_format_str),
                   "%%s%%.%df%%s",
                   _gimp_unit_get_digits (shell->display->gimp, shell->unit));
     }
 
-  gimp_statusbar_update_cursor (statusbar, image_width, image_height);
+  gimp_statusbar_update_cursor (statusbar, GIMP_CURSOR_PRECISION_SUBPIXEL,
+                                image_width, image_height);
 
   text = gtk_label_get_text (GTK_LABEL (statusbar->cursor_label));
 

Modified: branches/soc-2008-text/app/display/gimpstatusbar.h
==============================================================================
--- branches/soc-2008-text/app/display/gimpstatusbar.h	(original)
+++ branches/soc-2008-text/app/display/gimpstatusbar.h	Fri Aug 29 18:50:27 2008
@@ -37,31 +37,33 @@
 
 struct _GimpStatusbar
 {
-  GtkStatusbar      parent_instance;
+  GtkStatusbar         parent_instance;
 
-  GimpDisplayShell *shell;
+  GimpDisplayShell    *shell;
 
-  GSList           *messages;
-  GHashTable       *context_ids;
-  guint             seq_context_id;
+  GSList              *messages;
+  GHashTable          *context_ids;
+  guint                seq_context_id;
 
-  GdkPixbuf        *icon;
+  GdkPixbuf           *icon;
 
-  guint             temp_context_id;
-  guint             temp_timeout_id;
+  guint                temp_context_id;
+  guint                temp_timeout_id;
+  GimpMessageSeverity  temp_severity;
 
-  gchar             cursor_format_str[CURSOR_FORMAT_LENGTH];
-  gchar             length_format_str[CURSOR_FORMAT_LENGTH];
+  gchar                cursor_format_str[CURSOR_FORMAT_LENGTH];
+  gchar                cursor_format_str_f[CURSOR_FORMAT_LENGTH];
+  gchar                length_format_str[CURSOR_FORMAT_LENGTH];
 
-  GtkWidget        *cursor_label;
-  GtkWidget        *unit_combo;
-  GtkWidget        *scale_combo;
+  GtkWidget           *cursor_label;
+  GtkWidget           *unit_combo;
+  GtkWidget           *scale_combo;
 
-  GtkWidget        *progressbar;
-  GtkWidget        *cancel_button;
-  gboolean          progress_active;
-  gboolean          progress_shown;
-  gdouble           progress_value;
+  GtkWidget           *progressbar;
+  GtkWidget           *cancel_button;
+  gboolean             progress_active;
+  gboolean             progress_shown;
+  gdouble              progress_value;
 };
 
 struct _GimpStatusbarClass
@@ -92,6 +94,7 @@
 void        gimp_statusbar_push_coords      (GimpStatusbar       *statusbar,
                                              const gchar         *context,
                                              const gchar         *stock_id,
+                                             GimpCursorPrecision  precision,
                                              const gchar         *title,
                                              gdouble              x,
                                              const gchar         *separator,
@@ -120,16 +123,19 @@
                                              const gchar         *context);
 
 void        gimp_statusbar_push_temp        (GimpStatusbar       *statusbar,
+                                             GimpMessageSeverity  severity,
                                              const gchar         *stock_id,
                                              const gchar         *format,
-                                             ...) G_GNUC_PRINTF(3,4);
+                                             ...) G_GNUC_PRINTF(4,5);
 void        gimp_statusbar_push_temp_valist (GimpStatusbar       *statusbar,
+                                             GimpMessageSeverity  severity,
                                              const gchar         *stock_id,
                                              const gchar         *format,
                                              va_list              args);
 void        gimp_statusbar_pop_temp         (GimpStatusbar       *statusbar);
 
 void        gimp_statusbar_update_cursor    (GimpStatusbar       *statusbar,
+                                             GimpCursorPrecision  precision,
                                              gdouble              x,
                                              gdouble              y);
 void        gimp_statusbar_clear_cursor     (GimpStatusbar       *statusbar);

Modified: branches/soc-2008-text/app/file/file-save.c
==============================================================================
--- branches/soc-2008-text/app/file/file-save.c	(original)
+++ branches/soc-2008-text/app/file/file-save.c	Fri Aug 29 18:50:27 2008
@@ -194,6 +194,8 @@
         }
     }
 
+  gimp_image_flush (image);
+
   g_object_unref (image);
 
  out:

Modified: branches/soc-2008-text/app/main.c
==============================================================================
--- branches/soc-2008-text/app/main.c	(original)
+++ branches/soc-2008-text/app/main.c	Fri Aug 29 18:50:27 2008
@@ -278,6 +278,16 @@
   gchar          *basename;
   gint            i;
 
+#if defined (__GNUC__) && defined (_WIN64)
+  /* mingw-w64, at least the unstable build from late July 2008,
+   * starts subsystem:windows programs in main(), but passes them
+   * bogus argc and argv. __argc and __argv are OK, though, so just
+   * use them.
+   */
+  argc = __argc;
+  argv = __argv;
+#endif
+
   g_thread_init (NULL);
 
 #ifdef GIMP_UNSTABLE
@@ -421,7 +431,11 @@
 
 #ifdef G_OS_WIN32
 
-/* In case we build this as a windowed application. Well, we do. */
+/* Provide WinMain in case we build GIMP as a subsystem:windows
+ * application. Well, we do. When built with mingw, though, user code
+ * execution still starts in main() in that case. So WinMain() gets
+ * used on MSVC builds only.
+ */
 
 #ifdef __GNUC__
 #  ifndef _stdcall

Modified: branches/soc-2008-text/app/paint-funcs/paint-funcs.c
==============================================================================
--- branches/soc-2008-text/app/paint-funcs/paint-funcs.c	(original)
+++ branches/soc-2008-text/app/paint-funcs/paint-funcs.c	Fri Aug 29 18:50:27 2008
@@ -1391,6 +1391,8 @@
  *  The operation is still bounded by mask/opacity constraints
  */
 
+#define INT_DIV(a, b) ((a)/(b) + (((a) % (b)) > ((b) / 2)))
+
 static inline void
 replace_inten_pixels (const guchar   *src1,
                       const guchar   *src2,
@@ -1402,54 +1404,62 @@
                       guint           bytes1,
                       guint           bytes2)
 {
-  const guint has_alpha1 = HAS_ALPHA (bytes1);
-  const guint has_alpha2 = HAS_ALPHA (bytes2);
-  const guint bytes      = MIN (bytes1, bytes2);
-  guint b;
-  gint  tmp;
+  const guint   has_alpha1 = HAS_ALPHA (bytes1);
+  const guint   has_alpha2 = HAS_ALPHA (bytes2);
+  const guint   alpha      = bytes1 - has_alpha1;
+  const guint   alpha2     = bytes2 - has_alpha2;
+  const guchar *m          = mask ? mask : &no_mask;
+  guint         b;
+  gint          tmp;
 
-  if (mask)
+  while (length --)
     {
-      const guchar *m = mask;
+      guchar src1_alpha  = has_alpha1 ? src1[alpha]  : 255;
+      guchar src2_alpha  = has_alpha2 ? src2[alpha2] : 255;
+      guchar new_alpha   = INT_BLEND (src2_alpha, src1_alpha,
+                                      INT_MULT (*m, opacity, tmp), tmp);
 
-      while (length --)
+      if (new_alpha)
         {
-          guchar mask_alpha = INT_MULT (*m, opacity, tmp);
+          guint ratio = *m * opacity;
+          ratio = ratio / 255 * src2_alpha;
 
-          for (b = 0; b < bytes; b++)
-            dest[b] = (affect[b] ?
-                       INT_BLEND (src2[b], src1[b], mask_alpha, tmp) :
-                       src1[b]);
+          ratio = INT_DIV (ratio, new_alpha);
 
-          if (has_alpha1 && !has_alpha2)
+          for (b = 0; b < alpha; b++)
+            {
+              if (! affect[b])
+                {
+                  dest[b] = src1[b];
+                }
+              else if (src2[b] > src1[b])
+                {
+                  guint t = (src2[b] - src1[b]) * ratio;
+                  dest[b] = src1[b] + INT_DIV (t, 255);
+                }
+              else
+                {
+                  guint t = (src1[b] - src2[b]) * ratio;
+                  dest[b] = src1[b] - INT_DIV (t, 255);
+                }
+            }
+        }
+      else
+        {
+          for (b = 0; b < alpha; b++)
             dest[b] = src1[b];
-
-          m++;
-
-          src1 += bytes1;
-          src2 += bytes2;
-          dest += bytes1;
         }
-    }
-  else
-    {
-      const guchar mask_alpha = opacity;
 
-      while (length --)
-        {
-          for (b = 0; b < bytes; b++)
-            dest[b] = (affect[b] ?
-                       INT_BLEND (src2[b], src1[b], mask_alpha, tmp) :
-                       src1[b]);
+      if (has_alpha1)
+        dest[alpha] = affect[alpha] ? new_alpha : src1[alpha];
 
-          if (has_alpha1 && !has_alpha2)
-            dest[b] = src1[b];
+      if (mask)
+        m++;
 
-          src1 += bytes1;
-          src2 += bytes2;
-          dest += bytes1;
-        }
-    }
+      src1 += bytes1;
+      src2 += bytes2;
+      dest += bytes1;
+   }
 }
 
 /*  replace the contents of one pixel row with the other

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	Fri Aug 29 18:50:27 2008
@@ -29,341 +29,286 @@
 #include "base/tile.h"
 #include "base/tile-manager.h"
 #include "base/pixel-region.h"
+#include "base/pixel-surround.h"
 
 #include "paint-funcs.h"
 #include "scale-region.h"
 
 
-static void           scale_region_buffer     (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data);
-static void           scale_region_tile       (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data);
-static void           scale                   (TileManager           *srcTM,
-                                               TileManager           *dstTM,
-                                               GimpInterpolationType  interpolation,
-                                               GimpProgressFunc       progress_callback,
-                                               gpointer               progress_data,
-                                               gint                  *progress,
-                                               gint                   max_progress);
-static void           scale_pr                (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               GimpInterpolationType  interpolation);
-static void           interpolate_bilinear    (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static void           interpolate_nearest     (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static void           interpolate_cubic       (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static void           decimate_gauss          (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static void           decimate_average        (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static gfloat *       create_lanczos3_lookup  (void);
-static void           interpolate_lanczos3    (TileManager           *srcTM,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gint                   x2,
-                                               gint                   y2,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static void           decimate_average_pr     (PixelRegion           *srcPR,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               guchar                *pixel);
-static void           interpolate_bilinear_pr (PixelRegion           *srcPR,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *p);
-static void           determine_scale         (PixelRegion           *srcPR,
-                                               PixelRegion           *dstPR,
-                                               gint                  *levelx,
-                                               gint                  *levely,
-                                               gint                  *max_progress);
-static inline void    gaussan_lanczos2        (guchar                *pixels,
-                                               gint                   bytes,
-                                               guchar                *pixel);
-static inline void    decimate_lanczos2       (TileManager           *srcTM,
-                                               gint                   x0,
-                                               gint                   y0,
-                                               gint                   x1,
-                                               gint                   y1,
-                                               gdouble                xfrac,
-                                               gdouble                yfrac,
-                                               guchar                *pixel,
-                                               gfloat                *kernel_lookup);
-static inline void    pixel_average           (guchar                *p1,
-                                               guchar                *p2,
-                                               guchar                *p3,
-                                               guchar                *p4,
-                                               guchar                *p,
-                                               gint                   bytes);
-static inline void    gaussan_decimate        (guchar                *pixels,
-                                               gint                   bytes,
-                                               guchar                *pixel);
-static inline gdouble cubic_spline_fit        (gdouble                dx,
-                                               gint                   pt0,
-                                               gint                   pt1,
-                                               gint                   pt2,
-                                               gint                   pt3);
-static inline gdouble weighted_sum            (gdouble                dx,
-                                               gdouble                dy,
-                                               gint                   s00,
-                                               gint                   s10,
-                                               gint                   s01,
-                                               gint                   s11);
-static inline gdouble sinc                    (gdouble                x);
-static inline gdouble lanczos3_mul_alpha       (guchar                *pixels,
-                                               gdouble               *x_kernel,
-                                               gdouble               *y_kernel,
-                                               gint                   bytes,
-                                               gint                   byte);
-static inline gdouble lanczos3_mul            (guchar                *pixels,
-                                               gdouble               *x_kernel,
-                                               gdouble               *y_kernel,
-                                               gint                   bytes,
-                                               gint                   byte);
+#define NUM_TILES(w,h) ((((w) + (TILE_WIDTH - 1)) / TILE_WIDTH) *  \
+                        (((h) + (TILE_HEIGHT - 1)) / TILE_HEIGHT))
 
 
+static void           scale_determine_levels   (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                gint                  *levelx,
+                                                gint                  *levely);
+static gint           scale_determine_progress (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                gint                   levelx,
+                                                gint                   levely);
+
+static void           scale_region_buffer      (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR);
+static void           scale_region_tile        (PixelRegion           *srcPR,
+                                                PixelRegion           *dstPR,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data);
+static void           scale                    (TileManager           *srcTM,
+                                                TileManager           *dstTM,
+                                                GimpInterpolationType  interpolation,
+                                                GimpProgressFunc       progress_callback,
+                                                gpointer               progress_data,
+                                                gint                  *progress,
+                                                gint                   max_progress);
+static void           interpolate_nearest      (TileManager   *srcTM,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                guchar        *pixel);
+static void           interpolate_bilinear     (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           interpolate_cubic        (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           decimate_gauss           (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static void           decimate_average         (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     bytes,
+                                                guchar        *pixel);
+static gfloat *       create_lanczos3_lookup   (void);
+static void           interpolate_lanczos3     (PixelSurround *surround,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                const gint     bytes,
+                                                guchar        *pixel,
+                                                const gfloat  *kernel_lookup);
+static void           interpolate_bilinear_pr  (PixelRegion   *srcPR,
+                                                const gint     x0,
+                                                const gint     y0,
+                                                const gint     x1,
+                                                const gint     y1,
+                                                const gdouble  xfrac,
+                                                const gdouble  yfrac,
+                                                guchar        *pixel);
+static inline 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,
+                                                const gdouble  x2,
+                                                const gdouble  y2);
+static inline gdouble weighted_sum             (const gdouble  dx,
+                                                const gdouble  dy,
+                                                const gint     s00,
+                                                const gint     s10,
+                                                const gint     s01,
+                                                const gint     s11);
+static inline gdouble sinc                     (const gdouble  x);
+static inline gdouble lanczos3_mul_alpha       (const guchar  *pixels,
+                                                const gdouble *x_kernel,
+                                                const gdouble *y_kernel,
+                                                const gint     stride,
+                                                const gint     bytes,
+                                                const gint     byte);
+static inline gdouble lanczos3_mul             (const guchar  *pixels,
+                                                const gdouble *x_kernel,
+                                                const gdouble *y_kernel,
+                                                const gint     stride,
+                                                const gint     bytes,
+                                                const gint     byte);
+
+
+
+void
+scale_region (PixelRegion           *srcPR,
+              PixelRegion           *dstPR,
+              GimpInterpolationType  interpolation,
+              GimpProgressFunc       progress_callback,
+              gpointer               progress_data)
+{
+  /* Copy and return if scale = 1.0 */
+  if (srcPR->h == dstPR->h && srcPR->w == dstPR->w)
+    {
+      copy_region (srcPR, dstPR);
+      return;
+    }
+
+  if (srcPR->tiles == NULL && srcPR->data != NULL)
+    {
+      g_return_if_fail (interpolation == GIMP_INTERPOLATION_LINEAR);
+      g_return_if_fail (progress_callback == NULL);
+
+      scale_region_buffer (srcPR, dstPR);
+      return;
+    }
+
+  if (srcPR->tiles != NULL && srcPR->data == NULL)
+    {
+      GTimer *timer = g_timer_new ();
+
+      scale_region_tile (srcPR, dstPR, interpolation,
+                         progress_callback, progress_data);
+
+      g_printerr ("scale: %g sec\n", g_timer_elapsed (timer, NULL));
+      g_timer_destroy (timer);
+      return;
+    }
+
+  g_assert_not_reached ();
+}
+
 static void
-determine_scale (PixelRegion *srcPR,
-                 PixelRegion *dstPR,
-                 gint        *levelx,
-                 gint        *levely,
-                 gint        *max_progress)
+scale_determine_levels (PixelRegion *srcPR,
+                        PixelRegion *dstPR,
+                        gint        *levelx,
+                        gint        *levely)
 {
   gdouble scalex = (gdouble) dstPR->w / (gdouble) srcPR->w;
   gdouble scaley = (gdouble) dstPR->h / (gdouble) srcPR->h;
   gint    width  = srcPR->w;
   gint    height = srcPR->h;
 
-  *max_progress = ((height % TILE_HEIGHT) + 1) * ((width % TILE_WIDTH) + 1);
-
   /* determine scaling levels */
-  while (scalex >= 2)
+  while (scalex > 2)
     {
       scalex  /= 2;
-      width   *=2;
+      width   *= 2;
       *levelx -= 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scaley >= 2)
+  while (scaley > 2)
     {
       scaley  /= 2;
       height  *= 2;
       *levely -= 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scalex <= 0.5)
+  while (scalex < 0.5)
     {
       scalex  *= 2;
       width   /= 2;
       *levelx += 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 
-  while (scaley <= 0.5)
+  while (scaley < 0.5)
     {
       scaley  *= 2;
       height  *= 2;
       *levely += 1;
-      *max_progress += (((height % TILE_HEIGHT) + 1) *
-                        ((width % TILE_WIDTH) + 1));
     }
 }
 
-static void
-scale_region_buffer (PixelRegion           *srcPR,
-                     PixelRegion           *dstPR,
-                     GimpInterpolationType  interpolation,
-                     GimpProgressFunc       progress_callback,
-                     gpointer               progress_data)
-{
-  PixelRegion  tmpPR0;
-  PixelRegion  tmpPR1;
-  gint         width        = srcPR->w;
-  gint         height       = srcPR->h;
-  gint         bytes        = srcPR->bytes;
-  gint         max_progress = 0;
-  gint         levelx       = 0;
-  gint         levely       = 0;
-
-  /* determine scaling levels */
-  determine_scale (srcPR, dstPR, &levelx, &levely, &max_progress);
+/* This function calculates the number of tiles that are written in
+ * one scale operation. This number is used as the max_progress
+ * parameter in calls to GimpProgressFunc.
+ */
+static gint
+scale_determine_progress (PixelRegion *srcPR,
+                          PixelRegion *dstPR,
+                          gint         levelx,
+                          gint         levely)
+{
+  gint width  = srcPR->w;
+  gint height = srcPR->h;
+  gint tiles  = 0;
 
-  pixel_region_init_data (&tmpPR0,
-                          g_memdup (srcPR->data, width * height * bytes),
-                          bytes, width * bytes, 0, 0, width, height);
+  /*  The logic here should be kept in sync with scale_region_tile().  */
 
   while (levelx < 0 && levely < 0)
     {
       width  <<= 1;
       height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx++;
       levely++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx < 0)
     {
       width <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levely < 0)
     {
       height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
       levely++;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx > 0 && levely > 0)
     {
       width  >>= 1;
       height >>= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
       levelx--;
       levely--;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levelx > 0)
     {
-      width <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
+      width >>= 1;
       levelx--;
+
+      tiles += NUM_TILES (width, height);
     }
 
   while (levely > 0)
     {
-      height <<= 1;
-
-      pixel_region_init_data (&tmpPR1,
-                              g_new (guchar, width * height * bytes),
-                              bytes, width * bytes, 0, 0, width, height);
-
-      scale_pr (&tmpPR0, &tmpPR1, interpolation);
-
-      g_free (tmpPR0.data);
-      pixel_region_init_data (&tmpPR0,
-                              tmpPR1.data,
-                              bytes, width * bytes, 0, 0, width, height);
-
+      height >>= 1;
       levely--;
-    }
 
-  scale_pr (&tmpPR0, dstPR, interpolation);
+      tiles += NUM_TILES (width, height);
+    }
 
-  g_free (tmpPR0.data);
+  tiles += NUM_TILES (dstPR->w, dstPR->h);
 
-  return;
+  return tiles;
 }
 
 static void
@@ -379,20 +324,19 @@
   gint         width        = srcPR->w;
   gint         height       = srcPR->h;
   gint         bytes        = srcPR->bytes;
-  gint         max_progress = (((height % TILE_HEIGHT) + 1) *
-                               ((width % TILE_WIDTH) + 1));
+  gint         max_progress = 0;
   gint         progress     = 0;
   gint         levelx       = 0;
   gint         levely       = 0;
 
   /* determine scaling levels */
-  determine_scale (srcPR, dstPR, &levelx, &levely, &max_progress);
+  scale_determine_levels (srcPR, dstPR, &levelx, &levely);
+  max_progress = scale_determine_progress (srcPR, dstPR, levelx, levely);
 
   if (levelx == 0 && levely == 0)
     {
-       scale (srcTM, dstTM, interpolation,
-              progress_callback,
-              progress_data, &progress, max_progress);
+      scale (srcTM, dstTM, interpolation,
+             progress_callback, progress_data, &progress, max_progress);
     }
 
   while (levelx < 0 && levely < 0)
@@ -442,7 +386,7 @@
       levely++;
     }
 
-  while ( levelx > 0 && levely > 0 )
+  while (levelx > 0 && levely > 0)
     {
       width  >>= 1;
       height >>= 1;
@@ -459,9 +403,9 @@
       levely--;
     }
 
-  while ( levelx > 0 )
+  while (levelx > 0)
     {
-      width <<= 1;
+      width >>= 1;
 
       tmpTM = tile_manager_new (width, height, bytes);
       scale (srcTM, tmpTM, interpolation,
@@ -474,9 +418,9 @@
       levelx--;
     }
 
-  while ( levely > 0 )
+  while (levely > 0)
     {
-      height <<= 1;
+      height >>= 1;
 
       tmpTM = tile_manager_new (width, height, bytes);
       scale (srcTM, tmpTM, interpolation,
@@ -492,8 +436,7 @@
   if (tmpTM != NULL)
     {
       scale (tmpTM, dstTM, interpolation,
-             progress_callback,
-             progress_data, &progress, max_progress);
+             progress_callback, progress_data, &progress, max_progress);
       tile_manager_unref (tmpTM);
     }
 
@@ -512,455 +455,352 @@
        gint                  *progress,
        gint                   max_progress)
 {
-  guint              src_width      = tile_manager_width  (srcTM);
-  guint              src_height     = tile_manager_height (srcTM);
-  Tile              *dst_tile;
-  guchar            *dst_data;
-  guint              dst_width      = tile_manager_width  (dstTM);
-  guint              dst_height     = tile_manager_height (dstTM);
-  guint              dst_bpp        = tile_manager_bpp (dstTM);
-  guint              dst_tilerows   = tile_manager_tiles_per_row(dstTM);    /*  the number of tiles in each row      */
-  guint              dst_tilecols   = tile_manager_tiles_per_col(dstTM);    /*  the number of tiles in each columns  */
-  guint              dst_ewidth;
-  guint              dst_eheight;
-  guint              dst_stride;
-  gdouble            scalex         = (gdouble) dst_width  / (gdouble) src_width;
-  gdouble            scaley         = (gdouble) dst_height / (gdouble) src_height;
-  gdouble            xfrac;
-  gdouble            yfrac;
-  gint               x, y, x0, y0, x1, y1;
-  gint               sx0, sy0, sx1, sy1;
-  gint               col, row;
-  guchar             pixel[dst_bpp];
-  gfloat            *kernel_lookup = NULL;
+  PixelRegion     region;
+  PixelSurround  *surround   = NULL;
+  const guint     src_width  = tile_manager_width  (srcTM);
+  const guint     src_height = tile_manager_height (srcTM);
+  const guint     bytes      = tile_manager_bpp (srcTM);
+  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;
 
   /* fall back if not enough pixels available */
-  if (interpolation != GIMP_INTERPOLATION_NONE )
+  if (interpolation != GIMP_INTERPOLATION_NONE)
     {
-      if ( src_width < 2 || src_height < 2 ||
-           dst_width < 2 || dst_height < 2)
+      if (src_width < 2 || src_height < 2 ||
+          dst_width < 2 || dst_height < 2)
         {
           interpolation = GIMP_INTERPOLATION_NONE;
         }
-      else if ( src_width < 3 || src_height < 3 ||
-                dst_width < 3 || dst_height < 3)
+      else if (src_width < 3 || src_height < 3 ||
+               dst_width < 3 || dst_height < 3)
         {
           interpolation = GIMP_INTERPOLATION_LINEAR;
         }
     }
 
-  /* if scale is 2^n */
-  if (src_width == dst_width && src_height == dst_height)
+  switch (interpolation)
     {
-      for (row = 0; row < dst_tilerows; row++)
-        {
-          for (col = 0; col < dst_tilecols; col++)
-            {
-              dst_tile    = tile_manager_get_at (dstTM, col, row, TRUE, TRUE);
-              dst_data    = tile_data_pointer (dst_tile, 0, 0);
-              dst_bpp     = tile_bpp (dst_tile);
-              dst_ewidth  = tile_ewidth (dst_tile);
-              dst_eheight = tile_eheight (dst_tile);
-              dst_stride  = dst_ewidth * dst_bpp;
-              x0          = col * TILE_WIDTH;
-              y0          = row * TILE_HEIGHT;
-              x1          = x0 + dst_ewidth - 1;
-              y1          = y0 + dst_eheight - 1;
-
-              read_pixel_data (srcTM, x0, y0, x1, y1, dst_data, dst_stride);
-
-              tile_release (dst_tile, TRUE);
-
-              if (progress_callback)
-                progress_callback (0, max_progress, ((*progress)++),
-                                   progress_data);
-            }
-        }
-      return;
+    case GIMP_INTERPOLATION_NONE:
+      break;
+
+    case GIMP_INTERPOLATION_LINEAR:
+      surround = pixel_surround_new (srcTM, 2, 2, PIXEL_SURROUND_SMEAR);
+      break;
+
+    case GIMP_INTERPOLATION_CUBIC:
+      surround = pixel_surround_new (srcTM, 4, 4, PIXEL_SURROUND_SMEAR);
+      break;
+
+    case GIMP_INTERPOLATION_LANCZOS:
+      surround = pixel_surround_new (srcTM, 6, 6, PIXEL_SURROUND_SMEAR);
+      kernel_lookup = create_lanczos3_lookup ();
+      break;
     }
 
-  if (interpolation == GIMP_INTERPOLATION_LANCZOS )
-    kernel_lookup = create_lanczos3_lookup();
+  pixel_region_init (&region, dstTM, 0, 0, dst_width, dst_height, TRUE);
 
-  for (row = 0; row < dst_tilerows; row++)
+  for (pr = pixel_regions_register (1, &region);
+       pr != NULL;
+       pr = pixel_regions_process (pr))
     {
-      for (col = 0; col < dst_tilecols; col++)
+      const gint  x1  = region.x + region.w;
+      const gint  y1  = region.y + region.h;
+      guchar     *row = region.data;
+      gint        y;
+
+      for (y = region.y; y < y1; y++)
         {
-          dst_tile    = tile_manager_get_at (dstTM, col, row, FALSE, FALSE);
-          dst_data    = tile_data_pointer (dst_tile, 0, 0);
-          dst_bpp     = tile_bpp (dst_tile);
-          dst_ewidth  = tile_ewidth (dst_tile);
-          dst_eheight = tile_eheight (dst_tile);
-          dst_stride  = dst_ewidth * dst_bpp;
-
-          x0          = col * TILE_WIDTH;
-          y0          = row * TILE_HEIGHT;
-          x1          = x0 + dst_ewidth - 1;
-          y1          = y0 + dst_eheight - 1;
+          guchar  *pixel = row;
+          gdouble  yfrac = y / scaley;
+          gint     sy0   = (gint) yfrac;
+          gint     x;
+
+          yfrac = yfrac - sy0;
 
-          for (y = y0; y <= y1; y++)
+          for (x = region.x; x < x1; x++)
             {
-              yfrac = ( y / scaley );
-              sy0   = (gint) yfrac;
-              sy1   = sy0 + 1;
-              sy1   = ( sy1 >= src_height) ? src_height - 1 : sy1;
-              yfrac =  yfrac - sy0;
+              gdouble xfrac = x / scalex;
+              gint    sx0   = (gint) xfrac;
+
+              xfrac = xfrac - sx0;
 
-              for (x = x0; x <= x1; x++)
+              switch (interpolation)
                 {
-                  xfrac = (x / scalex);
-                  sx0   = (gint) xfrac;
-                  sx1   = sx0 + 1;
-                  sx1   = ( sx1 >= src_width) ? src_width - 1 : sx1;
-                  xfrac =  xfrac - sx0;
-
-                  switch (interpolation)
-                    {
-                    case GIMP_INTERPOLATION_NONE:
-                      interpolate_nearest (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
-                      break;
-
-                    case GIMP_INTERPOLATION_LINEAR:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_average (srcTM, sx0, sy0,
-                                          sx1, sy1,
-                                          xfrac, yfrac,
-                                          pixel,
+                case GIMP_INTERPOLATION_NONE:
+                  interpolate_nearest (srcTM, sx0, sy0, xfrac, yfrac, pixel);
+                  break;
+
+                case GIMP_INTERPOLATION_LINEAR:
+                  if (decimate)
+                    decimate_average (surround, sx0, sy0, bytes, pixel);
+                  else
+                    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);
+                  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);
-                      else
-                        interpolate_bilinear (srcTM, sx0, sy0,
-                                              sx1, sy1,
-                                              xfrac, yfrac,
-                                              pixel,
-                                              kernel_lookup);
-                      break;
-
-                    case GIMP_INTERPOLATION_CUBIC:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_gauss (srcTM, sx0, sy0,
-                                        sx1, sy1,
-                                        xfrac, yfrac,
-                                        pixel,
-                                        kernel_lookup);
-                      else
-                        interpolate_cubic (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
-                      break;
-
-                    case GIMP_INTERPOLATION_LANCZOS:
-                      if (scalex == 0.5 || scaley == 0.5)
-                        decimate_lanczos2 (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
-                      else
-                        interpolate_lanczos3 (srcTM, sx0, sy0,
-                                              sx1, sy1,
-                                              xfrac, yfrac,
-                                              pixel,
-                                              kernel_lookup);
-                      break;
-                    }
-                  write_pixel_data_1 (dstTM, x, y, pixel);
+                  break;
                 }
+
+              pixel += region.bytes;
             }
 
-          if (progress_callback)
-            progress_callback (0, max_progress, ((*progress)++), progress_data);
+          row += region.rowstride;
+        }
+
+      if (progress_callback)
+        {
+          (*progress)++;
+
+          if (*progress % 8 == 0)
+            progress_callback (0, max_progress, *progress, progress_data);
         }
     }
 
-  if (interpolation == GIMP_INTERPOLATION_LANCZOS)
+  if (kernel_lookup)
     g_free (kernel_lookup);
+
+  if (surround)
+    pixel_surround_destroy (surround);
 }
 
 static void inline
-pixel_average (guchar *p1,
-               guchar *p2,
-               guchar *p3,
-               guchar *p4,
-               guchar *p,
-               gint    bytes)
-{
-  gdouble sum, alphasum;
-  gdouble alpha;
-  gint    b;
-
-  for (b = 0; b < bytes; b++)
-    p[b]=0;
-
+pixel_average (const guchar *p1,
+               const guchar *p2,
+               const guchar *p3,
+               const guchar *p4,
+               guchar       *p,
+               const gint    bytes)
+{
   switch (bytes)
     {
     case 1:
-      sum = ((p1[0] + p2[0] + p3[0] + p4[0]) / 4);
-
-      p[0] = (guchar) CLAMP (sum, 0, 255);
+      p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
       break;
 
     case 2:
-      alphasum = p1[1] +  p2[1] +  p3[1] +  p4[1];
-
-      if (alphasum > 0)
-        {
-          sum = p1[0] * p1[1] + p2[0] * p2[1] + p3[0] * p3[1] + p4[0] * p4[1];
-          sum /= alphasum;
-
-          alpha = alphasum / 4;
+      {
+        guint a = p1[1] + p2[1] + p3[1] + p4[1];
 
-          p[0] = (guchar) CLAMP (sum, 0, 255);
-          p[1] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = 0;
+            break;
+
+          case 1020: /* all opaque */
+            p[0] = (p1[0]  + p2[0] + p3[0] + p4[0] + 2) >> 2;
+            p[1] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[1] +
+                     p2[0] * p2[1] +
+                     p3[0] * p3[1] +
+                     p4[0] * p4[1] + (a >> 1)) / a);
+            p[1] = (a + 2) >> 2;
+            break;
+          }
+      }
       break;
 
     case 3:
-      for (b = 0; b<3; b++)
-        {
-          sum = ((p1[b] + p2[b] + p3[b] + p4[b]) / 4);
-          p[b] = (guchar) CLAMP (sum, 0, 255);
-        }
+      p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
+      p[1] = (p1[1] + p2[1] + p3[1] + p4[1] + 2) >> 2;
+      p[2] = (p1[2] + p2[2] + p3[2] + p4[2] + 2) >> 2;
       break;
 
     case 4:
-      alphasum = p1[3] +  p2[3] +  p3[3] +  p4[3];
-
-      if (alphasum > 0)
-        {
-          for (b = 0; b<3; b++)
-            {
-              sum = p1[b] * p1[3] + p2[b] * p2[3] + p3[b] * p3[3] + p4[b] * p4[3];
-              sum /= alphasum;
-
-              p[b] = (guchar) CLAMP (sum, 0, 255);
-            }
-
-          alpha = alphasum / 4;
+      {
+        guint a = p1[3] + p2[3] + p3[3] + p4[3];
 
-          p[3] = (guchar) CLAMP (alpha, 0, 255);
-        }
+        switch (a)
+          {
+          case 0:    /* all transparent */
+            p[0] = p[1] = p[2] = p[3] = 0;
+            break;
+
+          case 1020: /* all opaque */
+            p[0] = (p1[0] + p2[0] + p3[0] + p4[0] + 2) >> 2;
+            p[1] = (p1[1] + p2[1] + p3[1] + p4[1] + 2) >> 2;
+            p[2] = (p1[2] + p2[2] + p3[2] + p4[2] + 2) >> 2;
+            p[3] = 255;
+            break;
+
+          default:
+            p[0] = ((p1[0] * p1[3] +
+                     p2[0] * p2[3] +
+                     p3[0] * p3[3] +
+                     p4[0] * p4[3] + (a >> 1)) / a);
+            p[1] = ((p1[1] * p1[3] +
+                     p2[1] * p2[3] +
+                     p3[1] * p3[3] +
+                     p4[1] * p4[3] + (a >> 1)) / a);
+            p[2] = ((p1[2] * p1[3] +
+                     p2[2] * p2[3] +
+                     p3[2] * p3[3] +
+                     p4[2] * p4[3] + (a >> 1)) / a);
+            p[3] = (a + 2) >> 2;
+            break;
+          }
+      }
       break;
     }
 }
 
-void
-scale_region (PixelRegion           *srcPR,
-              PixelRegion           *dstPR,
-              GimpInterpolationType  interpolation,
-              GimpProgressFunc       progress_callback,
-              gpointer               progress_data)
-{
-
-  /* Copy and return if scale = 1.0 */
-  if (srcPR->h == dstPR->h && srcPR->w == dstPR->w)
-    {
-      copy_region (srcPR, dstPR);
-      return;
-    }
-
-  if (srcPR->tiles == NULL && srcPR->data != NULL)
-    {
-      scale_region_buffer (srcPR, dstPR, interpolation,
-                           progress_callback, progress_data);
-      return;
-    }
-
-  if (srcPR->tiles != NULL && srcPR->data == NULL)
-    {
-      scale_region_tile (srcPR, dstPR, interpolation,
-                         progress_callback, progress_data);
-      return;
-    }
-
-  g_assert_not_reached ();
-}
-
 static void
-decimate_gauss (TileManager *srcTM,
-                gint         x0,
-                gint         y0,
-                gint         x1,
-                gint         y1,
-                gdouble      xfrac,
-                gdouble      yfrac,
-                guchar      *pixel,
-                gfloat      *kernel_lookup)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[src_bpp];
-  guchar  pixel2[src_bpp];
-  guchar  pixel3[src_bpp];
-  guchar  pixel4[src_bpp];
-  guchar  pixels[16 * src_bpp];
-  gint    x, y, i;
-  guchar *p;
-
-  for (y = y0 - 1, i = 0; y <= y0 + 2; y++)
-    {
-      for (x = x0 - 1; x <= x0 + 2; x++, i++)
-        {
-          x1 = ABS(x);
-          y1 = ABS(y);
-          x1 = (x1 < src_width)  ? x1 : 2 * src_width - x1 - 1;
-          y1 = (y1 < src_height) ? y1 : 2 * src_height - y1 - 1;
-          read_pixel_data_1 (srcTM, x1, y1, pixels + (i * src_bpp));
-        }
-    }
-
-  p = pixels + (0 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel1);
-  p = pixels + (1 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel2);
-  p = pixels + (4 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel3);
-  p = pixels + (5 * src_bpp);
-  gaussan_decimate (p, src_bpp, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
+decimate_gauss (PixelSurround *surround,
+                const gint     x0,
+                const gint     y0,
+                const gint     bytes,
+                guchar        *pixel)
+{
+  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
-gaussan_decimate (guchar *pixels,
-                  gint    bytes,
-                  guchar *pixel)
-{
-  guchar *p;
-  gdouble sum;
-  gdouble alphasum;
-  gdouble alpha;
-  gint    b;
-
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
-
-  p = pixels;
+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  = p[0]     + p[1] * 2 + p[2];
-      sum += p[4] * 2 + p[5] * 4 + p[6] * 2;
-      sum += p[8]     + p[9] * 2 + p[10];
-      sum /= 16;
+      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] = (guchar) CLAMP (sum, 0, 255);
+      pixel[0] = (sum + 8) >> 4;
       break;
 
     case 2:
-      alphasum  = p[1]     + p[3]  * 2 + p[5];
-      alphasum += p[9] * 2 + p[11] * 4 + p[13] * 2;
-      alphasum += p[17]    + p[19] * 2 + p[21];
+      alphasum = (s0[1]     + s0[3] * 2 + s0[5]     +
+                  s1[1] * 2 + s1[3] * 4 + s1[5] * 2 +
+                  s2[1]     + s2[3] * 2 + s2[5]);
 
       if (alphasum > 0)
         {
-          sum  = p[0]  * p[1]     + p[2]  * p[3]  * 2 + p[4]  * p[5];
-          sum += p[8]  * p[9] * 2 + p[10] * p[11] * 4 + p[12] * p[13] * 2;
-          sum += p[16] * p[17]    + p[18] * p[19] * 2 + p[20] * p[21];
-          sum /= alphasum;
+          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]);
 
-          alpha = alphasum / 16;
-
-          pixel[0] = (guchar) CLAMP (sum,   0, 255);
-          pixel[1] = (guchar) CLAMP (alpha, 0, 255);
+          pixel[0] = (sum + (alphasum >> 1)) / alphasum;
+          pixel[1] = (alphasum + 8) >> 4;
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
     case 3:
       for (b = 0; b < 3; b++ )
         {
-          sum  = p[b   ]     + p[3 + b] * 2 + p[6 + b];
-          sum += p[12 + b] * 2 + p[15 + b] * 4 + p[18 + b] * 2;
-          sum += p[24 + b]     + p[27 + b] * 2 + p[30 + b];
-          sum /= 16;
+          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] = (guchar) CLAMP (sum, 0, 255);
+          pixel[b] = (sum + 8) >> 4;
         }
       break;
 
     case 4:
-      alphasum  = p[3]      + p[7]  * 2  + p[11];
-      alphasum += p[19] * 2 + p[23] * 4  + p[27] * 2;
-      alphasum += p[35]     + p[39] * 2  + p[43];
+      alphasum  = (s0[3]     + s0[7] * 2 + s0[11]     +
+                   s1[3] * 2 + s1[7] * 4 + s1[11] * 2 +
+                   s2[3]     + s2[7] * 2 + s2[11]);
+
       if (alphasum > 0)
         {
           for (b = 0; b < 3; b++)
             {
-              sum = p[   b] * p[3]      + p[4 + b] * p[7]  * 2 + p[8 + b] * p[11];
-              sum += p[16 + b] * p[19] * 2 + p[20 + b] * p[23] * 4 + p[24 + b] * p[27] * 2;
-              sum += p[32 + b] * p[35]     + p[36 + b] * p[39] * 2 + p[40 + b] * p[43];
-              sum /= alphasum;
+              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]);
 
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+              pixel[b] = (sum + (alphasum >> 1)) / alphasum;
             }
 
-          alpha = alphasum / 16;
-
-          pixel[3] = (guchar) CLAMP (alpha, 0, 255);
+          pixel[3] = (alphasum + 8) >> 4;
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
 }
 
 static inline void
-decimate_lanczos2 (TileManager *srcTM,
-                   gint         x0,
-                   gint         y0,
-                   gint         x1,
-                   gint         y1,
-                   gdouble      xfrac,
-                   gdouble      yfrac,
-                   guchar      *pixel,
-                   gfloat      *kernel_lookup)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[src_bpp];
-  guchar  pixel2[src_bpp];
-  guchar  pixel3[src_bpp];
-  guchar  pixel4[src_bpp];
-  guchar  pixels[36 * src_bpp];
-  gint    x, y, i;
-  guchar *p;
-
-  for (y = y0 - 2, i = 0; y <= y0 + 3; y++)
-    {
-      for (x = x0 - 2; x <= x0 + 3; x++, i++)
-        {
-          x1 = ABS(x);
-          y1 = ABS(y);
-          x1 = (x1 < src_width)  ? x1 : 2 * src_width - x1 - 1;
-          y1 = (y1 < src_height) ? y1 : 2 * src_height - y1 - 1;
-          read_pixel_data_1 (srcTM, x1, y1, pixels + (i * src_bpp));
-        }
-    }
-
-  p = pixels + (0 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel1);
-  p = pixels + (1 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel2);
-  p = pixels + (6 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel3);
-  p = pixels + (7 * src_bpp);
-  gaussan_lanczos2 (p, src_bpp, pixel4);
-
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
+decimate_lanczos2 (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
-gaussan_lanczos2 (guchar *pixels,
-                  gint    bytes,
-                  guchar *pixel)
+gaussian_lanczos2 (const guchar *src,
+                   const gint    x,
+                   const gint    y,
+                   const gint    bytes,
+                   const gint    stride,
+                   guchar       *pixel)
 {
   /*
    *   Filter source taken from document:
@@ -971,161 +811,137 @@
    *   Ken Turkowski, Apple computer
    *
    */
-  guchar  *p;
-  gdouble  sum;
-  gdouble  alphasum;
-  gdouble  alpha;
-  gint     b;
-
-  for (b = 0; b < bytes; b++)
-    pixel[b] = 0;
-
-  p = pixels;
+  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  = p[0] + p[1] * -9 + p[2] * -16 + p[3] * -9 + p[4];
-      sum += p[6] * -9 + p[7] * 81 + p[8] * 144 + p[9] * 81 + p[10] * -9;
-      sum += p[12] * -16 +
-             p[13] * 144 + p[14] * 256 + p[15] * 144 + p[16] * -16;
-      sum += p[18] * -9 + p[19] * 81 + p[20] * 144 + p[21] * 81 + p[22] * -9;
-      sum += p[24] + p[25] * -9 + p[26] * -16 + p[27] * -9 + p[28];
+      sum  = 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] = (guchar) CLAMP (sum, 0, 255);
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
-      alphasum =  p[1] + p[3] * -9 + p[5] * -16 + p[7] * -9 + p[9];
-      alphasum += p[13] * -9 +
-                  p[15] * 81 + p[17] * 144 + p[19] * 81 + p[21] * -9;
-      alphasum += p[25] * -16 +
-                  p[27] * 144 + p[29] * 256 + p[31] * 144 + p[33] * -16;
-      alphasum += p[37] * -9 +
-                  p[39] * 81 + p[41] * 144 + p[43] * 81 + p[45] * -9;
-      alphasum += p[49] + p[51] * -9 + p[53] * -16 + p[55] * -9 + p[57];
+      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 =  p[0] * p[1] +
-                 p[2] * p[3] * -9 +
-                 p[4] * p[5] * -16 + p[6] * p[7] * -9 + p[8] * p[9];
-          sum += p[12] * p[13] * -9 +
-                 p[14] * p[15] * 81 +
-                 p[16] * p[17] * 144 + p[18] * p[19] * 81 + p[20] * p[21] * -9;
-          sum += p[24] * p[25] * -16 +
-                 p[26] * p[27] * 144 +
-                 p[28] * p[29] * 256 + p[30] * p[31] * 144 + p[32] * p[33] * -16;
-          sum += p[36] * p[37] * -9 +
-                 p[38] * p[39] * 81 +
-                 p[40] * p[41] * 144 + p[42] * p[43] * 81 + p[44] * p[45] * -9;
-          sum += p[48] * p[49] +
-                 p[50] * p[51] * -9 +
-                 p[52] * p[53] * -16 + p[54] * p[55] * -9 + p[56] * p[57];
-          sum /= alphasum;
+          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] = (guchar) CLAMP (sum, 0, 255);
-          pixel[1] = (guchar) CLAMP (alpha, 0, 255);
+          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 =  p[b] +
-                 p[3 + b] * -9 + p[6 + b] * -16 + p[9 + b] * -9 + p[12 + b];
-          sum += p[18 + b] * -9 +
-                 p[21 + b] * 81 +
-                 p[24 + b] * 144 + p[27 + b] * 81 + p[30 + b] * -9;
-          sum += p[36 + b] * -16 +
-                 p[39 + b] * 144 +
-                 p[42 + b] * 256 + p[45 + b] * 144 + p[48 + b] * -16;
-          sum += p[54 + b] * -9 +
-                 p[57 + b] * 81 +
-                 p[60 + b] * 144 + p[63 + b] * 81 + p[66 + b] * -9;
-          sum += p[72 + b] +
-                 p[75 + b] * -9 + p[78 + b] * -16 + p[81 + b] * -9 + p[84 + b];
+          sum =  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] = (guchar) CLAMP (sum, 0, 255);
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
     case 4:
-      alphasum =  p[3] + p[7] * -9 + p[11] * -16 + p[15] * -9 + p[19];
-      alphasum += p[27] * -9 +
-                  p[31] * 81 + p[35] * 144 + p[39] * 81 + p[43] * -9;
-      alphasum += p[51] * -16 +
-                  p[55] * 144 + p[59] * 256 + p[63] * 144 + p[67] * -16;
-      alphasum += p[75] * -9 +
-                  p[79] * 81 + p[83] * 144 + p[87] * 81 + p[91] * -9;
-      alphasum += p[99] + p[103] * -9 + p[107] * -16 + p[111] * -9 + p[115];
+      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 =  p[0 + b] * p[3] +
-                     p[4 + b] * p[7] * -9 +
-                     p[8 + b] * p[11] * -16 +
-                     p[12 + b] * p[15] * -9 + p[16 + b] * p[19];
-              sum += p[24 + b] * p[27] * -9 +
-                     p[28 + b] * p[31] * 81 +
-                     p[32 + b] * p[35] * 144 +
-                     p[36 + b] * p[39] * 81 + p[40 + b] * p[43] * -9;
-              sum += p[48 + b] * p[51] * -16 +
-                     p[52 + b] * p[55] * 144 +
-                     p[56 + b] * p[59] * 256 +
-                     p[60 + b] * p[63] * 144 + p[64 + b] * p[67] * -16;
-              sum += p[72 + b] * p[75] * -9 +
-                     p[76 + b] * p[79] * 81 +
-                     p[80 + b] * p[83] * 144 +
-                     p[84 + b] * p[87] * 81 + p[88 + b] * p[91] * -9;
-              sum += p[96 + b] * p[99] +
-                     p[100 + b] * p[103] * -9 +
-                    p[104 + b] * p[107] * -16 +
-                    p[108 + b] * p[111] * -9 + p[112 + b] * p[115];
+              sum =  (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;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          alpha = (gint) alphasum / 1024;
-          pixel[3] = (guchar) CLAMP (alpha, 0, 255);
+          alpha = alphasum / 1024;
+
+          pixel[3] = CLAMP (alpha, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
 }
 
 static void
-decimate_average (TileManager *srcTM,
-                  gint         x0,
-                  gint         y0,
-                  gint         x1,
-                  gint         y1,
-                  gdouble      xfrac,
-                  gdouble      yfrac,
-                  guchar      *pixel,
-                  gfloat      *kernel_lookup)
-{
-  gint   src_bpp    = tile_manager_bpp  (srcTM);
-  guchar pixel1[src_bpp];
-  guchar pixel2[src_bpp];
-  guchar pixel3[src_bpp];
-  guchar pixel4[src_bpp];
-
-  read_pixel_data_1 (srcTM, x0, y0, pixel1);
-  read_pixel_data_1 (srcTM, x1, y0, pixel2);
-  read_pixel_data_1 (srcTM, x0, y1, pixel3);
-  read_pixel_data_1 (srcTM, x1, y1, pixel4);
+decimate_average (PixelSurround *surround,
+                  const gint     x0,
+                  const gint     y0,
+                  const gint     bytes,
+                  guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
 
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
+  pixel_average (src, src + bytes, src + stride, src + stride + bytes,
+                 pixel, bytes);
 }
 
 static inline gdouble
-sinc (gdouble x)
+sinc (const gdouble x)
 {
   gdouble y = x * G_PI;
 
@@ -1137,7 +953,8 @@
 
 /*
  * allocate and fill lookup table of Lanczos windowed sinc function
- * use gfloat since errors due to granularity of array far exceed data precision
+ * use gfloat since errors due to granularity of array far exceed
+ * data precision
  */
 gfloat *
 create_lanczos_lookup (void)
@@ -1178,79 +995,75 @@
 }
 
 static void
-interpolate_nearest (TileManager *srcTM,
-                     gint         x0,
-                     gint         y0,
-                     gint         x1,
-                     gint         y1,
-                     gdouble      xfrac,
-                     gdouble      yfrac,
-                     guchar      *pixel,
-                     gfloat      *kernel_lookup)
-{
-  gint x = (xfrac <= 0.5) ? x0 : x1;
-  gint y = (yfrac <= 0.5) ? y0 : y1;
+interpolate_nearest (TileManager   *srcTM,
+                     const gint     x0,
+                     const gint     y0,
+                     const gdouble  xfrac,
+                     const gdouble  yfrac,
+                     guchar        *pixel)
+{
+  const gint w = tile_manager_width (srcTM) - 1;
+  const gint h = tile_manager_height (srcTM) - 1;
+  const gint x = (xfrac <= 0.5) ? x0 : x0 + 1;
+  const gint y = (yfrac <= 0.5) ? y0 : y0 + 1;
 
-  read_pixel_data_1 (srcTM, x, y, pixel);
+  read_pixel_data_1 (srcTM, CLAMP (x, 0, w), CLAMP (y, 0, h), pixel);
 }
 
 static inline gdouble
-weighted_sum (gdouble dx,
-              gdouble dy,
-              gint    s00,
-              gint    s10,
-              gint    s01,
-              gint    s11)
+weighted_sum (const gdouble dx,
+              const gdouble dy,
+              const gint    s00,
+              const gint    s10,
+              const gint    s01,
+              const gint    s11)
 {
   return ((1 - dy) *
           ((1 - dx) * s00 + dx * s10) + dy * ((1 - dx) * s01 + dx * s11));
 }
 
 static void
-interpolate_bilinear (TileManager *srcTM,
-                      gint         x0,
-                      gint         y0,
-                      gint         x1,
-                      gint         y1,
-                      gdouble      xfrac,
-                      gdouble      yfrac,
-                      guchar      *p,
-                      gfloat      *kernel_lookup)
-{
-  gint   src_bpp         = tile_manager_bpp  (srcTM);
-  guchar p1[src_bpp];
-  guchar p2[src_bpp];
-  guchar p3[src_bpp];
-  guchar p4[src_bpp];
-
-  gint   b;
-  gdouble sum, alphasum;
-
-  for (b=0; b < src_bpp; b++)
-    p[b]=0;
-
-  read_pixel_data_1 (srcTM, x0, y0, p1);
-  read_pixel_data_1 (srcTM, x1, y0, p2);
-  read_pixel_data_1 (srcTM, x0, y1, p3);
-  read_pixel_data_1 (srcTM, x1, y1, p4);
+interpolate_bilinear (PixelSurround *surround,
+                      const gint     x0,
+                      const gint     y0,
+                      const gdouble  xfrac,
+                      const gdouble  yfrac,
+                      const gint     bytes,
+                      guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0, y0, &stride);
+  const guchar *p1  = src;
+  const guchar *p2  = p1 + bytes;
+  const guchar *p3  = src + stride;
+  const guchar *p4  = p3 + bytes;
+  gdouble       sum;
+  gdouble       alphasum;
+  gint          b;
 
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
       sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      p[0] = (guchar) CLAMP (sum, 0, 255);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
       alphasum = weighted_sum (xfrac, yfrac, p1[1], p2[1], p3[1], p4[1]);
       if (alphasum > 0)
         {
-          sum = weighted_sum (xfrac, yfrac, p1[0] * p1[1], p2[0] * p2[1],
+          sum = weighted_sum (xfrac, yfrac,
+                              p1[0] * p1[1], p2[0] * p2[1],
                               p3[0] * p3[1], p4[0] * p4[1]);
           sum /= alphasum;
 
-          p[0] = (guchar) CLAMP (sum, 0, 255);
-          p[1] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
@@ -1258,7 +1071,8 @@
       for (b = 0; b < 3; b++)
         {
           sum = weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]);
-          p[b] = (guchar) CLAMP (sum, 0, 255);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1266,15 +1080,21 @@
       alphasum = weighted_sum (xfrac, yfrac, p1[3], p2[3], p3[3], p4[3]);
       if (alphasum > 0)
         {
-          for (b = 0; b<3; b++)
+          for (b = 0; b < 3; b++)
             {
-              sum = weighted_sum (xfrac, yfrac, p1[b] * p1[3], p2[b] * p2[3],
+              sum = weighted_sum (xfrac, yfrac,
+                                  p1[b] * p1[3], p2[b] * p2[3],
                                   p3[b] * p3[3], p4[b] * p4[3]);
               sum /= alphasum;
-              p[b] = (guchar) CLAMP (sum, 0, 255);
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
@@ -1287,111 +1107,103 @@
   */
 
 static inline gdouble
-cubic_spline_fit (gdouble dx,
-                  gint    pt0,
-                  gint    pt1,
-                  gint    pt2,
-                  gint    pt3)
+cubic_spline_fit (const gdouble  dx,
+                  const gdouble  pt0,
+                  const gdouble  pt1,
+                  const gdouble  pt2,
+                  const gdouble  pt3)
 {
-
   return (gdouble) ((( ( -pt0 + 3 * pt1 - 3 * pt2 + pt3 ) *   dx +
                        ( 2 * pt0 - 5 * pt1 + 4 * pt2 - pt3 ) ) * dx +
                      ( -pt0 + pt2 ) ) * dx + (pt1 + pt1) ) / 2.0;
 }
 
 static void
-interpolate_cubic (TileManager *srcTM,
-                   gint         x1,
-                   gint         y1,
-                   gint         x2,
-                   gint         y2,
-                   gdouble      xfrac,
-                   gdouble      yfrac,
-                   guchar      *p,
-                   gfloat      *kernel_lookup)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  gint    b, i;
-  gint    x, y;
-  gint    x0;
-  gint    y0;
-
-  guchar  ps[16 * src_bpp];
-  gdouble p0, p1, p2, p3;
-
-  gdouble sum, alphasum;
+interpolate_cubic (PixelSurround *surround,
+                   const gint     x0,
+                   const gint     y0,
+                   const gdouble  xfrac,
+                   const gdouble  yfrac,
+                   const gint     bytes,
+                   guchar        *pixel)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0 - 1, y0 - 1, &stride);
+  const guchar *s0  = src;
+  const guchar *s1  = s0 + stride;
+  const guchar *s2  = s1 + stride;
+  const guchar *s3  = s2 + stride;
+  gint          b;
+  gdouble       p0, p1, p2, p3;
+  gdouble       sum, alphasum;
 
-  for (b = 0; b < src_bpp; b++)
-    p[b] = 0;
-
-  for (y = y1 - 1, i = 0; y <= y1 + 2; y++)
-    for (x = x1 - 1; x <= x1 + 2; x++, i++)
-      {
-        x0 = (x < src_width)  ? ABS(x) : 2 * src_width  - x - 1;
-        y0 = (y < src_height) ? ABS(y) : 2 * src_height - y - 1;
-        read_pixel_data_1 (srcTM, x0, y0, ps + (i * src_bpp));
-      }
-
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
-      p0 = cubic_spline_fit (xfrac, ps[0 ], ps[1 ], ps[2 ], ps[3 ]);
-      p1 = cubic_spline_fit (xfrac, ps[4 ], ps[5 ], ps[6 ], ps[7 ]);
-      p2 = cubic_spline_fit (xfrac, ps[8 ], ps[9 ], ps[10], ps[11]);
-      p3 = cubic_spline_fit (xfrac, ps[12], ps[13], ps[14], ps[15]);
+      p0 = cubic_spline_fit (xfrac, s0[0], s0[1], s0[2], s0[3]);
+      p1 = cubic_spline_fit (xfrac, s1[0], s1[1], s1[2], s1[3]);
+      p2 = cubic_spline_fit (xfrac, s2[0], s2[1], s2[2], s2[3]);
+      p3 = cubic_spline_fit (xfrac, s3[0], s3[1], s3[2], s3[3]);
 
       sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-      p[0]= (guchar) CLAMP (sum, 0, 255);
+      pixel[0]= CLAMP (sum, 0, 255);
       break;
 
     case 2:
-      p0 = cubic_spline_fit (xfrac, ps[1 ], ps[3 ], ps[5 ], ps[7 ]);
-      p1 = cubic_spline_fit (xfrac, ps[9 ], ps[11], ps[13], ps[15]);
-      p2 = cubic_spline_fit (xfrac, ps[17], ps[19], ps[21], ps[23]);
-      p3 = cubic_spline_fit (xfrac, ps[25], ps[27], ps[29], ps[31]);
+      p0 = cubic_spline_fit (xfrac, s0[1], s0[3], s0[5], s0[7]);
+      p1 = cubic_spline_fit (xfrac, s1[1], s1[3], s1[5], s1[7]);
+      p2 = cubic_spline_fit (xfrac, s2[1], s2[3], s2[5], s2[7]);
+      p3 = cubic_spline_fit (xfrac, s3[1], s3[3], s3[5], s3[7]);
 
       alphasum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
       if (alphasum > 0)
         {
-          p0 = cubic_spline_fit (xfrac, ps[0 ] * ps[1 ], ps[2 ] * ps[3 ],
-                                 ps[4 ] * ps[5 ], ps[6 ] * ps[7 ]);
-          p1 = cubic_spline_fit (xfrac, ps[8 ] * ps[9 ], ps[10] * ps[11],
-                                 ps[12] * ps[13], ps[14] * ps[15]);
-          p2 = cubic_spline_fit (xfrac, ps[16] * ps[17], ps[18] * ps[19],
-                                 ps[20] * ps[21], ps[22] * ps[23]);
-          p3 = cubic_spline_fit (xfrac, ps[24] * ps[25], ps[26] * ps[27],
-                                 ps[28] * ps[29], ps[30] * ps[31]);
+          p0 = cubic_spline_fit (xfrac,
+                                 s0[0] * s0[1], s0[2] * s0[3],
+                                 s0[4] * s0[5], s0[6] * s0[7]);
+          p1 = cubic_spline_fit (xfrac,
+                                 s1[0] * s1[1], s1[2] * s1[3],
+                                 s1[4] * s1[5], s1[6] * s1[7]);
+          p2 = cubic_spline_fit (xfrac,
+                                 s2[0] * s2[1], s2[2] * s2[3],
+                                 s2[4] * s2[5], s2[6] * s2[7]);
+          p3 = cubic_spline_fit (xfrac,
+                                 s3[0] * s3[1], s3[2] * s3[3],
+                                 s3[4] * s3[5], s3[6] * s3[7]);
 
           sum  = cubic_spline_fit (yfrac, p0, p1, p2, p3);
           sum /= alphasum;
 
-          p[0] = (guchar) CLAMP (sum, 0, 255);
-          p[1] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
+
     case 3:
       for (b = 0; b < 3; b++)
         {
-          p0 = cubic_spline_fit (xfrac, ps[   b], ps[3 + b], ps[6 + b], ps[9 + b]);
-          p1 = cubic_spline_fit (xfrac, ps[12 + b], ps[15 + b], ps[18 + b], ps[21 + b]);
-          p2 = cubic_spline_fit (xfrac, ps[24 + b], ps[27 + b], ps[30 + b], ps[33 + b]);
-          p3 = cubic_spline_fit (xfrac, ps[36 + b], ps[39 + b], ps[42 + b], ps[45 + b]);
+          p0 = cubic_spline_fit (xfrac, s0[b], s0[3 + b], s0[6 + b], s0[9 + b]);
+          p1 = cubic_spline_fit (xfrac, s1[b], s1[3 + b], s1[6 + b], s1[9 + b]);
+          p2 = cubic_spline_fit (xfrac, s2[b], s2[3 + b], s2[6 + b], s2[9 + b]);
+          p3 = cubic_spline_fit (xfrac, s3[b], s3[3 + b], s3[6 + b], s3[9 + b]);
 
           sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-          p[b] = (guchar) CLAMP (sum, 0, 255);
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
     case 4:
-      p0 = cubic_spline_fit (xfrac, ps[3],  ps[7],  ps[11], ps[15]);
-      p1 = cubic_spline_fit (xfrac, ps[19], ps[23], ps[27], ps[31]);
-      p2 = cubic_spline_fit (xfrac, ps[35], ps[39], ps[43], ps[47]);
-      p3 = cubic_spline_fit (xfrac, ps[51], ps[55], ps[59], ps[63]);
+      p0 = cubic_spline_fit (xfrac, s0[3], s0[7], s0[11], s0[15]);
+      p1 = cubic_spline_fit (xfrac, s1[3], s1[7], s1[11], s1[15]);
+      p2 = cubic_spline_fit (xfrac, s2[3], s2[7], s2[11], s2[15]);
+      p3 = cubic_spline_fit (xfrac, s3[3], s3[7], s3[11], s3[15]);
 
       alphasum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
@@ -1399,42 +1211,52 @@
         {
           for (b = 0; b < 3; b++)
             {
-              p0 = cubic_spline_fit (xfrac, ps[0 + b] * ps[3],  ps[4 + b] * ps[7],
-                                     ps[8 + b] * ps[11], ps[12 + b] * ps[15]);
-              p1 = cubic_spline_fit (xfrac, ps[16 + b] * ps[19], ps[20 + b] * ps[23],
-                                     ps[24 + b] * ps[27], ps[28 + b] * ps[31]);
-              p2 = cubic_spline_fit (xfrac, ps[32 + b] * ps[35], ps[36 + b] * ps[39],
-                                     ps[40 + b] * ps[43], ps[44 + b] * ps[47]);
-              p3 = cubic_spline_fit (xfrac, ps[48 + b] * ps[51], ps[52 + b] * ps[55],
-                                     ps[56 + b] * ps[59], ps[60 + b] * ps[63]);
+              p0 = cubic_spline_fit (xfrac,
+                                     s0[0 + b] * s0[ 3], s0[ 4 + b] * s0[7],
+                                     s0[8 + b] * s0[11], s0[12 + b] * s0[15]);
+              p1 = cubic_spline_fit (xfrac,
+                                     s1[0 + b] * s1[ 3], s1[ 4 + b] * s1[7],
+                                     s1[8 + b] * s1[11], s1[12 + b] * s1[15]);
+              p2 = cubic_spline_fit (xfrac,
+                                     s2[0 + b] * s2[ 3], s2[ 4 + b] * s2[7],
+                                     s2[8 + b] * s2[11], s2[12 + b] * s2[15]);
+              p3 = cubic_spline_fit (xfrac,
+                                     s3[0 + b] * s3[ 3], s3[ 4 + b] * s3[7],
+                                     s3[8 + b] * s3[11], s3[12 + b] * s3[15]);
 
               sum  = cubic_spline_fit (yfrac, p0, p1, p2, p3);
               sum /= alphasum;
 
-              p[b] = (guchar) CLAMP (sum, 0, 255);
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
 }
 
 static gdouble inline
-lanczos3_mul_alpha (guchar  * pixels,
-                    gdouble * x_kernel,
-                    gdouble * y_kernel,
-                    gint bytes,
-                    gint byte)
-{
-  gdouble sum   = 0.0;
-  guchar *p     = pixels;
-  guchar  alpha = bytes - 1;
-  gint    x, y;
+lanczos3_mul_alpha (const guchar  *pixels,
+                    const gdouble *x_kernel,
+                    const gdouble *y_kernel,
+                    const gint     stride,
+                    const gint     bytes,
+                    const gint     byte)
+{
+  const guchar *row   = pixels;
+  const guchar  alpha = bytes - 1;
+  gdouble       sum   = 0.0;
+  gint          x, y;
 
-  for (y = 0; y < 6; y++)
+  for (y = 0; y < 6; y++, row += stride)
     {
-      gdouble tmpsum = 0.0;
+      const guchar *p      = row;
+      gdouble       tmpsum = 0.0;
 
       for (x = 0; x < 6; x++, p += bytes)
         {
@@ -1449,19 +1271,21 @@
 }
 
 static gdouble inline
-lanczos3_mul (guchar  *pixels,
-              gdouble *x_kernel,
-              gdouble *y_kernel,
-              gint     bytes,
-              gint     byte)
-{
-  gdouble sum  = 0.0;
-  guchar *p    = pixels;
-  gint    x, y;
+lanczos3_mul (const guchar  *pixels,
+              const gdouble *x_kernel,
+              const gdouble *y_kernel,
+              const gint     stride,
+              const gint     bytes,
+              const gint     byte)
+{
+  const guchar *row = pixels;
+  gdouble       sum = 0.0;
+  gint          x, y;
 
-  for (y = 0; y < 6; y++)
+  for (y = 0; y < 6; y++, row += stride)
     {
-      gdouble tmpsum = 0.0;
+      const guchar *p = row;
+      gdouble       tmpsum = 0.0;
 
       for (x = 0; x < 6; x++, p += bytes)
         {
@@ -1476,44 +1300,25 @@
 }
 
 static void
-interpolate_lanczos3 (TileManager *srcTM,
-                      gint         x1,
-                      gint         y1,
-                      gint         x2,
-                      gint         y2,
-                      gdouble      xfrac,
-                      gdouble      yfrac,
-                      guchar      *pixel,
-                      gfloat      *kernel_lookup)
-{
-  gint    src_bpp    = tile_manager_bpp  (srcTM);
-  guint   src_width  = tile_manager_width  (srcTM);
-  guint   src_height = tile_manager_height (srcTM);
-  gint    b, i;
-  gint    x, y;
-  gint    x0;
-  gint    y0;
-  gint    x_shift, y_shift;
-  gdouble kx_sum, ky_sum;
-  gdouble x_kernel[6], y_kernel[6];
-  guchar  pixels[36 * src_bpp];
-  gdouble sum, alphasum;
-
-  for (b = 0; b < src_bpp; b++)
-    pixel[b] = 0;
-
-  for (y = y1 - 2, i = 0; y <= y1 + 3; y++)
-    {
-      for (x = x1 - 2; x <= x1 + 3; x++, i++)
-        {
-          x0 = (x < src_width)  ? ABS(x) : 2 * src_width  - x - 1;
-          y0 = (y < src_height) ? ABS(y) : 2 * src_height - y - 1;
-          read_pixel_data_1 (srcTM, x0, y0, pixels + (i * src_bpp));
-        }
-    }
+interpolate_lanczos3 (PixelSurround *surround,
+                      const gint     x0,
+                      const gint     y0,
+                      const gdouble  xfrac,
+                      const gdouble  yfrac,
+                      const gint     bytes,
+                      guchar        *pixel,
+                      const gfloat  *kernel_lookup)
+{
+  gint          stride;
+  const guchar *src = pixel_surround_lock (surround, x0 - 2, y0 - 2, &stride);
+  const gint    x_shift    = (gint) (xfrac * LANCZOS_SPP + 0.5);
+  const gint    y_shift    = (gint) (yfrac * LANCZOS_SPP + 0.5);
+  gint          b, i;
+  gdouble       kx_sum, ky_sum;
+  gdouble       x_kernel[6];
+  gdouble       y_kernel[6];
+  gdouble       sum, alphasum;
 
-  x_shift = (gint) (xfrac * LANCZOS_SPP + 0.5);
-  y_shift = (gint) (yfrac * LANCZOS_SPP + 0.5);
   kx_sum  = ky_sum = 0.0;
 
   for (i = 3; i >= -2; i--)
@@ -1531,168 +1336,143 @@
       y_kernel[2 + i] /= ky_sum;
     }
 
-  switch (src_bpp)
+  switch (bytes)
     {
     case 1:
-      sum      = lanczos3_mul (pixels, x_kernel, y_kernel, 1, 0);
-      pixel[0] = (guchar) CLAMP ((gint) sum, 0, 255);
+      sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 1, 0);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
-      alphasum  = lanczos3_mul (pixels, x_kernel, y_kernel, 2, 1);
+      alphasum  = lanczos3_mul (src, x_kernel, y_kernel, stride, 2, 1);
       if (alphasum > 0)
         {
-          sum       = lanczos3_mul_alpha (pixels, x_kernel, y_kernel, 2, 0);
-          sum      /= alphasum;
-          pixel[0]  = (guchar) CLAMP (sum, 0, 255);
-          pixel[1]  = (guchar) CLAMP (alphasum, 0, 255);
+          sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 2, 0);
+          sum /= alphasum;
+
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
     case 3:
       for (b = 0; b < 3; b++)
         {
-          sum      = lanczos3_mul (pixels, x_kernel, y_kernel, 3, b);
-          pixel[b] = (guchar) CLAMP (sum, 0, 255);
+          sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 3, b);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
     case 4:
-      alphasum = lanczos3_mul (pixels, x_kernel, y_kernel, 4, 3);
+      alphasum = lanczos3_mul (src, x_kernel, y_kernel, stride, 4, 3);
       if (alphasum > 0)
         {
           for (b = 0; b < 3; b++)
             {
-              sum      = lanczos3_mul_alpha (pixels, x_kernel, y_kernel, 4, b);
-              sum     /= alphasum;
-              pixel[b] = (guchar) CLAMP (sum, 0, 255);
+              sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 4, b);
+              sum /= alphasum;
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }
 }
 
 static void
-scale_pr (PixelRegion           *srcPR,
-          PixelRegion           *dstPR,
-          GimpInterpolationType  interpolation)
-{
-  gdouble scalex     = (gdouble) dstPR->w / (gdouble) srcPR->w;
-  gdouble scaley     = (gdouble) dstPR->h / (gdouble) srcPR->h;
-  gint    src_width  = srcPR->w;
-  gint    src_height = srcPR->h;
-  gint    bytes      = srcPR->bytes;
-  guchar *dstPtr     = dstPR->data;
-  gdouble xfrac, yfrac;
-  gint    b, x, sx0, sx1, y, sy0, sy1;
-  guchar  pixel[bytes];
-
-  for (y = 0; y < dstPR->h; y++)
-    {
-      yfrac = (y / scaley);
-      sy0   = (gint) yfrac;
-      sy1   = sy0 + 1;
-      sy1   = (sy1 < src_height) ? ABS(sy1) : 2 * src_height - sy1 - 1;
-
-      yfrac =  yfrac - sy0;
-
-      for (x = 0; x < dstPR->w; x++)
-        {
-          xfrac = (x / scalex);
-          sx0   = (gint) xfrac;
-          sx1   = sx0 + 1;
-          sx1   = (sx1 < src_width) ? ABS(sx1) : 2 * src_width - sx1 - 1;
-          xfrac =  xfrac - sx0;
+scale_region_buffer (PixelRegion *srcPR,
+                     PixelRegion *dstPR)
+{
+  const gdouble   scalex     = (gdouble) dstPR->w / (gdouble) srcPR->w;
+  const gdouble   scaley     = (gdouble) dstPR->h / (gdouble) srcPR->h;
+  const gint      src_width  = srcPR->w;
+  const gint      src_height = srcPR->h;
+  const gint      bytes      = srcPR->bytes;
+  const gint      dst_width  = dstPR->w;
+  const gint      dst_height = dstPR->h;
+  guchar         *pixel      = dstPR->data;
+  gint            x, y;
+
+  for (y = 0; y < dst_height; y++)
+   {
+     gdouble yfrac = (y / scaley);
+     gint    sy0   = (gint) yfrac;
+     gint    sy1   = sy0 + 1;
+
+     sy1   = (sy1 < src_height - 1) ? sy1 : src_height - 1;
+     yfrac =  yfrac - sy0;
+
+      for (x = 0; x < dst_width; x++)
+        {
+          gdouble xfrac = (x / scalex);
+          gint    sx0   = (gint) xfrac;
+          gint    sx1   = sx0 + 1;
 
-          switch (interpolation)
-            {
-            case GIMP_INTERPOLATION_NONE:
-            case GIMP_INTERPOLATION_LINEAR:
-            case GIMP_INTERPOLATION_CUBIC:
-            case GIMP_INTERPOLATION_LANCZOS:
-              if (scalex == 0.5 || scaley == 0.5)
-                {
-                  decimate_average_pr (srcPR,
-                                       sx0, sy0,
-                                       sx1, sy1,
-                                       pixel);
-                }
-              else
-                {
-                  interpolate_bilinear_pr (srcPR,
-                                           sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel);
-                }
-              break;
-            }
+          sx1   = (sx1 < src_width - 1) ? sx1 : src_width - 1;
+          xfrac =  xfrac - sx0;
 
-          for (b = 0; b < bytes; b++, dstPtr++)
-            *dstPtr = pixel[b];
+          interpolate_bilinear_pr (srcPR,
+                                   sx0, sy0, sx1, sy1, xfrac, yfrac,
+                                   pixel);
+          pixel += bytes;
         }
-    }
+   }
 }
 
 static void
-decimate_average_pr (PixelRegion *srcPR,
-                     gint         x0,
-                     gint         y0,
-                     gint         x1,
-                     gint         y1,
-                     guchar      *p)
-{
-  gint    bytes = srcPR->bytes;
-  gint    width = srcPR->w;
-  guchar *p1    = srcPR->data + (y0 * width + x0) * bytes;
-  guchar *p2    = srcPR->data + (y0 * width + x1) * bytes;
-  guchar *p3    = srcPR->data + (y1 * width + x0) * bytes;
-  guchar *p4    = srcPR->data + (y1 * width + x1) * bytes;
-
-  pixel_average (p1, p2, p3, p4, p, bytes);
-}
-
-static void
-interpolate_bilinear_pr (PixelRegion *srcPR,
-                         gint         x0,
-                         gint         y0,
-                         gint         x1,
-                         gint         y1,
-                         gdouble      xfrac,
-                         gdouble      yfrac,
-                         guchar      *p)
-{
-  gint    bytes = srcPR->bytes;
-  gint    width = srcPR->w;
-  guchar *p1    = srcPR->data + (y0 * width + x0) * bytes;
-  guchar *p2    = srcPR->data + (y0 * width + x1) * bytes;
-  guchar *p3    = srcPR->data + (y1 * width + x0) * bytes;
-  guchar *p4    = srcPR->data + (y1 * width + x1) * bytes;
-
-  gint    b;
-  gdouble sum, alphasum;
-
-  for (b = 0; b < bytes; b++)
-    p[b] = 0;
+interpolate_bilinear_pr (PixelRegion    *srcPR,
+                         const gint      x0,
+                         const gint      y0,
+                         const gint      x1,
+                         const gint      y1,
+                         const gdouble   xfrac,
+                         const gdouble   yfrac,
+                         guchar         *pixel)
+{
+  const gint  bytes = srcPR->bytes;
+  const gint  width = srcPR->w;
+  guchar     *p1    = srcPR->data + (y0 * width + x0) * bytes;
+  guchar     *p2    = srcPR->data + (y0 * width + x1) * bytes;
+  guchar     *p3    = srcPR->data + (y1 * width + x0) * bytes;
+  guchar     *p4    = srcPR->data + (y1 * width + x1) * bytes;
+  gint        b;
+  gdouble     sum, alphasum;
 
   switch (bytes)
     {
     case 1:
-      sum      = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      p[0]     = (guchar) CLAMP (sum, 0, 255);
+      sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
+
+      pixel[0] = CLAMP (sum, 0, 255);
       break;
 
     case 2:
       alphasum = weighted_sum (xfrac, yfrac, p1[1], p2[1], p3[1], p4[1]);
       if (alphasum > 0)
         {
-          sum  = weighted_sum (xfrac, yfrac, p1[0] * p1[1], p2[0] * p2[1],
+          sum  = weighted_sum (xfrac, yfrac,
+                               p1[0] * p1[1], p2[0] * p2[1],
                                p3[0] * p3[1], p4[0] * p4[1]);
           sum /= alphasum;
-          p[0] = (guchar) CLAMP (sum, 0, 255);
-          p[1] = (guchar) CLAMP (alphasum, 0, 255);
+
+          pixel[0] = CLAMP (sum, 0, 255);
+          pixel[1] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = 0;
         }
       break;
 
@@ -1700,7 +1480,8 @@
       for (b = 0; b < 3; b++)
         {
           sum  = weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]);
-          p[b] = (guchar) CLAMP (sum, 0, 255);
+
+          pixel[b] = CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1710,13 +1491,19 @@
         {
           for (b = 0; b < 3; b++)
             {
-              sum  = weighted_sum (xfrac, yfrac, p1[b] * p1[3], p2[b] * p2[3],
+              sum  = weighted_sum (xfrac, yfrac,
+                                   p1[b] * p1[3], p2[b] * p2[3],
                                    p3[b] * p3[3], p4[b] * p4[3]);
               sum /= alphasum;
-              p[b] = (guchar) CLAMP (sum, 0, 255);
+
+              pixel[b] = CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = CLAMP (alphasum, 0, 255);
+        }
+      else
+        {
+          pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0;
         }
       break;
     }

Modified: branches/soc-2008-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	Fri Aug 29 18:50:27 2008
@@ -175,6 +175,7 @@
 
           initialized = TRUE;
 
+          core->cur_coords   = coords[0];
           core->start_coords = coords[0];
           core->last_coords  = coords[0];
 
@@ -277,6 +278,7 @@
             {
               initialized = TRUE;
 
+              core->cur_coords   = g_array_index (coords, GimpCoords, 0);
               core->start_coords = g_array_index (coords, GimpCoords, 0);
               core->last_coords  = g_array_index (coords, GimpCoords, 0);
 

Modified: branches/soc-2008-text/app/paint/gimppaintcore.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimppaintcore.c	(original)
+++ branches/soc-2008-text/app/paint/gimppaintcore.c	Fri Aug 29 18:50:27 2008
@@ -36,6 +36,7 @@
 #include "core/gimpimage.h"
 #include "core/gimpimage-undo.h"
 #include "core/gimppickable.h"
+#include "core/gimpprojection.h"
 
 #include "gimppaintcore.h"
 #include "gimppaintcoreundo.h"
@@ -368,11 +369,9 @@
 
   if (core->use_saved_proj)
     {
-      GimpPickable *pickable;
-      TileManager  *tiles;
-
-      pickable = GIMP_PICKABLE (gimp_item_get_image (item)->projection);
-      tiles    = gimp_pickable_get_tiles (pickable);
+      GimpImage      *image      = gimp_item_get_image (item);
+      GimpProjection *projection = gimp_image_get_projection (image);
+      TileManager    *tiles      = gimp_projection_get_tiles (projection);
 
       core->saved_proj_tiles = tile_manager_new (tile_manager_width (tiles),
                                                  tile_manager_height (tiles),
@@ -796,14 +795,15 @@
 
   if (core->use_saved_proj)
     {
-      GimpImage    *image    = gimp_item_get_image (GIMP_ITEM (drawable));
-      GimpPickable *pickable = GIMP_PICKABLE (image->projection);
-      gint          off_x;
-      gint          off_y;
+      GimpImage      *image      = gimp_item_get_image (GIMP_ITEM (drawable));
+      GimpProjection *projection = gimp_image_get_projection (image);
+      gint            off_x;
+      gint            off_y;
 
       gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
 
-      gimp_paint_core_validate_saved_proj_tiles (core, pickable,
+      gimp_paint_core_validate_saved_proj_tiles (core,
+                                                 GIMP_PICKABLE (projection),
                                                  core->canvas_buf->x + off_x,
                                                  core->canvas_buf->y + off_y,
                                                  core->canvas_buf->width,
@@ -1087,9 +1087,11 @@
                */
               dest_tile = tile_manager_get_tile (core->saved_proj_tiles,
                                                  j, i, TRUE, TRUE);
+
               memcpy (tile_data_pointer (dest_tile, 0, 0),
                       tile_data_pointer (src_tile, 0, 0),
                       tile_size (src_tile));
+
               tile_release (dest_tile, TRUE);
               tile_release (src_tile, FALSE);
             }

Modified: branches/soc-2008-text/app/paint/gimpperspectiveclone.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimpperspectiveclone.c	(original)
+++ branches/soc-2008-text/app/paint/gimpperspectiveclone.c	Fri Aug 29 18:50:27 2008
@@ -76,6 +76,9 @@
                                                    gint             *paint_area_height,
                                                    PixelRegion      *srcPR);
 
+static void     gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
+                                                   GimpMatrix3          *matrix);
+
 
 G_DEFINE_TYPE (GimpPerspectiveClone, gimp_perspective_clone,
                GIMP_TYPE_CLONE)
@@ -408,6 +411,35 @@
   return TRUE;
 }
 
+
+/*  public functions  */
+
+void
+gimp_perspective_clone_set_transform (GimpPerspectiveClone *clone,
+                                      GimpMatrix3          *transform)
+{
+  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
+  g_return_if_fail (transform != NULL);
+
+  clone->transform = *transform;
+
+  clone->transform_inv = clone->transform;
+  gimp_matrix3_invert (&clone->transform_inv);
+
+#if 0
+  g_printerr ("%f\t%f\t%f\n%f\t%f\t%f\n%f\t%f\t%f\n\n",
+              clone->transform.coeff[0][0],
+              clone->transform.coeff[0][1],
+              clone->transform.coeff[0][2],
+              clone->transform.coeff[1][0],
+              clone->transform.coeff[1][1],
+              clone->transform.coeff[1][2],
+              clone->transform.coeff[2][0],
+              clone->transform.coeff[2][1],
+              clone->transform.coeff[2][2]);
+#endif
+}
+
 void
 gimp_perspective_clone_get_source_point (GimpPerspectiveClone *clone,
                                          gdouble               x,
@@ -417,6 +449,10 @@
 {
   gdouble temp_x, temp_y;
 
+  g_return_if_fail (GIMP_IS_PERSPECTIVE_CLONE (clone));
+  g_return_if_fail (newx != NULL);
+  g_return_if_fail (newy != NULL);
+
   gimp_matrix3_transform_point (&clone->transform_inv,
                                 x, y, &temp_x, &temp_y);
 
@@ -440,7 +476,10 @@
                                 temp_x, temp_y, newx, newy);
 }
 
-void
+
+/*  private functions  */
+
+static void
 gimp_perspective_clone_get_matrix (GimpPerspectiveClone *clone,
                                    GimpMatrix3          *matrix)
 {

Modified: branches/soc-2008-text/app/paint/gimpperspectiveclone.h
==============================================================================
--- branches/soc-2008-text/app/paint/gimpperspectiveclone.h	(original)
+++ branches/soc-2008-text/app/paint/gimpperspectiveclone.h	Fri Aug 29 18:50:27 2008
@@ -56,18 +56,18 @@
 };
 
 
-void    gimp_perspective_clone_register   (Gimp                      *gimp,
-                                           GimpPaintRegisterCallback  callback);
+void    gimp_perspective_clone_register      (Gimp                      *gimp,
+                                              GimpPaintRegisterCallback  callback);
 
 GType   gimp_perspective_clone_get_type         (void) G_GNUC_CONST;
 
+void    gimp_perspective_clone_set_transform    (GimpPerspectiveClone   *clone,
+                                                 GimpMatrix3            *transform);
 void    gimp_perspective_clone_get_source_point (GimpPerspectiveClone   *clone,
                                                  gdouble                 x,
                                                  gdouble                 y,
-                                                 gdouble                 *newx,
-                                                 gdouble                 *newy);
-void    gimp_perspective_clone_get_matrix       (GimpPerspectiveClone    *clone,
-                                                 GimpMatrix3             *matrix);
+                                                 gdouble                *newx,
+                                                 gdouble                *newy);
 
 
 #endif  /*  __GIMP_PERSPECTIVE_CLONE_H__  */

Modified: branches/soc-2008-text/app/paint/gimpsourcecore.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimpsourcecore.c	(original)
+++ branches/soc-2008-text/app/paint/gimpsourcecore.c	Fri Aug 29 18:50:27 2008
@@ -368,7 +368,7 @@
           GimpImage *src_image = gimp_pickable_get_image (src_pickable);
           gint       off_x, off_y;
 
-          src_pickable = GIMP_PICKABLE (src_image->projection);
+          src_pickable = GIMP_PICKABLE (gimp_image_get_projection (src_image));
 
           gimp_item_offsets (GIMP_ITEM (source_core->src_drawable),
                              &off_x, &off_y);

Modified: branches/soc-2008-text/app/pdb/brush-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/brush-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/brush-cmds.c	Fri Aug 29 18:50:27 2008
@@ -65,7 +65,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -107,7 +108,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], copy_name);
@@ -140,7 +142,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], generated);
@@ -178,7 +181,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -211,7 +215,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -239,7 +244,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], editable);
@@ -280,7 +286,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -341,7 +348,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -383,7 +391,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], spacing);
@@ -416,7 +425,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -444,7 +454,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], shape);
@@ -483,7 +494,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], shape_out);
@@ -516,7 +528,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], radius);
@@ -555,7 +568,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], radius_out);
@@ -588,7 +602,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], spikes);
@@ -627,7 +642,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], spikes_out);
@@ -660,7 +676,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], hardness);
@@ -699,7 +716,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], hardness_out);
@@ -732,7 +750,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], aspect_ratio);
@@ -771,7 +790,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], aspect_ratio_out);
@@ -804,7 +824,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], angle);
@@ -843,7 +864,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], angle_out);

Modified: branches/soc-2008-text/app/pdb/brush-select-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/brush-select-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/brush-select-cmds.c	Fri Aug 29 18:50:27 2008
@@ -70,7 +70,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -95,7 +96,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -132,7 +134,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/brushes-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/brushes-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/brushes-cmds.c	Fri Aug 29 18:50:27 2008
@@ -50,7 +50,7 @@
 {
   gimp_data_factory_data_refresh (gimp->brush_factory);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -75,7 +75,8 @@
                                                            filter, &num_brushes);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -113,7 +114,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -145,7 +147,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], spacing);
@@ -171,7 +174,8 @@
       gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -220,7 +224,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/buffer-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/buffer-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/buffer-cmds.c	Fri Aug 29 18:50:27 2008
@@ -60,7 +60,8 @@
                                                             filter, &num_buffers);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -101,7 +102,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], real_name);
@@ -132,7 +134,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -160,7 +163,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], width);
@@ -193,7 +197,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], height);
@@ -226,7 +231,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], bytes);
@@ -259,7 +265,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], image_type);

Modified: branches/soc-2008-text/app/pdb/channel-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/channel-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/channel-cmds.c	Fri Aug 29 18:50:27 2008
@@ -75,7 +75,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], channel);
@@ -114,7 +115,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], channel);
@@ -146,7 +148,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], channel_copy);
@@ -181,7 +184,8 @@
       gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -204,7 +208,8 @@
       show_masked = gimp_channel_get_show_masked (channel);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], show_masked);
@@ -232,7 +237,8 @@
       gimp_channel_set_show_masked (channel, show_masked);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -255,7 +261,8 @@
       opacity = gimp_channel_get_opacity (channel) * 100;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], opacity);
@@ -283,7 +290,8 @@
       gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -307,7 +315,8 @@
       gimp_rgb_set_alpha (&color, 1.0);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &color);
@@ -338,7 +347,8 @@
       gimp_channel_set_color (channel, &rgb_color, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/color-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/color-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/color-cmds.c	Fri Aug 29 18:50:27 2008
@@ -76,7 +76,8 @@
                                            brightness, contrast);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -122,7 +123,8 @@
                               low_output, high_output);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -148,7 +150,8 @@
         gimp_drawable_levels_stretch (drawable, progress);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -174,7 +177,8 @@
         gimp_drawable_levels_stretch (drawable, progress);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -202,7 +206,8 @@
         gimp_drawable_posterize (drawable, progress, levels);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -228,7 +233,8 @@
         gimp_drawable_desaturate (drawable, progress, GIMP_DESATURATE_LIGHTNESS);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -256,7 +262,8 @@
         gimp_drawable_desaturate (drawable, progress, desaturate_mode);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -284,7 +291,8 @@
         gimp_drawable_equalize (drawable, mask_only);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -310,7 +318,8 @@
         gimp_drawable_invert (drawable, progress);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -347,7 +356,8 @@
                                      channel, control_pts, num_points);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -384,7 +394,8 @@
                                        channel, curve, num_bytes);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -423,7 +434,8 @@
                                      preserve_lum);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -456,7 +468,8 @@
                                 hue, saturation, lightness);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -516,7 +529,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -563,7 +577,8 @@
                                       hue_range, hue_offset, saturation, lightness);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -595,7 +610,8 @@
                                  low_threshold, high_threshold);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/context-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/context-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/context-cmds.c	Fri Aug 29 18:50:27 2008
@@ -57,7 +57,8 @@
   else
     success = FALSE;
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -76,7 +77,8 @@
   else
     success = FALSE;
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -94,7 +96,7 @@
   paint_methods = gimp_container_get_name_array (gimp->paint_info_list,
                                                  &num_paint_methods);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
   g_value_set_int (&return_vals->values[1], num_paint_methods);
   gimp_value_take_stringarray (&return_vals->values[2], paint_methods, num_paint_methods);
@@ -121,7 +123,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -152,7 +155,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -169,7 +173,7 @@
   gimp_context_get_foreground (context, &foreground);
   gimp_rgb_set_alpha (&foreground, 1.0);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   gimp_value_set_rgb (&return_vals->values[1], &foreground);
 
   return return_vals;
@@ -194,7 +198,8 @@
       gimp_context_set_foreground (context, &foreground);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -211,7 +216,7 @@
   gimp_context_get_background (context, &background);
   gimp_rgb_set_alpha (&background, 1.0);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   gimp_value_set_rgb (&return_vals->values[1], &background);
 
   return return_vals;
@@ -236,7 +241,8 @@
       gimp_context_set_background (context, &background);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -249,7 +255,7 @@
 {
   gimp_context_set_default_colors (context);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -262,7 +268,7 @@
 {
   gimp_context_swap_colors (context);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -278,7 +284,7 @@
 
   opacity = gimp_context_get_opacity (context) * 100.0;
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_double (&return_vals->values[1], opacity);
 
   return return_vals;
@@ -302,7 +308,8 @@
       gimp_context_set_opacity (context, opacity / 100.0);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -318,7 +325,7 @@
 
   paint_mode = gimp_context_get_paint_mode (context);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_enum (&return_vals->values[1], paint_mode);
 
   return return_vals;
@@ -342,7 +349,8 @@
       gimp_context_set_paint_mode (context, paint_mode);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -364,7 +372,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -395,7 +404,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -417,7 +427,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -448,7 +459,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -470,7 +482,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -501,7 +514,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -523,7 +537,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -554,7 +569,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -576,7 +592,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -607,7 +624,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/convert-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/convert-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/convert-cmds.c	Fri Aug 29 18:50:27 2008
@@ -65,7 +65,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -95,7 +96,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -168,7 +170,8 @@
                                       NULL, error);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -195,7 +198,8 @@
       gimp_image_convert_set_dither_matrix (matrix, width, height);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/display-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/display-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/display-cmds.c	Fri Aug 29 18:50:27 2008
@@ -50,7 +50,7 @@
 
   valid = (display != NULL);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_boolean (&return_vals->values[1], valid);
 
   return return_vals;
@@ -89,7 +89,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_display (&return_vals->values[1], display);
@@ -115,7 +116,8 @@
       gimp_delete_display (gimp, display);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -138,7 +140,8 @@
       window = (gint32) gimp_get_display_window (gimp, display);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], window);
@@ -156,7 +159,7 @@
 {
   gimp_container_foreach (gimp->images, (GFunc) gimp_image_flush, NULL);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -190,7 +193,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

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	Fri Aug 29 18:50:27 2008
@@ -68,7 +68,7 @@
   valid = (GIMP_IS_DRAWABLE (drawable) &&
            ! gimp_item_is_removed (GIMP_ITEM (drawable)));
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_boolean (&return_vals->values[1], valid);
 
   return return_vals;
@@ -94,7 +94,8 @@
       layer = GIMP_IS_LAYER (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], layer);
@@ -122,7 +123,8 @@
       text_layer = gimp_drawable_is_text_layer (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], text_layer);
@@ -150,7 +152,8 @@
       layer_mask = GIMP_IS_LAYER_MASK (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], layer_mask);
@@ -178,7 +181,8 @@
       channel = GIMP_IS_CHANNEL (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], channel);
@@ -206,7 +210,8 @@
       type = gimp_drawable_type (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], type);
@@ -234,7 +239,8 @@
       type_with_alpha = gimp_drawable_type_with_alpha (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], type_with_alpha);
@@ -262,7 +268,8 @@
       has_alpha = gimp_drawable_has_alpha (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], has_alpha);
@@ -290,7 +297,8 @@
       is_rgb = gimp_drawable_is_rgb (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], is_rgb);
@@ -318,7 +326,8 @@
       is_gray = gimp_drawable_is_gray (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], is_gray);
@@ -346,7 +355,8 @@
       is_indexed = gimp_drawable_is_indexed (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], is_indexed);
@@ -374,7 +384,8 @@
       bpp = gimp_drawable_bytes (drawable);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], bpp);
@@ -402,7 +413,8 @@
       width = gimp_item_width (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], width);
@@ -430,7 +442,8 @@
       height = gimp_item_height (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], height);
@@ -459,7 +472,8 @@
       gimp_item_offsets (GIMP_ITEM (drawable), &offset_x, &offset_y);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -494,7 +508,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -517,7 +532,8 @@
       image = gimp_item_get_image (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -546,7 +562,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -569,7 +586,8 @@
       name = g_strdup (gimp_object_get_name (GIMP_OBJECT (drawable)));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -597,7 +615,8 @@
       success = gimp_item_rename (GIMP_ITEM (drawable), name, error);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -620,7 +639,8 @@
       visible = gimp_item_get_visible (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], visible);
@@ -648,7 +668,8 @@
       gimp_item_set_visible (GIMP_ITEM (drawable), visible, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -671,7 +692,8 @@
       linked = gimp_item_get_linked (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], linked);
@@ -699,7 +721,8 @@
       gimp_item_set_linked (GIMP_ITEM (drawable), linked, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -722,7 +745,8 @@
       tattoo = gimp_item_get_tattoo (GIMP_ITEM (drawable));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_uint (&return_vals->values[1], tattoo);
@@ -750,7 +774,8 @@
       gimp_item_set_tattoo (GIMP_ITEM (drawable), tattoo);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -777,7 +802,8 @@
       non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -815,7 +841,8 @@
       non_empty = gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -859,7 +886,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -884,7 +912,8 @@
       gimp_drawable_free_shadow_tiles (drawable);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -913,7 +942,8 @@
       gimp_drawable_update (drawable, x, y, width, height);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -965,7 +995,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1024,7 +1055,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1047,7 +1079,8 @@
       gimp_drawable_fill_by_type (drawable, context, (GimpFillType) fill_type);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1080,7 +1113,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1147,7 +1181,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1229,7 +1264,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1268,7 +1304,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/drawable-transform-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/drawable-transform-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/drawable-transform-cmds.c	Fri Aug 29 18:50:27 2008
@@ -81,7 +81,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -157,7 +158,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -231,7 +233,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -317,7 +320,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -401,7 +405,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -449,7 +454,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -529,7 +535,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -607,7 +614,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -684,7 +692,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -759,7 +768,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -832,7 +842,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -903,7 +914,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -987,7 +999,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -1069,7 +1082,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -1161,7 +1175,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -1251,7 +1266,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);

Modified: branches/soc-2008-text/app/pdb/edit-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/edit-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/edit-cmds.c	Fri Aug 29 18:50:27 2008
@@ -82,7 +82,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], non_empty);
@@ -125,7 +126,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], non_empty);
@@ -162,7 +164,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], non_empty);
@@ -203,7 +206,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], floating_sel);
@@ -235,7 +239,8 @@
       image = NULL;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -285,7 +290,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], real_name);
@@ -335,7 +341,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], real_name);
@@ -379,7 +386,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], real_name);
@@ -422,7 +430,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], floating_sel);
@@ -460,7 +469,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -493,7 +503,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -524,7 +535,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -575,7 +587,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -630,7 +643,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -711,7 +725,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -746,7 +761,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -783,7 +799,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/fileops-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/fileops-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/fileops-cmds.c	Fri Aug 29 18:50:27 2008
@@ -66,7 +66,8 @@
                                     error);
 
   if (! uri)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   file_proc =
     file_procedure_find (gimp->plug_in_manager->load_procs, uri, error);
@@ -74,7 +75,8 @@
   g_free (uri);
 
   if (! file_proc)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   proc = GIMP_PROCEDURE (file_proc);
 
@@ -153,7 +155,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -217,7 +220,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -248,7 +252,8 @@
                                     error);
 
   if (! uri)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   file_proc =
     file_procedure_find (gimp->plug_in_manager->save_procs, uri, error);
@@ -256,7 +261,8 @@
   g_free (uri);
 
   if (! file_proc)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   proc = GIMP_PROCEDURE (file_proc);
 
@@ -316,7 +322,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -349,7 +356,8 @@
       success = file_utils_save_thumbnail (image, filename);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -372,7 +380,8 @@
       name = gimp_get_temp_filename (gimp, extension);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -410,7 +419,8 @@
       g_free (canonical);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -441,7 +451,8 @@
       g_free (canonical);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -472,7 +483,8 @@
       g_free (canonical);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -500,7 +512,8 @@
       g_free (canonical);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -530,7 +543,8 @@
       g_free (canon_thumb);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/floating-sel-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/floating-sel-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/floating-sel-cmds.c	Fri Aug 29 18:50:27 2008
@@ -66,7 +66,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -97,7 +98,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -128,7 +130,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -154,7 +157,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -187,7 +191,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -220,7 +225,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/font-select-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/font-select-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/font-select-cmds.c	Fri Aug 29 18:50:27 2008
@@ -59,7 +59,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -83,7 +84,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -110,7 +112,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/fonts-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/fonts-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/fonts-cmds.c	Fri Aug 29 18:50:27 2008
@@ -45,7 +45,7 @@
 {
   gimp_fonts_load (gimp);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -70,7 +70,8 @@
                                                           filter, &num_fonts);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/gimppdb.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gimppdb.c	(original)
+++ branches/soc-2008-text/app/pdb/gimppdb.c	Fri Aug 29 18:50:27 2008
@@ -302,12 +302,12 @@
 
   if (list == NULL)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_PROCEDURE_NOT_FOUND,
-                   _("PDB calling error:\n"
-                     "Procedure '%s' not found"), name);
+      GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
+                                       GIMP_PDB_PROCEDURE_NOT_FOUND,
+                                       _("Procedure '%s' not found"), name);
 
-      return_vals = gimp_procedure_get_return_values (NULL, FALSE);
-      g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
+      return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
+      g_propagate_error (error, pdb_error);
 
       return return_vals;
     }
@@ -370,14 +370,14 @@
 
   procedure = gimp_pdb_lookup_procedure (pdb, name);
 
-  if (procedure == NULL)
+  if (! procedure)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_PROCEDURE_NOT_FOUND,
-                    _("PDB calling error:\n"
-                      "Procedure '%s' not found"), name);
+      GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
+                                       GIMP_PDB_PROCEDURE_NOT_FOUND,
+                                       _("Procedure '%s' not found"), name);
 
-      return_vals = gimp_procedure_get_return_values (NULL, FALSE);
-      g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
+      return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
+      g_propagate_error (error, pdb_error);
 
       return return_vals;
     }
@@ -401,19 +401,22 @@
 
       if (arg_type != G_VALUE_TYPE (value))
         {
+          GError      *pdb_error;
           const gchar *expected = g_type_name (G_VALUE_TYPE (value));
           const gchar *got      = g_type_name (arg_type);
 
           g_value_array_free (args);
 
-          g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
-                       _("PDB calling error for procedure '%s':\n"
-                         "Argument #%d type mismatch (expected %s, got %s)"),
-                       gimp_object_get_name (GIMP_OBJECT (procedure)),
-                       i + 1, expected, got);
-
-          return_vals = gimp_procedure_get_return_values (procedure, FALSE);
-          g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
+          pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   _("Procedure '%s' has been called with a "
+                                     "wrong type for argument #%d. "
+                                     "Expected %s, got %s."),
+                                   gimp_object_get_name (GIMP_OBJECT (procedure)),
+                                   i + 1, expected, got);
+
+          return_vals = gimp_procedure_get_return_values (procedure,
+                                                          FALSE, pdb_error);
+          g_propagate_error (error, pdb_error);
 
           va_end (va_args);
 
@@ -424,13 +427,17 @@
 
       if (error_msg)
         {
+          GError *pdb_error = g_error_new_literal (GIMP_PDB_ERROR,
+                                                   GIMP_PDB_INTERNAL_ERROR,
+                                                   error_msg);
           g_warning ("%s: %s", G_STRFUNC, error_msg);
           g_free (error_msg);
 
           g_value_array_free (args);
 
-          return_vals = gimp_procedure_get_return_values (procedure, FALSE);
-          g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
+          return_vals = gimp_procedure_get_return_values (procedure,
+                                                          FALSE, pdb_error);
+          g_propagate_error (error, pdb_error);
 
           va_end (va_args);
 

Modified: branches/soc-2008-text/app/pdb/gimppdberror.h
==============================================================================
--- branches/soc-2008-text/app/pdb/gimppdberror.h	(original)
+++ branches/soc-2008-text/app/pdb/gimppdberror.h	Fri Aug 29 18:50:27 2008
@@ -23,7 +23,10 @@
 typedef enum
 {
   GIMP_PDB_PROCEDURE_NOT_FOUND,
-  GIMP_PDB_INVALID_ARGUMENT
+  GIMP_PDB_INVALID_ARGUMENT,
+  GIMP_PDB_INVALID_RETURN_VALUE,
+  GIMP_PDB_CANCELLED,
+  GIMP_PDB_INTERNAL_ERROR
 } GimpPdbErrorCode;
 
 

Modified: branches/soc-2008-text/app/pdb/gimpprocedure.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gimpprocedure.c	(original)
+++ branches/soc-2008-text/app/pdb/gimpprocedure.c	Fri Aug 29 18:50:27 2008
@@ -303,7 +303,8 @@
                         GValueArray    *args,
                         GError        **error)
 {
-  GValueArray *return_vals = NULL;
+  GValueArray *return_vals;
+  GError      *pdb_error = NULL;
 
   g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), NULL);
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
@@ -314,10 +315,11 @@
 
   if (! gimp_procedure_validate_args (procedure,
                                       procedure->args, procedure->num_args,
-                                      args, FALSE, error))
+                                      args, FALSE, &pdb_error))
     {
-      return_vals = gimp_procedure_get_return_values (procedure, FALSE);
-      g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
+      return_vals = gimp_procedure_get_return_values (procedure, FALSE,
+                                                      pdb_error);
+      g_propagate_error (error, pdb_error);
 
       return return_vals;
     }
@@ -330,13 +332,41 @@
                                                                args,
                                                                error);
 
-  /*  If there are no return arguments, assume an execution error  */
-  if (! return_vals)
+
+  if (return_vals)
+    {
+      if (g_value_get_enum (&return_vals->values[0]) != GIMP_PDB_SUCCESS)
+        {
+          /*  If the error has not already been set, construct one
+           *  from the error message that is optionally passed with
+           *  the return values.
+           */
+          if (error && *error == NULL)
+            {
+              if (return_vals->n_values > 1 &&
+                  G_VALUE_HOLDS_STRING (&return_vals->values[1]))
+                {
+                  g_set_error (error, 0, 0,
+                               g_value_get_string (&return_vals->values[1]));
+                }
+            }
+        }
+    }
+  else
     {
-      return_vals = gimp_procedure_get_return_values (procedure, FALSE);
-      g_value_set_enum (return_vals->values, GIMP_PDB_EXECUTION_ERROR);
+      g_warning ("%s: no return values, shouldn't happen", G_STRFUNC);
+
+      pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                               _("Procedure '%s' returned no return values"),
+                               gimp_object_get_name (GIMP_OBJECT (procedure)));
+
+      return_vals = gimp_procedure_get_return_values (procedure, FALSE,
+                                                      pdb_error);
+      if (error && *error == NULL)
+        g_propagate_error (error, pdb_error);
+      else
+        g_error_free (pdb_error);
 
-      return return_vals;
     }
 
   return return_vals;
@@ -392,36 +422,74 @@
 
 GValueArray *
 gimp_procedure_get_return_values (GimpProcedure *procedure,
-                                  gboolean       success)
+                                  gboolean       success,
+                                  const GError  *error)
 {
   GValueArray *args;
   GValue       value = { 0, };
-  gint         n_args;
   gint         i;
 
-  g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure) ||
-                        success == FALSE, NULL);
+  g_return_val_if_fail (success == FALSE || GIMP_IS_PROCEDURE (procedure),
+                        NULL);
 
-  if (procedure)
-    n_args = procedure->num_values + 1;
+  if (success)
+    {
+      args = g_value_array_new (procedure->num_values + 1);
+
+      g_value_init (&value, GIMP_TYPE_PDB_STATUS_TYPE);
+      g_value_set_enum (&value, GIMP_PDB_SUCCESS);
+      g_value_array_append (args, &value);
+      g_value_unset (&value);
+
+      for (i = 0; i < procedure->num_values; i++)
+        {
+          g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (procedure->values[i]));
+          g_value_array_append (args, &value);
+          g_value_unset (&value);
+        }
+    }
   else
-    n_args = 1;
+    {
+      args = g_value_array_new ((error && error->message) ? 2 : 1);
+
+      g_value_init (&value, GIMP_TYPE_PDB_STATUS_TYPE);
 
-  args = g_value_array_new (n_args);
+      /*  errors in the GIMP_PDB_ERROR domain are calling errors  */
+      if (error && error->domain == GIMP_PDB_ERROR)
+        {
+          switch ((GimpPdbErrorCode) error->code)
+            {
+            case GIMP_PDB_PROCEDURE_NOT_FOUND:
+            case GIMP_PDB_INVALID_ARGUMENT:
+            case GIMP_PDB_INVALID_RETURN_VALUE:
+            case GIMP_PDB_INTERNAL_ERROR:
+              g_value_set_enum (&value, GIMP_PDB_CALLING_ERROR);
+              break;
+
+            case GIMP_PDB_CANCELLED:
+              g_value_set_enum (&value, GIMP_PDB_CANCEL);
+              break;
 
-  g_value_init (&value, GIMP_TYPE_PDB_STATUS_TYPE);
-  g_value_set_enum (&value,
-                    success ? GIMP_PDB_SUCCESS : GIMP_PDB_EXECUTION_ERROR);
-  g_value_array_append (args, &value);
-  g_value_unset (&value);
-
-  if (procedure)
-    for (i = 0; i < procedure->num_values; i++)
-      {
-        g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (procedure->values[i]));
-        g_value_array_append (args, &value);
-        g_value_unset (&value);
-      }
+            default:
+              g_assert_not_reached ();
+            }
+        }
+      else
+        {
+          g_value_set_enum (&value, GIMP_PDB_EXECUTION_ERROR);
+        }
+
+      g_value_array_append (args, &value);
+      g_value_unset (&value);
+
+      if (error && error->message)
+        {
+          g_value_init (&value, G_TYPE_STRING);
+          g_value_set_string (&value, error->message);
+          g_value_array_append (args, &value);
+          g_value_unset (&value);
+        }
+    }
 
   return args;
 }
@@ -511,7 +579,8 @@
         {
           if (return_vals)
             {
-              g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+              g_set_error (error,
+                           GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
                            _("Procedure '%s' returned a wrong value type "
                              "for return value '%s' (#%d). "
                              "Expected %s, got %s."),
@@ -522,7 +591,8 @@
             }
           else
             {
-              g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+              g_set_error (error,
+                           GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
                            _("Procedure '%s' has been called with a "
                              "wrong value type for argument '%s' (#%d). "
                              "Expected %s, got %s."),
@@ -554,7 +624,7 @@
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -582,7 +652,7 @@
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -614,7 +684,7 @@
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned "
                                      "'%s' as return value '%s' "
                                      "(#%d, type %s). "

Modified: branches/soc-2008-text/app/pdb/gimpprocedure.h
==============================================================================
--- branches/soc-2008-text/app/pdb/gimpprocedure.h	(original)
+++ branches/soc-2008-text/app/pdb/gimpprocedure.h	Fri Aug 29 18:50:27 2008
@@ -121,7 +121,8 @@
 
 GValueArray   * gimp_procedure_get_arguments      (GimpProcedure    *procedure);
 GValueArray   * gimp_procedure_get_return_values  (GimpProcedure    *procedure,
-                                                   gboolean          success);
+                                                   gboolean          success,
+                                                   const GError     *error);
 
 GValueArray   * gimp_procedure_execute            (GimpProcedure    *procedure,
                                                    Gimp             *gimp,

Modified: branches/soc-2008-text/app/pdb/gimprc-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gimprc-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/gimprc-cmds.c	Fri Aug 29 18:50:27 2008
@@ -70,7 +70,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], value);
@@ -104,7 +105,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -120,7 +122,7 @@
 
   comment = g_strdup (gimp->config->default_image->comment);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], comment);
 
   return return_vals;
@@ -139,7 +141,7 @@
 
   unit_id = gimp_get_default_unit ();
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_int (&return_vals->values[1], unit_id);
 
   return return_vals;
@@ -160,7 +162,7 @@
   xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres;
   yres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_yres;
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
   g_value_set_double (&return_vals->values[1], xres);
   g_value_set_double (&return_vals->values[2], yres);
@@ -181,7 +183,7 @@
 
   theme_dir = g_strdup (gimp_get_theme_dir (gimp));
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], theme_dir);
 
   return return_vals;
@@ -200,7 +202,7 @@
 
   config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], config);
 
   return return_vals;
@@ -219,7 +221,7 @@
 
   load_inhibit = g_strdup (gimp_module_db_get_load_inhibit (gimp->module_db));
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], load_inhibit);
 
   return return_vals;

Modified: branches/soc-2008-text/app/pdb/gradient-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gradient-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/gradient-cmds.c	Fri Aug 29 18:50:27 2008
@@ -114,7 +114,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -156,7 +157,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], copy_name);
@@ -189,7 +191,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], editable);
@@ -227,7 +230,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -260,7 +264,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -294,7 +299,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], num_segments);
@@ -356,7 +362,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -422,7 +429,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -467,7 +475,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -513,7 +522,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -550,7 +560,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -596,7 +607,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -631,7 +643,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], pos);
@@ -673,7 +686,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], final_pos);
@@ -713,7 +727,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], pos);
@@ -756,7 +771,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], final_pos);
@@ -796,7 +812,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], pos);
@@ -839,7 +856,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], final_pos);
@@ -879,7 +897,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], blend_func);
@@ -919,7 +938,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], coloring_type);
@@ -965,7 +985,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1006,7 +1027,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1045,7 +1067,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1087,7 +1110,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1126,7 +1150,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1168,7 +1193,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1207,7 +1233,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1245,7 +1272,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1276,6 +1304,9 @@
 
       if (start_seg)
         {
+          if (!end_seg)
+            end_seg = gimp_gradient_segment_get_last (start_seg);
+
           gimp_gradient_segment_range_blend (gradient,
                                              start_seg, end_seg,
                                              &start_seg->left_color,
@@ -1286,7 +1317,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1317,6 +1349,9 @@
 
       if (start_seg)
         {
+          if (!end_seg)
+            end_seg = gimp_gradient_segment_get_last (start_seg);
+
           gimp_gradient_segment_range_blend (gradient,
                                              start_seg, end_seg,
                                              &start_seg->left_color,
@@ -1327,7 +1362,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1373,7 +1409,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], final_delta);

Modified: branches/soc-2008-text/app/pdb/gradient-select-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gradient-select-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/gradient-select-cmds.c	Fri Aug 29 18:50:27 2008
@@ -68,7 +68,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -93,7 +94,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -121,7 +123,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/gradients-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/gradients-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/gradients-cmds.c	Fri Aug 29 18:50:27 2008
@@ -49,7 +49,7 @@
 {
   gimp_data_factory_data_refresh (gimp->gradient_factory);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -74,7 +74,8 @@
                                                               filter, &num_gradients);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -134,7 +135,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -192,7 +194,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -269,7 +272,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/grid-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/grid-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/grid-cmds.c	Fri Aug 29 18:50:27 2008
@@ -66,7 +66,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -107,7 +108,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -139,7 +141,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -180,7 +183,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -208,7 +212,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &fgcolor);
@@ -241,7 +246,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -269,7 +275,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &bgcolor);
@@ -302,7 +309,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -330,7 +338,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], style);
@@ -363,7 +372,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/guides-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/guides-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/guides-cmds.c	Fri Aug 29 18:50:27 2008
@@ -65,7 +65,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_uint (&return_vals->values[1], guide);
@@ -103,7 +104,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_uint (&return_vals->values[1], guide);
@@ -136,7 +138,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -164,7 +167,8 @@
         next_guide = gimp_guide_get_ID (g);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_uint (&return_vals->values[1], next_guide);
@@ -199,7 +203,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], orientation);
@@ -234,7 +239,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], position);

Modified: branches/soc-2008-text/app/pdb/help-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/help-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/help-cmds.c	Fri Aug 29 18:50:27 2008
@@ -63,7 +63,8 @@
       gimp_help (gimp, progress, help_domain, help_id);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

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	Fri Aug 29 18:50:27 2008
@@ -87,7 +87,7 @@
 
   valid = GIMP_IS_IMAGE (image);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_boolean (&return_vals->values[1], valid);
 
   return return_vals;
@@ -119,7 +119,7 @@
         image_ids[i] = gimp_image_get_ID (GIMP_IMAGE (list->data));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
   g_value_set_int (&return_vals->values[1], num_images);
   gimp_value_take_int32array (&return_vals->values[2], image_ids, num_images);
@@ -154,7 +154,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -185,7 +186,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], new_image);
@@ -214,7 +216,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -237,7 +240,8 @@
       base_type = gimp_image_base_type (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], base_type);
@@ -265,7 +269,8 @@
       width = gimp_image_get_width (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], width);
@@ -293,7 +298,8 @@
       height = gimp_image_get_height (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], height);
@@ -318,7 +324,8 @@
     {
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -348,7 +355,8 @@
                          new_width, new_height, offx, offy, NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -369,7 +377,8 @@
       gimp_image_resize_to_layers (image, context, NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -396,7 +405,8 @@
                         NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -433,7 +443,8 @@
                          FALSE, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -456,7 +467,8 @@
       gimp_image_flip (image, context, flip_type, NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -479,7 +491,8 @@
       gimp_image_rotate (image, context, rotate_type, NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -515,7 +528,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -559,7 +573,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -603,7 +618,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -634,7 +650,8 @@
       drawable = gimp_image_get_active_drawable (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -660,7 +677,8 @@
       gimp_image_unset_active_channel (image);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -683,7 +701,8 @@
       floating_sel = gimp_image_floating_sel (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], floating_sel);
@@ -716,7 +735,8 @@
         drawable = NULL;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -766,7 +786,7 @@
       if (success)
         {
           if (sample_merged)
-            gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+            gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
           else
             gimp_pickable_flush (GIMP_PICKABLE (drawable));
 
@@ -782,7 +802,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &color);
@@ -814,7 +835,8 @@
       layer = gimp_image_pick_correlate_layer (image, x, y);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -854,7 +876,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -877,7 +900,8 @@
       gimp_image_remove_layer (image, layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -905,7 +929,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], position);
@@ -933,7 +958,8 @@
       success = gimp_image_raise_layer (image, layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -956,7 +982,8 @@
       success = gimp_image_lower_layer (image, layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -979,7 +1006,8 @@
       success = gimp_image_raise_layer_to_top (image, layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1002,7 +1030,8 @@
       success = gimp_image_lower_layer_to_bottom (image, layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1034,7 +1063,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1057,7 +1087,8 @@
       gimp_image_remove_channel (image, channel);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1085,7 +1116,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], position);
@@ -1113,7 +1145,8 @@
       success = gimp_image_raise_channel (image, channel);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1136,7 +1169,8 @@
       success = gimp_image_lower_channel (image, channel);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1168,7 +1202,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1191,7 +1226,8 @@
       gimp_image_remove_vectors (image, vectors);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1219,7 +1255,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], position);
@@ -1247,7 +1284,8 @@
       success = gimp_image_raise_vectors (image, vectors);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1270,7 +1308,8 @@
       success = gimp_image_lower_vectors (image, vectors);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1293,7 +1332,8 @@
       success = gimp_image_raise_vectors_to_top (image, vectors);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1316,7 +1356,8 @@
       success = gimp_image_lower_vectors_to_bottom (image, vectors);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1342,7 +1383,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -1375,7 +1417,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -1410,7 +1453,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -1441,7 +1485,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1466,7 +1511,8 @@
       gimp_layer_apply_mask (layer, mode, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1491,7 +1537,8 @@
       colormap = g_memdup (gimp_image_get_colormap (image), num_bytes);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1524,7 +1571,8 @@
       gimp_image_set_colormap (image, colormap, num_bytes / 3, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1545,7 +1593,8 @@
       gimp_image_clean_all (image);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1568,7 +1617,8 @@
       dirty = (image->dirty != 0);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], dirty);
@@ -1615,7 +1665,7 @@
       else
         width  = MAX (1, (height * dwidth) / dheight);
 
-      gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+      gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
 
       buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (image), context,
                                            width, height);
@@ -1635,7 +1685,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1669,7 +1720,8 @@
       active_layer = gimp_image_get_active_layer (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], active_layer);
@@ -1698,7 +1750,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1721,7 +1774,8 @@
       active_channel = gimp_image_get_active_channel (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], active_channel);
@@ -1750,7 +1804,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1773,7 +1828,8 @@
       active_vectors = gimp_image_get_active_vectors (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_vectors (&return_vals->values[1], active_vectors);
@@ -1802,7 +1858,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1828,7 +1885,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_selection (&return_vals->values[1], selection);
@@ -1866,7 +1924,8 @@
         active = gimp_image_get_component_active (image, component);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], active);
@@ -1904,7 +1963,8 @@
         gimp_image_set_component_active (image, component, active);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1937,7 +1997,8 @@
         visible = gimp_image_get_component_visible (image, component);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], visible);
@@ -1975,7 +2036,8 @@
         gimp_image_set_component_visible (image, component, visible);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1998,7 +2060,8 @@
       filename = gimp_image_get_filename (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], filename);
@@ -2044,7 +2107,8 @@
         gimp_image_set_filename (image, filename);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -2072,7 +2136,8 @@
         name = g_strdup (_("Untitled"));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -2101,7 +2166,8 @@
       gimp_image_get_resolution (image, &xresolution, &yresolution);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -2147,7 +2213,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -2170,7 +2237,8 @@
       unit = gimp_image_get_unit (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], unit);
@@ -2198,7 +2266,8 @@
       gimp_image_set_unit (image, unit);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -2221,7 +2290,8 @@
       tattoo_state = gimp_image_get_tattoo_state (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_uint (&return_vals->values[1], tattoo_state);
@@ -2249,7 +2319,8 @@
       gimp_image_set_tattoo_state (image, tattoo_state);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -2274,7 +2345,8 @@
       layer = gimp_image_get_layer_by_tattoo (image, tattoo);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -2304,7 +2376,8 @@
       channel = gimp_image_get_channel_by_tattoo (image, tattoo);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], channel);
@@ -2334,7 +2407,8 @@
       vectors = gimp_image_get_vectors_by_tattoo (image, tattoo);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_vectors (&return_vals->values[1], vectors);

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	Fri Aug 29 18:50:27 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 588 procedures registered total */
+/* 591 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	Fri Aug 29 18:50:27 2008
@@ -35,6 +35,7 @@
 #include "core/gimplayer.h"
 #include "core/gimplayermask.h"
 #include "core/gimpparamspecs.h"
+#include "core/gimpprojection.h"
 
 #include "gimppdb.h"
 #include "gimppdb-utils.h"
@@ -80,7 +81,47 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    gimp_value_set_layer (&return_vals->values[1], layer);
+
+  return return_vals;
+}
+
+static GValueArray *
+layer_new_from_visible_invoker (GimpProcedure      *procedure,
+                                Gimp               *gimp,
+                                GimpContext        *context,
+                                GimpProgress       *progress,
+                                const GValueArray  *args,
+                                GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpImage *image;
+  GimpImage *dest_image;
+  const gchar *name;
+  GimpLayer *layer = NULL;
+
+  image = gimp_value_get_image (&args->values[0], gimp);
+  dest_image = gimp_value_get_image (&args->values[1], gimp);
+  name = g_value_get_string (&args->values[2]);
+
+  if (success)
+    {
+      GimpProjection *projection = gimp_image_get_projection (image);
+
+      layer = gimp_layer_new_from_tiles (gimp_projection_get_tiles (projection),
+                                         dest_image,
+                                         gimp_image_base_type_with_alpha (dest_image),
+                                         name,
+                                         GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -126,7 +167,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer_copy);
@@ -166,7 +208,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer_copy);
@@ -192,7 +235,8 @@
       gimp_layer_add_alpha (layer);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -213,7 +257,8 @@
       gimp_layer_flatten (layer, context);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -245,7 +290,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -278,7 +324,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -302,7 +349,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -337,7 +385,8 @@
       gimp_image_undo_group_end (image);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -375,7 +424,8 @@
       gimp_image_undo_group_end (image);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -416,7 +466,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer_mask (&return_vals->values[1], mask);
@@ -444,7 +495,8 @@
       mask = gimp_layer_get_mask (layer);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer_mask (&return_vals->values[1], mask);
@@ -472,7 +524,8 @@
       layer = gimp_layer_mask_get_layer (mask);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -503,7 +556,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -529,7 +583,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -552,7 +607,8 @@
       is_floating_sel = gimp_layer_is_floating_sel (layer);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], is_floating_sel);
@@ -580,7 +636,8 @@
       lock_alpha = gimp_layer_get_lock_alpha (layer);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], lock_alpha);
@@ -608,7 +665,8 @@
       gimp_layer_set_lock_alpha (layer, lock_alpha, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -634,7 +692,8 @@
         apply_mask = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], apply_mask);
@@ -665,7 +724,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -691,7 +751,8 @@
         show_mask = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], show_mask);
@@ -722,7 +783,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -748,7 +810,8 @@
         edit_mask = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], edit_mask);
@@ -779,7 +842,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -802,7 +866,8 @@
       opacity = gimp_layer_get_opacity (layer) * 100.0;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], opacity);
@@ -830,7 +895,8 @@
       gimp_layer_set_opacity (layer, opacity / 100.0, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -853,7 +919,8 @@
       mode = gimp_layer_get_mode (layer);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], mode);
@@ -881,7 +948,8 @@
       gimp_layer_set_mode (layer, mode, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void
@@ -958,6 +1026,48 @@
   g_object_unref (procedure);
 
   /*
+   * gimp-layer-new-from-visible
+   */
+  procedure = gimp_procedure_new (layer_new_from_visible_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-layer-new-from-visible");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-layer-new-from-visible",
+                                     "Create a new layer from what is visible in an image.",
+                                     "This procedure creates a new layer from what is visible in the given image. The new layer still needs to be added to the destination image, as this is not automatic. Add the new layer with the 'gimp-image-add-layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_image_id ("image",
+                                                         "image",
+                                                         "The source image from where the content is copied",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_image_id ("dest-image",
+                                                         "dest image",
+                                                         "The destination image to which to add the layer",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_string ("name",
+                                                       "name",
+                                                       "The layer name",
+                                                       FALSE, TRUE, FALSE,
+                                                       NULL,
+                                                       GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   gimp_param_spec_layer_id ("layer",
+                                                             "layer",
+                                                             "The newly created layer",
+                                                             pdb->gimp, FALSE,
+                                                             GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
    * gimp-layer-new-from-drawable
    */
   procedure = gimp_procedure_new (layer_new_from_drawable_invoker);

Modified: branches/soc-2008-text/app/pdb/message-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/message-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/message-cmds.c	Fri Aug 29 18:50:27 2008
@@ -61,7 +61,8 @@
                          domain, message);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -77,7 +78,7 @@
 
   handler = gimp->message_handler;
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_enum (&return_vals->values[1], handler);
 
   return return_vals;
@@ -101,7 +102,8 @@
       gimp->message_handler = handler;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/misc-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/misc-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/misc-cmds.c	Fri Aug 29 18:50:27 2008
@@ -48,7 +48,7 @@
 
   version = g_strdup (GIMP_VERSION);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], version);
 
   return return_vals;
@@ -67,7 +67,7 @@
 
   pid = get_pid ();
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_int (&return_vals->values[1], pid);
 
   return return_vals;
@@ -91,7 +91,8 @@
       gimp_exit (gimp, force);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/paint-tools-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/paint-tools-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/paint-tools-cmds.c	Fri Aug 29 18:50:27 2008
@@ -134,7 +134,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -171,7 +172,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -223,7 +225,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -260,7 +263,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -306,7 +310,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -343,7 +348,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -392,7 +398,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -429,7 +436,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -475,7 +483,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -512,7 +521,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -558,7 +568,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -595,7 +606,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -646,7 +658,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -683,7 +696,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -720,7 +734,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -763,7 +778,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -800,7 +816,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/palette-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/palette-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/palette-cmds.c	Fri Aug 29 18:50:27 2008
@@ -65,7 +65,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -107,7 +108,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], copy_name);
@@ -145,7 +147,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], actual_name);
@@ -178,7 +181,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -206,7 +210,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], editable);
@@ -239,7 +244,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], num_colors);
@@ -284,7 +290,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -320,7 +327,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], num_columns);
@@ -353,7 +361,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -390,7 +399,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], entry_num);
@@ -432,7 +442,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -471,7 +482,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &color);
@@ -517,7 +529,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -556,7 +569,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], entry_name);
@@ -603,7 +617,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/palette-select-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/palette-select-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/palette-select-cmds.c	Fri Aug 29 18:50:27 2008
@@ -61,7 +61,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -86,7 +87,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -114,7 +116,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/palettes-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/palettes-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/palettes-cmds.c	Fri Aug 29 18:50:27 2008
@@ -51,7 +51,7 @@
 {
   gimp_data_factory_data_refresh (gimp->palette_factory);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -76,7 +76,8 @@
                                                              filter, &num_palettes);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -110,7 +111,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -166,7 +168,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/parasite-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/parasite-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/parasite-cmds.c	Fri Aug 29 18:50:27 2008
@@ -60,7 +60,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_boxed (&return_vals->values[1], parasite);
@@ -86,7 +87,8 @@
       gimp_parasite_attach (gimp, parasite);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -107,7 +109,8 @@
       gimp_parasite_detach (gimp, name);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -124,7 +127,7 @@
 
   parasites = gimp_parasite_list (gimp, &num_parasites);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
   g_value_set_int (&return_vals->values[1], num_parasites);
   gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
@@ -157,7 +160,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_boxed (&return_vals->values[1], parasite);
@@ -185,7 +189,8 @@
       gimp_image_parasite_attach (image, parasite);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -208,7 +213,8 @@
       gimp_image_parasite_detach (image, name);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -232,7 +238,8 @@
       parasites = gimp_image_parasite_list (image, &num_parasites);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -269,7 +276,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_boxed (&return_vals->values[1], parasite);
@@ -297,7 +305,8 @@
       gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -320,7 +329,8 @@
       gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -344,7 +354,8 @@
       parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -381,7 +392,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_boxed (&return_vals->values[1], parasite);
@@ -409,7 +421,8 @@
       gimp_item_parasite_attach (GIMP_ITEM (vectors), parasite);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -432,7 +445,8 @@
       gimp_item_parasite_detach (GIMP_ITEM (vectors), name);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -456,7 +470,8 @@
       parasites = gimp_item_parasite_list (GIMP_ITEM (vectors), &num_parasites);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

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	Fri Aug 29 18:50:27 2008
@@ -67,7 +67,8 @@
       path_list = gimp_container_get_name_array (image->vectors, &num_paths);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -103,7 +104,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -136,7 +138,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -164,7 +167,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -228,7 +232,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -304,7 +309,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -341,7 +347,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -416,7 +423,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -455,7 +463,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], tattoo);
@@ -490,7 +499,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -520,7 +530,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -555,7 +566,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], locked);
@@ -590,7 +602,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -636,7 +649,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -664,7 +678,8 @@
                                           merge, scale, -1, NULL, NULL);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/pattern-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/pattern-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/pattern-cmds.c	Fri Aug 29 18:50:27 2008
@@ -69,7 +69,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -118,7 +119,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/pattern-select-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/pattern-select-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/pattern-select-cmds.c	Fri Aug 29 18:50:27 2008
@@ -61,7 +61,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -86,7 +87,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -114,7 +116,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/patterns-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/patterns-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/patterns-cmds.c	Fri Aug 29 18:50:27 2008
@@ -50,7 +50,7 @@
 {
   gimp_data_factory_data_refresh (gimp->pattern_factory);
 
-  return gimp_procedure_get_return_values (procedure, TRUE);
+  return gimp_procedure_get_return_values (procedure, TRUE, NULL);
 }
 
 static GValueArray *
@@ -75,7 +75,8 @@
                                                              filter, &num_patterns);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -111,7 +112,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -166,7 +168,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/plug-in-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/plug-in-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/plug-in-cmds.c	Fri Aug 29 18:50:27 2008
@@ -72,7 +72,7 @@
                                             &plugin_real_name,
                                             &plugin_install_time);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
   g_value_set_int (&return_vals->values[1], num_plugins);
   gimp_value_take_stringarray (&return_vals->values[2], menu_path, num_plugins);
@@ -120,7 +120,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -153,7 +154,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -187,7 +189,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -220,7 +223,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -270,7 +274,71 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+plugin_set_pdb_error_handler_invoker (GimpProcedure      *procedure,
+                                      Gimp               *gimp,
+                                      GimpContext        *context,
+                                      GimpProgress       *progress,
+                                      const GValueArray  *args,
+                                      GError            **error)
+{
+  gboolean success = TRUE;
+  gint32 handler;
+
+  handler = g_value_get_enum (&args->values[0]);
+
+  if (success)
+    {
+      GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+      if (plug_in)
+        {
+          gimp_plug_in_set_error_handler (plug_in, handler);
+        }
+      else
+        {
+          success = FALSE;
+        }
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+plugin_get_pdb_error_handler_invoker (GimpProcedure      *procedure,
+                                      Gimp               *gimp,
+                                      GimpContext        *context,
+                                      GimpProgress       *progress,
+                                      const GValueArray  *args,
+                                      GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gint32 handler = 0;
+
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      handler = gimp_plug_in_get_error_handler (plug_in);
+    }
+  else
+    {
+      success = FALSE;
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_enum (&return_vals->values[1], handler);
+
+  return return_vals;
 }
 
 void
@@ -533,4 +601,52 @@
                                                            GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
+
+  /*
+   * gimp-plugin-set-pdb-error-handler
+   */
+  procedure = gimp_procedure_new (plugin_set_pdb_error_handler_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-plugin-set-pdb-error-handler");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-plugin-set-pdb-error-handler",
+                                     "Sets an error handler for procedure calls.",
+                                     "This procedure changes the way that errors in procedure calls are handled. By default GIMP will raise an error dialog if a procedure call made by a plug-in fails. Using this procedure the plug-in can change this behavior. If the error handler is set to %GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for calling 'gimp-get-pdb-error' and handling the error whenever one if its procedure calls fails. It can do this by displaying the error message or by forwarding it in its own return values.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("handler",
+                                                  "handler",
+                                                  "Who is responsible for handling procedure call errors",
+                                                  GIMP_TYPE_PDB_ERROR_HANDLER,
+                                                  GIMP_PDB_ERROR_HANDLER_INTERNAL,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-plugin-get-pdb-error-handler
+   */
+  procedure = gimp_procedure_new (plugin_get_pdb_error_handler_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-plugin-get-pdb-error-handler");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-plugin-get-pdb-error-handler",
+                                     "Retrieves the active error handler for procedure calls.",
+                                     "This procedure retrieves the currently active error handler for procedure calls made by the calling plug-in. See 'gimp-plugin-set-pdb-error-handler' for details.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2008",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_enum ("handler",
+                                                      "handler",
+                                                      "Who is responsible for handling procedure call errors",
+                                                      GIMP_TYPE_PDB_ERROR_HANDLER,
+                                                      GIMP_PDB_ERROR_HANDLER_INTERNAL,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
 }

Modified: branches/soc-2008-text/app/pdb/procedural-db-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/procedural-db-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/procedural-db-cmds.c	Fri Aug 29 18:50:27 2008
@@ -53,7 +53,7 @@
 
   temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_take_string (&return_vals->values[1], temp_name);
 
   return return_vals;
@@ -77,7 +77,8 @@
       success = gimp_pdb_dump (gimp->pdb, filename);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -117,7 +118,8 @@
                                 error);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -165,7 +167,8 @@
       exists = (procedure != NULL);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], exists);
@@ -212,7 +215,8 @@
       g_free (canonical);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -281,7 +285,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -345,7 +350,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -389,7 +395,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -426,7 +433,8 @@
       g_free (canonical);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], bytes);
@@ -461,7 +469,8 @@
       g_free (canonical);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/progress-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/progress-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/progress-cmds.c	Fri Aug 29 18:50:27 2008
@@ -63,7 +63,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -92,7 +93,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -114,7 +116,8 @@
   else
     success = FALSE;
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -143,7 +146,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -166,7 +170,8 @@
   else
     success = FALSE;
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -191,7 +196,8 @@
   else
     success = FALSE;
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], window);
@@ -222,7 +228,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -248,7 +255,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -274,7 +282,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

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	Fri Aug 29 18:50:27 2008
@@ -66,7 +66,8 @@
                                        &x1, &y1, &x2, &y2);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -104,7 +105,8 @@
       value = gimp_pickable_get_opacity_at (GIMP_PICKABLE (gimp_image_get_mask (image)), x, y);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], value);
@@ -132,7 +134,8 @@
       is_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], is_empty);
@@ -163,7 +166,8 @@
                            offx, offy, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -201,7 +205,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -227,7 +232,8 @@
       gimp_channel_invert (gimp_image_get_mask (image), TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -248,7 +254,8 @@
       gimp_channel_sharpen (gimp_image_get_mask (image), TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -269,7 +276,8 @@
       gimp_channel_all (gimp_image_get_mask (image), TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -290,7 +298,8 @@
       gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -314,7 +323,8 @@
                             radius, radius, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -339,7 +349,8 @@
                            radius, radius, TRUE, TRUE, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -363,7 +374,8 @@
                          steps, steps, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -387,7 +399,8 @@
                            steps, steps, FALSE, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -412,7 +425,8 @@
                                  GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -444,7 +458,8 @@
                                    FALSE, 0.0, 0.0);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -470,7 +485,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_channel (&return_vals->values[1], channel);
@@ -509,7 +525,8 @@
                                    FALSE, 0.0, 0.0);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/selection-tools-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/selection-tools-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/selection-tools-cmds.c	Fri Aug 29 18:50:27 2008
@@ -83,7 +83,8 @@
                                     feather_radius);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -136,7 +137,8 @@
                                     feather_radius_y);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -181,7 +183,8 @@
                                    TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -223,7 +226,8 @@
                                    TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -273,7 +277,8 @@
                                  feather_radius);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -329,7 +334,8 @@
                                  feather_radius_y);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -371,7 +377,8 @@
                                      TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -424,7 +431,8 @@
                                       TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/text-layer-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/text-layer-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/text-layer-cmds.c	Fri Aug 29 18:50:27 2008
@@ -93,7 +93,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], layer);
@@ -130,7 +131,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], text);
@@ -168,7 +170,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -200,7 +203,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], font);
@@ -238,7 +242,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -272,7 +277,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -316,7 +322,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -350,7 +357,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -394,7 +402,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -426,7 +435,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], antialias);
@@ -464,7 +474,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -496,7 +507,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], kerning);
@@ -534,7 +546,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -566,7 +579,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], language);
@@ -604,7 +618,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -636,7 +651,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], direction);
@@ -674,7 +690,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -706,7 +723,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_enum (&return_vals->values[1], justify);
@@ -744,7 +762,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -774,7 +793,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_rgb (&return_vals->values[1], &color);
@@ -812,7 +832,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -844,7 +865,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], indent);
@@ -882,7 +904,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -914,7 +937,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], line_spacing);
@@ -952,7 +976,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -984,7 +1009,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], letter_spacing);
@@ -1022,7 +1048,8 @@
         }
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 void

Modified: branches/soc-2008-text/app/pdb/text-tool-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/text-tool-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/text-tool-cmds.c	Fri Aug 29 18:50:27 2008
@@ -88,7 +88,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], text_layer);
@@ -131,7 +132,8 @@
       g_free (real_fontname);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -208,7 +210,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_layer (&return_vals->values[1], text_layer);
@@ -265,7 +268,8 @@
       g_free (real_fontname);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {

Modified: branches/soc-2008-text/app/pdb/transform-tools-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/transform-tools-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/transform-tools-cmds.c	Fri Aug 29 18:50:27 2008
@@ -73,7 +73,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -156,7 +157,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -224,7 +226,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -299,7 +302,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -369,7 +373,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);
@@ -443,7 +448,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_drawable (&return_vals->values[1], drawable);

Modified: branches/soc-2008-text/app/pdb/undo-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/undo-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/undo-cmds.c	Fri Aug 29 18:50:27 2008
@@ -67,7 +67,8 @@
         gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, undo_desc);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -94,7 +95,8 @@
         gimp_image_undo_group_end (image);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -117,7 +119,8 @@
       enabled = gimp_image_undo_is_enabled (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], enabled);
@@ -153,7 +156,8 @@
         disabled = gimp_image_undo_disable (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], disabled);
@@ -189,7 +193,8 @@
         enabled = gimp_image_undo_enable (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], enabled);
@@ -225,7 +230,8 @@
         frozen = gimp_image_undo_freeze (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], frozen);
@@ -261,7 +267,8 @@
         thawed = gimp_image_undo_thaw (image);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], thawed);

Modified: branches/soc-2008-text/app/pdb/unit-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/unit-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/unit-cmds.c	Fri Aug 29 18:50:27 2008
@@ -47,7 +47,7 @@
 
   num_units = _gimp_unit_get_number_of_units (gimp);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_int (&return_vals->values[1], num_units);
 
   return return_vals;
@@ -66,7 +66,7 @@
 
   num_units = _gimp_unit_get_number_of_built_in_units (gimp);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_int (&return_vals->values[1], num_units);
 
   return return_vals;
@@ -105,7 +105,8 @@
                                 symbol, abbreviation, singular, plural);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], unit_id);
@@ -133,7 +134,8 @@
       deletion_flag = _gimp_unit_get_deletion_flag (gimp, unit_id);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], deletion_flag);
@@ -161,7 +163,8 @@
       _gimp_unit_set_deletion_flag (gimp, unit_id, deletion_flag);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -184,7 +187,8 @@
       identifier = g_strdup (_gimp_unit_get_identifier (gimp, unit_id));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], identifier);
@@ -212,7 +216,8 @@
       factor = _gimp_unit_get_factor (gimp, unit_id);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], factor);
@@ -240,7 +245,8 @@
       digits = _gimp_unit_get_digits (gimp, unit_id);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], digits);
@@ -268,7 +274,8 @@
       symbol = g_strdup (_gimp_unit_get_symbol (gimp, unit_id));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], symbol);
@@ -296,7 +303,8 @@
       abbreviation = g_strdup (_gimp_unit_get_abbreviation (gimp, unit_id));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], abbreviation);
@@ -324,7 +332,8 @@
       singular = g_strdup (_gimp_unit_get_singular (gimp, unit_id));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], singular);
@@ -352,7 +361,8 @@
       plural = g_strdup (_gimp_unit_get_plural (gimp, unit_id));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], plural);

Modified: branches/soc-2008-text/app/pdb/vectors-cmds.c
==============================================================================
--- branches/soc-2008-text/app/pdb/vectors-cmds.c	(original)
+++ branches/soc-2008-text/app/pdb/vectors-cmds.c	Fri Aug 29 18:50:27 2008
@@ -65,7 +65,7 @@
   valid = (GIMP_IS_VECTORS (vectors) &&
            ! gimp_item_is_removed (GIMP_ITEM (vectors)));
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
   g_value_set_boolean (&return_vals->values[1], valid);
 
   return return_vals;
@@ -93,7 +93,8 @@
       vectors = gimp_vectors_new (image, name);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_vectors (&return_vals->values[1], vectors);
@@ -136,7 +137,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_vectors (&return_vals->values[1], vectors);
@@ -168,7 +170,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_vectors (&return_vals->values[1], vectors_copy);
@@ -196,7 +199,8 @@
       image = gimp_item_get_image (GIMP_ITEM (vectors));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -224,7 +228,8 @@
       name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], name);
@@ -252,7 +257,8 @@
       success = gimp_item_rename (GIMP_ITEM (vectors), name, error);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -275,7 +281,8 @@
       visible = gimp_item_get_visible (GIMP_ITEM (vectors));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], visible);
@@ -303,7 +310,8 @@
       gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -326,7 +334,8 @@
       linked = gimp_item_get_linked (GIMP_ITEM (vectors));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_boolean (&return_vals->values[1], linked);
@@ -354,7 +363,8 @@
       gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -377,7 +387,8 @@
       tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], tattoo);
@@ -405,7 +416,8 @@
       gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -445,7 +457,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -485,7 +498,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_double (&return_vals->values[1], length);
@@ -534,7 +548,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -572,7 +587,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -600,7 +616,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -632,7 +649,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -664,7 +682,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -698,7 +717,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -730,7 +750,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -766,7 +787,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -823,7 +845,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -892,7 +915,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], stroke_id);
@@ -952,7 +976,8 @@
         success = FALSE;
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -996,7 +1021,8 @@
       stroke_id = gimp_stroke_get_ID (stroke);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], stroke_id);
@@ -1040,7 +1066,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1087,7 +1114,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1142,7 +1170,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1183,7 +1212,8 @@
       stroke_id = gimp_stroke_get_ID (stroke);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_set_int (&return_vals->values[1], stroke_id);
@@ -1232,7 +1262,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1262,7 +1293,7 @@
       GList *list, *vectors_list = NULL;
 
       success = gimp_vectors_import_file (image, filename,
-                                          merge, scale, -1, &vectors_list, NULL);
+                                          merge, scale, -1, &vectors_list, error);
 
       if (success)
         {
@@ -1283,7 +1314,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1323,7 +1355,7 @@
       GList *list, *vectors_list = NULL;
 
       success = gimp_vectors_import_buffer (image, string, length,
-                                            merge, scale, -1, &vectors_list, NULL);
+                                            merge, scale, -1, &vectors_list, error);
 
       if (success)
         {
@@ -1344,7 +1376,8 @@
         }
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     {
@@ -1377,7 +1410,8 @@
       success = gimp_vectors_export_file (image, vectors, filename, error);
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1404,7 +1438,8 @@
       success = (string != NULL);
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     g_value_take_string (&return_vals->values[1], string);

Modified: branches/soc-2008-text/app/plug-in/gimpplugin-message.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimpplugin-message.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimpplugin-message.c	Fri Aug 29 18:50:27 2008
@@ -37,8 +37,9 @@
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-shadow.h"
 
-#include "pdb/gimppdb.h"
 #include "pdb/gimp-pdb-compat.h"
+#include "pdb/gimppdb.h"
+#include "pdb/gimppdberror.h"
 
 #include "gimpplugin.h"
 #include "gimpplugin-cleanup.h"
@@ -205,7 +206,7 @@
   if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in))
     {
       gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                    "plug_in_handle_tile_request: ERROR");
+                    "%s: ERROR", G_STRFUNC);
       gimp_plug_in_close (plug_in, TRUE);
       return;
     }
@@ -213,7 +214,7 @@
   if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in))
     {
       gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                    "plug_in_handle_tile_request: ERROR");
+                    "%s: ERROR", G_STRFUNC);
       gimp_plug_in_close (plug_in, TRUE);
       return;
     }
@@ -294,7 +295,7 @@
   if (! gp_tile_ack_write (plug_in->my_write, plug_in))
     {
       gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                    "plug_in_handle_tile_request: ERROR");
+                    "%s: ERROR", G_STRFUNC);
       gimp_plug_in_close (plug_in, TRUE);
       return;
     }
@@ -379,7 +380,7 @@
   if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in))
     {
       gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                    "plug_in_handle_tile_request: ERROR");
+                    "%s: ERROR", G_STRFUNC);
       gimp_plug_in_close (plug_in, TRUE);
       return;
     }
@@ -389,7 +390,7 @@
   if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in))
     {
       gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                    "plug_in_handle_tile_request: ERROR");
+                    "%s: ERROR", G_STRFUNC);
       gimp_plug_in_close (plug_in, TRUE);
       return;
     }
@@ -406,6 +407,41 @@
 }
 
 static void
+gimp_plug_in_handle_proc_error (GimpPlugIn          *plug_in,
+                                GimpPlugInProcFrame *proc_frame,
+                                const gchar         *name,
+                                const GError        *error)
+{
+  switch (proc_frame->error_handler)
+    {
+    case GIMP_PDB_ERROR_HANDLER_INTERNAL:
+      if (error->domain == GIMP_PDB_ERROR)
+        {
+          gimp_message (plug_in->manager->gimp,
+                        G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Calling error for procedure '%s':\n"
+                          "%s"),
+                        name, error->message);
+        }
+      else
+        {
+          gimp_message (plug_in->manager->gimp,
+                        G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Execution error for procedure '%s':\n"
+                          "%s"),
+                        name, error->message);
+        }
+      break;
+
+    case GIMP_PDB_ERROR_HANDLER_PLUGIN:
+      /*  the plug-in is responsible for handling this error  */
+      break;
+    }
+}
+
+static void
 gimp_plug_in_handle_proc_run (GimpPlugIn *plug_in,
                               GPProcRun  *proc_run)
 {
@@ -502,11 +538,8 @@
 
   if (error)
     {
-      gimp_message (plug_in->manager->gimp, G_OBJECT (proc_frame->progress),
-                    GIMP_MESSAGE_ERROR,
-                    _("PDB calling error for procedure '%s':\n"
-                      "%s"),
-                    canonical, error->message);
+      gimp_plug_in_handle_proc_error (plug_in, proc_frame,
+                                      canonical, error);
       g_error_free (error);
     }
 
@@ -530,7 +563,7 @@
       if (! gp_proc_return_write (plug_in->my_write, &proc_return, plug_in))
         {
           gimp_message (plug_in->manager->gimp, NULL, GIMP_MESSAGE_ERROR,
-                        "plug_in_handle_proc_run: ERROR");
+                        "%s: ERROR", G_STRFUNC);
           gimp_plug_in_close (plug_in, TRUE);
         }
 

Modified: branches/soc-2008-text/app/plug-in/gimpplugin-progress.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimpplugin-progress.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimpplugin-progress.c	Fri Aug 29 18:50:27 2008
@@ -30,12 +30,15 @@
 #include "core/gimpprogress.h"
 
 #include "pdb/gimppdb.h"
+#include "pdb/gimppdberror.h"
 
 #include "gimpplugin.h"
 #include "gimpplugin-progress.h"
 #include "gimppluginmanager.h"
 #include "gimptemporaryprocedure.h"
 
+#include "gimp-intl.h"
+
 
 /*  local function prototypes  */
 
@@ -317,6 +320,20 @@
 
 /*  private functions  */
 
+static GValueArray *
+get_cancel_return_values (GimpProcedure *procedure)
+{
+  GValueArray *return_vals;
+  GError      *error;
+
+  error = g_error_new_literal (GIMP_PDB_ERROR, GIMP_PDB_CANCELLED,
+                               _("Cancelled"));
+  return_vals = gimp_procedure_get_return_values (procedure, FALSE, error);
+  g_error_free (error);
+
+  return return_vals;
+}
+
 static void
 gimp_plug_in_progress_cancel_callback (GimpProgress *progress,
                                        GimpPlugIn   *plug_in)
@@ -326,10 +343,8 @@
 
   if (proc_frame->main_loop)
     {
-      proc_frame->return_vals = gimp_procedure_get_return_values (NULL,
-                                                                  FALSE);
-
-      g_value_set_enum (proc_frame->return_vals->values, GIMP_PDB_CANCEL);
+      proc_frame->return_vals =
+        get_cancel_return_values (proc_frame->procedure);
     }
 
   for (list = plug_in->temp_proc_frames; list; list = g_list_next (list))
@@ -338,10 +353,8 @@
 
       if (proc_frame->main_loop)
         {
-          proc_frame->return_vals = gimp_procedure_get_return_values (NULL,
-                                                                      FALSE);
-
-          g_value_set_enum (proc_frame->return_vals->values, GIMP_PDB_CANCEL);
+          proc_frame->return_vals =
+            get_cancel_return_values (proc_frame->procedure);
         }
     }
 

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	Fri Aug 29 18:50:27 2008
@@ -939,6 +939,36 @@
 }
 
 void
+gimp_plug_in_set_error_handler (GimpPlugIn          *plug_in,
+                                GimpPDBErrorHandler  handler)
+{
+  GimpPlugInProcFrame *proc_frame;
+
+  g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
+
+  proc_frame = gimp_plug_in_get_proc_frame (plug_in);
+
+  if (proc_frame)
+    proc_frame->error_handler = handler;
+}
+
+GimpPDBErrorHandler
+gimp_plug_in_get_error_handler (GimpPlugIn *plug_in)
+{
+  GimpPlugInProcFrame *proc_frame;
+
+  g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in),
+                        GIMP_PDB_ERROR_HANDLER_INTERNAL);
+
+  proc_frame = gimp_plug_in_get_proc_frame (plug_in);
+
+  if (proc_frame)
+    return proc_frame->error_handler;
+
+  return GIMP_PDB_ERROR_HANDLER_INTERNAL;
+}
+
+void
 gimp_plug_in_add_temp_proc (GimpPlugIn             *plug_in,
                             GimpTemporaryProcedure *proc)
 {

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

Modified: branches/soc-2008-text/app/plug-in/gimppluginmanager-call.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginmanager-call.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginmanager-call.c	Fri Aug 29 18:50:27 2008
@@ -41,6 +41,7 @@
 #include "gimpplugin.h"
 #include "gimpplugin-message.h"
 #include "gimpplugindef.h"
+#include "gimppluginerror.h"
 #include "gimppluginmanager.h"
 #define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_CALL__
 #include "gimppluginmanager-call.h"
@@ -140,7 +141,6 @@
                                GimpPlugInProcedure *procedure,
                                GValueArray         *args,
                                gboolean             synchronous,
-                               gboolean             destroy_return_vals,
                                GimpObject          *display)
 {
   GValueArray *return_vals = NULL;
@@ -167,8 +167,19 @@
 
       if (! gimp_plug_in_open (plug_in, GIMP_PLUG_IN_CALL_RUN, FALSE))
         {
+          const gchar *name  = gimp_object_get_name (GIMP_OBJECT (plug_in));
+          GError      *error = g_error_new (GIMP_PLUG_IN_ERROR,
+                                            GIMP_PLUG_IN_EXECUTION_FAILED,
+                                            _("Failed to run plug-in \"%s\""),
+                                            name);
+
           g_object_unref (plug_in);
-          goto done;
+
+          return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure),
+                                                          FALSE, error);
+          g_error_free (error);
+
+          return return_vals;
         }
 
       display_ID = display ? gimp_get_display_ID (manager->gimp, display) : -1;
@@ -206,14 +217,22 @@
           ! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
           ! gimp_wire_flush (plug_in->my_write, plug_in))
         {
+          const gchar *name  = gimp_object_get_name (GIMP_OBJECT (plug_in));
+          GError      *error = g_error_new (GIMP_PLUG_IN_ERROR,
+                                            GIMP_PLUG_IN_EXECUTION_FAILED,
+                                            _("Failed to run plug-in \"%s\""),
+                                            name);
+
           g_free (config.display_name);
           g_free (proc_run.params);
 
-          return_vals =
-            gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
-
           g_object_unref (plug_in);
-          goto done;
+
+          return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure),
+                                                          FALSE, error);
+          g_error_free (error);
+
+          return return_vals;
         }
 
       g_free (config.display_name);
@@ -254,19 +273,12 @@
           g_main_loop_unref (proc_frame->main_loop);
           proc_frame->main_loop = NULL;
 
-          return_vals = gimp_plug_in_proc_frame_get_return_vals (proc_frame);
+          return_vals = gimp_plug_in_proc_frame_get_return_values (proc_frame);
         }
 
       g_object_unref (plug_in);
     }
 
- done:
-  if (return_vals && destroy_return_vals)
-    {
-      g_value_array_free (return_vals);
-      return_vals = NULL;
-    }
-
   return return_vals;
 }
 
@@ -303,13 +315,20 @@
       if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
           ! gimp_wire_flush (plug_in->my_write, plug_in))
         {
+          const gchar *name  = gimp_object_get_name (GIMP_OBJECT (plug_in));
+          GError      *error = g_error_new (GIMP_PLUG_IN_ERROR,
+                                            GIMP_PLUG_IN_EXECUTION_FAILED,
+                                            _("Failed to run plug-in \"%s\""),
+                                            name);
+
           g_free (proc_run.params);
           gimp_plug_in_proc_frame_pop (plug_in);
 
-          return_vals =
-            gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
+          return_vals = gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure),
+                                                          FALSE, error);
+          g_error_free (error);
 
-          goto done;
+          return return_vals;
         }
 
       g_free (proc_run.params);
@@ -323,12 +342,11 @@
        *  gimp_plug_in_handle_temp_proc_return()
        */
 
-      return_vals = gimp_plug_in_proc_frame_get_return_vals (proc_frame);
+      return_vals = gimp_plug_in_proc_frame_get_return_values (proc_frame);
 
       gimp_plug_in_proc_frame_unref (proc_frame, plug_in);
       g_object_unref (plug_in);
     }
 
- done:
   return return_vals;
 }

Modified: branches/soc-2008-text/app/plug-in/gimppluginmanager-call.h
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginmanager-call.h	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginmanager-call.h	Fri Aug 29 18:50:27 2008
@@ -46,7 +46,6 @@
                                                   GimpPlugInProcedure    *procedure,
                                                   GValueArray            *args,
                                                   gboolean                synchronous,
-                                                  gboolean                destroy_return_vals,
                                                   GimpObject             *display);
 
 /*  Run a temp plug-in proc as if it were a procedure database procedure

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	Fri Aug 29 18:50:27 2008
@@ -212,7 +212,7 @@
   return gimp_plug_in_manager_call_run (gimp->plug_in_manager,
                                         context, progress,
                                         GIMP_PLUG_IN_PROCEDURE (procedure),
-                                        args, TRUE, FALSE, NULL);
+                                        args, TRUE, NULL);
 }
 
 static void
@@ -223,10 +223,21 @@
                                       GValueArray   *args,
                                       GimpObject    *display)
 {
-  gimp_plug_in_manager_call_run (gimp->plug_in_manager,
-                                 context, progress,
-                                 GIMP_PLUG_IN_PROCEDURE (procedure),
-                                 args, FALSE, TRUE, display);
+  GimpPlugInProcedure *plug_in_procedure = GIMP_PLUG_IN_PROCEDURE (procedure);
+  GValueArray         *return_vals;
+
+  return_vals = gimp_plug_in_manager_call_run (gimp->plug_in_manager,
+                                               context, progress,
+                                               plug_in_procedure,
+                                               args, FALSE, display);
+
+  if (return_vals)
+    {
+      gimp_plug_in_procedure_handle_return_values (plug_in_procedure,
+                                                   gimp, progress,
+                                                   return_vals);
+      g_value_array_free (return_vals);
+    }
 }
 
 const gchar *
@@ -949,3 +960,49 @@
 
   proc->thumb_loader = g_strdup (thumb_loader);
 }
+
+void
+gimp_plug_in_procedure_handle_return_values (GimpPlugInProcedure *proc,
+                                             Gimp                *gimp,
+                                             GimpProgress        *progress,
+                                             GValueArray         *return_vals)
+{
+  g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
+  g_return_if_fail (return_vals != NULL);
+
+  if (! return_vals->n_values > 0 ||
+      G_VALUE_TYPE (&return_vals->values[0]) != GIMP_TYPE_PDB_STATUS_TYPE)
+    {
+      return;
+    }
+
+  switch (g_value_get_enum (&return_vals->values[0]))
+    {
+    case GIMP_PDB_SUCCESS:
+      break;
+
+    case GIMP_PDB_CALLING_ERROR:
+      if (return_vals->n_values > 1 &&
+          G_VALUE_HOLDS_STRING (&return_vals->values[1]))
+        {
+          gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
+                        _("Calling error for '%s':\n"
+                          "%s"),
+                        gimp_plug_in_procedure_get_label (proc),
+                        g_value_get_string (&return_vals->values[1]));
+        }
+      break;
+
+    case GIMP_PDB_EXECUTION_ERROR:
+      if (return_vals->n_values > 1 &&
+          G_VALUE_HOLDS_STRING (&return_vals->values[1]))
+        {
+          gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
+                        _("Execution error for '%s':\n"
+                          "%s"),
+                        gimp_plug_in_procedure_get_label (proc),
+                        g_value_get_string (&return_vals->values[1]));
+        }
+      break;
+    }
+}

Modified: branches/soc-2008-text/app/plug-in/gimppluginprocedure.h
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginprocedure.h	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginprocedure.h	Fri Aug 29 18:50:27 2008
@@ -130,5 +130,11 @@
 void          gimp_plug_in_procedure_set_thumb_loader(GimpPlugInProcedure       *proc,
                                                       const gchar               *thumbnailer);
 
+void     gimp_plug_in_procedure_handle_return_values (GimpPlugInProcedure       *proc,
+                                                      Gimp                      *gimp,
+                                                      GimpProgress              *progress,
+
+                                                      GValueArray               *return_vals);
+
 
 #endif /* __GIMP_PLUG_IN_PROCEDURE_H__ */

Modified: branches/soc-2008-text/app/plug-in/gimppluginprocframe.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginprocframe.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginprocframe.c	Fri Aug 29 18:50:27 2008
@@ -29,11 +29,15 @@
 #include "core/gimpcontext.h"
 #include "core/gimpprogress.h"
 
+#include "pdb/gimppdberror.h"
+
 #include "gimpplugin.h"
 #include "gimpplugin-cleanup.h"
 #include "gimpplugin-progress.h"
 #include "gimppluginprocedure.h"
 
+#include "gimp-intl.h"
+
 
 /*  public functions  */
 
@@ -77,6 +81,7 @@
   proc_frame->progress           = progress ? g_object_ref (progress) : NULL;
   proc_frame->progress_created   = FALSE;
   proc_frame->progress_cancel_id = 0;
+  proc_frame->error_handler      = GIMP_PDB_ERROR_HANDLER_INTERNAL;
 
   if (progress)
     gimp_plug_in_progress_attach (progress);
@@ -156,7 +161,7 @@
 }
 
 GValueArray *
-gimp_plug_in_proc_frame_get_return_vals (GimpPlugInProcFrame *proc_frame)
+gimp_plug_in_proc_frame_get_return_values (GimpPlugInProcFrame *proc_frame)
 {
   GValueArray *return_vals;
 
@@ -173,7 +178,7 @@
         {
           /* Allocate new return values of the correct size. */
           return_vals = gimp_procedure_get_return_values (proc_frame->procedure,
-                                                          FALSE);
+                                                          TRUE, NULL);
 
           /* Copy all of the arguments we can. */
           memcpy (return_vals->values, proc_frame->return_vals->values,
@@ -191,9 +196,16 @@
     }
   else
     {
-      /* Just return a dummy set of values. */
-      return_vals = gimp_procedure_get_return_values (proc_frame->procedure,
-                                                      FALSE);
+      GimpProcedure *procedure = proc_frame->procedure;
+      GError        *error;
+
+      error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                           _("Procedure '%s' returned no return values"),
+                           gimp_object_get_name (GIMP_OBJECT (procedure)));
+
+      return_vals = gimp_procedure_get_return_values (procedure, FALSE,
+                                                      error);
+      g_error_free (error);
     }
 
   return return_vals;

Modified: branches/soc-2008-text/app/plug-in/gimppluginprocframe.h
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimppluginprocframe.h	(original)
+++ branches/soc-2008-text/app/plug-in/gimppluginprocframe.h	Fri Aug 29 18:50:27 2008
@@ -24,23 +24,25 @@
 
 struct _GimpPlugInProcFrame
 {
-  gint           ref_count;
+  gint                 ref_count;
 
-  GimpContext   *main_context;
-  GList         *context_stack;
+  GimpContext         *main_context;
+  GList               *context_stack;
 
-  GimpProcedure *procedure;
-  GMainLoop     *main_loop;
+  GimpProcedure       *procedure;
+  GMainLoop           *main_loop;
 
-  GValueArray   *return_vals;
+  GValueArray         *return_vals;
 
-  GimpProgress  *progress;
-  gboolean       progress_created;
-  gulong         progress_cancel_id;
+  GimpProgress        *progress;
+  gboolean             progress_created;
+  gulong               progress_cancel_id;
+
+  GimpPDBErrorHandler  error_handler;
 
   /*  lists of things to clean up on dispose  */
-  GList         *image_cleanups;
-  GList         *item_cleanups;
+  GList               *image_cleanups;
+  GList               *item_cleanups;
 };
 
 
@@ -59,7 +61,8 @@
 void                  gimp_plug_in_proc_frame_unref   (GimpPlugInProcFrame *proc_frame,
                                                        GimpPlugIn          *plug_in);
 
-GValueArray * gimp_plug_in_proc_frame_get_return_vals (GimpPlugInProcFrame *proc_frame);
+GValueArray         * gimp_plug_in_proc_frame_get_return_values
+                                                      (GimpPlugInProcFrame *proc_frame);
 
 
 #endif /* __GIMP_PLUG_IN_PROC_FRAME_H__ */

Modified: branches/soc-2008-text/app/plug-in/gimptemporaryprocedure.c
==============================================================================
--- branches/soc-2008-text/app/plug-in/gimptemporaryprocedure.c	(original)
+++ branches/soc-2008-text/app/plug-in/gimptemporaryprocedure.c	Fri Aug 29 18:50:27 2008
@@ -109,14 +109,23 @@
                                         GValueArray   *args,
                                         GimpObject    *display)
 {
-  GValueArray *return_vals;
+  GimpTemporaryProcedure *temp_procedure = GIMP_TEMPORARY_PROCEDURE (procedure);
+  GValueArray            *return_vals;
 
   return_vals = gimp_plug_in_manager_call_run_temp (gimp->plug_in_manager,
                                                     context, progress,
-                                                    GIMP_TEMPORARY_PROCEDURE (procedure),
+                                                    temp_procedure,
                                                     args);
 
-  g_value_array_free (return_vals);
+  if (return_vals)
+    {
+      GimpPlugInProcedure *proc = GIMP_PLUG_IN_PROCEDURE (procedure);
+
+      gimp_plug_in_procedure_handle_return_values (proc,
+                                                   gimp, progress,
+                                                   return_vals);
+      g_value_array_free (return_vals);
+    }
 }
 
 const gchar *

Modified: branches/soc-2008-text/app/text/gimptext.c
==============================================================================
--- branches/soc-2008-text/app/text/gimptext.c	(original)
+++ branches/soc-2008-text/app/text/gimptext.c	Fri Aug 29 18:50:27 2008
@@ -328,7 +328,7 @@
       g_value_set_double (value, text->box_height);
       break;
     case PROP_BOX_UNIT:
-      g_value_set_int (value, text->unit);
+      g_value_set_int (value, text->box_unit);
       break;
     case PROP_TRANSFORMATION:
       g_value_set_boxed (value, &text->transformation);

Modified: branches/soc-2008-text/app/text/gimptextlayout-render.c
==============================================================================
--- branches/soc-2008-text/app/text/gimptextlayout-render.c	(original)
+++ branches/soc-2008-text/app/text/gimptextlayout-render.c	Fri Aug 29 18:50:27 2008
@@ -74,6 +74,7 @@
                          gpointer            render_data)
 {
   PangoLayoutIter *iter;
+  PangoRectangle   rect;
   gint             x, y;
 
   g_return_if_fail (GIMP_IS_TEXT_LAYOUT (layout));
@@ -84,11 +85,30 @@
   x *= PANGO_SCALE;
   y *= PANGO_SCALE;
 
+  pango_layout_get_extents (layout->layout, NULL, &rect);
+
+  /* If the width of the layout is > 0, then the text-box is FIXED
+   * and the layout position should be offset if the alignment
+   * is centered or right-aligned*/
+  if (pango_layout_get_width (layout->layout) > 0)
+    switch (pango_layout_get_alignment (layout->layout))
+      {
+      case PANGO_ALIGN_LEFT:
+        break;
+
+      case PANGO_ALIGN_RIGHT:
+        x += pango_layout_get_width (layout->layout) - rect.width;
+        break;
+
+      case PANGO_ALIGN_CENTER:
+        x += (pango_layout_get_width (layout->layout) - rect.width) / 2;
+        break;
+      }
+
   iter = pango_layout_get_iter (layout->layout);
 
   do
     {
-      PangoRectangle   rect;
       PangoLayoutLine *line;
       gint             baseline;
 

Modified: branches/soc-2008-text/app/tools/gimpaligntool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpaligntool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpaligntool.c	Fri Aug 29 18:50:27 2008
@@ -176,6 +176,8 @@
   align_tool->vert_offset = 0;
 
   gimp_tool_control_set_snap_to     (tool->control, FALSE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_MOVE);
 
 }
@@ -882,9 +884,9 @@
 
   spinbutton = gimp_spin_button_new (&align_tool->horz_offset_adjustment,
                                      0,
-                                     -100000.,
-                                     100000.,
-                                     1., 20., 20., 1., 0);
+                                     -100000,
+                                     100000,
+                                     1, 20, 0, 1, 0);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   g_signal_connect (align_tool->horz_offset_adjustment, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),

Modified: branches/soc-2008-text/app/tools/gimpblendtool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpblendtool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpblendtool.c	Fri Aug 29 18:50:27 2008
@@ -390,7 +390,8 @@
                              GdkModifierType  state,
                              GimpDisplay     *display)
 {
-  gchar *status_help;
+  GimpTool *tool = GIMP_TOOL (blend_tool);
+  gchar    *status_help;
 
   status_help = gimp_suggest_modifiers ("",
                                         ((GDK_CONTROL_MASK | GDK_MOD1_MASK)
@@ -398,11 +399,14 @@
                                         NULL,
                                         _("%s for constrained angles"),
                                         _("%s to move the whole line"));
-  gimp_tool_push_status_coords (GIMP_TOOL (blend_tool), display,
+
+  gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Blend: "),
                                 blend_tool->end_x - blend_tool->start_x,
                                 ", ",
                                 blend_tool->end_y - blend_tool->start_y,
                                 status_help);
+
   g_free (status_help);
 }

Modified: branches/soc-2008-text/app/tools/gimpbycolorselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpbycolorselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpbycolorselecttool.c	Fri Aug 29 18:50:27 2008
@@ -121,7 +121,7 @@
     }
   else
     {
-      pickable = GIMP_PICKABLE (display->image->projection);
+      pickable = GIMP_PICKABLE (gimp_image_get_projection (display->image));
     }
 
   gimp_pickable_flush (pickable);

Modified: branches/soc-2008-text/app/tools/gimpcolortool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcolortool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpcolortool.c	Fri Aug 29 18:50:27 2008
@@ -254,6 +254,7 @@
       gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
 
       gimp_tool_push_status_coords (tool, display,
+                                    gimp_tool_control_get_precision (tool->control),
                                     _("Move Sample Point: "),
                                     color_tool->sample_point_x,
                                     ", ",
@@ -431,6 +432,7 @@
       else
         {
           gimp_tool_push_status_coords (tool, display,
+                                        gimp_tool_control_get_precision (tool->control),
                                         color_tool->sample_point ?
                                         _("Move Sample Point: ") :
                                         _("Add Sample Point: "),

Modified: branches/soc-2008-text/app/tools/gimpcroptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcroptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpcroptool.c	Fri Aug 29 18:50:27 2008
@@ -172,6 +172,8 @@
   gimp_rectangle_tool_init (GIMP_RECTANGLE_TOOL (crop_tool));
 
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
 
   crop_tool->current_image = NULL;

Modified: branches/soc-2008-text/app/tools/gimpcurvestool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcurvestool.h	(original)
+++ branches/soc-2008-text/app/tools/gimpcurvestool.h	Fri Aug 29 18:50:27 2008
@@ -62,4 +62,4 @@
 GType   gimp_curves_tool_get_type (void) G_GNUC_CONST;
 
 
-#endif  /*  __CURVES_H__  */
+#endif  /*  __GIMP_CURVES_TOOL_H__  */

Modified: branches/soc-2008-text/app/tools/gimpdrawtool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpdrawtool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpdrawtool.c	Fri Aug 29 18:50:27 2008
@@ -28,7 +28,6 @@
 
 #include "base/boundary.h"
 
-#include "core/gimpguide.h"
 #include "core/gimpimage.h"
 #include "core/gimplist.h"
 

Modified: branches/soc-2008-text/app/tools/gimpeditselectiontool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpeditselectiontool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpeditselectiontool.c	Fri Aug 29 18:50:27 2008
@@ -186,6 +186,7 @@
                                 gboolean           propagate_release)
 {
   GimpEditSelectionTool *edit_select;
+  GimpTool              *tool;
   GimpDisplayShell      *shell;
   GimpItem              *active_item;
   GimpChannel           *channel;
@@ -201,6 +202,8 @@
 
   edit_select->propagate_release = propagate_release;
 
+  tool = GIMP_TOOL (edit_select);
+
   shell = GIMP_DISPLAY_SHELL (display->shell);
 
   /*  Make a check to see if it should be a floating selection translation  */
@@ -429,7 +432,7 @@
         break;
       }
 
-    gimp_tool_control_set_snap_offsets (GIMP_TOOL (edit_select)->control,
+    gimp_tool_control_set_snap_offsets (tool->control,
                                         x1 - coords->x,
                                         y1 - coords->y,
                                         x2 - x1,
@@ -440,16 +443,17 @@
     edit_select->center_y = (y1 + y2) / 2.0;
   }
 
-  gimp_tool_control_activate (GIMP_TOOL (edit_select)->control);
-  GIMP_TOOL (edit_select)->display = display;
+  gimp_tool_control_activate (tool->control);
+  tool->display = display;
 
-  tool_manager_push_tool (display->image->gimp, GIMP_TOOL (edit_select));
+  tool_manager_push_tool (display->image->gimp, tool);
 
   /*  pause the current selection  */
   gimp_display_shell_selection_control (shell, GIMP_SELECTION_PAUSE);
 
   /* initialize the statusbar display */
-  gimp_tool_push_status_coords (GIMP_TOOL (edit_select), display,
+  gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Move: "), 0, ", ", 0, NULL);
 
   gimp_draw_tool_start (GIMP_DRAW_TOOL (edit_select), display);
@@ -579,8 +583,8 @@
                                         gdouble                new_y,
                                         GimpDisplay           *display)
 {
-  GimpDrawTool *draw_tool          = GIMP_DRAW_TOOL (edit_select);
-  GimpTool     *tool               = GIMP_TOOL (edit_select);
+  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (edit_select);
+  GimpTool     *tool      = GIMP_TOOL (edit_select);
   GimpItem     *active_item;
   gint          off_x, off_y;
   gdouble       motion_x, motion_y;
@@ -714,10 +718,11 @@
       edit_select->first_move = FALSE;
     }
 
-  gimp_projection_flush (display->image->projection);
+  gimp_projection_flush (gimp_image_get_projection (display->image));
 
   gimp_tool_pop_status (tool, display);
   gimp_tool_push_status_coords (tool, display,
+                                gimp_tool_control_get_precision (tool->control),
                                 _("Move: "),
                                 edit_select->cumlx,
                                 ", ",
@@ -772,7 +777,7 @@
 gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (draw_tool);
-  GimpDisplay           *display       = GIMP_TOOL (draw_tool)->display;
+  GimpDisplay           *display     = GIMP_TOOL (draw_tool)->display;
   GimpItem              *active_item;
 
   active_item = gimp_edit_selection_tool_get_active_item (edit_select,

Modified: branches/soc-2008-text/app/tools/gimpfliptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpfliptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpfliptool.c	Fri Aug 29 18:50:27 2008
@@ -104,6 +104,8 @@
   GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (flip_tool);
 
   gimp_tool_control_set_snap_to            (tool->control, FALSE);
+  gimp_tool_control_set_precision          (tool->control,
+                                            GIMP_CURSOR_PRECISION_PIXEL_CENTER);
   gimp_tool_control_set_cursor             (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_toggle_cursor      (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_tool_cursor        (tool->control,

Modified: branches/soc-2008-text/app/tools/gimpforegroundselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpforegroundselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpforegroundselecttool.c	Fri Aug 29 18:50:27 2008
@@ -185,6 +185,8 @@
   gimp_tool_control_set_scroll_lock (tool->control, FALSE);
   gimp_tool_control_set_preserve    (tool->control, FALSE);
   gimp_tool_control_set_dirty_mask  (tool->control, GIMP_DIRTY_IMAGE_SIZE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_CENTER);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_FREE_SELECT);
 

Modified: branches/soc-2008-text/app/tools/gimpfreeselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpfreeselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpfreeselecttool.c	Fri Aug 29 18:50:27 2008
@@ -56,10 +56,11 @@
 #define NO_CLICK_TIME_AVAILABLE 0
 
 #define GET_PRIVATE(fst)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((fst), GIMP_TYPE_FREE_SELECT_TOOL, Private))
+   (G_TYPE_INSTANCE_GET_PRIVATE ((fst), \
+    GIMP_TYPE_FREE_SELECT_TOOL, GimpFreeSelectToolPrivate))
 
 
-typedef struct _Private
+typedef struct
 {
   /* Index of grabbed segment index. */
   gint               grabbed_segment_index;
@@ -125,7 +126,7 @@
   guint32            last_click_time;
   GimpCoords         last_click_coord;
 
-} Private;
+} GimpFreeSelectToolPrivate;
 
 
 static void     gimp_free_select_tool_finalize            (GObject               *object);
@@ -224,17 +225,19 @@
 
   klass->select                   = gimp_free_select_tool_real_select;
 
-  g_type_class_add_private (klass, sizeof (Private));
+  g_type_class_add_private (klass, sizeof (GimpFreeSelectToolPrivate));
 }
 
 static void
 gimp_free_select_tool_init (GimpFreeSelectTool *fst)
 {
-  GimpTool *tool = GIMP_TOOL (fst);
-  Private  *priv = GET_PRIVATE (fst);
+  GimpTool                  *tool = GIMP_TOOL (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   gimp_tool_control_set_scroll_lock (tool->control, FALSE);
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_SUBPIXEL);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_FREE_SELECT);
 
@@ -268,8 +271,8 @@
 static void
 gimp_free_select_tool_finalize (GObject *object)
 {
-  GimpFreeSelectTool *fst  = GIMP_FREE_SELECT_TOOL (object);
-  Private            *priv = GET_PRIVATE (fst);
+  GimpFreeSelectTool        *fst  = GIMP_FREE_SELECT_TOOL (object);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   g_free (priv->points);
   g_free (priv->segment_indices);
@@ -286,7 +289,7 @@
                                    gint                 segment_start,
                                    gint                 segment_end)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   *points   = &priv->points[priv->segment_indices[segment_start]];
   *n_points = priv->segment_indices[segment_end] -
@@ -300,7 +303,7 @@
                                          gdouble            *start_point_y,
                                          gint                segment_index)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   *start_point_x = priv->points[priv->segment_indices[segment_index]].x;
   *start_point_y = priv->points[priv->segment_indices[segment_index]].y;
@@ -311,7 +314,7 @@
                                       gdouble            *start_point_x,
                                       gdouble            *start_point_y)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   gimp_free_select_tool_get_segment_point (fst,
                                            start_point_x,
@@ -342,9 +345,9 @@
                                     guint32             time,
                                     GimpCoords         *coords)
 {
-  Private  *priv         = GET_PRIVATE (fst);
-  gboolean  double_click = FALSE;
-  gdouble   dist         = G_MAXDOUBLE;
+  GimpFreeSelectToolPrivate *priv         = GET_PRIVATE (fst);
+  gboolean                   double_click = FALSE;
+  gdouble                    dist         = G_MAXDOUBLE;
 
   if (priv->polygon_modified       ||
       priv->n_segment_indices <= 1 ||
@@ -386,8 +389,8 @@
                      dist_from_last_point < double_click_distance;
     }
 
-  return (! priv->supress_handles && dist < POINT_GRAB_THRESHOLD_SQ) || 
-         double_click;
+  return ((! priv->supress_handles && dist < POINT_GRAB_THRESHOLD_SQ) ||
+          double_click);
 }
 
 static void
@@ -395,11 +398,11 @@
                                                 GimpDisplay        *display,
                                                 GimpCoords         *coords)
 {
-  Private      *priv                  = GET_PRIVATE (fst);
-  GimpDrawTool *draw_tool             = GIMP_DRAW_TOOL (fst);
-  gdouble       shortest_dist         = POINT_GRAB_THRESHOLD_SQ;
-  gint          grabbed_segment_index = INVALID_INDEX;
-  gint          i;
+  GimpFreeSelectToolPrivate *priv                  = GET_PRIVATE (fst);
+  GimpDrawTool              *draw_tool             = GIMP_DRAW_TOOL (fst);
+  gdouble                    shortest_dist         = POINT_GRAB_THRESHOLD_SQ;
+  gint                       grabbed_segment_index = INVALID_INDEX;
+  gint                       i;
 
   if (GIMP_TOOL (fst)->display != NULL &&
       ! priv->supress_handles)
@@ -438,9 +441,9 @@
 static void
 gimp_free_select_tool_halt (GimpFreeSelectTool *fst)
 {
-  GimpTool     *tool      = GIMP_TOOL (fst);
-  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (fst);
-  Private      *priv      = GET_PRIVATE (fst);
+  GimpTool                  *tool      = GIMP_TOOL (fst);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (fst);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
 
   if (gimp_draw_tool_is_active (draw_tool))
     gimp_draw_tool_stop (draw_tool);
@@ -459,7 +462,7 @@
 static void
 gimp_free_select_tool_revert_to_last_segment (GimpFreeSelectTool *fst)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   priv->n_points = priv->segment_indices[priv->n_segment_indices - 1] + 1;
 }
@@ -468,7 +471,7 @@
 gimp_free_select_tool_update_button_state (GimpFreeSelectTool *fst,
                                            GdkModifierType     state)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   priv->button1_down = state & GDK_BUTTON1_MASK ? TRUE : FALSE;
 }
@@ -476,8 +479,8 @@
 static void
 gimp_free_select_tool_remove_last_segment (GimpFreeSelectTool *fst)
 {
-  Private      *priv      = GET_PRIVATE (fst);
-  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (fst);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (fst);
 
   gimp_draw_tool_pause (draw_tool);
 
@@ -500,7 +503,7 @@
                                  gdouble             x,
                                  gdouble             y)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   if (priv->n_points >= priv->max_n_points)
     {
@@ -520,14 +523,15 @@
 gimp_free_select_tool_add_segment_index (GimpFreeSelectTool *fst,
                                          gint                index)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   if (priv->n_segment_indices >= priv->max_n_segment_indices)
     {
       priv->max_n_segment_indices += N_ITEMS_PER_ALLOC;
 
       priv->segment_indices = g_realloc (priv->segment_indices,
-                                        sizeof (GimpVector2) * priv->max_n_segment_indices);
+                                         sizeof (GimpVector2) *
+                                         priv->max_n_segment_indices);
     }
 
   priv->segment_indices[priv->n_segment_indices] = index;
@@ -538,7 +542,7 @@
 static gboolean
 gimp_free_select_tool_is_point_grabbed (GimpFreeSelectTool *fst)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   return priv->grabbed_segment_index != INVALID_INDEX;
 }
@@ -548,10 +552,10 @@
                              GimpCoords         *coords,
                              GimpDisplay        *display)
 {
-  GimpTool             *tool      = GIMP_TOOL (fst);
-  GimpDrawTool         *draw_tool = GIMP_DRAW_TOOL (tool);
-  GimpSelectionOptions *options   = GIMP_SELECTION_TOOL_GET_OPTIONS (fst);
-  Private              *priv      = GET_PRIVATE (fst);
+  GimpTool                  *tool      = GIMP_TOOL (fst);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (tool);
+  GimpSelectionOptions      *options   = GIMP_SELECTION_TOOL_GET_OPTIONS (fst);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
 
   gimp_free_select_tool_halt (fst);
 
@@ -686,12 +690,12 @@
                                               gdouble             new_x,
                                               gdouble             new_y)
 {
-  Private     *priv         = GET_PRIVATE (fst);
-  GimpVector2  cursor_point = { new_x, new_y };
-  GimpVector2 *dest;
-  GimpVector2 *dest_start_target;
-  GimpVector2 *dest_end_target;
-  gint         n_points;
+  GimpFreeSelectToolPrivate *priv         = GET_PRIVATE (fst);
+  GimpVector2                cursor_point = { new_x, new_y };
+  GimpVector2               *dest;
+  GimpVector2               *dest_start_target;
+  GimpVector2               *dest_end_target;
+  gint                       n_points;
 
   /* Handle the segment before the grabbed point */
   if (segment_index > 0)
@@ -766,7 +770,7 @@
 static void
 gimp_free_select_tool_finish_free_segment (GimpFreeSelectTool *fst)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   /* The points are all setup, just make a segment */
   gimp_free_select_tool_add_segment_index (fst,
@@ -777,7 +781,7 @@
 gimp_free_select_tool_commit (GimpFreeSelectTool *fst,
                               GimpDisplay        *display)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   if (priv->n_points >= 3)
     {
@@ -790,9 +794,9 @@
 static void
 gimp_free_select_tool_revert_to_saved_state (GimpFreeSelectTool *fst)
 {
-  Private     *priv = GET_PRIVATE (fst);
-  GimpVector2 *dest;
-  gint         n_points;
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
+  GimpVector2               *dest;
+  gint                       n_points;
 
   /* Without a point grab we have no sensible information to fall back
    * on, bail out
@@ -841,7 +845,7 @@
                                     guint32             time,
                                     GimpDisplay        *display)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   /*  If there is a floating selection, anchor it  */
   if (gimp_image_floating_sel (display->image))
@@ -870,7 +874,7 @@
            * free selection, revert it before doing the commit.
            */
           gimp_free_select_tool_revert_to_saved_state (fst);
-          
+
           gimp_free_select_tool_commit (fst, display);
         }
 
@@ -927,9 +931,9 @@
 static void
 gimp_free_select_tool_prepare_for_move (GimpFreeSelectTool *fst)
 {
-  Private     *priv = GET_PRIVATE (fst);
-  GimpVector2 *source;
-  gint         n_points;
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
+  GimpVector2               *source;
+  gint                       n_points;
 
   if (priv->grabbed_segment_index > 0)
     {
@@ -944,7 +948,8 @@
           priv->max_n_saved_points_lower_segment = n_points;
 
           priv->saved_points_lower_segment = g_realloc (priv->saved_points_lower_segment,
-                                                        sizeof (GimpVector2) * n_points);
+                                                        sizeof (GimpVector2) *
+                                                        n_points);
         }
 
       memcpy (priv->saved_points_lower_segment,
@@ -980,7 +985,7 @@
       if (priv->max_n_saved_points_lower_segment == 0)
         {
           priv->max_n_saved_points_lower_segment = 1;
-          
+
           priv->saved_points_lower_segment = g_new0 (GimpVector2, 1);
         }
 
@@ -1023,7 +1028,7 @@
                                      gdouble             new_x,
                                      gdouble             new_y)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   if (gimp_free_select_tool_is_point_grabbed (fst))
     {
@@ -1053,7 +1058,7 @@
                                                    &start_point_x,
                                                    &start_point_y,
                                                    segment_index);
-              
+
           gimp_tool_motion_constrain (start_point_x,
                                       start_point_y,
                                       &new_x,
@@ -1092,8 +1097,8 @@
                                      GimpCoords         *coords,
                                      gboolean            proximity)
 {
-  GimpTool *tool = GIMP_TOOL (fst);
-  Private  *priv = GET_PRIVATE (fst);
+  GimpTool                  *tool = GIMP_TOOL (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   gimp_tool_pop_status (tool, display);
 
@@ -1157,9 +1162,9 @@
                                    gboolean         proximity,
                                    GimpDisplay     *display)
 {
-  GimpFreeSelectTool *fst  = GIMP_FREE_SELECT_TOOL (tool);
-  Private            *priv = GET_PRIVATE (fst);
-  gboolean            hovering_first_point;
+  GimpFreeSelectTool        *fst  = GIMP_FREE_SELECT_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
+  gboolean                   hovering_first_point;
 
   gimp_free_select_tool_handle_segment_selection (fst,
                                                   display,
@@ -1202,9 +1207,10 @@
               gimp_free_select_tool_get_last_point (fst,
                                                     &start_point_x,
                                                     &start_point_y);
-              
+
               gimp_tool_motion_constrain (start_point_x, start_point_y,
-                                          &priv->pending_point.x, &priv->pending_point.y,
+                                          &priv->pending_point.x,
+                                          &priv->pending_point.y,
                                           GIMP_TOOL_CONSTRAIN_15_DEGREES);
             }
         }
@@ -1272,9 +1278,9 @@
                                     GdkModifierType  state,
                                     GimpDisplay     *display)
 {
-  GimpDrawTool       *draw_tool = GIMP_DRAW_TOOL (tool);
-  GimpFreeSelectTool *fst       = GIMP_FREE_SELECT_TOOL (tool);
-  Private            *priv      = GET_PRIVATE (fst);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (tool);
+  GimpFreeSelectTool        *fst       = GIMP_FREE_SELECT_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
 
   /* First of all handle delegation to the selection mask edit logic
    * if appropriate
@@ -1342,8 +1348,8 @@
                                       GimpButtonReleaseType  release_type,
                                       GimpDisplay           *display)
 {
-  GimpFreeSelectTool *fst  = GIMP_FREE_SELECT_TOOL (tool);
-  Private            *priv = GET_PRIVATE (fst);
+  GimpFreeSelectTool        *fst  = GIMP_FREE_SELECT_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   if (tool->display != display)
     return;
@@ -1392,9 +1398,9 @@
                               GdkModifierType  state,
                               GimpDisplay     *display)
 {
-  GimpFreeSelectTool *fst       = GIMP_FREE_SELECT_TOOL (tool);
-  Private            *priv      = GET_PRIVATE (fst);
-  GimpDrawTool       *draw_tool = GIMP_DRAW_TOOL (tool);
+  GimpFreeSelectTool        *fst       = GIMP_FREE_SELECT_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (fst);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (tool);
 
   if (tool->display != display)
     return;
@@ -1448,8 +1454,8 @@
                                     GdkModifierType  state,
                                     GimpDisplay     *display)
 {
-  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
-  Private      *priv      = GET_PRIVATE (tool);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (tool);
 
   if (tool->display == display)
     {
@@ -1476,8 +1482,8 @@
                                            GdkModifierType  state,
                                            GimpDisplay     *display)
 {
-  GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
-  Private      *priv      = GET_PRIVATE (tool);
+  GimpDrawTool              *draw_tool = GIMP_DRAW_TOOL (tool);
+  GimpFreeSelectToolPrivate *priv      = GET_PRIVATE (tool);
 
   if (tool->display != display)
     return;
@@ -1508,9 +1514,9 @@
 static void
 gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
 {
-  GimpFreeSelectTool *fst  = GIMP_FREE_SELECT_TOOL (draw_tool);
-  Private            *priv = GET_PRIVATE (fst);
-  GimpTool           *tool = GIMP_TOOL (draw_tool);
+  GimpFreeSelectTool        *fst  = GIMP_FREE_SELECT_TOOL (draw_tool);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
+  GimpTool                  *tool = GIMP_TOOL (draw_tool);
 
   if (! tool->display)
     return;
@@ -1527,8 +1533,8 @@
 
       for (i = 0; i < priv->n_segment_indices; i++)
         {
-          gdouble      dist;
           GimpVector2 *point;
+          gdouble      dist;
 
           point = &priv->points[priv->segment_indices[i]];
 
@@ -1568,8 +1574,8 @@
 gimp_free_select_tool_real_select (GimpFreeSelectTool *fst,
                                    GimpDisplay        *display)
 {
-  GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (fst);
-  Private              *priv    = GET_PRIVATE (fst);
+  GimpSelectionOptions      *options = GIMP_SELECTION_TOOL_GET_OPTIONS (fst);
+  GimpFreeSelectToolPrivate *priv    = GET_PRIVATE (fst);
 
   gimp_channel_select_polygon (gimp_image_get_mask (display->image),
                                C_("command", "Free Select"),
@@ -1590,7 +1596,7 @@
                                   const GimpVector2  **points,
                                   gint                *n_points)
 {
-  Private *priv = GET_PRIVATE (fst);
+  GimpFreeSelectToolPrivate *priv = GET_PRIVATE (fst);
 
   g_return_if_fail (points != NULL && n_points != NULL);
 

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	Fri Aug 29 18:50:27 2008
@@ -318,10 +318,11 @@
           strstr (opclass->categories, "blur")    ||
           strstr (opclass->categories, "edge")    ||
           strstr (opclass->categories, "render"))
-
-        gtk_list_store_insert_with_values (store, NULL, -1,
-                                           0, opclass->name,
-                                           -1);
+        {
+          gtk_list_store_insert_with_values (store, NULL, -1,
+                                             0, opclass->name,
+                                             -1);
+        }
     }
 
   g_list_free (opclasses);

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	Fri Aug 29 18:50:27 2008
@@ -506,10 +506,11 @@
 gimp_image_map_tool_flush (GimpImageMap     *image_map,
                            GimpImageMapTool *image_map_tool)
 {
-  GimpTool *tool = GIMP_TOOL (image_map_tool);
+  GimpTool    *tool = GIMP_TOOL (image_map_tool);
+  GimpDisplay *display = tool->display;
 
-  gimp_projection_flush_now (tool->display->image->projection);
-  gimp_display_flush_now (tool->display);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
+  gimp_display_flush_now (display);
 }
 
 static void

Modified: branches/soc-2008-text/app/tools/gimpiscissorstool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpiscissorstool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpiscissorstool.c	Fri Aug 29 18:50:27 2008
@@ -1786,7 +1786,7 @@
   dw = tile_ewidth (tile);
   dh = tile_eheight (tile);
 
-  pickable = GIMP_PICKABLE (image->projection);
+  pickable = GIMP_PICKABLE (gimp_image_get_projection (image));
 
   gimp_pickable_flush (pickable);
 

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	Fri Aug 29 18:50:27 2008
@@ -494,7 +494,7 @@
 
   spinbutton = gimp_spin_button_new (&data,
                                      config->low_input[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -509,7 +509,7 @@
   /*  input gamma spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->gamma[config->channel],
-                                     0.1, 10, 0.01, 0.1, 1, 0.5, 2);
+                                     0.1, 10, 0.01, 0.1, 0, 0.5, 2);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, TRUE, FALSE, 0);
   gimp_help_set_help_data (spinbutton, _("Gamma"), NULL);
   gtk_widget_show (spinbutton);
@@ -540,7 +540,7 @@
 
   spinbutton = gimp_spin_button_new (&data,
                                      config->high_input[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -601,7 +601,7 @@
   /*  low output spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->low_output[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
@@ -616,7 +616,7 @@
   /*  high output spin  */
   spinbutton = gimp_spin_button_new (&data,
                                      config->high_output[config->channel] * 255.0,
-                                     0, 255, 1, 10, 10, 0.5, 0);
+                                     0, 255, 1, 10, 0, 0.5, 0);
   gtk_box_pack_end (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 

Modified: branches/soc-2008-text/app/tools/gimpmovetool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpmovetool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpmovetool.c	Fri Aug 29 18:50:27 2008
@@ -262,6 +262,9 @@
               move->guide_orientation = gimp_guide_get_orientation (guide);
 
               gimp_tool_control_set_scroll_lock (tool->control, TRUE);
+              gimp_tool_control_set_precision   (tool->control,
+                                                 GIMP_CURSOR_PRECISION_PIXEL_BORDER);
+
               gimp_tool_control_activate (tool->control);
 
               gimp_display_shell_selection_control (shell,
@@ -366,6 +369,9 @@
       gimp_tool_pop_status (tool, display);
 
       gimp_tool_control_set_scroll_lock (tool->control, FALSE);
+      gimp_tool_control_set_precision   (tool->control,
+                                         GIMP_CURSOR_PRECISION_PIXEL_CENTER);
+
       gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
 
       if (release_type == GIMP_BUTTON_RELEASE_CANCEL)

Modified: branches/soc-2008-text/app/tools/gimppaintoptions-gui.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimppaintoptions-gui.c	(original)
+++ branches/soc-2008-text/app/tools/gimppaintoptions-gui.c	Fri Aug 29 18:50:27 2008
@@ -228,7 +228,7 @@
        * label positions in RTL mode.
        */
       fixed = gtk_fixed_new ();
-      gtk_table_attach (GTK_TABLE (table), fixed, 0, 6, 0, 1,
+      gtk_table_attach (GTK_TABLE (table), fixed, 0, n_dynamics + 2, 0, 1,
                         GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
       gtk_widget_show (fixed);
 

Modified: branches/soc-2008-text/app/tools/gimppainttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimppainttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimppainttool.c	Fri Aug 29 18:50:27 2008
@@ -90,6 +90,10 @@
 
 static void   gimp_paint_tool_draw           (GimpDrawTool          *draw_tool);
 
+static void   gimp_paint_tool_hard_notify    (GimpPaintOptions      *options,
+                                              const GParamSpec      *pspec,
+                                              GimpTool              *tool);
+
 
 G_DEFINE_TYPE (GimpPaintTool, gimp_paint_tool, GIMP_TYPE_COLOR_TOOL)
 
@@ -121,8 +125,8 @@
 {
   GimpTool *tool = GIMP_TOOL (paint_tool);
 
-  gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
-  gimp_tool_control_set_scroll_lock (tool->control, TRUE);
+  gimp_tool_control_set_motion_mode    (tool->control, GIMP_MOTION_MODE_EXACT);
+  gimp_tool_control_set_scroll_lock    (tool->control, TRUE);
   gimp_tool_control_set_action_value_1 (tool->control,
                                         "context/context-opacity-set");
 
@@ -144,15 +148,17 @@
                              guint                  n_params,
                              GObjectConstructParam *params)
 {
-  GObject       *object;
-  GimpTool      *tool;
-  GimpPaintInfo *paint_info;
-  GimpPaintTool *paint_tool;
+  GObject          *object;
+  GimpTool         *tool;
+  GimpPaintInfo    *paint_info;
+  GimpPaintTool    *paint_tool;
+  GimpPaintOptions *options;
 
   object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
 
   tool       = GIMP_TOOL (object);
   paint_tool = GIMP_PAINT_TOOL (object);
+  options    = GIMP_PAINT_TOOL_GET_OPTIONS (tool);
 
   g_assert (GIMP_IS_TOOL_INFO (tool->tool_info));
   g_assert (GIMP_IS_PAINT_INFO (tool->tool_info->paint_info));
@@ -165,6 +171,12 @@
                                    "undo-desc", paint_info->blurb,
                                    NULL);
 
+  g_signal_connect_object (options, "notify::hard",
+                           G_CALLBACK (gimp_paint_tool_hard_notify),
+                           tool, 0);
+
+  gimp_paint_tool_hard_notify (options, NULL, tool);
+
   return object;
 }
 
@@ -365,7 +377,7 @@
                              GIMP_PAINT_STATE_MOTION, time);
     }
 
-  gimp_projection_flush_now (display->image->projection);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
   gimp_display_flush_now (display);
 
   gimp_draw_tool_start (draw_tool, display);
@@ -456,7 +468,7 @@
 
   gimp_paint_core_interpolate (core, drawable, paint_options, time);
 
-  gimp_projection_flush_now (display->image->projection);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
   gimp_display_flush_now (display);
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
@@ -706,3 +718,14 @@
 
   GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
 }
+
+static void
+gimp_paint_tool_hard_notify (GimpPaintOptions *options,
+                             const GParamSpec *pspec,
+                             GimpTool         *tool)
+{
+  gimp_tool_control_set_precision (tool->control,
+                                   options->hard ?
+                                   GIMP_CURSOR_PRECISION_PIXEL_CENTER :
+                                   GIMP_CURSOR_PRECISION_SUBPIXEL);
+}

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

Modified: branches/soc-2008-text/app/tools/gimpperspectiveclonetool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimpperspectiveclonetool.h	(original)
+++ branches/soc-2008-text/app/tools/gimpperspectiveclonetool.h	Fri Aug 29 18:50:27 2008
@@ -95,10 +95,10 @@
 };
 
 
-void    gimp_perspective_clone_tool_register      (GimpToolRegisterCallback  callback,
-                                                   gpointer                  data);
+void    gimp_perspective_clone_tool_register (GimpToolRegisterCallback  callback,
+                                              gpointer                  data);
 
-GType   gimp_perspective_clone_tool_get_type      (void) G_GNUC_CONST;
+GType   gimp_perspective_clone_tool_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_PERSPECTIVE_CLONE_TOOL_H__  */

Modified: branches/soc-2008-text/app/tools/gimprectangleselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimprectangleselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimprectangleselecttool.c	Fri Aug 29 18:50:27 2008
@@ -222,6 +222,8 @@
   priv = GIMP_RECTANGLE_SELECT_TOOL_GET_PRIVATE (rect_sel_tool);
 
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_PIXEL_BORDER);
   gimp_tool_control_set_tool_cursor (tool->control,
                                      GIMP_TOOL_CURSOR_RECT_SELECT);
   gimp_tool_control_set_dirty_mask  (tool->control,

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	Fri Aug 29 18:50:27 2008
@@ -105,8 +105,7 @@
    * during gimp_rectangle_tool_button_press and then only read.
    */
 
-  /*
-   * Wether or not the rectangle currently being rubber-banded was
+  /* Wether or not the rectangle currently being rubber-banded was
    * created from scatch.
    */
   gboolean                is_new;
@@ -127,7 +126,6 @@
   gboolean                rect_adjusting;
 
 
-
   /* The rest of the members are internal state variables, that is, variables
    * that might change during the manipulation session of the rectangle. Make
    * sure these variables are in consistent states.
@@ -1080,7 +1078,7 @@
       private->function != GIMP_RECTANGLE_TOOL_EXECUTING)
     {
       gdouble pub_x1, pub_y1, pub_x2, pub_y2;
-      gint w, h;
+      gint    w, h;
 
       gimp_tool_pop_status (tool, display);
 
@@ -1096,6 +1094,7 @@
           aspect_text = g_strdup_printf ("  (%.2f:1)", w / (gdouble) h);
 
           gimp_tool_push_status_coords (tool, display,
+                                        GIMP_CURSOR_PRECISION_PIXEL_CENTER,
                                         _("Rectangle: "),
                                         w, " Ã ", h, aspect_text);
           g_free (aspect_text);
@@ -1105,8 +1104,8 @@
   if (private->function == GIMP_RECTANGLE_TOOL_CREATING)
     {
       GimpRectangleFunction function = GIMP_RECTANGLE_TOOL_CREATING;
-      gdouble               dx = snapped_x - private->lastx;
-      gdouble               dy = snapped_y - private->lasty;
+      gdouble               dx       = snapped_x - private->lastx;
+      gdouble               dy       = snapped_y - private->lasty;
 
       /* When the user starts to move the cursor, set the current
        * function to one of the corner-grabbed functions, depending on
@@ -1114,27 +1113,27 @@
        */
       if (dx < 0)
         {
-          function = dy < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT;
+          function = (dy < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT);
         }
       else if (dx > 0)
         {
-          function = dy < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT;
+          function = (dy < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT);
         }
       else if (dy < 0)
         {
-          function = dx < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT;
+          function = (dx < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_UPPER_RIGHT);
         }
       else if (dy > 0)
         {
-          function = dx < 0 ?
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT :
-            GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT;
+          function = (dx < 0 ?
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_LEFT :
+                      GIMP_RECTANGLE_TOOL_RESIZING_LOWER_RIGHT);
         }
 
       gimp_rectangle_tool_set_function (rect_tool, function);
@@ -1168,7 +1167,6 @@
   private->lasty = snapped_y;
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
-
 }
 
 void
@@ -1236,7 +1234,6 @@
 
   if (key == GDK_CONTROL_MASK)
     {
-
       g_object_set (options,
                     "fixed-center", ! options_private->fixed_center,
                     NULL);
@@ -1515,7 +1512,7 @@
 
   g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
 
-  private        = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
+  private   = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
   rect_tool = GIMP_RECTANGLE_TOOL (tool);
 
   if (tool->display != display)
@@ -1779,6 +1776,7 @@
 
   gimp_rectangle_tool_get_public_rect (GIMP_RECTANGLE_TOOL (draw_tool),
                                        &pub_x1, &pub_y1, &pub_x2, &pub_y2);
+
   switch (private->guide)
     {
     case GIMP_RECTANGLE_GUIDE_NONE:
@@ -1869,7 +1867,7 @@
 
     gint x2, y2, w2, h2;
 
-    gimp_display_shell_get_scaled_viewport (shell, &x2, &y2, &w2, &h2);
+    gimp_display_shell_scroll_get_scaled_viewport (shell, &x2, &y2, &w2, &h2);
 
     rectangle_width  = w1;
     rectangle_height = h1;
@@ -1992,6 +1990,7 @@
 
   /* initialize the statusbar display */
   gimp_tool_push_status_coords (tool, tool->display,
+                                GIMP_CURSOR_PRECISION_PIXEL_CENTER,
                                 _("Rectangle: "), 0, " Ã ", 0, NULL);
 
   gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), tool->display);
@@ -2188,7 +2187,6 @@
   g_signal_handlers_unblock_by_func (options,
                                      gimp_rectangle_tool_options_notify,
                                      rect_tool);
-
 }
 
 static void

Modified: branches/soc-2008-text/app/tools/gimprotatetool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimprotatetool.c	(original)
+++ branches/soc-2008-text/app/tools/gimprotatetool.c	Fri Aug 29 18:50:27 2008
@@ -199,7 +199,7 @@
                     GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
   gtk_widget_show (scale);
 
-  button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 1, 1, 2);
+  button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 0, 1, 2);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Center _X:"),
                              0.0, 0.5, button, 1, TRUE);

Modified: branches/soc-2008-text/app/tools/gimpsheartool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpsheartool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpsheartool.c	Fri Aug 29 18:50:27 2008
@@ -129,7 +129,7 @@
   gtk_widget_show (table);
 
   button = gimp_spin_button_new (&shear->x_adj,
-                                 0, -65536, 65536, 1, 15, 1, 1, 0);
+                                 0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Shear magnitude _X:"),
                              0.0, 0.5, button, 1, TRUE);
@@ -139,7 +139,7 @@
                     tr_tool);
 
   button = gimp_spin_button_new (&shear->y_adj,
-                                 0, -65536, 65536, 1, 15, 1, 1, 0);
+                                 0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Shear magnitude _Y:"),
                              0.0, 0.5, button, 1, TRUE);

Modified: branches/soc-2008-text/app/tools/gimptexttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptexttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimptexttool.c	Fri Aug 29 18:50:27 2008
@@ -619,6 +619,7 @@
         g_object_set (text_tool->proxy,
                       "box-mode", GIMP_TEXT_BOX_DYNAMIC,
                       NULL);
+
       text_tool->handle_rectangle_change_complete = FALSE;
     }
   else
@@ -997,9 +998,9 @@
 
   /* we need to redraw the rectangle if it is visible and the shape of
      the layer has changed, because of an undo for example. */
-  if ((0 == strcmp (pspec->name, "box-width"))
-      || (0 == strcmp (pspec->name, "box-height"))
-      || (text->box_mode == GIMP_TEXT_BOX_DYNAMIC))
+  if (strcmp (pspec->name, "box-width") == 0  ||
+      strcmp (pspec->name, "box-height") == 0 ||
+      text->box_mode == GIMP_TEXT_BOX_DYNAMIC)
     {
       GimpRectangleTool *rect_tool = GIMP_RECTANGLE_TOOL (text_tool);
 
@@ -1270,8 +1271,8 @@
 
   if (text_tool->text_box_fixed)
     {
-      GimpRectangleTool *rect_tool       = GIMP_RECTANGLE_TOOL (text_tool);
-      GimpItem          *item            = GIMP_ITEM (layer);
+      GimpRectangleTool *rect_tool = GIMP_RECTANGLE_TOOL (text_tool);
+      GimpItem          *item      = GIMP_ITEM (layer);
       gint               x1, y1, x2, y2;
 
       g_object_get (rect_tool,
@@ -1281,8 +1282,8 @@
                     "y2", &y2,
                     NULL);
       g_object_set (text_tool->proxy,
-                    "box-mode", GIMP_TEXT_BOX_FIXED,
-                    "box-width", (gdouble) (x2 - x1),
+                    "box-mode",   GIMP_TEXT_BOX_FIXED,
+                    "box-width",  (gdouble) (x2 - x1),
                     "box-height", (gdouble) (y2 - y1),
                     NULL);
       gimp_item_translate (item,
@@ -1741,6 +1742,7 @@
                     NULL);
 
       text_tool->text_box_fixed = TRUE;
+
       if (! text)
         {
           /*
@@ -1753,8 +1755,8 @@
         }
 
       g_object_set (text_tool->proxy,
-                    "box-mode", GIMP_TEXT_BOX_FIXED,
-                    "box-width", (gdouble) (x2 - x1),
+                    "box-mode",   GIMP_TEXT_BOX_FIXED,
+                    "box-width",  (gdouble) (x2 - x1),
                     "box-height", (gdouble) (y2 - y1),
                     NULL);
 
@@ -1791,7 +1793,7 @@
 gimp_rectangle_tool_frame_item (GimpRectangleTool *rect_tool,
                                 GimpItem          *item)
 {
-  GimpDisplay *display    = GIMP_TOOL (rect_tool)->display;
+  GimpDisplay *display  = GIMP_TOOL (rect_tool)->display;
   gint         offset_x;
   gint         offset_y;
   gint         width;
@@ -1800,10 +1802,11 @@
   g_return_if_fail (GIMP_IS_ITEM (item));
   g_return_if_fail (gimp_item_is_attached (item));
   g_return_if_fail (display != NULL);
-  g_return_if_fail ( (display->image == item->image) );
+  g_return_if_fail (display->image == item->image);
+
+  width  = gimp_item_width (item);
+  height = gimp_item_height (item);
 
-  width     = gimp_item_width (item);
-  height    = gimp_item_height (item);
   gimp_item_offsets (item, &offset_x, &offset_y);
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (rect_tool));

Modified: branches/soc-2008-text/app/tools/gimptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimptool.c	Fri Aug 29 18:50:27 2008
@@ -864,13 +864,14 @@
 }
 
 void
-gimp_tool_push_status_coords (GimpTool    *tool,
-                              GimpDisplay *display,
-                              const gchar *title,
-                              gdouble      x,
-                              const gchar *separator,
-                              gdouble      y,
-                              const gchar *help)
+gimp_tool_push_status_coords (GimpTool            *tool,
+                              GimpDisplay         *display,
+                              GimpCursorPrecision  precision,
+                              const gchar         *title,
+                              gdouble              x,
+                              const gchar         *separator,
+                              gdouble              y,
+                              const gchar         *help)
 {
   GimpDisplayShell *shell;
   const gchar      *stock_id;
@@ -884,7 +885,8 @@
 
   gimp_statusbar_push_coords (GIMP_STATUSBAR (shell->statusbar),
                               G_OBJECT_TYPE_NAME (tool), stock_id,
-                              title, x, separator, y, help);
+                              precision, title, x, separator, y,
+                              help);
 
   tool->status_displays = g_list_remove (tool->status_displays, display);
   tool->status_displays = g_list_prepend (tool->status_displays, display);

Modified: branches/soc-2008-text/app/tools/gimptool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimptool.h	(original)
+++ branches/soc-2008-text/app/tools/gimptool.h	Fri Aug 29 18:50:27 2008
@@ -191,6 +191,7 @@
                                              ...) G_GNUC_PRINTF(3,4);
 void          gimp_tool_push_status_coords  (GimpTool            *tool,
                                              GimpDisplay         *display,
+                                             GimpCursorPrecision  precision,
                                              const gchar         *title,
                                              gdouble              x,
                                              const gchar         *separator,

Modified: branches/soc-2008-text/app/tools/gimptoolcontrol.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptoolcontrol.c	(original)
+++ branches/soc-2008-text/app/tools/gimptoolcontrol.c	Fri Aug 29 18:50:27 2008
@@ -60,6 +60,8 @@
   control->snap_width             = 0;
   control->snap_height            = 0;
 
+  control->precision              = GIMP_CURSOR_PRECISION_PIXEL_CENTER;
+
   control->toggled                = FALSE;
 
   control->wants_all_key_events   = FALSE;
@@ -337,6 +339,24 @@
 }
 
 void
+gimp_tool_control_set_precision (GimpToolControl     *control,
+                                 GimpCursorPrecision  precision)
+{
+  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
+
+  control->precision = precision;
+}
+
+GimpCursorPrecision
+gimp_tool_control_get_precision (GimpToolControl *control)
+{
+  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control),
+                        GIMP_CURSOR_PRECISION_PIXEL_CENTER);
+
+  return control->precision;
+}
+
+void
 gimp_tool_control_set_toggled (GimpToolControl *control,
                                gboolean         toggled)
 {

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

Modified: branches/soc-2008-text/app/tools/gimptransformtool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimptransformtool.c	(original)
+++ branches/soc-2008-text/app/tools/gimptransformtool.c	Fri Aug 29 18:50:27 2008
@@ -203,6 +203,8 @@
                                      GIMP_DIRTY_IMAGE_SIZE |
                                      GIMP_DIRTY_DRAWABLE   |
                                      GIMP_DIRTY_SELECTION);
+  gimp_tool_control_set_precision   (tool->control,
+                                     GIMP_CURSOR_PRECISION_SUBPIXEL);
 
   tr_tool->function = TRANSFORM_CREATING;
   tr_tool->original = NULL;
@@ -1179,15 +1181,9 @@
       return;
     }
 
-  mask_empty = gimp_channel_is_empty (gimp_image_get_mask (display->image));
+  gimp_dialog_factory_hide_dialog (tr_tool->dialog);
 
-  if (gimp_display_shell_get_show_transform (shell))
-    {
-      gimp_display_shell_set_show_transform (shell, FALSE);
-
-      /* get rid of preview artifacts left outside the drawable's area */
-      gtk_widget_queue_draw (shell->canvas);
-    }
+  mask_empty = gimp_channel_is_empty (gimp_image_get_mask (display->image));
 
   gimp_set_busy (display->image->gimp);
 
@@ -1294,6 +1290,14 @@
    */
   gimp_tool_control_set_preserve (tool->control, FALSE);
 
+  if (gimp_display_shell_get_show_transform (shell))
+    {
+      gimp_display_shell_set_show_transform (shell, FALSE);
+
+      /* get rid of preview artifacts left outside the drawable's area */
+      gtk_widget_queue_draw (shell->canvas);
+    }
+
   gimp_unset_busy (display->image->gimp);
 
   gimp_image_flush (display->image);
@@ -1352,7 +1356,9 @@
        options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
       options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
       options->direction    == GIMP_TRANSFORM_FORWARD)
-    gimp_transform_tool_force_expose_preview (tr_tool);
+    {
+      gimp_transform_tool_force_expose_preview (tr_tool);
+    }
 }
 
 static void
@@ -1692,16 +1698,16 @@
                              GimpDisplay       *display)
 {
   GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tr_tool);
+  gboolean              show_transform;
 
-  if ((options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
-       options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
-      options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
-      options->direction    == GIMP_TRANSFORM_FORWARD)
-    gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
-                                           TRUE);
-  else
-    gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
-                                           FALSE);
+  show_transform =
+    ((options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
+      options->preview_type == GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID) &&
+     options->type         == GIMP_TRANSFORM_TYPE_LAYER &&
+     options->direction    == GIMP_TRANSFORM_FORWARD);
+
+  gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (display->shell),
+                                         show_transform);
 
   if (tr_tool->dialog)
     {

Modified: branches/soc-2008-text/app/tools/gimpvectortool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpvectortool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpvectortool.c	Fri Aug 29 18:50:27 2008
@@ -192,6 +192,8 @@
   gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
   gimp_tool_control_set_motion_mode        (tool->control,
                                             GIMP_MOTION_MODE_COMPRESS);
+  gimp_tool_control_set_precision          (tool->control,
+                                            GIMP_CURSOR_PRECISION_SUBPIXEL);
   gimp_tool_control_set_cursor             (tool->control, GIMP_CURSOR_MOUSE);
   gimp_tool_control_set_tool_cursor        (tool->control,
                                             GIMP_TOOL_CURSOR_PATHS);

Modified: branches/soc-2008-text/app/widgets/gimpaction.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpaction.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpaction.c	Fri Aug 29 18:50:27 2008
@@ -278,12 +278,22 @@
                  const gchar *tooltip,
                  const gchar *stock_id)
 {
-  return g_object_new (GIMP_TYPE_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       NULL);
+  GimpAction *action;
+
+  action = g_object_new (GIMP_TYPE_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 gint

Modified: branches/soc-2008-text/app/widgets/gimpcolormapeditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpcolormapeditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpcolormapeditor.c	Fri Aug 29 18:50:27 2008
@@ -219,7 +219,7 @@
   gtk_widget_show (table);
 
   editor->index_spinbutton = gimp_spin_button_new (&adj,
-                                                   0, 0, 0, 1, 10, 10, 1.0, 0);
+                                                   0, 0, 0, 1, 10, 0, 1.0, 0);
   editor->index_adjustment = GTK_ADJUSTMENT (adj);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("Color index:"), 0.0, 0.5,

Modified: branches/soc-2008-text/app/widgets/gimpdockable.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpdockable.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpdockable.c	Fri Aug 29 18:50:27 2008
@@ -692,6 +692,21 @@
 }
 
 static GtkWidget *
+gimp_dockable_get_icon (GimpDockable *dockable,
+                        GtkIconSize   size)
+{
+  GdkScreen    *screen = gtk_widget_get_screen (GTK_WIDGET (dockable));
+  GtkIconTheme *theme  = gtk_icon_theme_get_for_screen (screen);
+
+  if (gtk_icon_theme_has_icon (theme, dockable->stock_id))
+    {
+      return gtk_image_new_from_icon_name (dockable->stock_id, size);
+    }
+
+  return  gtk_image_new_from_stock (dockable->stock_id, size);
+}
+
+static GtkWidget *
 gimp_dockable_get_tab_widget_internal (GimpDockable *dockable,
                                        GimpContext  *context,
                                        GimpTabStyle  tab_style,
@@ -725,7 +740,7 @@
     case GIMP_TAB_STYLE_ICON:
     case GIMP_TAB_STYLE_ICON_NAME:
     case GIMP_TAB_STYLE_ICON_BLURB:
-      icon = gtk_image_new_from_stock (dockable->stock_id, size);
+      icon = gimp_dockable_get_icon (dockable, size);
       break;
 
     case GIMP_TAB_STYLE_PREVIEW:
@@ -739,7 +754,7 @@
                                           context, size);
 
         if (! icon)
-          icon = gtk_image_new_from_stock (dockable->stock_id, size);
+          icon = gimp_dockable_get_icon (dockable, size);
       }
       break;
 
@@ -1213,6 +1228,17 @@
                     "visible",  TRUE,
                     NULL);
 
+      if (dockable->stock_id)
+        {
+          if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
+                                       dockable->stock_id))
+            {
+              g_object_set (parent_menu_action,
+                            "icon-name", dockable->stock_id,
+                            NULL);
+            }
+        }
+
       if (! GTK_IS_MENU (child_menu_widget))
         {
           g_warning ("%s: child_menu_widget (%p) is not a GtkMenu",
@@ -1222,8 +1248,8 @@
 
       /* FIXME */
       {
-        GtkWidget *image = gtk_image_new_from_stock (dockable->stock_id,
-                                                     GTK_ICON_SIZE_MENU);
+        GtkWidget *image = gimp_dockable_get_icon (dockable,
+                                                   GTK_ICON_SIZE_MENU);
 
         gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (parent_menu_widget),
                                        image);

Modified: branches/soc-2008-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	Fri Aug 29 18:50:27 2008
@@ -53,6 +53,7 @@
 #define GIMP_HELP_EDIT_PASTE                      "gimp-edit-paste"
 #define GIMP_HELP_EDIT_PASTE_INTO                 "gimp-edit-paste-into"
 #define GIMP_HELP_EDIT_PASTE_AS_NEW               "gimp-edit-paste-as-new"
+#define GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER         "gimp-edit-paste-as-new-layer"
 #define GIMP_HELP_EDIT_CLEAR                      "gimp-edit-clear"
 #define GIMP_HELP_EDIT_FILL_FG                    "gimp-edit-fill-fg"
 #define GIMP_HELP_EDIT_FILL_BG                    "gimp-edit-fill-bg"
@@ -136,6 +137,7 @@
 #define GIMP_HELP_LAYER_DIALOG_LOCK_ALPHA_BUTTON  "gimp-layer-dialog-lock-alpha-button"
 
 #define GIMP_HELP_LAYER_NEW                       "gimp-layer-new"
+#define GIMP_HELP_LAYER_NEW_FROM_VISIBLE          "gimp-layer-new-from-visible"
 #define GIMP_HELP_LAYER_DUPLICATE                 "gimp-layer-duplicate"
 #define GIMP_HELP_LAYER_ANCHOR                    "gimp-layer-anchor"
 #define GIMP_HELP_LAYER_MERGE_DOWN                "gimp-layer-merge-down"

Modified: branches/soc-2008-text/app/widgets/gimphistogrameditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimphistogrameditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimphistogrameditor.c	Fri Aug 29 18:50:27 2008
@@ -391,7 +391,13 @@
 
   if (gimp_viewable_preview_is_frozen (GIMP_VIEWABLE (editor->drawable)))
     {
-      if (! editor->bg_histogram)
+      /* Only do the background histogram if the histogram is visible.
+       * This is a workaround for the fact that recalculating the
+       * histogram is expensive and that it is only validated when it
+       * is shown. So don't slow down painting by doing something that
+       * is not even seen by the user.
+       */
+      if (! editor->bg_histogram && GTK_WIDGET_DRAWABLE (editor))
         {
           if (gimp_histogram_editor_validate (editor))
             editor->bg_histogram = gimp_histogram_duplicate (editor->histogram);

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	Fri Aug 29 18:50:27 2008
@@ -38,7 +38,7 @@
 #include "gimpviewrenderer.h"
 
 
-#define BORDER_PEN_WIDTH 3
+#define BORDER_WIDTH 2
 
 
 enum
@@ -69,17 +69,13 @@
   gint         motion_offset_x;
   gint         motion_offset_y;
   gboolean     has_grab;
-
-  GdkGC       *gc;
 };
 
 
-static void     gimp_navigation_view_realize        (GtkWidget      *widget);
-static void     gimp_navigation_view_unrealize      (GtkWidget      *widget);
 static void     gimp_navigation_view_size_allocate  (GtkWidget      *widget,
                                                      GtkAllocation  *allocation);
 static gboolean gimp_navigation_view_expose         (GtkWidget      *widget,
-                                                     GdkEventExpose *eevent);
+                                                     GdkEventExpose *event);
 static gboolean gimp_navigation_view_button_press   (GtkWidget      *widget,
                                                      GdkEventButton *bevent);
 static gboolean gimp_navigation_view_button_release (GtkWidget      *widget,
@@ -93,7 +89,7 @@
 
 static void     gimp_navigation_view_transform      (GimpNavigationView *nav_view);
 static void     gimp_navigation_view_draw_marker    (GimpNavigationView *nav_view,
-                                                     GdkRectangle       *area);
+                                                     cairo_t            *cr);
 
 
 G_DEFINE_TYPE (GimpNavigationView, gimp_navigation_view, GIMP_TYPE_VIEW)
@@ -141,8 +137,6 @@
                   G_TYPE_NONE, 1,
                   GDK_TYPE_SCROLL_DIRECTION);
 
-  widget_class->realize              = gimp_navigation_view_realize;
-  widget_class->unrealize            = gimp_navigation_view_unrealize;
   widget_class->size_allocate        = gimp_navigation_view_size_allocate;
   widget_class->expose_event         = gimp_navigation_view_expose;
   widget_class->button_press_event   = gimp_navigation_view_button_press;
@@ -172,37 +166,6 @@
   view->motion_offset_x = 0;
   view->motion_offset_y = 0;
   view->has_grab        = FALSE;
-
-  view->gc              = NULL;
-}
-
-static void
-gimp_navigation_view_realize (GtkWidget *widget)
-{
-  GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
-
-  GTK_WIDGET_CLASS (parent_class)->realize (widget);
-
-  nav_view->gc = gdk_gc_new (widget->window);
-
-  gdk_gc_set_function (nav_view->gc, GDK_INVERT);
-  gdk_gc_set_line_attributes (nav_view->gc,
-                              BORDER_PEN_WIDTH,
-                              GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_ROUND);
-}
-
-static void
-gimp_navigation_view_unrealize (GtkWidget *widget)
-{
-  GimpNavigationView *nav_view = GIMP_NAVIGATION_VIEW (widget);
-
-  if (nav_view->gc)
-    {
-      g_object_unref (nav_view->gc);
-      nav_view->gc = NULL;
-    }
-
-  GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
 }
 
 static void
@@ -217,52 +180,59 @@
 
 static gboolean
 gimp_navigation_view_expose (GtkWidget      *widget,
-                             GdkEventExpose *eevent)
+                             GdkEventExpose *event)
 {
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
+      cairo_t *cr;
+
+      GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+
+      cr = gdk_cairo_create (widget->window);
 
-      gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget),
-                                        &eevent->area);
+      gdk_cairo_region (cr, event->region);
+      cairo_clip (cr);
+
+      gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget), cr);
+
+      cairo_destroy (cr);
     }
 
   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);
-  GimpImage *image;
   gdouble    ratiox, ratioy;
   gdouble    x, y;
 
   if (! view->renderer->viewable)
     return;
 
-  tx = CLAMP (tx, 0, view->renderer->width  - nav_view->p_width);
-  ty = CLAMP (ty, 0, view->renderer->height - nav_view->p_height);
+  gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
 
-  image = GIMP_IMAGE (view->renderer->viewable);
-
-  /*  transform to image coordinates  */
-  if (view->renderer->width != nav_view->p_width)
-    ratiox = ((gimp_image_get_width (image) - nav_view->width + 1.0) /
-              (view->renderer->width - nav_view->p_width));
-  else
-    ratiox = 1.0;
-
-  if (view->renderer->height != nav_view->p_height)
-    ratioy = ((gimp_image_get_height (image) - nav_view->height + 1.0) /
-              (view->renderer->height - nav_view->p_height));
-  else
-    ratioy = 1.0;
-
-  x = tx * ratiox;
-  y = ty * ratioy;
+  x = tx / ratiox;
+  y = ty / ratioy;
 
   g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
                  x, y, nav_view->width, nav_view->height);
@@ -290,7 +260,7 @@
                     GDK_POINTER_MOTION_HINT_MASK |
                     GDK_BUTTON_MOTION_MASK       |
                     GDK_EXTENSION_EVENTS_ALL,
-                    window, cursor, GDK_CURRENT_TIME);
+                    NULL, cursor, GDK_CURRENT_TIME);
 
   gdk_cursor_unref (cursor);
 }
@@ -501,58 +471,46 @@
 static void
 gimp_navigation_view_transform (GimpNavigationView *nav_view)
 {
-  GimpView  *view = GIMP_VIEW (nav_view);
-  GimpImage *image;
-  gdouble    ratiox, ratioy;
-
-  image = GIMP_IMAGE (view->renderer->viewable);
+  gdouble ratiox, ratioy;
 
-  ratiox = ((gdouble) view->renderer->width  /
-            (gdouble) gimp_image_get_width  (image));
-  ratioy = ((gdouble) view->renderer->height /
-            (gdouble) gimp_image_get_height (image));
+  gimp_navigation_view_get_ratio (nav_view, &ratiox, &ratioy);
 
   nav_view->p_x = RINT (nav_view->x * ratiox);
   nav_view->p_y = RINT (nav_view->y * ratioy);
 
-  nav_view->p_width  = RINT (nav_view->width  * ratiox);
-  nav_view->p_height = RINT (nav_view->height * ratioy);
+  nav_view->p_width  = ceil (nav_view->width  * ratiox);
+  nav_view->p_height = ceil (nav_view->height * ratioy);
 }
 
 static void
 gimp_navigation_view_draw_marker (GimpNavigationView *nav_view,
-                                  GdkRectangle       *area)
+                                  cairo_t            *cr)
 {
   GimpView *view = GIMP_VIEW (nav_view);
 
-  if (view->renderer->viewable  &&
-      nav_view->width           &&
-      nav_view->height)
+  if (view->renderer->viewable && nav_view->width && nav_view->height)
     {
-      GimpImage *image;
-
-      image = GIMP_IMAGE (view->renderer->viewable);
-
-      if (nav_view->x      > 0                             ||
-          nav_view->y      > 0                             ||
-          nav_view->width  < gimp_image_get_width  (image) ||
-          nav_view->height < gimp_image_get_height (image))
-        {
-          GtkWidget *widget = GTK_WIDGET (view);
+      GtkWidget *widget = GTK_WIDGET (view);
 
-          if (area)
-            gdk_gc_set_clip_rectangle (nav_view->gc, area);
-
-          gdk_draw_rectangle (widget->window, nav_view->gc,
-                              FALSE,
-                              widget->allocation.x + nav_view->p_x + 1,
-                              widget->allocation.y + nav_view->p_y + 1,
-                              MAX (1, nav_view->p_width  - BORDER_PEN_WIDTH),
-                              MAX (1, nav_view->p_height - BORDER_PEN_WIDTH));
-
-          if (area)
-            gdk_gc_set_clip_rectangle (nav_view->gc, NULL);
-        }
+      cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+      cairo_rectangle (cr,
+                       0, 0,
+                       widget->allocation.width, widget->allocation.height);
+      cairo_rectangle (cr,
+                       nav_view->p_x, nav_view->p_y,
+                       nav_view->p_width, nav_view->p_height);
+
+      cairo_set_source_rgba (cr, 0, 0, 0, 0.5);
+      cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+      cairo_fill (cr);
+
+      cairo_rectangle (cr,
+                       nav_view->p_x, nav_view->p_y,
+                       nav_view->p_width, nav_view->p_height);
+
+      cairo_set_source_rgb (cr, 1, 1, 1);
+      cairo_set_line_width (cr, BORDER_WIDTH);
+      cairo_stroke (cr);
     }
 }
 
@@ -563,8 +521,7 @@
                                  gdouble             width,
                                  gdouble             height)
 {
-  GimpView  *view;
-  GimpImage *image;
+  GimpView *view;
 
   g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (nav_view));
 
@@ -572,31 +529,15 @@
 
   g_return_if_fail (view->renderer->viewable);
 
-  image = GIMP_IMAGE (view->renderer->viewable);
-
-  /*  remove old marker  */
-  if (GTK_WIDGET_DRAWABLE (view))
-    gimp_navigation_view_draw_marker (nav_view, NULL);
-
-  nav_view->x = CLAMP (x, 0.0, gimp_image_get_width  (image) - 1.0);
-  nav_view->y = CLAMP (y, 0.0, gimp_image_get_height (image) - 1.0);
-
-  if (width < 0.0)
-    width = gimp_image_get_width (image);
-
-  if (height < 0.0)
-    height = gimp_image_get_height (image);
-
-  nav_view->width  = CLAMP (width,  1.0,
-                            gimp_image_get_width  (image) - nav_view->x);
-  nav_view->height = CLAMP (height, 1.0,
-                            gimp_image_get_height (image) - nav_view->y);
+  nav_view->x      = x;
+  nav_view->y      = y;
+  nav_view->width  = MAX (1.0, width);
+  nav_view->height = MAX (1.0, height);
 
   gimp_navigation_view_transform (nav_view);
 
-  /*  draw new marker  */
-  if (GTK_WIDGET_DRAWABLE (view))
-    gimp_navigation_view_draw_marker (nav_view, NULL);
+  /* Marker changed, invalidate */
+  gimp_view_renderer_invalidate (view->renderer);
 }
 
 void

Modified: branches/soc-2008-text/app/widgets/gimppaletteeditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimppaletteeditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimppaletteeditor.c	Fri Aug 29 18:50:27 2008
@@ -264,7 +264,7 @@
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
-  spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 4, 1, 0);
+  spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 0, 1, 0);
   editor->columns_data = GTK_ADJUSTMENT (adj);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);

Modified: branches/soc-2008-text/app/widgets/gimpradioaction.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpradioaction.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpradioaction.c	Fri Aug 29 18:50:27 2008
@@ -80,13 +80,24 @@
                        const gchar *stock_id,
                        gint         value)
 {
-  return g_object_new (GIMP_TYPE_RADIO_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       "value",    value,
-                       NULL);
+  GtkRadioAction *action;
+
+  action = g_object_new (GIMP_TYPE_RADIO_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "value",    value,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_factory_lookup_default (stock_id))
+        g_object_set (action, "stock-id", stock_id, NULL);
+      else
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 

Modified: branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c	Fri Aug 29 18:50:27 2008
@@ -269,7 +269,8 @@
       g_signal_handlers_disconnect_by_func (image_editor->image,
                                             gimp_sample_point_editor_point_update,
                                             editor);
-      g_signal_handlers_disconnect_by_func (image_editor->image->projection,
+
+      g_signal_handlers_disconnect_by_func (gimp_image_get_projection (image_editor->image),
                                             gimp_sample_point_editor_proj_update,
                                             editor);
     }
@@ -287,7 +288,8 @@
       g_signal_connect (image, "update-sample-point",
                         G_CALLBACK (gimp_sample_point_editor_point_update),
                         editor);
-      g_signal_connect (image->projection, "update",
+
+      g_signal_connect (gimp_image_get_projection (image), "update",
                         G_CALLBACK (gimp_sample_point_editor_proj_update),
                         editor);
     }

Modified: branches/soc-2008-text/app/widgets/gimpstringaction.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpstringaction.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpstringaction.c	Fri Aug 29 18:50:27 2008
@@ -158,13 +158,23 @@
                         const gchar *stock_id,
                         const gchar *value)
 {
-  return g_object_new (GIMP_TYPE_STRING_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       "value",    value,
-                       NULL);
+  GimpStringAction *action;
+
+  action = g_object_new (GIMP_TYPE_STRING_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         "value",    value,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 static void

Modified: branches/soc-2008-text/app/widgets/gimptoggleaction.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimptoggleaction.c	(original)
+++ branches/soc-2008-text/app/widgets/gimptoggleaction.c	Fri Aug 29 18:50:27 2008
@@ -79,12 +79,24 @@
                         const gchar *tooltip,
                         const gchar *stock_id)
 {
-  return g_object_new (GIMP_TYPE_TOGGLE_ACTION,
-                       "name",     name,
-                       "label",    label,
-                       "tooltip",  tooltip,
-                       "stock-id", stock_id,
-                       NULL);
+  GtkToggleAction *action;
+
+  action = g_object_new (GIMP_TYPE_TOGGLE_ACTION,
+                         "name",     name,
+                         "label",    label,
+                         "tooltip",  tooltip,
+                         "stock-id", stock_id,
+                         NULL);
+
+  if (stock_id)
+    {
+      if (gtk_icon_factory_lookup_default (stock_id))
+        g_object_set (action, "stock-id", stock_id, NULL);
+      else
+        g_object_set (action, "icon-name", stock_id, NULL);
+    }
+
+  return action;
 }
 
 

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

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

Modified: branches/soc-2008-text/app/xcf/xcf.c
==============================================================================
--- branches/soc-2008-text/app/xcf/xcf.c	(original)
+++ branches/soc-2008-text/app/xcf/xcf.c	Fri Aug 29 18:50:27 2008
@@ -330,7 +330,8 @@
                    gimp_filename_to_utf8 (filename), g_strerror (save_errno));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   if (success)
     gimp_value_set_image (&return_vals->values[1], image);
@@ -422,7 +423,8 @@
                    gimp_filename_to_utf8 (filename), g_strerror (save_errno));
     }
 
-  return_vals = gimp_procedure_get_return_values (procedure, success);
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
   gimp_unset_busy (gimp);
 

Modified: branches/soc-2008-text/authors.xml
==============================================================================
--- branches/soc-2008-text/authors.xml	(original)
+++ branches/soc-2008-text/authors.xml	Fri Aug 29 18:50:27 2008
@@ -17,6 +17,7 @@
   <contributor role="author" last-active="2.4">Henrik Brix Andersen</contributor>
   <contributor role="author" last-active="1.0">Karl-Johan Andersson</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>
@@ -28,7 +29,7 @@
   <contributor role="author" last-active="2.0">Stanislav Brabec</contributor>
   <contributor role="author" last-active="2.6">Hans Breuer</contributor>
   <contributor role="author" last-active="2.6">Simon Budig</contributor>
-  <contributor role="author" last-active="2.4">JoÃo S. O. Bueno</contributor>
+  <contributor role="author" last-active="2.6">JoÃo S. O. Bueno</contributor>
   <contributor role="documenter" last-active="1.2">Carey Bunks</contributor>
   <contributor role="author" last-active="2.4">Seth Burgess</contributor>
   <contributor role="author" last-active="1.0">Brent Burton</contributor>
@@ -41,6 +42,7 @@
   <contributor role="author" last-active="1.2">Winston Chang</contributor>
   <contributor role="author" last-active="2.4">Stephane Chauveau</contributor>
   <contributor role="author" last-active="2.4">Zbigniew Chyla</contributor>
+  <contributor role="author" last-active="2.6">Lars-Peter Clausen</contributor>
   <contributor role="author" last-active="2.0">Branko Collin</contributor>
   <contributor role="author" last-active="1.0">Ed Connel</contributor>
   <contributor role="author" last-active="1.2">Piers Cornwell</contributor>
@@ -49,14 +51,18 @@
   <contributor role="author" last-active="2.4">Jay Cox</contributor>
   <contributor role="author" last-active="2.6">Kevin Cozens</contributor>
   <contributor role="artist" last-active="2.4">Paul Davey</contributor>
+  <contributor role="author" last-active="2.6">Michael Deal</contributor>
+  <contributor role="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="author" last-active="2.6">Aurore Derriennic</contributor>
   <contributor role="author" last-active="1.0">Andreas Dilger</contributor>
   <contributor role="author" last-active="2.0">Austin Donnelly</contributor>
   <contributor role="author" last-active="1.0">Scott Draves</contributor>
   <contributor role="author" last-active="1.0">Daniel Dunbar</contributor>
   <contributor role="documenter" last-active="2.4">Dust</contributor>
   <contributor role="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" last-active="2.0">Morton Eriksen</contributor>
@@ -88,6 +94,7 @@
   <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="author" last-active="2.6">Marcus Heese</contributor>
   <contributor role="author" last-active="2.4">Robert Helgesson</contributor>
   <contributor role="author" last-active="2.0">James Henstridge</contributor>
   <contributor role="author" last-active="1.0">Eric Hernes</contributor>
@@ -95,21 +102,22 @@
   <contributor role="author" last-active="1.0">Christoph Hoegl</contributor>
   <contributor role="author" last-active="2.2">Wolfgang Hofer</contributor>
   <contributor role="author" last-active="2.2">Alan Horkan</contributor>
+  <contributor role="author" last-active="2.6">Daniel Hornung</contributor>
   <contributor role="author" last-active="1.2">Jan HubiÄka</contributor>
   <contributor role="author" last-active="1.2">Ben Jackson</contributor>
   <contributor role="documenter" last-active="1.2">Simon Janes</contributor>
   <contributor role="author" last-active="2.2">Tim Janik</contributor>
   <contributor role="author" last-active="2.4">Kristian Jantz</contributor>
-  <contributor role="author documenter" last-active="2.4">RÃman Joost</contributor>
+  <contributor role="author documenter" last-active="2.6">RÃman Joost</contributor>
   <contributor role="documenter" last-active="2.4">Hans de Jonge</contributor>
-  <contributor role="author" last-active="2.4">Geert Jordaens</contributor>
-  <contributor role="author" last-active="2.4">Aurimas JuÅka</contributor>
+  <contributor role="author" last-active="2.6">Geert Jordaens</contributor>
+  <contributor role="author" last-active="2.6">Aurimas JuÅka</contributor>
   <contributor role="author" last-active="1.0">Andrew Kieschnick</contributor>
   <contributor role="author" last-active="2.2">Peter Kirchgessner</contributor>
   <contributor role="author" last-active="1.0">Philipp Klaus</contributor>
   <contributor role="author" last-active="2.0">David Koblas</contributor>
   <contributor role="author" last-active="2.2">Daniel Kobras</contributor>
-  <contributor role="author" last-active="2.4">Ãyvind KolÃs</contributor>
+  <contributor role="author" last-active="2.6">Ãyvind KolÃs</contributor>
   <contributor role="author" last-active="2.4">Robert L Krawitz</contributor>
   <contributor role="documenter" last-active="2.4">Semka KuloviÃ-Debals</contributor>
   <contributor role="artist author" last-active="2.0">Tuomas Kuosmanen</contributor>
@@ -123,6 +131,7 @@
   <contributor role="author" last-active="1.2">Marco Lamberto</contributor>
   <contributor role="author" last-active="1.2">Jens Lautenbacher</contributor>
   <contributor role="author" last-active="2.0">Laramie Leavitt</contributor>
+  <contributor role="author" last-active="2.6">Tom Lechner</contributor>
   <contributor role="author" last-active="1.0">Elliot Lee</contributor>
   <contributor role="author" last-active="2.0">Marc Lehmann</contributor>
   <contributor role="author" last-active="1.2">Ray Lehtiniemi</contributor>
@@ -130,12 +139,14 @@
   <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="author" last-active="1.2">Ingo LÃtkebohle</contributor>
   <contributor role="author" last-active="1.0">Josh MacDonald</contributor>
   <contributor role="author documenter" last-active="1.0">Ed Mackey</contributor>
   <contributor role="author" last-active="1.2">Vidar Madsen</contributor>
+  <contributor role="author" last-active="2.6">Luidnel Maignan</contributor>
   <contributor role="author documenter" last-active="1.2">Ian Main</contributor>
   <contributor role="author" last-active="2.4">Kjartan Maraas</contributor>
   <contributor role="author" last-active="2.6">John Marshall</contributor>

Modified: branches/soc-2008-text/autogen.sh
==============================================================================
--- branches/soc-2008-text/autogen.sh	(original)
+++ branches/soc-2008-text/autogen.sh	Fri Aug 29 18:50:27 2008
@@ -17,7 +17,6 @@
 
 AUTOCONF_REQUIRED_VERSION=2.54
 AUTOMAKE_REQUIRED_VERSION=1.9.6
-GLIB_REQUIRED_VERSION=2.16.0
 INTLTOOL_REQUIRED_VERSION=0.35.5
 LIBTOOL_REQUIRED_VERSION=1.5
 
@@ -171,21 +170,6 @@
 fi
 
 
-echo -n "checking for glib-gettextize ... "
-if (glib-gettextize --version) < /dev/null > /dev/null 2>&1; then
-    VER=`glib-gettextize --version \
-         | grep glib-gettextize | sed "s/.* \([0-9.]*\)/\1/"`
-    check_version $VER $GLIB_REQUIRED_VERSION
-else
-    echo
-    echo "  You must have glib-gettextize installed to compile $PROJECT."
-    echo "  glib-gettextize is part of glib-2.0, so you should already"
-    echo "  have it. Make sure it is in your PATH."
-    echo
-    DIE=1
-fi
-
-
 echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
 if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
     VER=`intltoolize --version \
@@ -292,8 +276,7 @@
 $AUTOMAKE --add-missing || exit $?
 $AUTOCONF || exit $?
 
-glib-gettextize --force || exit $?
-intltoolize --force --automake || exit $?
+intltoolize --automake || exit $?
 
 
 cd $ORIGDIR

Modified: branches/soc-2008-text/configure.in
==============================================================================
--- branches/soc-2008-text/configure.in	(original)
+++ branches/soc-2008-text/configure.in	Fri Aug 29 18:50:27 2008
@@ -8,7 +8,7 @@
 
 m4_define([gimp_major_version], [2])
 m4_define([gimp_minor_version], [5])
-m4_define([gimp_micro_version], [3])
+m4_define([gimp_micro_version], [4])
 m4_define([gimp_real_version],
           [gimp_major_version.gimp_minor_version.gimp_micro_version])
 m4_define([gimp_version], [gimp_real_version])
@@ -63,6 +63,7 @@
 m4_define([dbus_glib_required_version], [0.70])
 m4_define([libhal_required_version], [0.5.7])
 m4_define([exif_required_version], [0.6.15])
+m4_define([lcms_required_version], [1.16])
 
 
 AC_INIT([GIMP], [gimp_version],
@@ -221,6 +222,13 @@
 case "$target_or_host" in
   *-*-mingw*)
     os_win32=yes
+    case "$host" in
+      x86_64-*-*)
+	;;
+      *)
+	WIN32_LARGE_ADDRESS_AWARE='-Wl,--large-address-aware'
+	;;
+    esac
     PATHSEP=';'
     ;;
   *)
@@ -229,6 +237,7 @@
     ;;
 esac
 AC_MSG_RESULT([$os_win32])
+AC_SUBST(WIN32_LARGE_ADDRESS_AWARE)
 AC_SUBST(PATHSEP)
 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
@@ -893,11 +902,13 @@
 #############################
 
 AC_ARG_ENABLE(mp, [  --disable-mp            disable support for multiple processors])
+
 if test "x$enable_mp" != "xno"; then
   AC_DEFINE(ENABLE_MP, 1,
 	    [Define to 1 to enable support for multiple processors.])
 fi
 
+
 ###################################################
 # gimp-remote is obsolete, but can still be enabled
 ###################################################
@@ -923,7 +934,7 @@
    DOC_SHOOTER=doc-shooter
 
    # screenshot plug-in needs to link to X11 explicitely
-   LIBSCREENSHOT="$X_LIBS -lX11"
+   SCREENSHOT_LIBS="$X_LIBS -lX11"
 
    gimp_save_CFLAGS="$CFLAGS"
    gimp_save_LDFLAGS="$LDFLAGS"
@@ -931,20 +942,20 @@
    LDFLAGS="$LDFLAGS $X_LIBS"
 
    # Test for Xmu
-   if test -z "$LIBXMU"; then
+   if test -z "$XMU_LIBS"; then
       AC_CHECK_LIB(Xmu, XmuClientWindow,
         [AC_CHECK_HEADERS(X11/Xmu/WinUtil.h,
 	  have_libxmu=yes
-          LIBXMU="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt",
+          XMU_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt",
 	  [have_libxmu="no (XMU header file not found)"],[#include <gdk/gdkx.h>])],
 	[have_libxmu="no (XMU library not found)"], -lXt -lX11)
-      LIBSCREENSHOT="$LIBXMU"
+      SCREENSHOT_LIBS="$XMU_LIBS"
    fi
 
    # Check for shaped window extension
    AC_CHECK_LIB(Xext, XShapeGetRectangles,
      [AC_CHECK_HEADERS(X11/extensions/shape.h,
-        LIBSCREENSHOT="$LIBSCREENSHOT -lXext",,[#include <gdk/gdkx.h>])],,
+        SCREENSHOT_LIBS="$SCREENSHOT_LIBS -lXext",,[#include <gdk/gdkx.h>])],,
      -lX11 -lXext)
 
    CFLAGS="$gimp_save_CFLAGS"
@@ -954,12 +965,12 @@
    PKG_CHECK_MODULES(XFIXES, xfixes,
       AC_DEFINE(HAVE_XFIXES, 1,
                 [Define to 1 to if the XFIXES X extension is available])
-      LIBSCREENSHOT="$LIBSCREENSHOT $XFIXES_LIBS",
+      SCREENSHOT_LIBS="$SCREENSHOT_LIBS $XFIXES_LIBS",
       true)
 fi
 
-AC_SUBST(LIBXMU)
-AC_SUBST(LIBSCREENSHOT)
+AC_SUBST(XMU_LIBS)
+AC_SUBST(SCREENSHOT_LIBS)
 
 AC_SUBST(DOC_SHOOTER)
 
@@ -994,86 +1005,87 @@
 # Check for libtiff
 ###################
 
-have_libtiff=no
 AC_ARG_WITH(libtiff,  [  --without-libtiff       build without TIFF support])
-  if test "x$with_libtiff" != xno && test -z "$LIBTIFF"; then
-    have_libtiff=yes
-    AC_CHECK_LIB(tiff, TIFFReadScanline,
+
+have_libtiff=no
+if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
+  have_libtiff=yes
+  AC_CHECK_LIB(tiff, TIFFReadScanline,
+    [AC_CHECK_HEADER(tiffio.h,
+      FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff',
+      [have_libtiff="no (TIFF header files not found)"])],
+    [AC_CHECK_LIB(tiff, TIFFWriteScanline,
       [AC_CHECK_HEADER(tiffio.h,
-	TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff',
+        FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff -ljpeg -lz',
 	[have_libtiff="no (TIFF header files not found)"])],
-      [AC_CHECK_LIB(tiff, TIFFWriteScanline,
+      [AC_CHECK_LIB(tiff34, TIFFFlushData,
 	[AC_CHECK_HEADER(tiffio.h,
-          TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff -ljpeg -lz',
+          FILE_TIFF_LOAD='file-tiff-load$(EXEEXT)'; FILE_TIFF_SAVE='file-tiff-save$(EXEEXT)'; TIFF_LIBS='-ltiff34 -ljpeg -lz',
 	  [have_libtiff="no (TIFF header files not found)"])],
-	[AC_CHECK_LIB(tiff34, TIFFFlushData,
-	  [AC_CHECK_HEADER(tiffio.h,
-            TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff34 -ljpeg -lz',
-	    [have_libtiff="no (TIFF header files not found)"])],
-        [have_libtiff="no (TIFF library not found)"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
-  fi
+      [have_libtiff="no (TIFF library not found)"], -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
+fi
 
-  if test "x$with_libtiff" != xno && test -z "$LIBTIFF"; then
-    AC_MSG_ERROR([
+if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
+  AC_MSG_ERROR([
 *** Checks for TIFF libary failed. You can build without it by passing
 *** --without-libtiff to configure but you won't be able to use TIFFs then.])
-  fi
+fi
 
-  if test "x$have_libtiff" = xyes; then
-    MIME_TYPES="$MIME_TYPES;image/tiff"
-  fi
+if test "x$have_libtiff" = xyes; then
+  MIME_TYPES="$MIME_TYPES;image/tiff"
+fi
 
-AC_SUBST(TIFF_LOAD)
-AC_SUBST(TIFF_SAVE)
-AC_SUBST(LIBTIFF)
+AC_SUBST(FILE_TIFF_LOAD)
+AC_SUBST(FILE_TIFF_SAVE)
+AC_SUBST(TIFF_LIBS)
 
 
 ###################
 # Check for libjpeg
 ###################
 
-jpeg_ok=no
-
 AC_ARG_WITH(libjpeg,  [  --without-libjpeg       build without JPEG support])
-  if test "x$with_libjpeg" != xno && test -z "$LIBJPEG"; then
-    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
-      jpeg_ok=yes,
-      [jpeg_ok="no (JPEG library not found)"
-      AC_MSG_WARN(*** XJT plug-in will not be built (JPEG library not found) ***)])
-    if test "$jpeg_ok" = yes; then
-      AC_MSG_CHECKING([for jpeglib.h])
-      AC_TRY_CPP([
+
+jpeg_ok=no
+if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
+  AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
+    jpeg_ok=yes,
+    [jpeg_ok="no (JPEG library not found)"
+    AC_MSG_WARN(*** XJT plug-in will not be built (JPEG library not found) ***)])
+  if test "$jpeg_ok" = yes; then
+    AC_MSG_CHECKING([for jpeglib.h])
+    AC_TRY_CPP([
 #include <stdio.h>
 #undef HAVE_STDDEF_H
 #undef HAVE_STDLIB_H
 #undef PACKAGE
 #undef VERSION
 #include <jpeglib.h>],
-	jpeg_ok=yes,
-	jpeg_ok="no (Can't include jpeglib.h)")
-      AC_MSG_RESULT($jpeg_ok)
-      if test "$jpeg_ok" = yes; then
-	AC_CHECK_LIB(jpeg, jpeg_save_markers,
-	JPEG='jpeg$(EXEEXT)'; LIBJPEG='-ljpeg',
-        jpeg_ok="no (JPEG library is too old)")
-      else
-	jpeg_ok="no (JPEG header file not found)"
-      fi
+      jpeg_ok=yes,
+      jpeg_ok="no (Can't include jpeglib.h)")
+    AC_MSG_RESULT($jpeg_ok)
+    if test "$jpeg_ok" = yes; then
+      AC_CHECK_LIB(jpeg, jpeg_save_markers,
+      JPEG='jpeg$(EXEEXT)'; JPEG_LIBS='-ljpeg',
+      jpeg_ok="no (JPEG library is too old)")
+    else
+      jpeg_ok="no (JPEG header file not found)"
     fi
   fi
+fi
 
-  if test "x$with_libjpeg" != xno && test -z "$LIBJPEG"; then
-    AC_MSG_ERROR([
+if test "x$with_libjpeg" != xno && test -z "$JPEG_LIBS"; then
+  AC_MSG_ERROR([
 *** Checks for JPEG library failed. You can build without it by passing
 *** --without-libjpeg to configure but you won't be able to use JPEGs then.])
-  fi
+fi
 
-  if test "x$jpeg_ok" = xyes; then
-    MIME_TYPES="$MIME_TYPES;image/jpeg"
-  fi
+if test "x$jpeg_ok" = xyes; then
+  MIME_TYPES="$MIME_TYPES;image/jpeg"
+fi
 
 AM_CONDITIONAL(BUILD_JPEG, test "x$jpeg_ok" = xyes)
-AC_SUBST(LIBJPEG)
+AC_SUBST(JPEG_LIBS)
 
 
 ## xjt does build, but it is more confusing than useful on Win32,
@@ -1093,10 +1105,10 @@
 ################
 
 have_zlib=yes
-if test -z "$LIBZ"; then
+if test -z "$Z_LIBS"; then
   AC_CHECK_LIB(z, gzsetparams,
     [AC_CHECK_HEADER(zlib.h,
-      PSP='psp$(EXEEXT)'; LIBZ='-lz',
+      FILE_PSP='file-psp$(EXEEXT)'; Z_LIBS='-lz',
       [have_zlib="no (ZLIB header files not found)"])],
     [have_zlib="no (ZLIB library not found)"])
 fi
@@ -1105,21 +1117,21 @@
   MIME_TYPES="$MIME_TYPES;image/x-psd"
 fi
 
-AC_SUBST(LIBZ)
-AC_SUBST(PSP)
+AC_SUBST(FILE_PSP)
+AC_SUBST(Z_LIBS)
 
 
 ##################
 # Check for libpng
 ##################
 
-have_libpng=no
 AC_ARG_WITH(libpng,  [  --without-libpng        build without PNG support])
+
+have_libpng=no
 if test "x$with_libpng" != xno; then
   have_libpng=yes
   PKG_CHECK_MODULES(PNG, libpng,
-    PNG='png$(EXEEXT)'
-    LIBPNG="$PNG_LIBS",
+    FILE_PNG='file-png$(EXEEXT)',
     [have_libpng="no (libpng not found)"
      AC_MSG_ERROR([
 *** Checks for PNG library failed. You can build without it by passing
@@ -1130,8 +1142,7 @@
   MIME_TYPES="$MIME_TYPES;image/png;image/x-icon"
 fi
 
-AC_SUBST(PNG)
-AC_SUBST(LIBPNG)
+AC_SUBST(FILE_PNG)
 
 AM_CONDITIONAL(HAVE_PNG, test "x$have_libpng" = xyes)
 
@@ -1140,23 +1151,23 @@
 # Check for libmng
 ##################
 
-have_libmng=no
 AC_ARG_WITH(libmng,  [  --without-libmng        build without MNG support])
-  have_libmng=yes
-  if test "x$with_libmng" != xno && test -z "$LIBMNG" &&
-     test -n "$LIBPNG" && test -n "$LIBJPEG" && test -n "$LIBZ"; 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
-      MNG='mng$(EXEEXT)'; LIBMNG="-lmng $LIBJPEG $LIBPNG"
-    else
-      have_libmng="no (MNG header file not found)"
-    fi
+
+have_libmng=yes
+if test "x$with_libmng" != xno && test -z "$MNG_LIBS" &&
+   test -n "$PNG_LIBS" && test -n "$JPEG_LIBS" && test -n "$Z_LIBS"; then
+  AC_CHECK_LIB(mng, mng_create,
+    [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
+    [have_libmng="no (MNG library not found)"], -lz -lm)
+  if test "$mng_ok" = yes; then
+    FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"
+  else
+    have_libmng="no (MNG header file not found)"
   fi
+fi
 
-AC_SUBST(MNG)
-AC_SUBST(LIBMNG)
+AC_SUBST(FILE_MNG)
+AC_SUBST(MNG_LIBS)
 
 
 ############################################################
@@ -1165,9 +1176,10 @@
 # avoid destruction, but no data modification is performed.
 ############################################################
 
-have_libexif=no
 AC_ARG_WITH(libexif,  [  --without-libexif       build without EXIF support])
-if test "x$with_libexif" != xno && test -z "$LIBEXIF" && test -n "$LIBJPEG"; then
+
+have_libexif=no
+if test "x$with_libexif" != xno && test -z "$EXIF_LIBS" && test -n "$JPEG_LIBS"; then
   have_libexif=yes
   PKG_CHECK_MODULES(EXIF, libexif >= exif_required_version,
     AC_DEFINE(HAVE_EXIF, 1, [Define to 1 if libexif is available]),
@@ -1182,20 +1194,20 @@
 # Check for libaa
 #################
 
+AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
 
 have_libaa=no
-AC_ARG_WITH(aa,  [  --without-aa            do not build the AA plug-in])
-if test "x$with_aa" != xno && test -z "$LIBAA"; then
+if test "x$with_aa" != xno && test -z "$AA_LIBS"; then
   have_libaa=yes
   AC_CHECK_LIB(aa, aa_printf,
     [AC_CHECK_HEADER(aalib.h,
-      AA='aa$(EXEEXT)'; LIBAA='-laa',
+      FILE_AA='file-aa$(EXEEXT)'; AA_LIBS='-laa',
       [have_libaa="no (AA header file not found)"])],
     [have_libaa="no (AA library not found)"])
 fi
 
-AC_SUBST(AA)
-AC_SUBST(LIBAA)
+AC_SUBST(FILE_AA)
+AC_SUBST(AA_LIBS)
 
 
 ##################
@@ -1210,10 +1222,10 @@
   lib_X11=-lX11
 fi
 have_libxpm=yes
-if test -z "$LIBXPM"; then
+if test -z "$XPM_LIBS"; then
   AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
     [AC_CHECK_HEADER(X11/xpm.h,
-      XPM='xpm$(EXEEXT)'; LIBXPM="$X_LIBS $X_PRE_LIBS $lib_X11 -lXpm",
+      FILE_XPM='file-xpm$(EXEEXT)'; XPM_LIBS="$X_LIBS $X_PRE_LIBS $lib_X11 -lXpm",
       [have_libxpm="no (XPM header file not found)"])],
     [have_libxpm="no (XPM library not found)"], $X_PRE_LIBS $lib_X11)
 fi
@@ -1224,8 +1236,8 @@
   MIME_TYPES="$MIME_TYPES;image/x-xpixmap"
 fi
 
-AC_SUBST(XPM)
-AC_SUBST(LIBXPM)
+AC_SUBST(FILE_XPM)
+AC_SUBST(XPM_LIBS)
 
 
 ##################
@@ -1265,8 +1277,7 @@
 if test "x$with_librsvg" != xno; then
   have_librsvg=yes
   PKG_CHECK_MODULES(SVG, librsvg-2.0 >= rsvg_required_version,
-    SVG='svg$(EXEEXT)'
-    LIBSVG=$SVG_LIBS,
+    FILE_SVG='file-svg$(EXEEXT)',
     have_librsvg="no (librsvg not found)")
 else
    have_librsvg="no (librsvg support disabled)"
@@ -1276,20 +1287,20 @@
   MIME_TYPES="$MIME_TYPES;image/svg+xml"
 fi
 
-AC_SUBST(SVG)
-AC_SUBST(LIBSVG)
+AC_SUBST(FILE_SVG)
 
 
 ####################################
 # Allow to disable the print plug-in
 ####################################
 
-enable_print="no (disabled)"
 AC_ARG_WITH(print,[  --without-print         build without print support])
 
+enable_print="no (disabled)"
 if test "x$with_print" != xno; then
-    enable_print="yes"
+  enable_print="yes"
 fi
+
 AM_CONDITIONAL(BUILD_PRINT, test "x$enable_print" == xyes)
 
 
@@ -1297,14 +1308,13 @@
 # Check for libpoppler
 ######################
 
-have_poppler=no
 AC_ARG_WITH(poppler,[  --without-poppler       build without poppler support])
 
+have_poppler=no
 if test "x$with_poppler" != xno; then
   PKG_CHECK_MODULES(POPPLER,
     poppler-glib >= poppler_required_version gthread-2.0,
-    POPPLER='poppler$(EXEEXT)'
-    LIBPOPPLER=$POPPLER_LIBS
+    FILE_PDF='file-pdf$(EXEEXT)'
     AC_DEFINE(HAVE_POPPLER, 1, [Define to 1 if libpoppler is available])
     have_poppler=yes,
     have_poppler="Using PostScript plug-in (libpoppler not found)")
@@ -1312,8 +1322,7 @@
   have_poppler="Using PostScript plug-in (libpoppler support disabled)"
 fi
 
-AC_SUBST(POPPLER)
-AC_SUBST(LIBPOPPLER)
+AC_SUBST(FILE_PDF)
 
 
 ###############################################
@@ -1409,8 +1418,8 @@
   wmf_version=`$WMF_CONFIG --version`
   if expr $wmf_version \>= wmf_required_version >/dev/null; then
     AC_MSG_RESULT([yes (version $wmf_version)])
-    WMF='wmf$(EXEEXT)'
-    LIBWMF=`$WMF_CONFIG --libs`
+    FILE_WMF='file-wmf$(EXEEXT)'
+    WMF_LIBS=`$WMF_CONFIG --libs`
     WMF_CFLAGS=`$WMF_CONFIG --cflags`
   else
     have_libwmf="no (libwmf is too old)"
@@ -1423,9 +1432,9 @@
   MIME_TYPES="$MIME_TYPES;image/x-wmf"
 fi
 
-AC_SUBST(LIBWMF)
+AC_SUBST(FILE_WMF)
+AC_SUBST(WMF_LIBS)
 AC_SUBST(WMF_CFLAGS)
-AC_SUBST(WMF)
 
 
 ################
@@ -1434,30 +1443,16 @@
 
 AC_ARG_WITH(lcms, [  --without-lcms          build without lcms support])
 
-have_lcms=no
+have_lcms="no (lcms support disabled)"
 if test "x$with_lcms" != xno; then
-  AC_CHECK_LIB(lcms, cmsCreate_sRGBProfile, [
-    AC_CHECK_HEADER(lcms.h,
-      have_lcms=yes, [
-      AC_CHECK_HEADER(lcms/lcms.h,
-        have_lcms=yes
-        AC_DEFINE(HAVE_LCMS_LCMS_H, 1,
-          [Define to 1 if the lcms header must be included as lcms/lcms.h]))
-      ])
-  ])
-  if test "x$have_lcms" = xyes; then
+  have_lcms=yes
+  PKG_CHECK_MODULES(LCMS, lcms >= lcms_required_version,
     AC_DEFINE(HAVE_LCMS, 1, [Define to 1 if lcms is available])
-    LIBLCMS="-llcms"
-    LCMS='lcms$(EXEEXT)'
-  else
-    have_lcms="no (lcms not found or unusable)"
-  fi
-else
-  have_lcms="no (lcms support disabled)"
+    LCMS='lcms$(EXEEXT)',
+    have_lcms="no (lcms not found or unusable)")
 fi
 
 AC_SUBST(LCMS)
-AC_SUBST(LIBLCMS)
 AM_CONDITIONAL(HAVE_LCMS, test "x$have_lcms" = xyes)
 
 
@@ -1465,9 +1460,9 @@
 # Check for alsa
 ################
 
-have_alsa=no
 AC_ARG_WITH(alsa, [  --without-alsa          disable alsa support in midi input controller])
 
+have_alsa="no (alsa support disabled)"
 if test "x$with_alsa" != xno; then
   have_alsa=yes
   AM_PATH_ALSA(alsa_required_version,
@@ -1482,7 +1477,7 @@
 
 AC_ARG_WITH(linux-input, [  --without-linux-input   don't build linux input event controller module])
 
-have_linux_input=no
+have_linux_input="no (linux input support disabled)"
 if test "x$with_linux_input" != "xno"; then
   AC_CHECK_HEADER(linux/input.h,
 	AC_CHECK_DECL(KEY_OK,
@@ -1538,11 +1533,9 @@
 have_dbus_glib="no (disabled)"
 
 if test "x$with_dbus" != xno; then
-
-PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_required_version,
-  have_dbus_glib=yes,
-  have_dbus_glib=no)
-
+  PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= dbus_glib_required_version,
+    have_dbus_glib=yes,
+    have_dbus_glib=no)
 fi
 
 if test "x$have_dbus_glib" = xyes; then
@@ -1573,11 +1566,10 @@
 fi
 
 if test "x$have_linux_input" = xyes && test "x$have_dbus_glib" = xyes &&
-    test "x$with_hal" != xno; then
+   test "x$with_hal" != xno; then
   PKG_CHECK_MODULES(HAL, hal >= libhal_required_version,
     have_libhal=yes,
-    have_libhal="no (libhal not found)"
-    )
+    have_libhal="no (libhal not found)")
 fi
 
 if test "x$have_libhal" = xyes; then
@@ -1668,7 +1660,7 @@
   PYLINK_LIBS=
   if test "x$platform_win32" = "xyes"; then
     PYBIN_PATH="$py_exec_prefix\pythonw.exe"
-    PYTHON_INCLUDES=`$echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
+    PYTHON_INCLUDES=`echo "$PYTHON_INCLUDES" | sed -e 's/\\\\/\\//g'`
     py_exec_prefix=`echo "$py_exec_prefix" | sed -e 's/\\\\/\\//g'`
     pylibversion=`echo $PYTHON_VERSION | sed -e 's/\\.//'`
     PYLINK_LIBS="-L${py_exec_prefix}/libs -lpython${pylibversion}"
@@ -1986,32 +1978,35 @@
 app/widgets/Makefile
 app/xcf/Makefile
 plug-ins/Makefile
-plug-ins/bmp/Makefile
 plug-ins/color-rotate/Makefile
 plug-ins/color-rotate/images/Makefile
-plug-ins/common/Makefile
-plug-ins/faxg3/Makefile
-plug-ins/fits/Makefile
+plug-ins/file-bmp/Makefile
+plug-ins/file-faxg3/Makefile
+plug-ins/file-fits/Makefile
+plug-ins/file-fli/Makefile
+plug-ins/file-ico/Makefile
+plug-ins/file-jpeg/Makefile
+plug-ins/file-psd/Makefile
+plug-ins/file-sgi/Makefile
+plug-ins/file-uri/Makefile
+plug-ins/file-xjt/Makefile
 plug-ins/flame/Makefile
-plug-ins/fli/Makefile
 plug-ins/fractal-explorer/Makefile
 plug-ins/fractal-explorer/examples/Makefile
 plug-ins/gfig/Makefile
 plug-ins/gfig/gfig-examples/Makefile
 plug-ins/gfig/images/Makefile
-plug-ins/gradient-flare/Makefile
-plug-ins/gradient-flare/flares/Makefile
 plug-ins/gimpressionist/Brushes/Makefile
 plug-ins/gimpressionist/Makefile
 plug-ins/gimpressionist/Paper/Makefile
 plug-ins/gimpressionist/Presets/Makefile
+plug-ins/gradient-flare/Makefile
+plug-ins/gradient-flare/flares/Makefile
 plug-ins/help-browser/Makefile
 plug-ins/help/Makefile
-plug-ins/ico/Makefile
 plug-ins/ifs-compose/Makefile
 plug-ins/imagemap/Makefile
 plug-ins/imagemap/images/Makefile
-plug-ins/jpeg/Makefile
 plug-ins/lighting/Makefile
 plug-ins/lighting/images/Makefile
 plug-ins/map-object/Makefile
@@ -2019,7 +2014,6 @@
 plug-ins/metadata/Makefile
 plug-ins/pagecurl/Makefile
 plug-ins/print/Makefile
-plug-ins/psd/Makefile
 plug-ins/pygimp/Makefile
 plug-ins/pygimp/plug-ins/Makefile
 plug-ins/script-fu/Makefile
@@ -2029,11 +2023,9 @@
 plug-ins/script-fu/scripts/images/Makefile
 plug-ins/script-fu/tinyscheme/Makefile
 plug-ins/selection-to-path/Makefile
-plug-ins/sgi/Makefile
 plug-ins/twain/Makefile
-plug-ins/uri/Makefile
 plug-ins/win-snap/Makefile
-plug-ins/xjt/Makefile
+plug-ins/common/Makefile
 modules/Makefile
 devel-docs/Makefile
 devel-docs/app/Makefile
@@ -2098,11 +2090,11 @@
 )
 
 AC_CONFIG_COMMANDS([sed-po-makefiles],
-[sed -e "/POTFILES =/r po-libgimp/POTFILES" po-libgimp/Makefile.in > po-libgimp/Makefile
-sed -e "/POTFILES =/r po-python/POTFILES" po-python/Makefile.in > po-python/Makefile
-sed -e "/POTFILES =/r po-plug-ins/POTFILES" po-plug-ins/Makefile.in > po-plug-ins/Makefile
-sed -e "/POTFILES =/r po-script-fu/POTFILES" po-script-fu/Makefile.in > po-script-fu/Makefile
-sed -e "/POTFILES =/r po-tips/POTFILES" po-tips/Makefile.in > po-tips/Makefile])
+[sed -e "/POTFILES =/r po-libgimp/POTFILES" po-libgimp/Makefile.in > po-libgimp/Makefile && touch po-libgimp/stamp-it
+sed -e "/POTFILES =/r po-python/POTFILES" po-python/Makefile.in > po-python/Makefile && touch po-python/stamp-it
+sed -e "/POTFILES =/r po-plug-ins/POTFILES" po-plug-ins/Makefile.in > po-plug-ins/Makefile && touch po-plug-ins/stamp-it
+sed -e "/POTFILES =/r po-script-fu/POTFILES" po-script-fu/Makefile.in > po-script-fu/Makefile && touch po-script-fu/stamp-it
+sed -e "/POTFILES =/r po-tips/POTFILES" po-tips/Makefile.in > po-tips/Makefile && touch po-tips/stamp-it])
 
 AC_OUTPUT
 

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	Fri Aug 29 18:50:27 2008
@@ -24,6 +24,7 @@
 gimp_run_procedure2
 gimp_destroy_params
 gimp_destroy_paramdefs
+gimp_get_pdb_error
 gimp_tile_width
 gimp_tile_height
 gimp_shm_ID
@@ -591,6 +592,8 @@
 <SECTION>
 <FILE>gimplayer</FILE>
 gimp_layer_new
+gimp_layer_new_from_drawable
+gimp_layer_new_from_visible
 gimp_layer_copy
 gimp_layer_scale
 gimp_layer_resize
@@ -604,7 +607,6 @@
 gimp_layer_get_mask
 gimp_layer_add_mask
 gimp_layer_remove_mask
-gimp_layer_new_from_drawable
 gimp_layer_get_lock_alpha
 gimp_layer_set_lock_alpha
 gimp_layer_get_preserve_trans
@@ -771,6 +773,8 @@
 gimp_plugin_icon_register
 gimp_plugin_menu_register
 gimp_plugin_menu_branch_register
+gimp_plugin_set_pdb_error_handler
+gimp_plugin_get_pdb_error_handler
 </SECTION>
 
 <SECTION>

Modified: branches/soc-2008-text/devel-docs/libgimp/tmpl/gimp.sgml
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimp/tmpl/gimp.sgml	(original)
+++ branches/soc-2008-text/devel-docs/libgimp/tmpl/gimp.sgml	Fri Aug 29 18:50:27 2008
@@ -249,6 +249,14 @@
 @n_params: 
 
 
+<!-- ##### FUNCTION gimp_get_pdb_error ##### -->
+<para>
+
+</para>
+
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_tile_width ##### -->
 <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	Fri Aug 29 18:50:27 2008
@@ -33,6 +33,27 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_layer_new_from_drawable ##### -->
+<para>
+
+</para>
+
+ drawable_ID: 
+ dest_image_ID: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gimp_layer_new_from_visible ##### -->
+<para>
+
+</para>
+
+ image_ID: 
+ dest_image_ID: 
+ name: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_layer_copy ##### -->
 <para>
 
@@ -164,16 +185,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gimp_layer_new_from_drawable ##### -->
-<para>
-
-</para>
-
- drawable_ID: 
- dest_image_ID: 
- Returns: 
-
-
 <!-- ##### FUNCTION gimp_layer_get_lock_alpha ##### -->
 <para>
 

Modified: branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpplugin.sgml
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpplugin.sgml	(original)
+++ branches/soc-2008-text/devel-docs/libgimp/tmpl/gimpplugin.sgml	Fri Aug 29 18:50:27 2008
@@ -69,3 +69,20 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_plugin_set_pdb_error_handler ##### -->
+<para>
+
+</para>
+
+ handler: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gimp_plugin_get_pdb_error_handler ##### -->
+<para>
+
+</para>
+
+ Returns: 
+
+

Modified: branches/soc-2008-text/devel-docs/libgimpbase/libgimpbase-sections.txt
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimpbase/libgimpbase-sections.txt	(original)
+++ branches/soc-2008-text/devel-docs/libgimpbase/libgimpbase-sections.txt	Fri Aug 29 18:50:27 2008
@@ -32,6 +32,7 @@
 GimpMessageHandlerType
 GimpPaintApplicationMode
 GimpPDBArgType
+GimpPDBErrorHandler
 GimpPDBProcType
 GimpPDBStatusType
 GimpProgressCommand
@@ -67,6 +68,7 @@
 GIMP_TYPE_MESSAGE_HANDLER_TYPE
 GIMP_TYPE_PAINT_APPLICATION_MODE
 GIMP_TYPE_PDB_ARG_TYPE
+GIMP_TYPE_PDB_ERROR_HANDLER
 GIMP_TYPE_PDB_PROC_TYPE
 GIMP_TYPE_PDB_STATUS_TYPE
 GIMP_TYPE_PROGRESS_COMMAND
@@ -101,6 +103,7 @@
 gimp_message_handler_type_get_type
 gimp_paint_application_mode_get_type
 gimp_pdb_arg_type_get_type
+gimp_pdb_error_handler_get_type
 gimp_pdb_proc_type_get_type
 gimp_pdb_status_type_get_type
 gimp_progress_command_get_type

Modified: branches/soc-2008-text/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
==============================================================================
--- branches/soc-2008-text/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	(original)
+++ branches/soc-2008-text/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	Fri Aug 29 18:50:27 2008
@@ -240,6 +240,14 @@
 @GIMP_PDB_PATH: 
 @GIMP_PDB_BOUNDARY: 
 
+<!-- ##### ENUM GimpPDBErrorHandler ##### -->
+<para>
+
+</para>
+
+ GIMP_PDB_ERROR_HANDLER_INTERNAL: 
+ GIMP_PDB_ERROR_HANDLER_PLUGIN: 
+
 <!-- ##### ENUM GimpPDBProcType ##### -->
 <para>
 

Modified: branches/soc-2008-text/docs/gimprc.5.in
==============================================================================
--- branches/soc-2008-text/docs/gimprc.5.in	(original)
+++ branches/soc-2008-text/docs/gimprc.5.in	Fri Aug 29 18:50:27 2008
@@ -646,7 +646,7 @@
 no.
 
 .TP
-(trust-dirty-flag no)
+(trust-dirty-flag yes)
 
 When enabled, GIMP will not save an image if it has not been changed since it
 was opened.  Possible values are yes and no.

Modified: branches/soc-2008-text/etc/gimprc
==============================================================================
--- branches/soc-2008-text/etc/gimprc	(original)
+++ branches/soc-2008-text/etc/gimprc	Fri Aug 29 18:50:27 2008
@@ -503,7 +503,7 @@
 # When enabled, GIMP will not save an image if it has not been changed since
 # it was opened.  Possible values are yes and no.
 # 
-# (trust-dirty-flag no)
+# (trust-dirty-flag yes)
 
 # Remember the current tool, pattern, color, and brush across GIMP sessions. 
 # Possible values are yes and no.

Modified: branches/soc-2008-text/libgimp/gimp.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.c	(original)
+++ branches/soc-2008-text/libgimp/gimp.c	Fri Aug 29 18:50:27 2008
@@ -90,7 +90,6 @@
 #  define USE_WIN32_SHM 1
 #endif
 
-#include <libintl.h>
 #include <locale.h>
 
 #include "libgimpbase/gimpbasetypes.h"
@@ -104,6 +103,8 @@
 #include "gimp.h"
 #include "gimpunitcache.h"
 
+#include "libgimp-intl.h"
+
 
 #define TILE_MAP_SIZE (_tile_width * _tile_height * 4)
 
@@ -156,6 +157,9 @@
                                                 GIOCondition     condition,
                                                 gpointer         data);
 
+static void       gimp_set_pdb_error           (const GimpParam *return_vals,
+                                                gint             n_return_vals);
+
 
 static GIOChannel *_readchannel  = NULL;
 GIOChannel *_writechannel = NULL;
@@ -203,10 +207,13 @@
   { "on",             GIMP_DEBUG_DEFAULT        }
 };
 
-
 static GimpPlugInInfo PLUG_IN_INFO;
 
 
+static GimpPDBStatusType  pdb_error_status   = GIMP_PDB_SUCCESS;
+static gchar             *pdb_error_message  = NULL;
+
+
 /**
  * gimp_main:
  * @info: the PLUG_IN_INFO structure
@@ -964,22 +971,10 @@
   proc_return->nparams = 0;
   proc_return->params  = NULL;
 
-  switch (return_vals[0].data.d_status)
-    {
-    case GIMP_PDB_EXECUTION_ERROR:
-      break;
-
-    case GIMP_PDB_CALLING_ERROR:
-      g_printerr ("a calling error occurred while trying to run: \"%s\"\n",
-                  name);
-      break;
-
-    default:
-      break;
-    }
-
   gimp_wire_destroy (&msg);
 
+  gimp_set_pdb_error (return_vals, *n_return_vals);
+
   return return_vals;
 }
 
@@ -1019,6 +1014,53 @@
 }
 
 /**
+ * gimp_get_pdb_error:
+ *
+ * Retrieves the error message from the last procedure call.
+ *
+ * If a procedure call fails, then it might pass an error message with
+ * the return values. Plug-ins that are using the libgimp C wrappers
+ * don't access the procedure return values directly. Thus ligimp
+ * stores the error message and makes it available with this
+ * function. The next procedure call unsets the error message again.
+ *
+ * The returned string is owned by libgimp and must not be freed or
+ * modified.
+ *
+ * Return value: the error message
+ *
+ * Since: GIMP 2.6
+ **/
+const gchar *
+gimp_get_pdb_error (void)
+{
+  if (pdb_error_message && strlen (pdb_error_message))
+    return pdb_error_message;
+
+  switch (pdb_error_status)
+    {
+    case GIMP_PDB_SUCCESS:
+      /*  procedure executed successfully  */
+      return _("success");
+
+    case GIMP_PDB_EXECUTION_ERROR:
+      /*  procedure execution failed       */
+      return _("execution error");
+
+    case GIMP_PDB_CALLING_ERROR:
+      /*  procedure called incorrectly     */
+      return _("calling error");
+
+    case GIMP_PDB_CANCEL:
+      /*  procedure execution cancelled    */
+      return _("cancelled");
+
+    default:
+      return "invalid return status";
+    }
+}
+
+/**
  * gimp_tile_width:
  *
  * Returns the tile width GIMP is using.
@@ -1229,7 +1271,7 @@
 const gchar *
 gimp_wm_class (void)
 {
-  return (const gchar *) _wm_class;
+  return _wm_class;
 }
 
 /**
@@ -1244,7 +1286,7 @@
 const gchar *
 gimp_display_name (void)
 {
-  return (const gchar *) _display_name;
+  return _display_name;
 }
 
 /**
@@ -1953,3 +1995,32 @@
 
   return TRUE;
 }
+
+static void
+gimp_set_pdb_error (const GimpParam *return_vals,
+                    gint             n_return_vals)
+{
+  if (pdb_error_message)
+    {
+      g_free (pdb_error_message);
+      pdb_error_message = NULL;
+    }
+
+  pdb_error_status = return_vals[0].data.d_status;
+
+  switch (pdb_error_status)
+    {
+    case GIMP_PDB_SUCCESS:
+    case GIMP_PDB_PASS_THROUGH:
+      break;
+
+    case GIMP_PDB_EXECUTION_ERROR:
+    case GIMP_PDB_CALLING_ERROR:
+    case GIMP_PDB_CANCEL:
+      if (n_return_vals > 1 && return_vals[1].type == GIMP_PDB_STRING)
+        {
+          pdb_error_message = g_strdup (return_vals[1].data.d_string);
+        }
+      break;
+    }
+}

Modified: branches/soc-2008-text/libgimp/gimp.def
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.def	(original)
+++ branches/soc-2008-text/libgimp/gimp.def	Fri Aug 29 18:50:27 2008
@@ -236,6 +236,7 @@
 	gimp_get_module_load_inhibit
 	gimp_get_monitor_resolution
 	gimp_get_path_by_tattoo
+	gimp_get_pdb_error
 	gimp_get_progname
 	gimp_get_theme_dir
 	gimp_getpid
@@ -423,6 +424,7 @@
 	gimp_layer_mode_effects_get_type
 	gimp_layer_new
 	gimp_layer_new_from_drawable
+	gimp_layer_new_from_visible
 	gimp_layer_remove_mask
 	gimp_layer_resize
 	gimp_layer_resize_to_image_size
@@ -534,10 +536,12 @@
 	gimp_pixel_rgns_register
 	gimp_pixel_rgns_register2
 	gimp_plugin_domain_register
+	gimp_plugin_get_pdb_error_handler
 	gimp_plugin_help_register
 	gimp_plugin_icon_register
 	gimp_plugin_menu_branch_register
 	gimp_plugin_menu_register
+	gimp_plugin_set_pdb_error_handler
 	gimp_posterize
 	gimp_procedural_db_dump
 	gimp_procedural_db_get_data

Modified: branches/soc-2008-text/libgimp/gimp.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.h	(original)
+++ branches/soc-2008-text/libgimp/gimp.h	Fri Aug 29 18:50:27 2008
@@ -199,7 +199,10 @@
    int                                                  \
    main (int argc, char *argv[])                        \
    {                                                    \
-     return gimp_main (&PLUG_IN_INFO, argc, argv);      \
+     /* Use __argc and __argv here, too, as they work   \
+      * better with mingw-w64.				\
+      */						\
+     return gimp_main (&PLUG_IN_INFO, __argc, __argv);  \
    }
 #else
 #  define MAIN()                                        \
@@ -304,6 +307,10 @@
 void           gimp_destroy_paramdefs   (GimpParamDef    *paramdefs,
                                          gint             n_params);
 
+/* Retrieve the error message for the last procedure call.
+ */
+const gchar  * gimp_get_pdb_error       (void);
+
 
 /* Return various constants given by the GIMP core at plug-in config time.
  */

Modified: branches/soc-2008-text/libgimp/gimpenums.c.tail
==============================================================================
--- branches/soc-2008-text/libgimp/gimpenums.c.tail	(original)
+++ branches/soc-2008-text/libgimp/gimpenums.c.tail	Fri Aug 29 18:50:27 2008
@@ -36,6 +36,7 @@
   gimp_offset_type_get_type,
   gimp_orientation_type_get_type,
   gimp_pdb_arg_type_get_type,
+  gimp_pdb_error_handler_get_type,
   gimp_pdb_proc_type_get_type,
   gimp_pdb_status_type_get_type,
   gimp_paint_application_mode_get_type,
@@ -90,6 +91,7 @@
   "GimpOffsetType",
   "GimpOrientationType",
   "GimpPDBArgType",
+  "GimpPDBErrorHandler",
   "GimpPDBProcType",
   "GimpPDBStatusType",
   "GimpPaintApplicationMode",

Modified: branches/soc-2008-text/libgimp/gimplayer_pdb.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimplayer_pdb.c	(original)
+++ branches/soc-2008-text/libgimp/gimplayer_pdb.c	Fri Aug 29 18:50:27 2008
@@ -79,6 +79,48 @@
 }
 
 /**
+ * gimp_layer_new_from_visible:
+ * @image_ID: The source image from where the content is copied.
+ * @dest_image_ID: The destination image to which to add the layer.
+ * @name: The layer name.
+ *
+ * Create a new layer from what is visible in an image.
+ *
+ * This procedure creates a new layer from what is visible in the given
+ * image. The new layer still needs to be added to the destination
+ * image, as this is not automatic. Add the new layer with the
+ * gimp_image_add_layer() command. Other attributes such as layer mask
+ * modes, and offsets should be set with explicit procedure calls.
+ *
+ * Returns: The newly created layer.
+ *
+ * Since: GIMP 2.6
+ */
+gint32
+gimp_layer_new_from_visible (gint32       image_ID,
+                             gint32       dest_image_ID,
+                             const gchar *name)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gint32 layer_ID = -1;
+
+  return_vals = gimp_run_procedure ("gimp-layer-new-from-visible",
+                                    &nreturn_vals,
+                                    GIMP_PDB_IMAGE, image_ID,
+                                    GIMP_PDB_IMAGE, dest_image_ID,
+                                    GIMP_PDB_STRING, name,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    layer_ID = return_vals[1].data.d_layer;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return layer_ID;
+}
+
+/**
  * gimp_layer_new_from_drawable:
  * @drawable_ID: The source drawable from where the new layer is copied.
  * @dest_image_ID: The destination image to which to add the layer.

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	Fri Aug 29 18:50:27 2008
@@ -36,6 +36,9 @@
                                                         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,

Modified: branches/soc-2008-text/libgimp/gimppixelrgn.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimppixelrgn.c	(original)
+++ branches/soc-2008-text/libgimp/gimppixelrgn.c	Fri Aug 29 18:50:27 2008
@@ -98,7 +98,7 @@
  *                                    the shadow tiles. It is common
  *                                    practice to write to the shadow
  *                                    tiles and then use
- *                                    #gimp_drawable_merge_shadow () to
+ *                                    gimp_drawable_merge_shadow() to
  *                                    merge the changes from the shadow
  *                                    tiles using the current selection
  *                                    as a mask.

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

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

Modified: branches/soc-2008-text/libgimpbase/gimpbase.def
==============================================================================
--- branches/soc-2008-text/libgimpbase/gimpbase.def	(original)
+++ branches/soc-2008-text/libgimpbase/gimpbase.def	Fri Aug 29 18:50:27 2008
@@ -76,6 +76,7 @@
 	gimp_path_parse
 	gimp_path_to_str
 	gimp_pdb_arg_type_get_type
+	gimp_pdb_error_handler_get_type
 	gimp_pdb_proc_type_get_type
 	gimp_pdb_status_type_get_type
 	gimp_personal_rc_file

Modified: branches/soc-2008-text/libgimpbase/gimpbaseenums.c
==============================================================================
--- branches/soc-2008-text/libgimpbase/gimpbaseenums.c	(original)
+++ branches/soc-2008-text/libgimpbase/gimpbaseenums.c	Fri Aug 29 18:50:27 2008
@@ -864,6 +864,35 @@
 }
 
 GType
+gimp_pdb_error_handler_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_PDB_ERROR_HANDLER_INTERNAL, "GIMP_PDB_ERROR_HANDLER_INTERNAL", "internal" },
+    { GIMP_PDB_ERROR_HANDLER_PLUGIN, "GIMP_PDB_ERROR_HANDLER_PLUGIN", "plugin" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_PDB_ERROR_HANDLER_INTERNAL, "GIMP_PDB_ERROR_HANDLER_INTERNAL", NULL },
+    { GIMP_PDB_ERROR_HANDLER_PLUGIN, "GIMP_PDB_ERROR_HANDLER_PLUGIN", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpPDBErrorHandler", values);
+      gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_pdb_proc_type_get_type (void)
 {
   static const GEnumValue values[] =

Modified: branches/soc-2008-text/libgimpbase/gimpbaseenums.h
==============================================================================
--- branches/soc-2008-text/libgimpbase/gimpbaseenums.h	(original)
+++ branches/soc-2008-text/libgimpbase/gimpbaseenums.h	Fri Aug 29 18:50:27 2008
@@ -385,6 +385,17 @@
 } GimpPDBArgType;
 
 
+#define GIMP_TYPE_PDB_ERROR_HANDLER (gimp_pdb_error_handler_get_type ())
+
+GType gimp_pdb_error_handler_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_PDB_ERROR_HANDLER_INTERNAL,
+  GIMP_PDB_ERROR_HANDLER_PLUGIN
+} GimpPDBErrorHandler;
+
+
 #define GIMP_TYPE_PDB_PROC_TYPE (gimp_pdb_proc_type_get_type ())
 
 GType gimp_pdb_proc_type_get_type (void) G_GNUC_CONST;

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

Modified: branches/soc-2008-text/libgimpwidgets/gimpscrolledpreview.h
==============================================================================
--- branches/soc-2008-text/libgimpwidgets/gimpscrolledpreview.h	(original)
+++ branches/soc-2008-text/libgimpwidgets/gimpscrolledpreview.h	Fri Aug 29 18:50:27 2008
@@ -50,7 +50,7 @@
   GtkWidget    *nav_icon;
   GtkWidget    *nav_popup;
   GdkCursor    *cursor_move;
-  GdkGC        *nav_gc;
+  GdkGC        *nav_gc; /* unused */
 
   /*< private >*/
   gpointer      priv;

Modified: branches/soc-2008-text/libgimpwidgets/gimpwidgets.c
==============================================================================
--- branches/soc-2008-text/libgimpwidgets/gimpwidgets.c	(original)
+++ branches/soc-2008-text/libgimpwidgets/gimpwidgets.c	Fri Aug 29 18:50:27 2008
@@ -728,7 +728,7 @@
   GtkWidget           *sizeentry;
   GtkWidget           *chainbutton;
 
-  spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 1, 1, 2);
+  spinbutton = gimp_spin_button_new (&adjustment, 1, 0, 1, 1, 10, 0, 1, 2);
 
   if (spinbutton_width > 0)
     {

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	Fri Aug 29 18:50:27 2008
@@ -29,6 +29,8 @@
         <menuitem action="debug-dump-items" />
         <menuitem action="debug-dump-managers" />
         <menuitem action="debug-dump-attached-data" />
+        <separator />
+        <menuitem action="debug-use-gegl" />
       </menu>
 
       <separator />
@@ -178,6 +180,7 @@
       </placeholder>
       <menu action="edit-paste-as-menu" name="Paste as">
 	<menuitem action="edit-paste-as-new-short" />
+	<menuitem action="edit-paste-as-new-layer" />
       </menu>
       <menu action="edit-buffer-menu" name="Buffer">
         <menuitem action="edit-named-cut" />
@@ -345,6 +348,7 @@
     <menu action="layers-menu" name="Layer">
       <placeholder name="New">
         <menuitem action="layers-new" />
+        <menuitem action="layers-new-from-visible" />
         <menuitem action="layers-duplicate" />
       </placeholder>
       <placeholder name="Structure">

Modified: branches/soc-2008-text/menus/layers-menu.xml
==============================================================================
--- branches/soc-2008-text/menus/layers-menu.xml	(original)
+++ branches/soc-2008-text/menus/layers-menu.xml	Fri Aug 29 18:50:27 2008
@@ -7,6 +7,7 @@
     <menuitem action="layers-edit-attributes" />
     <separator />
     <menuitem action="layers-new" />
+    <menuitem action="layers-new-from-visible" />
 <!--
     <menuitem action="layers-raise" />
     <menuitem action="layers-raise-to-top" />

Modified: branches/soc-2008-text/modules/Makefile.am
==============================================================================
--- branches/soc-2008-text/modules/Makefile.am	(original)
+++ branches/soc-2008-text/modules/Makefile.am	Fri Aug 29 18:50:27 2008
@@ -21,89 +21,92 @@
 	makefile.msc
 
 if HAVE_LCMS
-cdisplay_lcms_module = libcdisplay_lcms.la
-cdisplay_proof_module = libcdisplay_proof.la
+display_filter_lcms_module = libdisplay-filter-lcms.la
+display_filter_proof_module = libdisplay-filter-proof.la
 endif
 
 if PLATFORM_WIN32
 else
-controller_midi_module = libcontroller_midi.la
+controller_midi_module = libcontroller-midi.la
 endif
 
 if HAVE_LINUX_INPUT
-controller_linux_input_module = libcontroller_linux_input.la
+controller_linux_input_module = libcontroller-linux-input.la
 endif
 
 if HAVE_DX_DINPUT
-controller_dx_dinput_module = libcontroller_dx_dinput.la
+controller_dx_dinput_module = libcontroller-dx-dinput.la
 endif
 
 lib_LTLIBRARIES = \
-	libcolorsel_cmyk.la		\
-	libcolorsel_triangle.la		\
-	libcolorsel_water.la		\
-	libcdisplay_colorblind.la	\
-	libcdisplay_gamma.la		\
-	libcdisplay_highcontrast.la	\
-	$(cdisplay_lcms_module)		\
-	$(cdisplay_proof_module)	\
-	$(controller_midi_module)	\
-	$(controller_linux_input_module)\
+	libcolor-selector-cmyk.la		\
+	libcolor-selector-water.la		\
+	libcolor-selector-wheel.la		\
+	libdisplay-filter-color-blind.la	\
+	libdisplay-filter-gamma.la		\
+	libdisplay-filter-high-contrast.la	\
+	$(display_filter_lcms_module)		\
+	$(display_filter_proof_module)		\
+	$(controller_midi_module)		\
+	$(controller_linux_input_module)	\
 	$(controller_dx_dinput_module)
 
 
 modules_libadd = $(libgimpmodule) $(libgimpwidgets) $(GTK_LIBS)
 
-colorsel_libadd = $(libgimpcolor) $(modules_libadd)
-cdisplay_libadd = $(libgimpbase) $(libgimpconfig) $(libgimpcolor) $(modules_libadd)
+color_selector_libadd = $(libgimpcolor) $(modules_libadd)
+display_filter_libadd = $(libgimpbase) $(libgimpconfig) $(libgimpcolor) $(modules_libadd)
 controller_libadd = $(modules_libadd)
 
 if HAVE_LCMS
-libcolorsel_cmyk_la_SOURCES = colorsel_cmyk_lcms.c
-libcolorsel_cmyk_la_LIBADD = $(libgimpconfig) $(colorsel_libadd) $(LIBLCMS)
+libcolor_selector_cmyk_la_SOURCES = color-selector-cmyk-lcms.c
+libcolor_selector_cmyk_la_CFLAGS = $(LCMS_CFLAGS)
+libcolor_selector_cmyk_la_LIBADD = $(libgimpconfig) $(color_selector_libadd) $(LCMS_LIBS)
 else
-libcolorsel_cmyk_la_SOURCES = colorsel_cmyk.c
-libcolorsel_cmyk_la_LIBADD = $(colorsel_libadd)
+libcolor_selector_cmyk_la_SOURCES = color-selector-cmyk.c
+libcolor_selector_cmyk_la_LIBADD = $(color_selector_libadd)
 endif
 
-libcolorsel_cmyk_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libcolor_selector_cmyk_la_LDFLAGS = -avoid-version -module $(no_undefined)
 
-libcolorsel_triangle_la_SOURCES = colorsel_triangle.c
-libcolorsel_triangle_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcolorsel_triangle_la_LIBADD = $(colorsel_libadd)
+libcolor_selector_water_la_SOURCES = color-selector-water.c
+libcolor_selector_water_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libcolor_selector_water_la_LIBADD = $(color_selector_libadd)
 
-libcolorsel_water_la_SOURCES = colorsel_water.c
-libcolorsel_water_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcolorsel_water_la_LIBADD = $(colorsel_libadd)
+libcolor_selector_wheel_la_SOURCES = color-selector-wheel.c
+libcolor_selector_wheel_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libcolor_selector_wheel_la_LIBADD = $(color_selector_libadd)
 
-libcdisplay_colorblind_la_SOURCES = cdisplay_colorblind.c
-libcdisplay_colorblind_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcdisplay_colorblind_la_LIBADD = $(cdisplay_libadd)
+libdisplay_filter_color_blind_la_SOURCES = display-filter-color-blind.c
+libdisplay_filter_color_blind_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libdisplay_filter_color_blind_la_LIBADD = $(display_filter_libadd)
 
-libcdisplay_gamma_la_SOURCES = cdisplay_gamma.c
-libcdisplay_gamma_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcdisplay_gamma_la_LIBADD = $(cdisplay_libadd)
+libdisplay_filter_gamma_la_SOURCES = display-filter-gamma.c
+libdisplay_filter_gamma_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libdisplay_filter_gamma_la_LIBADD = $(display_filter_libadd)
 
-libcdisplay_highcontrast_la_SOURCES = cdisplay_highcontrast.c
-libcdisplay_highcontrast_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcdisplay_highcontrast_la_LIBADD = $(cdisplay_libadd)
+libdisplay_filter_high_contrast_la_SOURCES = display-filter-high-contrast.c
+libdisplay_filter_high_contrast_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libdisplay_filter_high_contrast_la_LIBADD = $(display_filter_libadd)
 
-libcdisplay_lcms_la_SOURCES = cdisplay_lcms.c
-libcdisplay_lcms_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcdisplay_lcms_la_LIBADD = $(cdisplay_libadd) $(LIBLCMS)
+libdisplay_filter_lcms_la_SOURCES = display-filter-lcms.c
+libdisplay_filter_lcms_la_CFLAGS = $(LCMS_CFLAGS)
+libdisplay_filter_lcms_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libdisplay_filter_lcms_la_LIBADD = $(display_filter_libadd) $(LCMS_LIBS)
 
 if PLATFORM_WIN32
-libcdisplay_lcms_la_LIBADD += -lgdi32
+libdisplay_filter_lcms_la_LIBADD += -lgdi32
 endif
 
-libcdisplay_proof_la_SOURCES = cdisplay_proof.c
-libcdisplay_proof_la_LDFLAGS = -avoid-version -module $(no_undefined)
-libcdisplay_proof_la_LIBADD = $(cdisplay_libadd) $(LIBLCMS)
+libdisplay_filter_proof_la_SOURCES = display-filter-proof.c
+libdisplay_filter_proof_la_CFLAGS = $(LCMS_CFLAGS)
+libdisplay_filter_proof_la_LDFLAGS = -avoid-version -module $(no_undefined)
+libdisplay_filter_proof_la_LIBADD = $(display_filter_libadd) $(LCMS_LIBS)
 
 libcontroller_linux_input_la_SOURCES = \
 	gimpinputdevicestore-hal.c	\
 	gimpinputdevicestore.h		\
-	controller_linux_input.c
+	controller-linux-input.c
 libcontroller_linux_input_la_CFLAGS = $(DBUS_GLIB_CFLAGS) $(HAL_CFLAGS)
 libcontroller_linux_input_la_LDFLAGS = -avoid-version -module $(no_undefined)
 libcontroller_linux_input_la_LIBADD = \
@@ -112,13 +115,13 @@
 libcontroller_dx_dinput_la_SOURCES = \
 	gimpinputdevicestore-dx.c	\
 	gimpinputdevicestore.h		\
-	controller_dx_dinput.c
+	controller-dx-dinput.c
 # Use -Wl to avoid libtool lossage
 libcontroller_dx_dinput_la_LDFLAGS = -avoid-version -module $(no_undefined) -Wl,-ldinput8 -Wl,-ldxguid
 libcontroller_dx_dinput_la_LIBADD = \
 	$(controller_libadd) -lrpcrt4
 
-libcontroller_midi_la_SOURCES = controller_midi.c
+libcontroller_midi_la_SOURCES = controller-midi.c
 libcontroller_midi_la_CFLAGS = $(ALSA_CFLAGS)
 libcontroller_midi_la_LDFLAGS = -avoid-version -module $(no_undefined)
 libcontroller_midi_la_LIBADD = $(controller_libadd) $(ALSA_LIBS)

Modified: branches/soc-2008-text/po-libgimp/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-libgimp/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-libgimp/Makefile.in.in	Fri Aug 29 18:50:27 2008
@@ -11,6 +11,11 @@
 #
 # - Modified by jacob berkman <jacob ximian com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE -libgimp
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
@@ -19,11 +24,10 @@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -31,19 +35,17 @@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-libgimp
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -52,35 +54,30 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+# This comment gets stripped out
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
-	$(COMPILE) $<
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -91,7 +88,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- USE_NLS@
@@ -102,115 +99,91 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
-	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
-	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
-installcheck:
+install-exec installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
-
-dvi info tags TAGS ID:
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
 
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -226,28 +199,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( posrcprefix='$(top_srcdir)/'; \
-	  rm -f $ -t $@ \
-	    && (sed -e '/^#/d' 					\
-		    -e 's/^[[].*] *//' 				\
-		    -e '/^[ 	]*$$/d' 			\
-		    -e "s ^@	$$posrcprefix@" $(srcdir)/$  in	\
-		| sed -e '$$!s/$$/ \\/') > $ -t \
-	    && chmod a-w $ -t \
-	    && mv $ -t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-	cd .. \
-	  && CONFIG_FILES=$(subdir)/$  in CONFIG_HEADERS= \
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

Modified: branches/soc-2008-text/po-libgimp/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po-libgimp/POTFILES.in	(original)
+++ branches/soc-2008-text/po-libgimp/POTFILES.in	Fri Aug 29 18:50:27 2008
@@ -3,6 +3,7 @@
 
 [encoding: UTF-8]
 
+libgimp/gimp.c
 libgimp/gimpbrushmenu.c
 libgimp/gimpbrushselectbutton.c
 libgimp/gimpexport.c
@@ -58,15 +59,15 @@
 libgimpwidgets/gimpwidgets.c
 libgimpwidgets/gimpwidgetsenums.c
 
-modules/cdisplay_colorblind.c
-modules/cdisplay_gamma.c
-modules/cdisplay_highcontrast.c
-modules/cdisplay_lcms.c
-modules/cdisplay_proof.c
-modules/colorsel_cmyk.c
-modules/colorsel_cmyk_lcms.c
-modules/colorsel_triangle.c
-modules/colorsel_water.c
-modules/controller_linux_input.c
-modules/controller_dx_dinput.c
-modules/controller_midi.c
+modules/display-filter-color-blind.c
+modules/display-filter-gamma.c
+modules/display-filter-high-contrast.c
+modules/display-filter-lcms.c
+modules/display-filter-proof.c
+modules/color-selector-cmyk.c
+modules/color-selector-cmyk-lcms.c
+modules/color-selector-water.c
+modules/color-selector-wheel.c
+modules/controller-linux-input.c
+modules/controller-dx-dinput.c
+modules/controller-midi.c

Modified: branches/soc-2008-text/po-libgimp/POTFILES.skip
==============================================================================
--- branches/soc-2008-text/po-libgimp/POTFILES.skip	(original)
+++ branches/soc-2008-text/po-libgimp/POTFILES.skip	Fri Aug 29 18:50:27 2008
@@ -1,5 +1,6 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 plug-ins
 tools

Modified: branches/soc-2008-text/po-plug-ins/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-plug-ins/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-plug-ins/Makefile.in.in	Fri Aug 29 18:50:27 2008
@@ -11,6 +11,11 @@
 #
 # - Modified by jacob berkman <jacob ximian com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE -std-plug-ins
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
@@ -19,11 +24,10 @@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -31,19 +35,17 @@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-plug-ins
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -52,35 +54,30 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+# This comment gets stripped out
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
-	$(COMPILE) $<
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -91,7 +88,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- USE_NLS@
@@ -102,115 +99,91 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
-	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
-	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
-installcheck:
+install-exec installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
-
-dvi info tags TAGS ID:
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
 
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -226,28 +199,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( posrcprefix='$(top_srcdir)/'; \
-	  rm -f $ -t $@ \
-	    && (sed -e '/^#/d' 					\
-		    -e 's/^[[].*] *//' 				\
-		    -e '/^[ 	]*$$/d' 			\
-		    -e "s ^@	$$posrcprefix@" $(srcdir)/$  in	\
-		| sed -e '$$!s/$$/ \\/') > $ -t \
-	    && chmod a-w $ -t \
-	    && mv $ -t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-	cd .. \
-	  && CONFIG_FILES=$(subdir)/$  in CONFIG_HEADERS= \
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

Modified: branches/soc-2008-text/po-plug-ins/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po-plug-ins/POTFILES.in	(original)
+++ branches/soc-2008-text/po-plug-ins/POTFILES.in	Fri Aug 29 18:50:27 2008
@@ -3,13 +3,9 @@
 
 [encoding: UTF-8]
 
-plug-ins/bmp/bmp.c
-plug-ins/bmp/bmp-read.c
-plug-ins/bmp/bmp-write.c
 plug-ins/color-rotate/color-rotate-dialog.c
 plug-ins/color-rotate/color-rotate-stock.c
 plug-ins/color-rotate/color-rotate.c
-plug-ins/common/aa.c
 plug-ins/common/alien-map.c
 plug-ins/common/align-layers.c
 plug-ins/common/animation-optimize.c
@@ -24,7 +20,6 @@
 plug-ins/common/border-average.c
 plug-ins/common/bump-map.c
 plug-ins/common/cartoon.c
-plug-ins/common/cel.c
 plug-ins/common/channel-mixer.c
 plug-ins/common/checkerboard.c
 plug-ins/common/cml-explorer.c
@@ -35,7 +30,6 @@
 plug-ins/common/colorify.c
 plug-ins/common/colormap-remap.c
 plug-ins/common/compose.c
-plug-ins/common/compressor.c
 plug-ins/common/contrast-normalize.c
 plug-ins/common/contrast-retinex.c
 plug-ins/common/contrast-stretch-hsv.c
@@ -43,16 +37,13 @@
 plug-ins/common/convolution-matrix.c
 plug-ins/common/crop-auto.c
 plug-ins/common/crop-zealous.c
-plug-ins/common/csource.c
 plug-ins/common/cubism.c
 plug-ins/common/curve-bend.c
 plug-ins/common/decompose.c
 plug-ins/common/deinterlace.c
 plug-ins/common/depth-merge.c
-plug-ins/common/desktop-link.c
 plug-ins/common/despeckle.c
 plug-ins/common/destripe.c
-plug-ins/common/dicom.c
 plug-ins/common/diffraction.c
 plug-ins/common/displace.c
 plug-ins/common/edge-dog.c
@@ -62,22 +53,47 @@
 plug-ins/common/edge.c
 plug-ins/common/emboss.c
 plug-ins/common/engrave.c
+plug-ins/common/file-aa.c
+plug-ins/common/file-cel.c
+plug-ins/common/file-compressor.c
+plug-ins/common/file-csource.c
+plug-ins/common/file-desktop-link.c
+plug-ins/common/file-dicom.c
+plug-ins/common/file-gbr.c
+plug-ins/common/file-gif-load.c
+plug-ins/common/file-gif-save.c
+plug-ins/common/file-gih.c
+plug-ins/common/file-glob.c
+plug-ins/common/file-header.c
+plug-ins/common/file-html-table.c
+plug-ins/common/file-mng.c
+plug-ins/common/file-pat.c
+plug-ins/common/file-pcx.c
+plug-ins/common/file-pdf.c
+plug-ins/common/file-pix.c
+plug-ins/common/file-png.c
+plug-ins/common/file-pnm.c
+plug-ins/common/file-ps.c
+plug-ins/common/file-psp.c
+plug-ins/common/file-raw.c
+plug-ins/common/file-sunras.c
+plug-ins/common/file-svg.c
+plug-ins/common/file-tga.c
+plug-ins/common/file-tiff-load.c
+plug-ins/common/file-tiff-save.c
+plug-ins/common/file-wmf.c
+plug-ins/common/file-xbm.c
+plug-ins/common/file-xpm.c
+plug-ins/common/file-xwd.c
 plug-ins/common/film.c
 plug-ins/common/filter-pack.c
 plug-ins/common/fractal-trace.c
-plug-ins/common/gbr.c
 plug-ins/common/gee-zoom.c
 plug-ins/common/gee.c
-plug-ins/common/gif-load.c
-plug-ins/common/gif-save.c
-plug-ins/common/gih.c
-plug-ins/common/glob.c
 plug-ins/common/gradient-map.c
 plug-ins/common/grid.c
 plug-ins/common/guillotine.c
-plug-ins/common/header.c
 plug-ins/common/hot.c
-plug-ins/common/html-table.c
 plug-ins/common/illusion.c
 plug-ins/common/iwarp.c
 plug-ins/common/jigsaw.c
@@ -87,7 +103,6 @@
 plug-ins/common/lens-flare.c
 plug-ins/common/mail.c
 plug-ins/common/max-rgb.c
-plug-ins/common/mng.c
 plug-ins/common/mosaic.c
 plug-ins/common/newsprint.c
 plug-ins/common/nl-filter.c
@@ -98,22 +113,13 @@
 plug-ins/common/noise-spread.c
 plug-ins/common/nova.c
 plug-ins/common/oilify.c
-plug-ins/common/pat.c
-plug-ins/common/pcx.c
 plug-ins/common/photocopy.c
-plug-ins/common/pix.c
 plug-ins/common/pixelize.c
 plug-ins/common/plasma.c
 plug-ins/common/plugin-browser.c
-plug-ins/common/png.c
-plug-ins/common/pnm.c
 plug-ins/common/polar-coords.c
-plug-ins/common/poppler.c
-plug-ins/common/postscript.c
 plug-ins/common/procedure-browser.c
-plug-ins/common/psp.c
 plug-ins/common/qbist.c
-plug-ins/common/raw.c
 plug-ins/common/red-eye-removal.c
 plug-ins/common/ripple.c
 plug-ins/common/rotate.c
@@ -127,12 +133,7 @@
 plug-ins/common/softglow.c
 plug-ins/common/sparkle.c
 plug-ins/common/sphere-designer.c
-plug-ins/common/sunras.c
-plug-ins/common/svg.c
-plug-ins/common/tga.c
 plug-ins/common/threshold-alpha.c
-plug-ins/common/tiff-load.c
-plug-ins/common/tiff-save.c
 plug-ins/common/tile-glass.c
 plug-ins/common/tile-paper.c
 plug-ins/common/tile-seamless.c
@@ -149,14 +150,35 @@
 plug-ins/common/web-browser.c
 plug-ins/common/whirl-pinch.c
 plug-ins/common/wind.c
-plug-ins/common/wmf.c
-plug-ins/common/xbm.c
-plug-ins/common/xpm.c
-plug-ins/common/xwd.c
-plug-ins/faxg3/faxg3.c
-plug-ins/fits/fits.c
+plug-ins/file-bmp/bmp-read.c
+plug-ins/file-bmp/bmp-write.c
+plug-ins/file-bmp/bmp.c
+plug-ins/file-faxg3/faxg3.c
+plug-ins/file-fits/fits.c
+plug-ins/file-fli/fli-gimp.c
+plug-ins/file-ico/ico-dialog.c
+plug-ins/file-ico/ico-load.c
+plug-ins/file-ico/ico-save.c
+plug-ins/file-ico/ico.c
+plug-ins/file-jpeg/jpeg-exif.c
+plug-ins/file-jpeg/jpeg-load.c
+plug-ins/file-jpeg/jpeg-save.c
+plug-ins/file-jpeg/jpeg.c
+plug-ins/file-psd/psd-image-res-load.c
+plug-ins/file-psd/psd-load.c
+plug-ins/file-psd/psd-save.c
+plug-ins/file-psd/psd-thumb-load.c
+plug-ins/file-psd/psd-util.c
+plug-ins/file-psd/psd.c
+plug-ins/file-sgi/sgi.c
+plug-ins/file-uri/gimpmountoperation.c
+plug-ins/file-uri/uri-backend-gnomevfs.c
+plug-ins/file-uri/uri-backend-gvfs.c
+plug-ins/file-uri/uri-backend-libcurl.c
+plug-ins/file-uri/uri-backend-wget.c
+plug-ins/file-uri/uri.c
+plug-ins/file-xjt/xjt.c
 plug-ins/flame/flame.c
-plug-ins/fli/fli-gimp.c
 plug-ins/fractal-explorer/fractal-explorer-dialogs.c
 plug-ins/fractal-explorer/fractal-explorer.c
 plug-ins/gfig/gfig-bezier.c
@@ -190,10 +212,6 @@
 plug-ins/help-browser/help-browser.c
 plug-ins/help/gimphelpdomain.c
 plug-ins/help/gimphelplocale.c
-plug-ins/ico/ico-dialog.c
-plug-ins/ico/ico-load.c
-plug-ins/ico/ico-save.c
-plug-ins/ico/ico.c
 plug-ins/ifs-compose/ifs-compose.c
 plug-ins/imagemap/imap_about.c
 plug-ins/imagemap/imap_circle.c
@@ -240,41 +258,23 @@
 plug-ins/imagemap/imap_settings.c
 plug-ins/imagemap/imap_source.c
 plug-ins/imagemap/imap_stock.c
-plug-ins/jpeg/jpeg-exif.c
-plug-ins/jpeg/jpeg-load.c
-plug-ins/jpeg/jpeg-save.c
-plug-ins/jpeg/jpeg.c
 plug-ins/lighting/lighting-apply.c
 plug-ins/lighting/lighting-main.c
 plug-ins/lighting/lighting-ui.c
 plug-ins/map-object/map-object-apply.c
 plug-ins/map-object/map-object-main.c
 plug-ins/map-object/map-object-ui.c
-plug-ins/maze/maze.c
-plug-ins/maze/maze.h
 plug-ins/maze/maze-algorithms.c
 plug-ins/maze/maze-dialog.c
+plug-ins/maze/maze.c
+plug-ins/maze/maze.h
 plug-ins/metadata/metadata.c
 plug-ins/metadata/xmp-parse.c
 plug-ins/pagecurl/pagecurl.c
 plug-ins/print/print-draw-page.c
 plug-ins/print/print-page-layout.c
 plug-ins/print/print.c
-plug-ins/psd/psd-image-res-load.c
-plug-ins/psd/psd-load.c
-plug-ins/psd/psd-save.c
-plug-ins/psd/psd-thumb-load.c
-plug-ins/psd/psd-util.c
-plug-ins/psd/psd.c
 plug-ins/selection-to-path/pxl-outline.c
 plug-ins/selection-to-path/selection-to-path.c
-plug-ins/sgi/sgi.c
 plug-ins/twain/twain.c
-plug-ins/uri/gimpmountoperation.c
-plug-ins/uri/uri-backend-gnomevfs.c
-plug-ins/uri/uri-backend-gvfs.c
-plug-ins/uri/uri-backend-libcurl.c
-plug-ins/uri/uri-backend-wget.c
-plug-ins/uri/uri.c
 plug-ins/win-snap/winsnap.c
-plug-ins/xjt/xjt.c

Modified: branches/soc-2008-text/po-plug-ins/POTFILES.skip
==============================================================================
--- branches/soc-2008-text/po-plug-ins/POTFILES.skip	(original)
+++ branches/soc-2008-text/po-plug-ins/POTFILES.skip	Fri Aug 29 18:50:27 2008
@@ -1,6 +1,7 @@
 app
 data/tips
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-text/po-python/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-python/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-python/Makefile.in.in	Fri Aug 29 18:50:27 2008
@@ -11,6 +11,11 @@
 #
 # - Modified by jacob berkman <jacob ximian com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE -python
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
@@ -19,11 +24,10 @@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -31,19 +35,17 @@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-python
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -52,35 +54,30 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+# This comment gets stripped out
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
-	$(COMPILE) $<
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -91,7 +88,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- USE_NLS@
@@ -102,115 +99,91 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
-	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
-	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
-installcheck:
+install-exec installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
-
-dvi info tags TAGS ID:
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
 
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -226,28 +199,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( posrcprefix='$(top_srcdir)/'; \
-	  rm -f $ -t $@ \
-	    && (sed -e '/^#/d' 					\
-		    -e 's/^[[].*] *//' 				\
-		    -e '/^[ 	]*$$/d' 			\
-		    -e "s ^@	$$posrcprefix@" $(srcdir)/$  in	\
-		| sed -e '$$!s/$$/ \\/') > $ -t \
-	    && chmod a-w $ -t \
-	    && mv $ -t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-	cd .. \
-	  && CONFIG_FILES=$(subdir)/$  in CONFIG_HEADERS= \
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

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

Modified: branches/soc-2008-text/po-script-fu/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-script-fu/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-script-fu/Makefile.in.in	Fri Aug 29 18:50:27 2008
@@ -11,6 +11,11 @@
 #
 # - Modified by jacob berkman <jacob ximian com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE -script-fu
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
@@ -19,11 +24,10 @@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -31,19 +35,17 @@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-script-fu
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -52,35 +54,30 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+# This comment gets stripped out
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
-	$(COMPILE) $<
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -91,7 +88,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- USE_NLS@
@@ -102,115 +99,91 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
-	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
-	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
-installcheck:
+install-exec installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
-
-dvi info tags TAGS ID:
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
 
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -226,28 +199,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( posrcprefix='$(top_srcdir)/'; \
-	  rm -f $ -t $@ \
-	    && (sed -e '/^#/d' 					\
-		    -e 's/^[[].*] *//' 				\
-		    -e '/^[ 	]*$$/d' 			\
-		    -e "s ^@	$$posrcprefix@" $(srcdir)/$  in	\
-		| sed -e '$$!s/$$/ \\/') > $ -t \
-	    && chmod a-w $ -t \
-	    && mv $ -t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-	cd .. \
-	  && CONFIG_FILES=$(subdir)/$  in CONFIG_HEADERS= \
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

Modified: branches/soc-2008-text/po-script-fu/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po-script-fu/POTFILES.in	(original)
+++ branches/soc-2008-text/po-script-fu/POTFILES.in	Fri Aug 29 18:50:27 2008
@@ -4,6 +4,7 @@
 [encoding: UTF-8]
 
 plug-ins/script-fu/script-fu-console.c
+plug-ins/script-fu/script-fu-eval.c
 plug-ins/script-fu/script-fu-interface.c
 plug-ins/script-fu/script-fu-scripts.c
 plug-ins/script-fu/script-fu-server.c
@@ -90,7 +91,6 @@
 plug-ins/script-fu/scripts/speed-text.scm
 plug-ins/script-fu/scripts/spinning-globe.scm
 plug-ins/script-fu/scripts/spyrogimp.scm
-plug-ins/script-fu/scripts/starburst-logo.scm
 plug-ins/script-fu/scripts/starscape-logo.scm
 plug-ins/script-fu/scripts/swirltile.scm
 plug-ins/script-fu/scripts/swirly-pattern.scm

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

Modified: branches/soc-2008-text/po-tips/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-tips/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-tips/Makefile.in.in	Fri Aug 29 18:50:27 2008
@@ -11,6 +11,11 @@
 #
 # - Modified by jacob berkman <jacob ximian com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE -tips
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
@@ -19,11 +24,10 @@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
 VPATH = @srcdir@
 
 prefix = @prefix@
@@ -31,19 +35,17 @@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-tips
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -52,35 +54,30 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+# This comment gets stripped out
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
-	$(COMPILE) $<
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -91,7 +88,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- USE_NLS@
@@ -102,115 +99,91 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
-	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
-	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
-installcheck:
+install-exec installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
-
-dvi info tags TAGS ID:
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
 
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -226,28 +199,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( posrcprefix='$(top_srcdir)/'; \
-	  rm -f $ -t $@ \
-	    && (sed -e '/^#/d' 					\
-		    -e 's/^[[].*] *//' 				\
-		    -e '/^[ 	]*$$/d' 			\
-		    -e "s ^@	$$posrcprefix@" $(srcdir)/$  in	\
-		| sed -e '$$!s/$$/ \\/') > $ -t \
-	    && chmod a-w $ -t \
-	    && mv $ -t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
-	cd .. \
-	  && CONFIG_FILES=$(subdir)/$  in CONFIG_HEADERS= \
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

Modified: branches/soc-2008-text/po-tips/POTFILES.skip
==============================================================================
--- branches/soc-2008-text/po-tips/POTFILES.skip	(original)
+++ branches/soc-2008-text/po-tips/POTFILES.skip	Fri Aug 29 18:50:27 2008
@@ -1,5 +1,6 @@
 app
 desktop
+desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-text/po/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po/POTFILES.in	(original)
+++ branches/soc-2008-text/po/POTFILES.in	Fri Aug 29 18:50:27 2008
@@ -206,7 +206,7 @@
 app/display/gimpdisplayshell-dnd.c
 app/display/gimpdisplayshell-filter-dialog.c
 app/display/gimpdisplayshell-layer-select.c
-app/display/gimpdisplayshell-scale.c
+app/display/gimpdisplayshell-scale-dialog.c
 app/display/gimpdisplayshell-title.c
 app/display/gimpnavigationeditor.c
 app/display/gimpstatusbar.c
@@ -269,11 +269,13 @@
 app/plug-in/gimpenvirontable.c
 app/plug-in/gimpinterpreterdb.c
 app/plug-in/gimpplugin-message.c
+app/plug-in/gimpplugin-progress.c
 app/plug-in/gimpplugin.c
 app/plug-in/gimppluginmanager-call.c
 app/plug-in/gimppluginmanager-restore.c
 app/plug-in/gimppluginmanager.c
 app/plug-in/gimppluginprocedure.c
+app/plug-in/gimppluginprocframe.c
 app/plug-in/gimptemporaryprocedure.c
 app/plug-in/plug-in-enums.c
 app/plug-in/plug-in-icc-profile.c

Modified: branches/soc-2008-text/po/POTFILES.skip
==============================================================================
--- branches/soc-2008-text/po/POTFILES.skip	(original)
+++ branches/soc-2008-text/po/POTFILES.skip	Fri Aug 29 18:50:27 2008
@@ -1,7 +1,6 @@
 app/widgets/gtkscalebutton.c
 data/tips/gimp-tips.xml.in
 desktop/gimp.desktop.in
-desktop/gimp.desktop.in
 libgimp
 libgimpbase
 libgimpconfig

Modified: branches/soc-2008-text/tools/Makefile.am
==============================================================================
--- branches/soc-2008-text/tools/Makefile.am	(original)
+++ branches/soc-2008-text/tools/Makefile.am	Fri Aug 29 18:50:27 2008
@@ -23,7 +23,7 @@
 
 gimp_remote_2_5_LDADD = \
 	$(GTK_LIBS)	\
-	$(LIBXMU)
+	$(XMU_LIBS)
 
 gimptool_2_0_SOURCES = \
 	gimptool.c

Modified: branches/soc-2008-text/tools/pdbgen/app.pl
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/app.pl	(original)
+++ branches/soc-2008-text/tools/pdbgen/app.pl	Fri Aug 29 18:50:27 2008
@@ -128,14 +128,21 @@
 
 sub marshal_outargs {
     my $proc = shift;
-
-    my $result = <<CODE;
-  return_vals = gimp_procedure_get_return_values (procedure, success);
-CODE
-
+    my $result;
     my $argc = 0;
     my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
 
+    if ($success) {
+	$result = <<CODE;
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+CODE
+    } else {
+	$result = <<CODE;
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
+CODE
+    }
+
     if (scalar @outargs) {
 	my $outargs = "";
 
@@ -177,13 +184,14 @@
     else {
 	if ($success) {
 	    $result =~ s/return_vals =/return/;
+	    $result =~ s/       error/error/;
 	}
 	else {
 	    $result =~ s/  return_vals =/\n  return/;
+	    $result =~ s/       error/error/;
 	}
     }
 
-    $result =~ s/, success\);$/, TRUE);/m unless $success;
     $result;
 }
 

Modified: branches/soc-2008-text/tools/pdbgen/enums.pl
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/enums.pl	(original)
+++ branches/soc-2008-text/tools/pdbgen/enums.pl	Fri Aug 29 18:50:27 2008
@@ -294,6 +294,14 @@
 		       GIMP_PDB_PATH => 'GIMP_PDB_VECTORS',
 		       GIMP_PDB_BOUNDARY => 'GIMP_PDB_COLORARRAY' }
 	},
+    GimpPDBErrorHandler =>
+	{ contig => 1,
+	  header => 'libgimpbase/gimpbaseenums.h',
+	  symbols => [ qw(GIMP_PDB_ERROR_HANDLER_INTERNAL
+			  GIMP_PDB_ERROR_HANDLER_PLUGIN) ],
+	  mapping => { GIMP_PDB_ERROR_HANDLER_INTERNAL => '0',
+		       GIMP_PDB_ERROR_HANDLER_PLUGIN => '1' }
+	},
     GimpPDBProcType =>
 	{ contig => 1,
 	  header => 'libgimpbase/gimpbaseenums.h',

Modified: branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb	Fri Aug 29 18:50:27 2008
@@ -63,7 +63,8 @@
                                     error);
 
   if (! uri)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   file_proc =
     file_procedure_find (gimp->plug_in_manager->load_procs, uri, error);
@@ -71,7 +72,8 @@
   g_free (uri);
 
   if (! file_proc)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   proc = GIMP_PROCEDURE (file_proc);
 
@@ -276,7 +278,8 @@
                                     error);
 
   if (! uri)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   file_proc =
     file_procedure_find (gimp->plug_in_manager->save_procs, uri, error);
@@ -284,7 +287,8 @@
   g_free (uri);
 
   if (! file_proc)
-    return gimp_procedure_get_return_values (procedure, FALSE);
+    return gimp_procedure_get_return_values (procedure, FALSE,
+                                             error ? *error : NULL);
 
   proc = GIMP_PROCEDURE (file_proc);
 

Modified: branches/soc-2008-text/tools/pdbgen/pdb/gradient.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/gradient.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/gradient.pdb	Fri Aug 29 18:50:27 2008
@@ -1252,6 +1252,9 @@
 
   if (start_seg)
     {
+      if (!end_seg)
+        end_seg = gimp_gradient_segment_get_last (start_seg);
+
       gimp_gradient_segment_range_blend (gradient,
                                          start_seg, end_seg,
                                          &start_seg->left_color,
@@ -1298,6 +1301,9 @@
 
   if (start_seg)
     {
+      if (!end_seg)
+        end_seg = gimp_gradient_segment_get_last (start_seg);
+
       gimp_gradient_segment_range_blend (gradient,
                                          start_seg, end_seg,
                                          &start_seg->left_color,

Modified: branches/soc-2008-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	Fri Aug 29 18:50:27 2008
@@ -615,7 +615,7 @@
   if (success)
     {
       if (sample_merged)
-        gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+        gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
       else
         gimp_pickable_flush (GIMP_PICKABLE (drawable));
 
@@ -2508,7 +2508,7 @@
   else
     width  = MAX (1, (height * dwidth) / dheight);
 
-  gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+  gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
 
   buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (image), context,
                                        width, height);

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	Fri Aug 29 18:50:27 2008
@@ -65,6 +65,97 @@
     );
 }
 
+sub layer_new_from_visible {
+    $blurb = 'Create a new layer from what is visible in an image.';
+
+    $help = <<'HELP';
+This procedure creates a new layer from what is visible in the given image.
+The new layer still needs to be added to the destination image, as this is
+not automatic. Add the new layer with the gimp_image_add_layer() command.
+Other attributes such as layer mask modes, and offsets should be set with
+explicit procedure calls.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @inargs = (
+	{ name => 'image', type => 'image',
+	  desc => 'The source image from where the content is copied' },
+	{ name => 'dest_image', type => 'image',
+	  desc => 'The destination image to which to add the layer' },
+	{ name => 'name', type => 'string',
+	  desc => 'The layer name', null_ok => 1 }
+     );
+
+    @outargs = (
+	{ name => 'layer', type => 'layer',
+	  desc => 'The newly created layer' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GimpProjection *projection = gimp_image_get_projection (image);
+
+  layer = gimp_layer_new_from_tiles (gimp_projection_get_tiles (projection),
+                                     dest_image,
+                                     gimp_image_base_type_with_alpha (dest_image),
+                                     name,
+                                     GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
+}
+CODE
+    );
+}
+
+sub layer_new_from_drawable {
+    $blurb = 'Create a new layer by copying an existing drawable.';
+
+    $help = <<'HELP';
+This procedure creates a new layer as a copy of the specified drawable.  The
+new layer still needs to be added to the image, as this is not automatic.  Add
+the new layer with the gimp_image_add_layer() command. Other attributes such
+as layer mask modes, and offsets should be set with explicit procedure calls.
+HELP
+
+    &std_pdb_misc;
+
+    @inargs = (
+	{ name => 'drawable', type => 'drawable',
+	  desc => 'The source drawable from where the new layer is copied' },
+	{ name => 'dest_image', type => 'image',
+	  desc => 'The destination image to which to add the layer' }
+     );
+
+    @outargs = (
+	{ name => 'layer_copy', type => 'layer',
+	  desc => 'The newly copied layer' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GType     new_type;
+  GimpItem *new_item;
+
+  if (GIMP_IS_LAYER (drawable))
+    new_type = G_TYPE_FROM_INSTANCE (drawable);
+  else
+    new_type = GIMP_TYPE_LAYER;
+
+  if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
+    new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
+  else
+    new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
+
+  if (new_item)
+    layer_copy = GIMP_LAYER (new_item);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
 sub layer_copy {
     $blurb = 'Copy a layer.';
 
@@ -124,7 +215,7 @@
 to gimp_layer_add_mask().
 HELP
 
-    &std_pdb_misc;
+    &std_pdb_misc();
 
     @inargs = (
 	{ name => 'layer', type => 'layer',
@@ -558,55 +649,6 @@
     );
 }
 
-sub layer_new_from_drawable {
-    $blurb = 'Create a new layer by copying an existing drawable.';
-
-    $help = <<'HELP';
-This procedure creates a new layer as a copy of the specified drawable.  The
-new layer still needs to be added to the image, as this is not automatic.  Add
-the new layer with the gimp_image_add_layer() command. Other attributes such
-as layer mask modes, and offsets should be set with explicit procedure calls.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-	{ name => 'drawable', type => 'drawable',
-	  desc => 'The source drawable from where the new layer is copied' },
-	{ name => 'dest_image', type => 'image',
-	  desc => 'The destination image to which to add the layer' }
-     );
-
-    @outargs = (
-	{ name => 'layer_copy', type => 'layer',
-	  desc => 'The newly copied layer' }
-    );
-
-    %invoke = (
-	code => <<'CODE'
-{
-  GType     new_type;
-  GimpItem *new_item;
-
-  if (GIMP_IS_LAYER (drawable))
-    new_type = G_TYPE_FROM_INSTANCE (drawable);
-  else
-    new_type = GIMP_TYPE_LAYER;
-
-  if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
-    new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
-  else
-    new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
-
-  if (new_item)
-    layer_copy = GIMP_LAYER (new_item);
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
 sub layer_get_lock_alpha {
     $blurb = 'Get the lock alpha channel setting of the specified layer.';
 
@@ -953,10 +995,12 @@
               "core/gimp.h"
               "core/gimpimage-undo.h"
               "core/gimpitem-linked.h"
+              "core/gimpprojection.h"
               "gimppdb-utils.h"
               "gimp-intl.h");
 
 @procs = qw(layer_new
+            layer_new_from_visible
             layer_new_from_drawable
             layer_copy
             layer_add_alpha

Modified: branches/soc-2008-text/tools/pdbgen/pdb/plug_in.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/plug_in.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/plug_in.pdb	Fri Aug 29 18:50:27 2008
@@ -278,6 +278,78 @@
     );
 }
 
+sub plugin_set_pdb_error_handler {
+    $blurb = "Sets an error handler for procedure calls.";
+
+    $help = <<HELP;
+This procedure changes the way that errors in procedure calls are
+handled. By default GIMP will raise an error dialog if a procedure
+call made by a plug-in fails. Using this procedure the plug-in can
+change this behavior. If the error handler is set to
+%GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for
+calling gimp_get_pdb_error() and handling the error whenever one if
+its procedure calls fails. It can do this by displaying the error
+message or by forwarding it in its own return values.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @inargs = (
+	{ name => 'handler', type => 'enum GimpPDBErrorHandler',
+	  desc => "Who is responsible for handling procedure call errors" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      gimp_plug_in_set_error_handler (plug_in, handler);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
+sub plugin_get_pdb_error_handler {
+    $blurb = "Retrieves the active error handler for procedure calls.";
+
+    $help = <<HELP;
+This procedure retrieves the currently active error handler for
+procedure calls made by the calling plug-in. See
+gimp_plugin_set_pdb_error_handler() for details.
+HELP
+
+    &neo_pdb_misc('2008', '2.6');
+
+    @outargs = (
+	{ name => 'handler', type => 'enum GimpPDBErrorHandler',
+	  desc => "Who is responsible for handling procedure call errors" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
+
+  if (plug_in)
+    {
+      handler = gimp_plug_in_get_error_handler (plug_in);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
 
 @headers = qw(<string.h>
               <stdlib.h>
@@ -295,9 +367,11 @@
             plugin_help_register
             plugin_menu_register
             plugin_menu_branch_register
-            plugin_icon_register);
+            plugin_icon_register
+            plugin_set_pdb_error_handler
+            plugin_get_pdb_error_handler);
 
-%exports = (app => [ procs], lib => [ procs[1,2,3,4,5]]);
+%exports = (app => [ procs], lib => [ procs[1,2,3,4,5,6,7]]);
 
 $desc = 'Plug-in';
 

Modified: branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb	Fri Aug 29 18:50:27 2008
@@ -1267,7 +1267,7 @@
   GList *list, *vectors_list = NULL;
 
   success = gimp_vectors_import_file (image, filename,
-                                      merge, scale, -1, &vectors_list, NULL);
+                                      merge, scale, -1, &vectors_list, error);
 
   if (success)
     {
@@ -1330,7 +1330,7 @@
   GList *list, *vectors_list = NULL;
 
   success = gimp_vectors_import_buffer (image, string, length,
-                                        merge, scale, -1, &vectors_list, NULL);
+                                        merge, scale, -1, &vectors_list, error);
 
   if (success)
     {



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