gimp r26610 - in branches/soc-2008-text: . app app/actions app/base app/config app/core app/dialogs app/display 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 libgimp menus modules modules/modules plug-ins plug-ins/bmp plug-ins/common plug-ins/common/common plug-ins/faxg3 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/fits plug-ins/flame plug-ins/fli plug-ins/fractal-explorer plug-ins/gimpressionist plug-ins/help plug-ins/help-browser plug-ins/ico plug-ins/ifs-compose plug-ins/imagemap plug-ins/jpeg plug-ins/lighting plug-ins/map-object plug-ins/plug-ins plug-ins/print plug-ins/pygimp plug-ins/pygimp/plug-ins plug-ins/script-fu plug-ins/script-fu/scripts plug-ins/selection-to-path plug-ins/sgi plug-ins/uri plug-ins/win-snap plug-ins/ xjt po po-libgimp po-plug-ins po-python po-script-fu po-tips tools tools/pdbgen tools/pdbgen/pdb



Author: danedde
Date: Sat Aug 16 23:02:21 2008
New Revision: 26610
URL: http://svn.gnome.org/viewvc/gimp?rev=26610&view=rev

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

	Merged 26402:26609 from trunk



Added:
   branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.c
      - copied unchanged from r26609, /trunk/app/display/gimpdisplayshell-scale-dialog.c
   branches/soc-2008-text/app/display/gimpdisplayshell-scale-dialog.h
      - copied unchanged from r26609, /trunk/app/display/gimpdisplayshell-scale-dialog.h
   branches/soc-2008-text/modules/color-selector-cmyk-lcms.c
      - copied unchanged from r26609, /trunk/modules/color-selector-cmyk-lcms.c
   branches/soc-2008-text/modules/color-selector-cmyk.c
      - copied unchanged from r26609, /trunk/modules/color-selector-cmyk.c
   branches/soc-2008-text/modules/color-selector-water.c
      - copied unchanged from r26609, /trunk/modules/color-selector-water.c
   branches/soc-2008-text/modules/color-selector-wheel.c
      - copied unchanged from r26609, /trunk/modules/color-selector-wheel.c
   branches/soc-2008-text/modules/controller-dx-dinput.c
      - copied unchanged from r26609, /trunk/modules/controller-dx-dinput.c
   branches/soc-2008-text/modules/controller-linux-input.c
      - copied unchanged from r26609, /trunk/modules/controller-linux-input.c
   branches/soc-2008-text/modules/controller-midi.c
      - copied unchanged from r26609, /trunk/modules/controller-midi.c
   branches/soc-2008-text/modules/display-filter-color-blind.c
      - copied unchanged from r26609, /trunk/modules/display-filter-color-blind.c
   branches/soc-2008-text/modules/display-filter-gamma.c
      - copied unchanged from r26609, /trunk/modules/display-filter-gamma.c
   branches/soc-2008-text/modules/display-filter-high-contrast.c
      - copied unchanged from r26609, /trunk/modules/display-filter-high-contrast.c
   branches/soc-2008-text/modules/display-filter-lcms.c
      - copied unchanged from r26609, /trunk/modules/display-filter-lcms.c
   branches/soc-2008-text/modules/display-filter-proof.c
      - copied unchanged from r26609, /trunk/modules/display-filter-proof.c
   branches/soc-2008-text/modules/modules/
      - copied from r26609, /trunk/modules/
   branches/soc-2008-text/plug-ins/common/common/
      - copied from r26582, /trunk/plug-ins/common/
   branches/soc-2008-text/plug-ins/common/file-aa.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-aa.c
   branches/soc-2008-text/plug-ins/common/file-cel.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-cel.c
   branches/soc-2008-text/plug-ins/common/file-csource.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-csource.c
   branches/soc-2008-text/plug-ins/common/file-desktop-link.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-desktop-link.c
   branches/soc-2008-text/plug-ins/common/file-dicom.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-dicom.c
   branches/soc-2008-text/plug-ins/common/file-gbr.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-gbr.c
   branches/soc-2008-text/plug-ins/common/file-gif-load.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-gif-load.c
   branches/soc-2008-text/plug-ins/common/file-gif-save.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-gif-save.c
   branches/soc-2008-text/plug-ins/common/file-gih.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-gih.c
   branches/soc-2008-text/plug-ins/common/file-glob.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-glob.c
   branches/soc-2008-text/plug-ins/common/file-header.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-header.c
   branches/soc-2008-text/plug-ins/common/file-html-table.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-html-table.c
   branches/soc-2008-text/plug-ins/common/file-mng.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-mng.c
   branches/soc-2008-text/plug-ins/common/file-pat.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-pat.c
   branches/soc-2008-text/plug-ins/common/file-pcx.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-pcx.c
   branches/soc-2008-text/plug-ins/common/file-pdf.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-pdf.c
   branches/soc-2008-text/plug-ins/common/file-pix.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-pix.c
   branches/soc-2008-text/plug-ins/common/file-png.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-png.c
   branches/soc-2008-text/plug-ins/common/file-pnm.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-pnm.c
   branches/soc-2008-text/plug-ins/common/file-ps.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-ps.c
   branches/soc-2008-text/plug-ins/common/file-psp.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-psp.c
   branches/soc-2008-text/plug-ins/common/file-raw.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-raw.c
   branches/soc-2008-text/plug-ins/common/file-sunras.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-sunras.c
   branches/soc-2008-text/plug-ins/common/file-svg.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-svg.c
   branches/soc-2008-text/plug-ins/common/file-tga.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-tga.c
   branches/soc-2008-text/plug-ins/common/file-tiff-load.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-tiff-load.c
   branches/soc-2008-text/plug-ins/common/file-tiff-save.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-tiff-save.c
   branches/soc-2008-text/plug-ins/common/file-wmf.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-wmf.c
   branches/soc-2008-text/plug-ins/common/file-xbm.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-xbm.c
   branches/soc-2008-text/plug-ins/common/file-xpm.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-xpm.c
   branches/soc-2008-text/plug-ins/common/file-xwd.c
      - copied unchanged from r26609, /trunk/plug-ins/common/file-xwd.c
   branches/soc-2008-text/plug-ins/file-bmp/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-bmp/
   branches/soc-2008-text/plug-ins/file-faxg3/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-faxg3/
   branches/soc-2008-text/plug-ins/file-fits/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-fits/
   branches/soc-2008-text/plug-ins/file-fli/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-fli/
   branches/soc-2008-text/plug-ins/file-ico/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-ico/
   branches/soc-2008-text/plug-ins/file-jpeg/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-jpeg/
   branches/soc-2008-text/plug-ins/file-psd/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-psd/
   branches/soc-2008-text/plug-ins/file-sgi/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-sgi/
   branches/soc-2008-text/plug-ins/file-uri/
      - copied from r26582, /trunk/plug-ins/file-uri/
   branches/soc-2008-text/plug-ins/file-xjt/   (props changed)
      - copied from r26609, /trunk/plug-ins/file-xjt/
   branches/soc-2008-text/plug-ins/plug-ins/
      - copied from r26609, /trunk/plug-ins/
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/plug-ins/bmp/
   branches/soc-2008-text/plug-ins/common/aa.c
   branches/soc-2008-text/plug-ins/common/cel.c
   branches/soc-2008-text/plug-ins/common/csource.c
   branches/soc-2008-text/plug-ins/common/desktop-link.c
   branches/soc-2008-text/plug-ins/common/dicom.c
   branches/soc-2008-text/plug-ins/common/gbr.c
   branches/soc-2008-text/plug-ins/common/gif-load.c
   branches/soc-2008-text/plug-ins/common/gif-save.c
   branches/soc-2008-text/plug-ins/common/gih.c
   branches/soc-2008-text/plug-ins/common/glob.c
   branches/soc-2008-text/plug-ins/common/header.c
   branches/soc-2008-text/plug-ins/common/html-table.c
   branches/soc-2008-text/plug-ins/common/mng.c
   branches/soc-2008-text/plug-ins/common/pat.c
   branches/soc-2008-text/plug-ins/common/pcx.c
   branches/soc-2008-text/plug-ins/common/pix.c
   branches/soc-2008-text/plug-ins/common/png.c
   branches/soc-2008-text/plug-ins/common/pnm.c
   branches/soc-2008-text/plug-ins/common/poppler.c
   branches/soc-2008-text/plug-ins/common/postscript.c
   branches/soc-2008-text/plug-ins/common/psp.c
   branches/soc-2008-text/plug-ins/common/raw.c
   branches/soc-2008-text/plug-ins/common/sunras.c
   branches/soc-2008-text/plug-ins/common/svg.c
   branches/soc-2008-text/plug-ins/common/tga.c
   branches/soc-2008-text/plug-ins/common/tiff-load.c
   branches/soc-2008-text/plug-ins/common/tiff-save.c
   branches/soc-2008-text/plug-ins/common/wmf.c
   branches/soc-2008-text/plug-ins/common/xbm.c
   branches/soc-2008-text/plug-ins/common/xpm.c
   branches/soc-2008-text/plug-ins/common/xwd.c
   branches/soc-2008-text/plug-ins/faxg3/
   branches/soc-2008-text/plug-ins/fits/
   branches/soc-2008-text/plug-ins/fli/
   branches/soc-2008-text/plug-ins/ico/
   branches/soc-2008-text/plug-ins/jpeg/
   branches/soc-2008-text/plug-ins/sgi/
   branches/soc-2008-text/plug-ins/uri/
   branches/soc-2008-text/plug-ins/xjt/
Modified:
   branches/soc-2008-text/ChangeLog
   branches/soc-2008-text/HACKING
   branches/soc-2008-text/INSTALL
   branches/soc-2008-text/app/Makefile.am
   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/text-tool-commands.c
   branches/soc-2008-text/app/actions/view-commands.c
   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/gimpguiconfig.c
   branches/soc-2008-text/app/core/gimpbrushclipboard.c
   branches/soc-2008-text/app/core/gimpbuffer.c
   branches/soc-2008-text/app/core/gimpbuffer.h
   branches/soc-2008-text/app/core/gimpdrawable-shadow.c
   branches/soc-2008-text/app/core/gimpimage.c
   branches/soc-2008-text/app/core/gimpimage.h
   branches/soc-2008-text/app/core/gimpitem.c
   branches/soc-2008-text/app/core/gimplayer.c
   branches/soc-2008-text/app/core/gimpobject.c
   branches/soc-2008-text/app/core/gimppatternclipboard.c
   branches/soc-2008-text/app/core/gimpprojection.c
   branches/soc-2008-text/app/core/gimpselection.c
   branches/soc-2008-text/app/dialogs/preferences-dialog.c
   branches/soc-2008-text/app/display/Makefile.am
   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-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/gimpnavigationeditor.c
   branches/soc-2008-text/app/display/gimpstatusbar.c
   branches/soc-2008-text/app/display/gimpstatusbar.h
   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/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/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/gimppluginprocframe.c
   branches/soc-2008-text/app/text/gimptext.c
   branches/soc-2008-text/app/text/gimptextlayout-render.c
   branches/soc-2008-text/app/tools/gimpbycolorselecttool.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/gimpfreeselecttool.c
   branches/soc-2008-text/app/tools/gimpimagemaptool.c
   branches/soc-2008-text/app/tools/gimpiscissorstool.c
   branches/soc-2008-text/app/tools/gimppainttool.c
   branches/soc-2008-text/app/tools/gimprectangletool.c
   branches/soc-2008-text/app/tools/gimptexttool.c
   branches/soc-2008-text/app/tools/gimptexttool.h
   branches/soc-2008-text/app/widgets/gimphelp-ids.h
   branches/soc-2008-text/app/widgets/gimphistogrameditor.c
   branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c
   branches/soc-2008-text/app/xcf/xcf.c
   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/gimplayer.sgml
   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/gimplayer_pdb.c
   branches/soc-2008-text/libgimp/gimplayer_pdb.h
   branches/soc-2008-text/libgimp/gimppixelrgn.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/plug-ins/Makefile.am
   branches/soc-2008-text/plug-ins/common/   (props changed)
   branches/soc-2008-text/plug-ins/common/Makefile.am
   branches/soc-2008-text/plug-ins/common/cml-explorer.c
   branches/soc-2008-text/plug-ins/common/depth-merge.c
   branches/soc-2008-text/plug-ins/common/filter-pack.c
   branches/soc-2008-text/plug-ins/common/grid.c
   branches/soc-2008-text/plug-ins/common/lcms.c
   branches/soc-2008-text/plug-ins/common/mkgen.pl
   branches/soc-2008-text/plug-ins/common/mosaic.c
   branches/soc-2008-text/plug-ins/common/newsprint.c
   branches/soc-2008-text/plug-ins/common/oilify.c
   branches/soc-2008-text/plug-ins/common/pixelize.c
   branches/soc-2008-text/plug-ins/common/plugin-defs.pl
   branches/soc-2008-text/plug-ins/flame/flame.c
   branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
   branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.c
   branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.h
   branches/soc-2008-text/plug-ins/gimpressionist/gimp.c
   branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.c
   branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h
   branches/soc-2008-text/plug-ins/gimpressionist/orientmap.c
   branches/soc-2008-text/plug-ins/gimpressionist/presets.c
   branches/soc-2008-text/plug-ins/gimpressionist/sizemap.c
   branches/soc-2008-text/plug-ins/help-browser/dialog.c
   branches/soc-2008-text/plug-ins/help-browser/dialog.h
   branches/soc-2008-text/plug-ins/help-browser/help-browser.c
   branches/soc-2008-text/plug-ins/help/gimphelplocale.c
   branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose.c
   branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c
   branches/soc-2008-text/plug-ins/imagemap/imap_main.c
   branches/soc-2008-text/plug-ins/imagemap/imap_main.h
   branches/soc-2008-text/plug-ins/imagemap/imap_selection.c
   branches/soc-2008-text/plug-ins/lighting/lighting-main.c
   branches/soc-2008-text/plug-ins/lighting/lighting-main.h
   branches/soc-2008-text/plug-ins/lighting/lighting-ui.c
   branches/soc-2008-text/plug-ins/map-object/map-object-main.c
   branches/soc-2008-text/plug-ins/map-object/map-object-main.h
   branches/soc-2008-text/plug-ins/map-object/map-object-ui.c
   branches/soc-2008-text/plug-ins/print/print.c
   branches/soc-2008-text/plug-ins/pygimp/gimpmodule.c
   branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py
   branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c
   branches/soc-2008-text/plug-ins/pygimp/pygimp-pdb.c
   branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c
   branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm
   branches/soc-2008-text/plug-ins/selection-to-path/selection-to-path.c
   branches/soc-2008-text/plug-ins/win-snap/Makefile.am
   branches/soc-2008-text/plug-ins/win-snap/winsnap.c
   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/ar.po
   branches/soc-2008-text/po-libgimp/de.po
   branches/soc-2008-text/po-libgimp/gl.po
   branches/soc-2008-text/po-libgimp/ja.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/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-python/ChangeLog
   branches/soc-2008-text/po-python/Makefile.in.in
   branches/soc-2008-text/po-python/ja.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/ar.po
   branches/soc-2008-text/po-script-fu/gl.po
   branches/soc-2008-text/po-script-fu/ja.po
   branches/soc-2008-text/po-tips/ChangeLog
   branches/soc-2008-text/po-tips/Makefile.in.in
   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/ChangeLog
   branches/soc-2008-text/po/POTFILES.in
   branches/soc-2008-text/po/ar.po
   branches/soc-2008-text/po/de.po
   branches/soc-2008-text/po/gl.po
   branches/soc-2008-text/po/ja.po
   branches/soc-2008-text/tools/Makefile.am
   branches/soc-2008-text/tools/pdbgen/app.pl
   branches/soc-2008-text/tools/pdbgen/pdb/fileops.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/vectors.pdb

Modified: branches/soc-2008-text/HACKING
==============================================================================
--- branches/soc-2008-text/HACKING	(original)
+++ branches/soc-2008-text/HACKING	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/app/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/Makefile.am	(original)
+++ branches/soc-2008-text/app/Makefile.am	Sat Aug 16 23:02:21 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/edit-actions.c
==============================================================================
--- branches/soc-2008-text/app/actions/edit-actions.c	(original)
+++ branches/soc-2008-text/app/actions/edit-actions.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/text-tool-commands.c
==============================================================================
--- branches/soc-2008-text/app/actions/text-tool-commands.c	(original)
+++ branches/soc-2008-text/app/actions/text-tool-commands.c	Sat Aug 16 23:02:21 2008
@@ -61,7 +61,7 @@
                              gpointer   data)
 {
   GimpTextTool *text_tool = GIMP_TEXT_TOOL (data); 
-  gimp_text_tool_clipboard_copy (text_tool);
+  gimp_text_tool_clipboard_copy (text_tool, TRUE);
 }
 
 void
@@ -69,7 +69,7 @@
                               gpointer   data)
 {
   GimpTextTool *text_tool = GIMP_TEXT_TOOL (data); 
-  gimp_text_tool_clipboard_paste (text_tool);
+  gimp_text_tool_clipboard_paste (text_tool, TRUE);
 }
 
 void

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	Sat Aug 16 23:02:21 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/tile-manager.c
==============================================================================
--- branches/soc-2008-text/app/base/tile-manager.c	(original)
+++ branches/soc-2008-text/app/base/tile-manager.c	Sat Aug 16 23:02:21 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;
+    tile_manager_allocate_tiles (tm);
 
-      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_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

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	Sat Aug 16 23:02:21 2008
@@ -71,8 +71,8 @@
 
   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 */
 };
 

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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -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

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	Sat Aug 16 23:02:21 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/gimpguiconfig.c
==============================================================================
--- branches/soc-2008-text/app/config/gimpguiconfig.c	(original)
+++ branches/soc-2008-text/app/config/gimpguiconfig.c	Sat Aug 16 23:02:21 2008
@@ -124,7 +124,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",

Modified: branches/soc-2008-text/app/core/gimpbrushclipboard.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpbrushclipboard.c	(original)
+++ branches/soc-2008-text/app/core/gimpbrushclipboard.c	Sat Aug 16 23:02:21 2008
@@ -207,7 +207,7 @@
 
   if (gimp->global_buffer)
     {
-      TileManager   *tiles = gimp->global_buffer->tiles;
+      TileManager   *tiles = gimp_buffer_get_tiles (gimp->global_buffer);
       GimpImageType  type  = gimp_buffer_get_image_type (gimp->global_buffer);
 
       width  = MIN (gimp_buffer_get_width  (gimp->global_buffer), 512);

Modified: branches/soc-2008-text/app/core/gimpbuffer.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpbuffer.c	(original)
+++ branches/soc-2008-text/app/core/gimpbuffer.c	Sat Aug 16 23:02:21 2008
@@ -327,3 +327,11 @@
 
   return 0;
 }
+
+TileManager *
+gimp_buffer_get_tiles (const GimpBuffer *buffer)
+{
+  g_return_val_if_fail (GIMP_IS_BUFFER (buffer), NULL);
+
+  return buffer->tiles;
+}

Modified: branches/soc-2008-text/app/core/gimpbuffer.h
==============================================================================
--- branches/soc-2008-text/app/core/gimpbuffer.h	(original)
+++ branches/soc-2008-text/app/core/gimpbuffer.h	Sat Aug 16 23:02:21 2008
@@ -59,6 +59,7 @@
 
 gint            gimp_buffer_get_bytes       (const GimpBuffer *buffer);
 GimpImageType   gimp_buffer_get_image_type  (const GimpBuffer *buffer);
+TileManager   * gimp_buffer_get_tiles       (const GimpBuffer *buffer);
 
 
 #endif /* __GIMP_BUFFER_H__ */

Modified: branches/soc-2008-text/app/core/gimpdrawable-shadow.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpdrawable-shadow.c	(original)
+++ branches/soc-2008-text/app/core/gimpdrawable-shadow.c	Sat Aug 16 23:02:21 2008
@@ -27,7 +27,6 @@
 
 #include "gimpdrawable.h"
 #include "gimpdrawable-shadow.h"
-#include "gimpimage.h"
 
 
 TileManager *
@@ -96,6 +95,7 @@
 
       pixel_region_init (&shadowPR, drawable->shadow,
                          x, y, width, height, FALSE);
+
       gimp_drawable_apply_region (drawable, &shadowPR,
                                   push_undo, undo_desc,
                                   GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,

Modified: branches/soc-2008-text/app/core/gimpimage.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpimage.c	(original)
+++ branches/soc-2008-text/app/core/gimpimage.c	Sat Aug 16 23:02:21 2008
@@ -2507,6 +2507,17 @@
 }
 
 
+/*  projection  */
+
+GimpProjection *
+gimp_image_get_projection (const GimpImage *image)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return image->projection;
+}
+
+
 /*  layers / channels / vectors  */
 
 GimpContainer *

Modified: branches/soc-2008-text/app/core/gimpimage.h
==============================================================================
--- branches/soc-2008-text/app/core/gimpimage.h	(original)
+++ branches/soc-2008-text/app/core/gimpimage.h	Sat Aug 16 23:02:21 2008
@@ -403,6 +403,11 @@
 GimpTattoo      gimp_image_get_tattoo_state      (GimpImage          *image);
 
 
+/*  projection  */
+
+GimpProjection * gimp_image_get_projection       (const GimpImage    *image);
+
+
 /*  layers / channels / vectors  */
 
 GimpContainer * gimp_image_get_layers            (const GimpImage    *image);

Modified: branches/soc-2008-text/app/core/gimpitem.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpitem.c	(original)
+++ branches/soc-2008-text/app/core/gimpitem.c	Sat Aug 16 23:02:21 2008
@@ -577,7 +577,7 @@
  * different from the name it already has, and pushes an entry onto the
  * undo stack for the item's image.  If @new_name is NULL or empty, the
  * default name for the item's class is used.  If the name is changed,
- * the "name_changed" signal is emitted for the item.
+ * the GimpObject::name-changed signal is emitted for the item.
  *
  * Returns: %TRUE if the @item could be renamed, %FALSE otherwise.
  */

Modified: branches/soc-2008-text/app/core/gimplayer.c
==============================================================================
--- branches/soc-2008-text/app/core/gimplayer.c	(original)
+++ branches/soc-2008-text/app/core/gimplayer.c	Sat Aug 16 23:02:21 2008
@@ -1003,12 +1003,12 @@
 
 /**
  * gimp_layer_new_from_tiles:
- * @tiles:       The buffer to make the new layer from.
+ * @tiles:      The buffer to make the new layer from.
  * @dest_image: The image the new layer will be added to.
- * @type:        The #GimpImageType of the new layer.
- * @name:        The new layer's name.
- * @opacity:     The new layer's opacity.
- * @mode:        The new layer's mode.
+ * @type:       The #GimpImageType of the new layer.
+ * @name:       The new layer's name.
+ * @opacity:    The new layer's opacity.
+ * @mode:       The new layer's mode.
  *
  * Copies %tiles to a layer taking into consideration the
  * possibility of transforming the contents to meet the requirements
@@ -1028,7 +1028,6 @@
 
   g_return_val_if_fail (tiles != NULL, NULL);
   g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
 
   pixel_region_init (&bufPR, tiles,
                      0, 0,
@@ -1042,12 +1041,12 @@
 
 /**
  * gimp_layer_new_from_pixbuf:
- * @pixbuf:      The pixbuf to make the new layer from.
+ * @pixbuf:     The pixbuf to make the new layer from.
  * @dest_image: The image the new layer will be added to.
- * @type:        The #GimpImageType of the new layer.
- * @name:        The new layer's name.
- * @opacity:     The new layer's opacity.
- * @mode:        The new layer's mode.
+ * @type:       The #GimpImageType of the new layer.
+ * @name:       The new layer's name.
+ * @opacity:    The new layer's opacity.
+ * @mode:       The new layer's mode.
  *
  * Copies %pixbuf to a layer taking into consideration the
  * possibility of transforming the contents to meet the requirements
@@ -1067,7 +1066,6 @@
 
   g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
   g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
 
   pixel_region_init_data (&bufPR, gdk_pixbuf_get_pixels (pixbuf),
                           gdk_pixbuf_get_n_channels (pixbuf),
@@ -1082,12 +1080,12 @@
 
 /**
  * gimp_layer_new_from_region:
- * @region:      A readable pixel region.
+ * @region:     A readable pixel region.
  * @dest_image: The image the new layer will be added to.
- * @type:        The #GimpImageType of the new layer.
- * @name:        The new layer's name.
- * @opacity:     The new layer's opacity.
- * @mode:        The new layer's mode.
+ * @type:       The #GimpImageType of the new layer.
+ * @name:       The new layer's name.
+ * @opacity:    The new layer's opacity.
+ * @mode:       The new layer's mode.
  *
  * Copies %region to a layer taking into consideration the
  * possibility of transforming the contents to meet the requirements
@@ -1111,7 +1109,6 @@
 
   g_return_val_if_fail (region != NULL, NULL);
   g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
 
   width  = region->w;
   height = region->h;
@@ -1149,6 +1146,7 @@
        case GIMP_RGB_IMAGE:
           copy_region (region, &layerPR);
           break;
+
         default:
           g_warning ("%s: unhandled type conversion", G_STRFUNC);
           break;
@@ -1161,15 +1159,18 @@
         case GIMP_RGBA_IMAGE:
           copy_region (region, &layerPR);
           break;
+
         case GIMP_RGB_IMAGE:
           add_alpha_region (region, &layerPR);
           break;
+
         case GIMP_GRAY_IMAGE:
         case GIMP_GRAYA_IMAGE:
           gimp_layer_transform_color (dest_image,
                                       region,   src_type,
                                       &layerPR, type);
           break;
+
         default:
           g_warning ("%s: unhandled type conversion", G_STRFUNC);
           break;
@@ -1182,6 +1183,7 @@
         case GIMP_GRAY_IMAGE:
           copy_region (region, &layerPR);
           break;
+
         default:
           g_warning ("%s: unhandled type conversion", G_STRFUNC);
           break;
@@ -1197,12 +1199,15 @@
                                       region,   src_type,
                                       &layerPR, type);
           break;
+
         case GIMP_GRAYA_IMAGE:
           copy_region (region, &layerPR);
           break;
+
         case GIMP_GRAY_IMAGE:
           add_alpha_region (region, &layerPR);
           break;
+
         default:
           g_warning ("%s: unhandled type conversion", G_STRFUNC);
           break;
@@ -1224,6 +1229,7 @@
                                       region,   src_type,
                                       &layerPR, type);
           break;
+
         default:
           g_warning ("%s: unhandled type conversion", G_STRFUNC);
           break;

Modified: branches/soc-2008-text/app/core/gimpobject.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpobject.c	(original)
+++ branches/soc-2008-text/app/core/gimpobject.c	Sat Aug 16 23:02:21 2008
@@ -184,7 +184,7 @@
  * @name: the @object's new name
  *
  * Sets the @object's name. Takes care of freeing the old name and
- * emitting the "name_changed" signal if the old and new name differ.
+ * emitting the ::name_changed signal if the old and new name differ.
  **/
 void
 gimp_object_set_name (GimpObject  *object,
@@ -284,7 +284,7 @@
  * gimp_object_name_changed:
  * @object: a #GimpObject
  *
- * Causes the "name-changed" signal to be emitted.
+ * Causes the ::name-changed signal to be emitted.
  **/
 void
 gimp_object_name_changed (GimpObject *object)
@@ -303,7 +303,7 @@
  *
  * In general you should be using gimp_object_set_name() instead. But
  * if you ever need to free the object name but don't want the
- * "name-changed" signal to be emitted, then use this function. Never
+ * ::name-changed signal to be emitted, then use this function. Never
  * ever free the object name directly!
  **/
 void

Modified: branches/soc-2008-text/app/core/gimppatternclipboard.c
==============================================================================
--- branches/soc-2008-text/app/core/gimppatternclipboard.c	(original)
+++ branches/soc-2008-text/app/core/gimppatternclipboard.c	Sat Aug 16 23:02:21 2008
@@ -210,7 +210,8 @@
 
       pattern->mask = temp_buf_new (width, height, bytes, 0, 0, NULL);
 
-      pixel_region_init (&bufferPR, gimp->global_buffer->tiles,
+      pixel_region_init (&bufferPR,
+                         gimp_buffer_get_tiles (gimp->global_buffer),
                          0, 0, width, height, FALSE);
       pixel_region_init_temp_buf (&maskPR, pattern->mask,
                                   0, 0, width, height);

Modified: branches/soc-2008-text/app/core/gimpprojection.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpprojection.c	(original)
+++ branches/soc-2008-text/app/core/gimpprojection.c	Sat Aug 16 23:02:21 2008
@@ -654,11 +654,14 @@
                             gint            w,
                             gint            h)
 {
+  const gint width  = gimp_image_get_width  (proj->image);
+  const gint height = gimp_image_get_height (proj->image);
+
   /*  Bounds check  */
-  gint x1 = CLAMP (x,     0, gimp_image_get_width  (proj->image));
-  gint y1 = CLAMP (y,     0, gimp_image_get_height (proj->image));
-  gint x2 = CLAMP (x + w, 0, gimp_image_get_width  (proj->image));
-  gint y2 = CLAMP (y + h, 0, gimp_image_get_height (proj->image));
+  gint x1 = CLAMP (x,     0, width);
+  gint y1 = CLAMP (y,     0, height);
+  gint x2 = CLAMP (x + w, 0, width);
+  gint y2 = CLAMP (y + h, 0, height);
 
   gimp_projection_invalidate (proj, x1, y1, x2 - x1, y2 - y1);
 

Modified: branches/soc-2008-text/app/core/gimpselection.c
==============================================================================
--- branches/soc-2008-text/app/core/gimpselection.c	(original)
+++ branches/soc-2008-text/app/core/gimpselection.c	Sat Aug 16 23:02:21 2008
@@ -753,10 +753,7 @@
       else
         {
           /*  Otherwise, do a straight copy  */
-          if (! GIMP_IS_DRAWABLE (pickable))
-            copy_region_nocow (&srcPR, &destPR);
-          else
-            copy_region (&srcPR, &destPR);
+          copy_region (&srcPR, &destPR);
         }
 
       /*  If we're cutting, remove either the layer (or floating selection),

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	Sat Aug 16 23:02:21 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/display/Makefile.am
==============================================================================
--- branches/soc-2008-text/app/display/Makefile.am	(original)
+++ branches/soc-2008-text/app/display/Makefile.am	Sat Aug 16 23:02:21 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/gimpdisplay-handlers.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplay-handlers.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplay-handlers.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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"
 
@@ -136,9 +135,9 @@
 
       info->time += AUTOSCROLL_DT;
 
-      gimp_display_shell_scroll_private (shell,
-                                         AUTOSCROLL_DX * (gdouble) dx,
-                                         AUTOSCROLL_DX * (gdouble) dy);
+      gimp_display_shell_scroll (shell,
+                                 AUTOSCROLL_DX * (gdouble) dx,
+                                 AUTOSCROLL_DX * (gdouble) dy);
 
       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	Sat Aug 16 23:02:21 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"
@@ -303,8 +302,8 @@
       shell->disp_width  = allocation->width;
       shell->disp_height = allocation->height;
 
-      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);
     }
 }
@@ -967,13 +966,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 +1114,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)
           {
@@ -1678,20 +1675,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 +1705,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 +1726,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-draw.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpdisplayshell-draw.c	(original)
+++ branches/soc-2008-text/app/display/gimpdisplayshell-draw.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -422,7 +422,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
@@ -492,21 +496,15 @@
        * 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);
 
-      /* 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_set_offset (shell,
+                                            shell->offset_x + scaled_previous_origin_x,
+                                            shell->offset_y + scaled_previous_origin_y);
     }
 }
 
@@ -631,7 +629,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	Sat Aug 16 23:02:21 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;

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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,232 @@
 }
 
 /**
- * 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 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;
-
-  data = g_slice_new (ScaleDialogData);
+  if (! shell->display)
+    return;
 
-  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_untransform_xy_f (shell,
+                                       viewport_x,
+                                       viewport_y,
+                                       &image_focus_x,
+                                       &image_focus_y,
+                                       FALSE);
 
-  gtk_widget_show (shell->scale_dialog);
-}
+  target_offset_x = scale * image_focus_x - viewport_x;
+  target_offset_y = scale * 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -36,7 +36,7 @@
 #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"
 
@@ -44,8 +44,16 @@
 #define OVERPAN_FACTOR 0.5
 
 
+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 +62,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,15 +77,15 @@
   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;
@@ -114,7 +122,7 @@
       gdk_window_process_updates (shell->canvas->window, FALSE);
 
       /*  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 +131,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 +242,117 @@
 }
 
 /**
- * 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_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 +364,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 +385,7 @@
 }
 
 /**
- * gimp_display_shell_get_viewport:
+ * gimp_display_shell_scroll_get_viewport:
  * @shell:
  * @x:
  * @y:
@@ -249,11 +396,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 +411,7 @@
 }
 
 /**
- * gimp_display_shell_get_scaled_viewport_offset:
+ * gimp_display_shell_scroll_get_scaled_viewport_offset:
  * @shell:
  * @x:
  * @y:
@@ -273,9 +420,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 +431,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 +441,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 +473,7 @@
 }
 
 /**
- * gimp_display_shell_get_render_start_offset:
+ * gimp_display_shell_scroll_get_render_start_offset:
  * @shell:
  * @offset_x:
  * @offset_y:
@@ -372,9 +483,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 +494,7 @@
 }
 
 /**
- * gimp_display_shell_setup_hscrollbar_with_value:
+ * gimp_display_shell_scroll_setup_hscrollbar:
  * @shell:
  * @value:
  *
@@ -391,8 +502,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 +513,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)
     {
@@ -425,7 +536,7 @@
 }
 
 /**
- * gimp_display_shell_setup_vscrollbar_with_value:
+ * gimp_display_shell_scroll_setup_vscrollbar:
  * @shell:
  * @value:
  *
@@ -433,8 +544,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 +555,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)
     {

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	Sat Aug 16 23:02:21 2008
@@ -20,44 +20,47 @@
 #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_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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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;
@@ -575,6 +579,50 @@
 }
 
 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);
+
+  /* Only run this stuff if the size changed */
+  if (shell->display        &&
+      shell->display->image &&
+      (cevent->width  != current_width ||
+       cevent->height != current_height))
+    {
+      gint sw;
+      gint sh;
+      gboolean center_horizontally;
+      gboolean center_vertically;
+
+      gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
+
+      center_horizontally = sw <= shell->disp_width;
+      center_vertically   = sh <= shell->disp_height;
+
+      /* If the image fits within the display shell canvas on a given
+       * axis, center the image on that axis. We know that the canvas
+       * will get a size-allocate if we get here.
+       */
+      gimp_display_shell_scroll_center_image_on_next_size_allocate (shell,
+                                                                    center_horizontally,
+                                                                    center_vertically);
+    }
+
+  return TRUE;
+}
+
+static gboolean
 gimp_display_shell_window_state_event (GtkWidget           *widget,
                                        GdkEventWindowState *event)
 {
@@ -717,6 +765,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  */
 
@@ -1078,9 +1141,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 +1268,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 +1314,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 +1366,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 +1389,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 +1424,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 +1453,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 +1501,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 +1912,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/gimpnavigationeditor.c
==============================================================================
--- branches/soc-2008-text/app/display/gimpnavigationeditor.c	(original)
+++ branches/soc-2008-text/app/display/gimpnavigationeditor.c	Sat Aug 16 23:02:21 2008
@@ -510,7 +510,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 +660,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	Sat Aug 16 23:02:21 2008
@@ -496,8 +496,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 +536,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;
 }
@@ -1030,33 +1030,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 +1070,8 @@
     g_timeout_add (MESSAGE_TIMEOUT,
                    (GSourceFunc) gimp_statusbar_temp_timeout, statusbar);
 
+  statusbar->temp_severity = severity;
+
   if (statusbar->messages)
     {
       msg = statusbar->messages->data;

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	Sat Aug 16 23:02:21 2008
@@ -37,31 +37,32 @@
 
 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                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
@@ -120,10 +121,12 @@
                                              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);

Modified: branches/soc-2008-text/app/main.c
==============================================================================
--- branches/soc-2008-text/app/main.c	(original)
+++ branches/soc-2008-text/app/main.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -54,123 +54,105 @@
 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 void           interpolate_bilinear    (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               const gdouble  xfrac,
+                                               const gdouble  yfrac,
+                                               guchar        *pixel);
+static void           interpolate_nearest     (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               const gdouble  xfrac,
+                                               const gdouble  yfrac,
+                                               guchar        *pixel);
+static void           interpolate_cubic       (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gdouble  xfrac,
+                                               const gdouble  yfrac,
+                                               guchar        *pixel);
+static void           decimate_gauss          (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               guchar        *pixel);
+static void           decimate_average        (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               guchar        *pixel);
 static gfloat *       create_lanczos3_lookup  (void);
-static void           interpolate_lanczos3    (TileManager           *srcTM,
-                                               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);
+static void           interpolate_lanczos3    (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               const gdouble  xfrac,
+                                               const gdouble  yfrac,
+                                               guchar        *pixel,
+                                               const gfloat  *kernel_lookup);
+static void           decimate_average_pr     (PixelRegion   *srcPR,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               guchar        *pixel);
+static void           interpolate_bilinear_pr (PixelRegion   *srcPR,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               const gint     x1,
+                                               const gint     y1,
+                                               const gdouble  xfrac,
+                                               const gdouble  yfrac,
+                                               guchar        *pixel);
+static void           determine_scale         (PixelRegion   *srcPR,
+                                               PixelRegion   *dstPR,
+                                               gint          *levelx,
+                                               gint          *levely,
+                                               gint          *max_progress);
+static inline void    gaussan_lanczos2        (const guchar  *pixels,
+                                               const gint     bytes,
+                                               guchar        *pixel);
+static inline void    decimate_lanczos2       (TileManager   *srcTM,
+                                               const gint     x0,
+                                               const gint     y0,
+                                               guchar        *pixel);
+static inline void    pixel_average           (const guchar  *p1,
+                                               const guchar  *p2,
+                                               const guchar  *p3,
+                                               const guchar  *p4,
+                                               guchar        *pixel,
+                                               const gint     bytes);
+static inline void    gaussan_decimate        (const guchar  *pixels,
+                                               const gint     bytes,
+                                               guchar        *pixel);
+static inline gdouble cubic_spline_fit        (const gdouble  dx,
+                                               const gint     pt0,
+                                               const gint     pt1,
+                                               const gint     pt2,
+                                               const gint     pt3);
+static inline gdouble weighted_sum            (const gdouble  dx,
+                                               const gdouble  dy,
+                                               const gint     s00,
+                                               const gint     s10,
+                                               const gint     s01,
+                                               const gint     s11);
+static inline gdouble sinc                    (const gdouble  x);
+static inline gdouble lanczos3_mul_alpha      (const guchar  *pixels,
+                                               const gdouble *x_kernel,
+                                               const gdouble *y_kernel,
+                                               const gint     bytes,
+                                               const gint     byte);
+static inline gdouble lanczos3_mul            (const guchar  *pixels,
+                                               const gdouble *x_kernel,
+                                               const gdouble *y_kernel,
+                                               const gint     bytes,
+                                               const gint     byte);
 
 
 static void
@@ -442,7 +424,7 @@
       levely++;
     }
 
-  while ( levelx > 0 && levely > 0 )
+  while (levelx > 0 && levely > 0)
     {
       width  >>= 1;
       height >>= 1;
@@ -459,7 +441,7 @@
       levely--;
     }
 
-  while ( levelx > 0 )
+  while (levelx > 0)
     {
       width <<= 1;
 
@@ -474,7 +456,7 @@
       levelx--;
     }
 
-  while ( levely > 0 )
+  while (levely > 0)
     {
       height <<= 1;
 
@@ -512,38 +494,26 @@
        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;
+  guint              src_width    = tile_manager_width  (srcTM);
+  guint              src_height   = tile_manager_height (srcTM);
+  guint              dst_width    = tile_manager_width  (dstTM);
+  guint              dst_height   = tile_manager_height (dstTM);
+  guint              dst_tilerows = tile_manager_tiles_per_row(dstTM);    /*  the number of tiles in each row      */
+  guint              dst_tilecols = tile_manager_tiles_per_col(dstTM);    /*  the number of tiles in each columns  */
   gint               col, row;
-  guchar             pixel[dst_bpp];
+  guchar             pixel[4];
   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;
         }
@@ -556,16 +526,17 @@
         {
           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;
+              Tile   *dst_tile    = tile_manager_get_at (dstTM,
+                                                         col, row, TRUE, TRUE);
+              guchar *dst_data    = tile_data_pointer (dst_tile, 0, 0);
+              guint   dst_bpp     = tile_bpp (dst_tile);
+              guint   dst_ewidth  = tile_ewidth (dst_tile);
+              guint   dst_eheight = tile_eheight (dst_tile);
+              guint   dst_stride  = dst_ewidth * dst_bpp;
+              gint    x0          = col * TILE_WIDTH;
+              gint    y0          = row * TILE_HEIGHT;
+              gint    x1          = x0 + dst_ewidth - 1;
+              gint    y1          = y0 + dst_eheight - 1;
 
               read_pixel_data (srcTM, x0, y0, x1, y1, dst_data, dst_stride);
 
@@ -576,6 +547,7 @@
                                    progress_data);
             }
         }
+
       return;
     }
 
@@ -586,89 +558,78 @@
     {
       for (col = 0; col < dst_tilecols; col++)
         {
-          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;
+          Tile  *dst_tile    = tile_manager_get_at (dstTM,
+                                                    col, row, FALSE, FALSE);
+          guint  dst_ewidth  = tile_ewidth (dst_tile);
+          guint  dst_eheight = tile_eheight (dst_tile);
+          gint   x0          = col * TILE_WIDTH;
+          gint   y0          = row * TILE_HEIGHT;
+          gint   x1          = x0 + dst_ewidth  - 1;
+          gint   y1          = y0 + dst_eheight - 1;
+          gint   x, y;
 
           for (y = y0; y <= y1; y++)
             {
-              yfrac = ( y / scaley );
-              sy0   = (gint) yfrac;
-              sy1   = sy0 + 1;
-              sy1   = ( sy1 >= src_height) ? src_height - 1 : sy1;
-              yfrac =  yfrac - sy0;
+              gdouble scaley = (gdouble) dst_height / (gdouble) src_height;
+              gdouble yfrac  = y / scaley;
+              gint    sy0    = (gint) yfrac;
+              gint    sy1    = sy0 + 1;
+
+              sy0 = (sy0 > 0) ? sy0 : 0;
+              sy1 = (sy1 > 0) ? sy1 : 0;
+              sy0 = (sy0 < src_height - 1) ? sy0 : src_height - 1;
+              sy1 = (sy1 < src_height - 1) ? sy1 : src_height - 1;
+
+              yfrac = yfrac - sy0;
 
               for (x = x0; x <= x1; x++)
                 {
-                  xfrac = (x / scalex);
-                  sx0   = (gint) xfrac;
-                  sx1   = sx0 + 1;
-                  sx1   = ( sx1 >= src_width) ? src_width - 1 : sx1;
-                  xfrac =  xfrac - sx0;
+                  gdouble scalex  = (gdouble) dst_width / (gdouble) src_width;
+                  gdouble xfrac   = x / scalex;
+                  gint sx0        = (gint) xfrac;
+                  gint sx1        = sx0 + 1;
+
+                  sx0 = (sx0 > 0) ? sx0 : 0;
+                  sx1 = (sx1 > 0) ? sx1 : 0;
+                  sx0 = (sx0 < src_width - 1) ? sx0 : src_width - 1;
+                  sx1 = (sx1 < src_width - 1) ? sx1 : src_width - 1;
+
+                  xfrac = xfrac - sx0;
 
                   switch (interpolation)
                     {
                     case GIMP_INTERPOLATION_NONE:
-                      interpolate_nearest (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
+                      interpolate_nearest (srcTM, sx0, sy0, sx1, sy1,
+                                           xfrac, yfrac, pixel);
                       break;
 
                     case GIMP_INTERPOLATION_LINEAR:
                       if (scalex == 0.5 || scaley == 0.5)
-                        decimate_average (srcTM, sx0, sy0,
-                                          sx1, sy1,
-                                          xfrac, yfrac,
-                                          pixel,
-                                          kernel_lookup);
+                        decimate_average (srcTM, sx0, sy0, sx1, sy1,
+                                          pixel);
                       else
-                        interpolate_bilinear (srcTM, sx0, sy0,
-                                              sx1, sy1,
-                                              xfrac, yfrac,
-                                              pixel,
-                                              kernel_lookup);
+                        interpolate_bilinear (srcTM, sx0, sy0, sx1, sy1,
+                                              xfrac, yfrac, pixel);
                       break;
 
                     case GIMP_INTERPOLATION_CUBIC:
                       if (scalex == 0.5 || scaley == 0.5)
-                        decimate_gauss (srcTM, sx0, sy0,
-                                        sx1, sy1,
-                                        xfrac, yfrac,
-                                        pixel,
-                                        kernel_lookup);
+                        decimate_gauss (srcTM, sx0, sy0, pixel);
                       else
                         interpolate_cubic (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
+                                           xfrac, yfrac, pixel);
                       break;
 
                     case GIMP_INTERPOLATION_LANCZOS:
                       if (scalex == 0.5 || scaley == 0.5)
-                        decimate_lanczos2 (srcTM, sx0, sy0,
-                                           sx1, sy1,
-                                           xfrac, yfrac,
-                                           pixel,
-                                           kernel_lookup);
+                        decimate_lanczos2 (srcTM, sx0, sy0, pixel);
                       else
-                        interpolate_lanczos3 (srcTM, sx0, sy0,
-                                              sx1, sy1,
-                                              xfrac, yfrac,
-                                              pixel,
+                        interpolate_lanczos3 (srcTM, sx0, sy0, sx1, sy1,
+                                              xfrac, yfrac, pixel,
                                               kernel_lookup);
                       break;
                     }
+
                   write_pixel_data_1 (dstTM, x, y, pixel);
                 }
             }
@@ -683,12 +644,12 @@
 }
 
 static void inline
-pixel_average (guchar *p1,
-               guchar *p2,
-               guchar *p3,
-               guchar *p4,
-               guchar *p,
-               gint    bytes)
+pixel_average (const guchar *p1,
+               const guchar *p2,
+               const guchar *p3,
+               const guchar *p4,
+               guchar       *p,
+               const gint    bytes)
 {
   gdouble sum, alphasum;
   gdouble alpha;
@@ -782,24 +743,19 @@
 }
 
 static void
-decimate_gauss (TileManager *srcTM,
-                gint         x0,
-                gint         y0,
-                gint         x1,
-                gint         y1,
-                gdouble      xfrac,
-                gdouble      yfrac,
-                guchar      *pixel,
-                gfloat      *kernel_lookup)
+decimate_gauss (TileManager  *srcTM,
+                const gint    x0,
+                const gint    y0,
+                guchar       *pixel)
 {
   gint    src_bpp    = tile_manager_bpp  (srcTM);
   guint   src_width  = tile_manager_width  (srcTM);
   guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[src_bpp];
-  guchar  pixel2[src_bpp];
-  guchar  pixel3[src_bpp];
-  guchar  pixel4[src_bpp];
-  guchar  pixels[16 * src_bpp];
+  guchar  pixel1[4];
+  guchar  pixel2[4];
+  guchar  pixel3[4];
+  guchar  pixel4[4];
+  guchar  pixels[16 * 4];
   gint    x, y, i;
   guchar *p;
 
@@ -807,11 +763,12 @@
     {
       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));
+          gint u, v;
+          u = (x > 0) ? x : 0;
+          u = (u < src_width - 1) ? u : src_width - 1;
+          v = (y > 0) ? y : 0;
+          v = (v < src_height - 1) ? v : src_height - 1;
+          read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
         }
     }
 
@@ -829,15 +786,15 @@
 }
 
 static inline void
-gaussan_decimate (guchar *pixels,
-                  gint    bytes,
-                  guchar *pixel)
-{
-  guchar *p;
-  gdouble sum;
-  gdouble alphasum;
-  gdouble alpha;
-  gint    b;
+gaussan_decimate (const guchar *pixels,
+                  const gint    bytes,
+                  guchar       *pixel)
+{
+  const guchar *p;
+  gdouble       sum;
+  gdouble       alphasum;
+  gdouble       alpha;
+  gint          b;
 
   for (b = 0; b < bytes; b++)
     pixel[b] = 0;
@@ -890,6 +847,7 @@
       alphasum  = p[3]      + p[7]  * 2  + p[11];
       alphasum += p[19] * 2 + p[23] * 4  + p[27] * 2;
       alphasum += p[35]     + p[39] * 2  + p[43];
+
       if (alphasum > 0)
         {
           for (b = 0; b < 3; b++)
@@ -911,38 +869,32 @@
 }
 
 static inline void
-decimate_lanczos2 (TileManager *srcTM,
-                   gint         x0,
-                   gint         y0,
-                   gint         x1,
-                   gint         y1,
-                   gdouble      xfrac,
-                   gdouble      yfrac,
-                   guchar      *pixel,
-                   gfloat      *kernel_lookup)
+decimate_lanczos2 (TileManager  *srcTM,
+                   const gint    x0,
+                   const gint    y0,
+                   guchar       *pixel)
 {
   gint    src_bpp    = tile_manager_bpp  (srcTM);
   guint   src_width  = tile_manager_width  (srcTM);
   guint   src_height = tile_manager_height (srcTM);
-  guchar  pixel1[src_bpp];
-  guchar  pixel2[src_bpp];
-  guchar  pixel3[src_bpp];
-  guchar  pixel4[src_bpp];
-  guchar  pixels[36 * src_bpp];
+  guchar  pixel1[4];
+  guchar  pixel2[4];
+  guchar  pixel3[4];
+  guchar  pixel4[4];
+  guchar  pixels[36 * 4];
   gint    x, y, i;
   guchar *p;
 
   for (y = y0 - 2, i = 0; y <= y0 + 3; y++)
-    {
-      for (x = x0 - 2; x <= x0 + 3; x++, i++)
-        {
-          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));
-        }
-    }
+    for (x = x0 - 2; x <= x0 + 3; x++, i++)
+      {
+        gint u, v;
+        u = (x > 0) ? x : 0;
+        u = (u < src_width - 1) ? u : src_width - 1;
+        v = (y > 0) ? y : 0;
+        v = (v < src_height - 1) ? v : src_height - 1;
+        read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
+      }
 
   p = pixels + (0 * src_bpp);
   gaussan_lanczos2 (p, src_bpp, pixel1);
@@ -958,9 +910,9 @@
 }
 
 static inline void
-gaussan_lanczos2 (guchar *pixels,
-                  gint    bytes,
-                  guchar *pixel)
+gaussan_lanczos2 (const guchar *pixels,
+                  const gint    bytes,
+                  guchar       *pixel)
 {
   /*
    *   Filter source taken from document:
@@ -971,11 +923,11 @@
    *   Ken Turkowski, Apple computer
    *
    */
-  guchar  *p;
-  gdouble  sum;
-  gdouble  alphasum;
-  gdouble  alpha;
-  gint     b;
+  const guchar *p;
+  gdouble      sum;
+  gdouble      alphasum;
+  gdouble      alpha;
+  gint         b;
 
   for (b = 0; b < bytes; b++)
     pixel[b] = 0;
@@ -1100,32 +1052,28 @@
 }
 
 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];
+decimate_average (TileManager  *srcTM,
+                  const gint    x0,
+                  const gint    y0,
+                  const gint    x1,
+                  const gint    y1,
+                  guchar       *pixel)
+{
+  guchar pixel1[4];
+  guchar pixel2[4];
+  guchar pixel3[4];
+  guchar pixel4[4];
 
   read_pixel_data_1 (srcTM, x0, y0, pixel1);
   read_pixel_data_1 (srcTM, x1, y0, pixel2);
   read_pixel_data_1 (srcTM, x0, y1, pixel3);
   read_pixel_data_1 (srcTM, x1, y1, pixel4);
 
-  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, src_bpp);
+  pixel_average (pixel1, pixel2, pixel3, pixel4, pixel, tile_manager_bpp (srcTM));
 }
 
 static inline gdouble
-sinc (gdouble x)
+sinc (const gdouble x)
 {
   gdouble y = x * G_PI;
 
@@ -1178,15 +1126,14 @@
 }
 
 static void
-interpolate_nearest (TileManager *srcTM,
-                     gint         x0,
-                     gint         y0,
-                     gint         x1,
-                     gint         y1,
-                     gdouble      xfrac,
-                     gdouble      yfrac,
-                     guchar      *pixel,
-                     gfloat      *kernel_lookup)
+interpolate_nearest (TileManager   *srcTM,
+                     const gint     x0,
+                     const gint     y0,
+                     const gint     x1,
+                     const gint     y1,
+                     const gdouble  xfrac,
+                     const gdouble  yfrac,
+                     guchar        *pixel)
 {
   gint x = (xfrac <= 0.5) ? x0 : x1;
   gint y = (yfrac <= 0.5) ? y0 : y1;
@@ -1195,39 +1142,38 @@
 }
 
 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];
+interpolate_bilinear (TileManager   *srcTM,
+                      const gint     x0,
+                      const gint     y0,
+                      const gint     x1,
+                      const gint     y1,
+                      const gdouble  xfrac,
+                      const gdouble  yfrac,
+                      guchar        *pixel)
+{
+  gint   src_bpp = tile_manager_bpp  (srcTM);
+  guchar p1[4];
+  guchar p2[4];
+  guchar p3[4];
+  guchar p4[4];
 
   gint   b;
   gdouble sum, alphasum;
 
   for (b=0; b < src_bpp; b++)
-    p[b]=0;
+    pixel[b]=0;
 
   read_pixel_data_1 (srcTM, x0, y0, p1);
   read_pixel_data_1 (srcTM, x1, y0, p2);
@@ -1238,7 +1184,7 @@
     {
     case 1:
       sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
-      p[0] = (guchar) CLAMP (sum, 0, 255);
+      pixel[0] = (guchar) CLAMP (sum, 0, 255);
       break;
 
     case 2:
@@ -1249,8 +1195,8 @@
                               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] = (guchar) CLAMP (sum, 0, 255);
+          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
         }
       break;
 
@@ -1258,7 +1204,7 @@
       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] = (guchar) CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1271,10 +1217,10 @@
               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] = (guchar) CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
         }
       break;
     }
@@ -1287,11 +1233,11 @@
   */
 
 static inline gdouble
-cubic_spline_fit (gdouble dx,
-                  gint    pt0,
-                  gint    pt1,
-                  gint    pt2,
-                  gint    pt3)
+cubic_spline_fit (const gdouble dx,
+                  const gint    pt0,
+                  const gint    pt1,
+                  const gint    pt2,
+                  const gint    pt3)
 {
 
   return (gdouble) ((( ( -pt0 + 3 * pt1 - 3 * pt2 + pt3 ) *   dx +
@@ -1300,38 +1246,36 @@
 }
 
 static void
-interpolate_cubic (TileManager *srcTM,
-                   gint         x1,
-                   gint         y1,
-                   gint         x2,
-                   gint         y2,
-                   gdouble      xfrac,
-                   gdouble      yfrac,
-                   guchar      *p,
-                   gfloat      *kernel_lookup)
+interpolate_cubic (TileManager  *srcTM,
+                   const gint    x0,
+                   const gint    y0,
+                   const gdouble xfrac,
+                   const gdouble yfrac,
+                   guchar       *pixel)
 {
   gint    src_bpp    = tile_manager_bpp  (srcTM);
   guint   src_width  = tile_manager_width  (srcTM);
   guint   src_height = tile_manager_height (srcTM);
   gint    b, i;
   gint    x, y;
-  gint    x0;
-  gint    y0;
 
-  guchar  ps[16 * src_bpp];
+  guchar  ps[16 * 4];
   gdouble p0, p1, p2, p3;
 
   gdouble sum, alphasum;
 
   for (b = 0; b < src_bpp; b++)
-    p[b] = 0;
+    pixel[b] = 0;
 
-  for (y = y1 - 1, i = 0; y <= y1 + 2; y++)
-    for (x = x1 - 1; x <= x1 + 2; x++, i++)
+  for (y = y0 - 1, i = 0; y <= y0 + 2; y++)
+    for (x = x0 - 1; x <= x0 + 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));
+        gint u,v;
+        u = (x > 0) ? x : 0;
+        u = (u < src_width - 1) ? u : src_width - 1;
+        v = (y > 0) ? y : 0;
+        v = (v < src_height - 1) ? v : src_height - 1;
+        read_pixel_data_1 (srcTM, u, v, ps + (i * src_bpp));
       }
 
   switch (src_bpp)
@@ -1344,7 +1288,7 @@
 
       sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-      p[0]= (guchar) CLAMP (sum, 0, 255);
+      pixel[0]= (guchar) CLAMP (sum, 0, 255);
       break;
 
     case 2:
@@ -1369,8 +1313,8 @@
           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] = (guchar) CLAMP (sum, 0, 255);
+          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
         }
       break;
     case 3:
@@ -1383,7 +1327,7 @@
 
           sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
 
-          p[b] = (guchar) CLAMP (sum, 0, 255);
+          pixel[b] = (guchar) CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1411,26 +1355,26 @@
               sum  = cubic_spline_fit (yfrac, p0, p1, p2, p3);
               sum /= alphasum;
 
-              p[b] = (guchar) CLAMP (sum, 0, 255);
+              pixel[b] = (guchar) CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
         }
       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     bytes,
+                    const gint     byte)
+{
+  const guchar *p     = pixels;
+  const guchar  alpha = bytes - 1;
+  gdouble       sum   = 0.0;
+  gint          x, y;
 
   for (y = 0; y < 6; y++)
     {
@@ -1449,15 +1393,15 @@
 }
 
 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     bytes,
+              const gint     byte)
+{
+  const guchar *p   = pixels;
+  gdouble       sum = 0.0;
+  gint          x, y;
 
   for (y = 0; y < 6; y++)
     {
@@ -1476,39 +1420,40 @@
 }
 
 static void
-interpolate_lanczos3 (TileManager *srcTM,
-                      gint         x1,
-                      gint         y1,
-                      gint         x2,
-                      gint         y2,
-                      gdouble      xfrac,
-                      gdouble      yfrac,
-                      guchar      *pixel,
-                      gfloat      *kernel_lookup)
+interpolate_lanczos3 (TileManager        *srcTM,
+                      const gint          x0,
+                      const gint          y0,
+                      const gint          x1,
+                      const gint          y1,
+                      const gdouble       xfrac,
+                      const gdouble       yfrac,
+                      guchar              *pixel,
+                      const gfloat *kernel_lookup)
 {
   gint    src_bpp    = tile_manager_bpp  (srcTM);
   guint   src_width  = tile_manager_width  (srcTM);
   guint   src_height = tile_manager_height (srcTM);
   gint    b, i;
   gint    x, y;
-  gint    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];
+  guchar  pixels[36 * 4];
   gdouble sum, alphasum;
 
   for (b = 0; b < src_bpp; b++)
     pixel[b] = 0;
 
-  for (y = y1 - 2, i = 0; y <= y1 + 3; y++)
+  for (y = y0 - 2, i = 0; y <= y0 + 3; y++)
     {
-      for (x = x1 - 2; x <= x1 + 3; x++, i++)
+      for (x = x0 - 2; x <= x0 + 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));
+          gint u, v;
+          u = (x > 0) ? x : 0;
+          u = (u < src_width - 1) ? u : src_width - 1;
+          v = (y > 0) ? y : 0;
+          v = (v < src_height - 1) ? v : src_height - 1;
+          read_pixel_data_1 (srcTM, u, v, pixels + (i * src_bpp));
         }
     }
 
@@ -1519,7 +1464,6 @@
   for (i = 3; i >= -2; i--)
     {
       gint pos = i * LANCZOS_SPP;
-
       kx_sum += x_kernel[2 + i] = kernel_lookup[ABS (x_shift - pos)];
       ky_sum += y_kernel[2 + i] = kernel_lookup[ABS (y_shift - pos)];
     }
@@ -1590,11 +1534,11 @@
   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;
+      sy1 = sy0 + 1;
+      sy1   = (sy1 < src_height - 1) ? sy1 : src_height - 1;
 
       yfrac =  yfrac - sy0;
 
@@ -1603,7 +1547,7 @@
           xfrac = (x / scalex);
           sx0   = (gint) xfrac;
           sx1   = sx0 + 1;
-          sx1   = (sx1 < src_width) ? ABS(sx1) : 2 * src_width - sx1 - 1;
+          sx1   = (sx1 < src_width - 1) ? sx1 : src_width - 1;
           xfrac =  xfrac - sx0;
 
           switch (interpolation)
@@ -1638,11 +1582,11 @@
 
 static void
 decimate_average_pr (PixelRegion *srcPR,
-                     gint         x0,
-                     gint         y0,
-                     gint         x1,
-                     gint         y1,
-                     guchar      *p)
+                     const gint   x0,
+                     const gint   y0,
+                     const gint   x1,
+                     const gint   y1,
+                     guchar      *pixel)
 {
   gint    bytes = srcPR->bytes;
   gint    width = srcPR->w;
@@ -1651,18 +1595,18 @@
   guchar *p3    = srcPR->data + (y1 * width + x0) * bytes;
   guchar *p4    = srcPR->data + (y1 * width + x1) * bytes;
 
-  pixel_average (p1, p2, p3, p4, p, bytes);
+  pixel_average (p1, p2, p3, p4, pixel, bytes);
 }
 
 static void
-interpolate_bilinear_pr (PixelRegion *srcPR,
-                         gint         x0,
-                         gint         y0,
-                         gint         x1,
-                         gint         y1,
-                         gdouble      xfrac,
-                         gdouble      yfrac,
-                         guchar      *p)
+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)
 {
   gint    bytes = srcPR->bytes;
   gint    width = srcPR->w;
@@ -1675,13 +1619,13 @@
   gdouble sum, alphasum;
 
   for (b = 0; b < bytes; b++)
-    p[b] = 0;
+    pixel[b] = 0;
 
   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]     = (guchar) CLAMP (sum, 0, 255);
       break;
 
     case 2:
@@ -1691,8 +1635,8 @@
           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] = (guchar) CLAMP (sum, 0, 255);
+          pixel[1] = (guchar) CLAMP (alphasum, 0, 255);
         }
       break;
 
@@ -1700,7 +1644,7 @@
       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] = (guchar) CLAMP (sum, 0, 255);
         }
       break;
 
@@ -1713,10 +1657,10 @@
               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] = (guchar) CLAMP (sum, 0, 255);
             }
 
-          p[3] = (guchar) CLAMP (alphasum, 0, 255);
+          pixel[3] = (guchar) CLAMP (alphasum, 0, 255);
         }
       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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/gimpsourcecore.c
==============================================================================
--- branches/soc-2008-text/app/paint/gimpsourcecore.c	(original)
+++ branches/soc-2008-text/app/paint/gimpsourcecore.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,18 @@
 
       if (error_msg)
         {
+          GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
+                                           GIMP_PDB_INTERNAL_ERROR,
+                                           "%s", 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,15 @@
                                                                args,
                                                                error);
 
-  /*  If there are no return arguments, assume an execution error  */
   if (! return_vals)
     {
-      return_vals = gimp_procedure_get_return_values (procedure, FALSE);
-      g_value_set_enum (return_vals->values, GIMP_PDB_EXECUTION_ERROR);
-
-      return return_vals;
+      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);
+      g_propagate_error (error, pdb_error);
     }
 
   return return_vals;
@@ -392,36 +396,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 (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);
 
-  if (procedure)
-    n_args = procedure->num_values + 1;
+      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);
+
+      /*  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;
 
-  args = g_value_array_new (n_args);
+            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);
 
-  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);
-      }
+      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 +553,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 +565,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 +598,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 +626,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 +658,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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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 *
@@ -1286,7 +1314,8 @@
         success = FALSE;
     }
 
-  return gimp_procedure_get_return_values (procedure, success);
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
 }
 
 static GValueArray *
@@ -1327,7 +1356,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 +1403,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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 588 procedures registered total */
+/* 589 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,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/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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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;
     }
@@ -502,11 +503,23 @@
 
   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);
+      if (error->domain == GIMP_PDB_ERROR)
+        {
+          gimp_message (plug_in->manager->gimp, G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Calling error for procedure '%s':\n"
+                          "%s"),
+                        canonical, error->message);
+        }
+      else
+        {
+          gimp_message (plug_in->manager->gimp, G_OBJECT (proc_frame->progress),
+                        GIMP_MESSAGE_ERROR,
+                        _("Execution error for procedure '%s':\n"
+                          "%s"),
+                        canonical, error->message);
+        }
+
       g_error_free (error);
     }
 
@@ -530,7 +543,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	Sat Aug 16 23:02:21 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  */
 
@@ -326,10 +329,13 @@
 
   if (proc_frame->main_loop)
     {
-      proc_frame->return_vals = gimp_procedure_get_return_values (NULL,
-                                                                  FALSE);
+      GError *error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_CANCELLED,
+                                   "%s", _("Cancelled"));
+
+      proc_frame->return_vals =
+        gimp_procedure_get_return_values (proc_frame->procedure, FALSE, error);
 
-      g_value_set_enum (proc_frame->return_vals->values, GIMP_PDB_CANCEL);
+      g_error_free (error);
     }
 
   for (list = plug_in->temp_proc_frames; list; list = g_list_next (list))
@@ -338,8 +344,12 @@
 
       if (proc_frame->main_loop)
         {
-          proc_frame->return_vals = gimp_procedure_get_return_values (NULL,
-                                                                      FALSE);
+          GError *error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_CANCELLED,
+                                       "%s", _("Cancelled"));
+
+          proc_frame->return_vals =
+            gimp_procedure_get_return_values (proc_frame->procedure,
+                                              FALSE, error);
 
           g_value_set_enum (proc_frame->return_vals->values, GIMP_PDB_CANCEL);
         }

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	Sat Aug 16 23:02:21 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);
@@ -260,13 +279,6 @@
       g_object_unref (plug_in);
     }
 
- done:
-  if (return_vals && destroy_return_vals)
-    {
-      g_value_array_free (return_vals);
-      return_vals = NULL;
-    }
-
   return return_vals;
 }
 
@@ -277,8 +289,7 @@
                                     GimpTemporaryProcedure *procedure,
                                     GValueArray            *args)
 {
-  GValueArray *return_vals = NULL;
-  GimpPlugIn  *plug_in;
+  GimpPlugIn *plug_in;
 
   g_return_val_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager), NULL);
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@@ -291,6 +302,7 @@
   if (plug_in)
     {
       GimpPlugInProcFrame *proc_frame;
+      GValueArray         *return_vals;
       GPProcRun            proc_run;
 
       proc_frame = gimp_plug_in_proc_frame_push (plug_in, context, progress,
@@ -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);
@@ -327,8 +346,13 @@
 
       gimp_plug_in_proc_frame_unref (proc_frame, plug_in);
       g_object_unref (plug_in);
-    }
 
- done:
-  return return_vals;
+      return return_vals;
+    }
+  else
+    {
+      /*  can we actually ever get here?  */
+      return gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure),
+                                               FALSE, NULL);
+    }
 }

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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,19 @@
                                       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);
+
+  /*  In case of errors, gimp_plug_in_manager_call_run() may return
+   *  return_vals, even if run asynchronously.
+   */
+  if (return_vals)
+    g_value_array_free (return_vals);
 }
 
 const gchar *

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	Sat Aug 16 23:02:21 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  */
 
@@ -173,7 +177,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 +195,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/text/gimptext.c
==============================================================================
--- branches/soc-2008-text/app/text/gimptext.c	(original)
+++ branches/soc-2008-text/app/text/gimptext.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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,26 @@
   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_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/gimpbycolorselecttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpbycolorselecttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpbycolorselecttool.c	Sat Aug 16 23:02:21 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/gimpcurvestool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimpcurvestool.h	(original)
+++ branches/soc-2008-text/app/tools/gimpcurvestool.h	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -714,7 +714,7 @@
       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,

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	Sat Aug 16 23:02:21 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,14 +225,14 @@
 
   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);
@@ -268,8 +269,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 +287,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 +301,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 +312,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 +343,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 +387,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 +396,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 +439,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 +460,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 +469,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 +477,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 +501,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 +521,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 +540,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 +550,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 +688,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 +768,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 +779,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 +792,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 +843,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 +872,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 +929,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 +946,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 +983,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 +1026,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 +1056,7 @@
                                                    &start_point_x,
                                                    &start_point_y,
                                                    segment_index);
-              
+
           gimp_tool_motion_constrain (start_point_x,
                                       start_point_y,
                                       &new_x,
@@ -1092,8 +1095,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 +1160,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 +1205,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 +1276,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 +1346,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 +1396,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 +1452,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 +1480,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 +1512,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 +1531,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 +1572,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 +1594,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/gimpimagemaptool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimpimagemaptool.c	(original)
+++ branches/soc-2008-text/app/tools/gimpimagemaptool.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/gimppainttool.c
==============================================================================
--- branches/soc-2008-text/app/tools/gimppainttool.c	(original)
+++ branches/soc-2008-text/app/tools/gimppainttool.c	Sat Aug 16 23:02:21 2008
@@ -365,7 +365,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 +456,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));

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	Sat Aug 16 23:02:21 2008
@@ -97,9 +97,7 @@
   (gimp_rectangle_tool_get_private (GIMP_RECTANGLE_TOOL (obj)))
 
 
-typedef struct _GimpRectangleToolPrivate GimpRectangleToolPrivate;
-
-struct _GimpRectangleToolPrivate
+typedef struct
 {
   /* The following members are "constants", that is, variables that are setup
    * during gimp_rectangle_tool_button_press and then only read.
@@ -202,7 +200,7 @@
 
   /* Synced with options->guide, only exists for drawing. */
   GimpRectangleGuide      guide;
-};
+} GimpRectangleToolPrivate;
 
 
 static void          gimp_rectangle_tool_iface_base_init      (GimpRectangleToolInterface *iface);
@@ -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;

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	Sat Aug 16 23:02:21 2008
@@ -62,6 +62,7 @@
 
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplayshell.h"
+#include "display/gimpcanvas.h"
 
 #include "gimpeditselectiontool.h"
 #include "gimprectangletool.h"
@@ -317,6 +318,9 @@
   gimp_tool_control_set_wants_all_key_events (tool->control, FALSE);
   gimp_tool_control_set_show_context_menu (tool->control, FALSE);
 
+  gtk_im_context_set_client_window (text_tool->im_context, NULL);
+  gtk_im_context_focus_out (text_tool->im_context);
+
   gtk_text_buffer_set_text (text_tool->text_buffer, "", -1);
   g_signal_handlers_disconnect_by_func (text_tool->im_context,
                                         gimp_text_tool_commit_cb, text_tool);
@@ -418,7 +422,7 @@
   if (x1 <= cx && x2 >= cx && y1 <= cy && y2 >= cy)
   {
     text_tool->text_cursor_changing = TRUE;
-    gimp_rectangle_tool_set_function (rect_tool, GIMP_RECTANGLE_TOOL_DEAD); 
+    gimp_rectangle_tool_set_function (rect_tool, GIMP_RECTANGLE_TOOL_DEAD);
     gimp_tool_control_activate (tool->control);
   }
   else
@@ -612,6 +616,7 @@
         g_object_set (text_tool->proxy,
                       "box-mode", GIMP_TEXT_BOX_DYNAMIC,
                       NULL);
+
       text_tool->handle_rectangle_change_complete = FALSE;
     }
   else
@@ -670,7 +675,7 @@
 
           if (offset == old_cursor_offset)
               return;
-    
+
           gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
           gtk_text_buffer_get_iter_at_offset (text_tool->text_buffer,
                                              &cursor, offset);
@@ -729,9 +734,9 @@
 
   if (kevent->keyval == GDK_BackSpace)
     {
-      gimp_draw_tool_pause (draw_tool);
+      /*gimp_draw_tool_pause (draw_tool);*/
       gimp_text_tool_delete_text (text_tool);
-      gimp_draw_tool_resume (draw_tool);
+/*      gimp_draw_tool_resume (draw_tool);*/
       return TRUE;
     }
 
@@ -995,9 +1000,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);
 
@@ -1268,8 +1273,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,
@@ -1279,8 +1284,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,
@@ -1306,7 +1311,7 @@
 static void
 gimp_text_tool_canvas_editor (GimpTextTool *text_tool)
 {
-  GimpTool *tool = GIMP_TOOL (text_tool);
+  GimpTool          *tool = GIMP_TOOL (text_tool);
   GimpTextOptions   *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
   GimpDialogFactory *dialog_factory;
   GtkWindow         *parent  = NULL;
@@ -1323,6 +1328,8 @@
                                     GIMP_DISPLAY_SHELL (tool->display->shell)->canvas->window);
   gtk_im_context_focus_in (text_tool->im_context);
 
+
+
   dialog_factory = gimp_dialog_factory_from_name ("toplevel");
   text_tool->ui_manager = gimp_menu_factory_manager_new (dialog_factory->menu_factory,
                                                          "<TextTool>",
@@ -1335,6 +1342,12 @@
 
   g_signal_connect (text_tool, "show-popup",
                     G_CALLBACK (gimp_text_tool_show_context_menu), NULL);
+/*
+  if (!text_tool->layer) {gimp_text_tool_create_layer (text_tool, NULL); printf ("1\n");}
+  if (!text_tool->layer->text) printf ("2\n");
+  if (!text_tool->layout) {printf ("3\n"); return;}
+  if (!text_tool->layout->layout) printf ("4\n");
+  */
 }
 
 static void
@@ -1734,6 +1747,7 @@
                     NULL);
 
       text_tool->text_box_fixed = TRUE;
+
       if (! text)
         {
           /*
@@ -1746,8 +1760,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);
 
@@ -1784,7 +1798,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;
@@ -1793,10 +1807,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));
@@ -1895,11 +1910,20 @@
 gimp_text_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpTextTool   *text_tool = GIMP_TEXT_TOOL (draw_tool);
+  GimpTool       *tool = GIMP_TOOL (draw_tool);
   gint            width, height;
   GtkTextIter     start;
+  GdkRectangle    cliprect;
+  gint            x1, y1, x2, y2;
 
   GValue value = { 0, };
 
+  g_object_get (G_OBJECT (text_tool),
+                          "x1", &x1,
+                          "y1", &y1,
+                          "x2", &x2,
+                          "y2", &y2,
+                          NULL);
 
   g_value_init (&value, G_TYPE_BOOLEAN);
   g_value_set_boolean (&value, TRUE);
@@ -1914,6 +1938,14 @@
   if (!text_tool->layout) return;
   if (!text_tool->layout->layout) return;
 
+  /*Turn on clipping for text-cursor and selections*/
+  cliprect.x = x1;
+  cliprect.width = x2 - x1;
+  cliprect.y = y1;
+  cliprect.height = y2 - y1;
+  gimp_canvas_set_clip_rect (GIMP_DISPLAY_SHELL (tool->display->shell)->canvas,
+                             GIMP_CANVAS_STYLE_XOR, &cliprect);
+
   gtk_text_buffer_get_start_iter (text_tool->text_buffer, &start);
 
   if (!gtk_text_buffer_get_has_selection (text_tool->text_buffer))
@@ -1923,7 +1955,7 @@
       gint           cursorx;
       GtkTextIter    cursor;
       PangoRectangle crect;
-      gchar          *string;
+      gchar         *string;
 
       gtk_text_buffer_get_iter_at_mark (text_tool->text_buffer, &cursor,
                                         gtk_text_buffer_get_insert (text_tool->text_buffer));
@@ -1947,10 +1979,9 @@
       crect.height = PANGO_PIXELS (crect.height);
 
       gimp_draw_tool_draw_rectangle (draw_tool, TRUE,
-                                     crect.x, crect.y,
-                                     4, crect.height,
-                                     TRUE);
-
+                                       crect.x, crect.y,
+                                       4, crect.height,
+                                       TRUE);
       if (text_tool->preedit_string && text_tool->preedit_len > 0)
           gimp_text_tool_draw_preedit_lines (draw_tool);
     }
@@ -2032,6 +2063,8 @@
 
       pango_layout_iter_free (line_iter);
     }
+  gimp_canvas_set_clip_rect (GIMP_DISPLAY_SHELL (tool->display->shell)->canvas,
+                             GIMP_CANVAS_STYLE_XOR, NULL);
 }
 
 static void
@@ -2179,7 +2212,7 @@
 }
 
 void
-gimp_text_tool_clipboard_copy (GimpTextTool *text_tool)
+gimp_text_tool_clipboard_copy (GimpTextTool *text_tool, gboolean use_CLIPBOARD)
 {
   GtkClipboard *clipboard;
 
@@ -2188,7 +2221,7 @@
 }
 
 void
-gimp_text_tool_clipboard_paste (GimpTextTool *text_tool)
+gimp_text_tool_clipboard_paste (GimpTextTool *text_tool, gboolean use_CLIPBOARD)
 {
   GtkClipboard *clipboard;
 

Modified: branches/soc-2008-text/app/tools/gimptexttool.h
==============================================================================
--- branches/soc-2008-text/app/tools/gimptexttool.h	(original)
+++ branches/soc-2008-text/app/tools/gimptexttool.h	Sat Aug 16 23:02:21 2008
@@ -86,7 +86,7 @@
 
 void    gimp_text_tool_delete_text     (GimpTextTool *text_tool);
 void    gimp_text_tool_clipboard_cut   (GimpTextTool *text_tool);
-void    gimp_text_tool_clipboard_copy  (GimpTextTool *text_tool);
-void    gimp_text_tool_clipboard_paste (GimpTextTool *text_tool);
+void    gimp_text_tool_clipboard_copy  (GimpTextTool *text_tool, gboolean use_CLIPBOARD);
+void    gimp_text_tool_clipboard_paste (GimpTextTool *text_tool, gboolean use_CLIPBOARD);
 
 #endif /* __GIMP_TEXT_TOOL_H__ */

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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/gimpsamplepointeditor.c
==============================================================================
--- branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c	(original)
+++ branches/soc-2008-text/app/widgets/gimpsamplepointeditor.c	Sat Aug 16 23:02:21 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/xcf/xcf.c
==============================================================================
--- branches/soc-2008-text/app/xcf/xcf.c	(original)
+++ branches/soc-2008-text/app/xcf/xcf.c	Sat Aug 16 23:02:21 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/autogen.sh
==============================================================================
--- branches/soc-2008-text/autogen.sh	(original)
+++ branches/soc-2008-text/autogen.sh	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 2008
@@ -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")
@@ -923,7 +932,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 +940,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 +963,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)
 
@@ -996,24 +1005,24 @@
 
 have_libtiff=no
 AC_ARG_WITH(libtiff,  [  --without-libtiff       build without TIFF support])
-  if test "x$with_libtiff" != xno && test -z "$LIBTIFF"; then
+  if test "x$with_libtiff" != xno && test -z "$TIFF_LIBS"; then
     have_libtiff=yes
     AC_CHECK_LIB(tiff, TIFFReadScanline,
       [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',
 	[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 -ljpeg -lz',
+          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(tiff34, TIFFFlushData,
 	  [AC_CHECK_HEADER(tiffio.h,
-            TIFF_LOAD='tiff-load$(EXEEXT)'; TIFF_SAVE='tiff-save$(EXEEXT)'; LIBTIFF='-ltiff34 -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)"])],
         [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
+  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.])
@@ -1023,9 +1032,9 @@
     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)
 
 
 ###################
@@ -1035,7 +1044,7 @@
 jpeg_ok=no
 
 AC_ARG_WITH(libjpeg,  [  --without-libjpeg       build without JPEG support])
-  if test "x$with_libjpeg" != xno && test -z "$LIBJPEG"; then
+  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)"
@@ -1054,7 +1063,7 @@
       AC_MSG_RESULT($jpeg_ok)
       if test "$jpeg_ok" = yes; then
 	AC_CHECK_LIB(jpeg, jpeg_save_markers,
-	JPEG='jpeg$(EXEEXT)'; LIBJPEG='-ljpeg',
+	JPEG='jpeg$(EXEEXT)'; JPEG_LIBS='-ljpeg',
         jpeg_ok="no (JPEG library is too old)")
       else
 	jpeg_ok="no (JPEG header file not found)"
@@ -1062,7 +1071,7 @@
     fi
   fi
 
-  if test "x$with_libjpeg" != xno && test -z "$LIBJPEG"; then
+  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.])
@@ -1073,7 +1082,7 @@
   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 +1102,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,8 +1114,8 @@
   MIME_TYPES="$MIME_TYPES;image/x-psd"
 fi
 
-AC_SUBST(LIBZ)
-AC_SUBST(PSP)
+AC_SUBST(FILE_PSP)
+AC_SUBST(Z_LIBS)
 
 
 ##################
@@ -1118,8 +1127,7 @@
 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 +1138,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)
 
@@ -1143,20 +1150,20 @@
 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
+  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
-      MNG='mng$(EXEEXT)'; LIBMNG="-lmng $LIBJPEG $LIBPNG"
+      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)
 
 
 ############################################################
@@ -1167,7 +1174,7 @@
 
 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
+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]),
@@ -1185,17 +1192,17 @@
 
 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 +1217,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 +1231,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 +1272,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,8 +1282,7 @@
   MIME_TYPES="$MIME_TYPES;image/svg+xml"
 fi
 
-AC_SUBST(SVG)
-AC_SUBST(LIBSVG)
+AC_SUBST(FILE_SVG)
 
 
 ####################################
@@ -1303,8 +1308,7 @@
 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 +1316,7 @@
   have_poppler="Using PostScript plug-in (libpoppler support disabled)"
 fi
 
-AC_SUBST(POPPLER)
-AC_SUBST(LIBPOPPLER)
+AC_SUBST(FILE_PDF)
 
 
 ###############################################
@@ -1409,8 +1412,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 +1426,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 +1437,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)
 
 
@@ -1986,32 +1975,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 +2011,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 +2020,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 +2087,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	Sat Aug 16 23:02:21 2008
@@ -591,6 +591,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 +606,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

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	Sat Aug 16 23:02:21 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/libgimp/gimp.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.c	(original)
+++ branches/soc-2008-text/libgimp/gimp.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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

Modified: branches/soc-2008-text/libgimp/gimp.h
==============================================================================
--- branches/soc-2008-text/libgimp/gimp.h	(original)
+++ branches/soc-2008-text/libgimp/gimp.h	Sat Aug 16 23:02:21 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/gimplayer_pdb.c
==============================================================================
--- branches/soc-2008-text/libgimp/gimplayer_pdb.c	(original)
+++ branches/soc-2008-text/libgimp/gimplayer_pdb.c	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/menus/image-menu.xml.in
==============================================================================
--- branches/soc-2008-text/menus/image-menu.xml.in	(original)
+++ branches/soc-2008-text/menus/image-menu.xml.in	Sat Aug 16 23:02:21 2008
@@ -178,6 +178,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 +346,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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/plug-ins/Makefile.am
==============================================================================
--- branches/soc-2008-text/plug-ins/Makefile.am	(original)
+++ branches/soc-2008-text/plug-ins/Makefile.am	Sat Aug 16 23:02:21 2008
@@ -9,7 +9,7 @@
 endif
 
 if BUILD_JPEG
-jpeg = jpeg
+file_jpeg = file-jpeg
 endif
 
 if BUILD_PRINT
@@ -29,54 +29,54 @@
 endif
 
 if HAVE_PNG
-ico = ico
+file_ico = file-ico
 endif
 
 if OS_WIN32
 twain = twain
 win_snap = win-snap
 if HAVE_LIBCURL
-uri = uri
+file_uri = file-uri
 endif
 else
-uri = uri
+file_uri = file-uri
 endif
 
 if BUILD_XJT
-xjt = xjt
+file_xjt = file-xjt
 endif
 
 
 SUBDIRS = \
 	$(script_fu)		\
 	$(pygimp)		\
-	bmp			\
 	color-rotate		\
-	faxg3			\
-	fits			\
+	file-bmp		\
+	file-faxg3		\
+	file-fits		\
+	file-fli		\
+	$(file_ico)		\
+	$(file_jpeg)		\
+	file-psd		\
+	file-sgi		\
+	$(file_uri)		\
+	$(file_xjt)		\
 	flame			\
-	fli			\
 	fractal-explorer	\
 	gfig			\
 	gimpressionist		\
 	gradient-flare		\
 	help			\
 	$(help_browser)		\
-	$(ico)			\
 	ifs-compose		\
 	imagemap		\
-	$(jpeg)                 \
 	lighting		\
 	map-object		\
 	maze			\
 	metadata		\
 	pagecurl		\
 	$(print)		\
-	psd			\
 	selection-to-path	\
-	sgi			\
 	$(twain)		\
-	$(uri)			\
 	$(win_snap)		\
-	$(xjt)			\
 	common

Modified: branches/soc-2008-text/plug-ins/common/Makefile.am
==============================================================================
--- branches/soc-2008-text/plug-ins/common/Makefile.am	(original)
+++ branches/soc-2008-text/plug-ins/common/Makefile.am	Sat Aug 16 23:02:21 2008
@@ -36,7 +36,6 @@
 	-I$(includedir)
 
 libexec_PROGRAMS = \
-	$(AA) \
 	alien-map \
 	align-layers \
 	animation-optimize \
@@ -51,7 +50,6 @@
 	border-average \
 	bump-map \
 	cartoon \
-	cel \
 	channel-mixer \
 	checkerboard \
 	cml-explorer \
@@ -70,16 +68,13 @@
 	convolution-matrix \
 	crop-auto \
 	crop-zealous \
-	csource \
 	cubism \
 	curve-bend \
 	decompose \
 	deinterlace \
 	depth-merge \
-	desktop-link \
 	despeckle \
 	destripe \
-	dicom \
 	diffraction \
 	displace \
 	edge \
@@ -89,22 +84,46 @@
 	edge-sobel \
 	emboss \
 	engrave \
+	$(FILE_AA) \
+	file-cel \
+	file-csource \
+	file-desktop-link \
+	file-dicom \
+	file-gbr \
+	file-gif-load \
+	file-gif-save \
+	file-gih \
+	file-glob \
+	file-header \
+	file-html-table \
+	$(FILE_MNG) \
+	file-pat \
+	file-pcx \
+	$(FILE_PDF) \
+	file-pix \
+	$(FILE_PNG) \
+	file-pnm \
+	file-ps \
+	$(FILE_PSP) \
+	file-raw \
+	file-sunras \
+	$(FILE_SVG) \
+	file-tga \
+	$(FILE_TIFF_LOAD) \
+	$(FILE_TIFF_SAVE) \
+	$(FILE_WMF) \
+	file-xbm \
+	$(FILE_XPM) \
+	file-xwd \
 	film \
 	filter-pack \
 	fractal-trace \
-	gbr \
 	gee \
 	gee-zoom \
-	gif-load \
-	gif-save \
-	gih \
-	glob \
 	gradient-map \
 	grid \
 	guillotine \
-	header \
 	hot \
-	html-table \
 	illusion \
 	iwarp \
 	jigsaw \
@@ -114,7 +133,6 @@
 	lens-flare \
 	$(MAIL) \
 	max-rgb \
-	$(MNG) \
 	mosaic \
 	newsprint \
 	nl-filter \
@@ -125,22 +143,13 @@
 	noise-spread \
 	nova \
 	oilify \
-	pat \
-	pcx \
 	photocopy \
-	pix \
 	pixelize \
 	plasma \
 	plugin-browser \
-	$(PNG) \
-	pnm \
 	polar-coords \
-	$(POPPLER) \
-	postscript \
 	procedure-browser \
-	$(PSP) \
 	qbist \
-	raw \
 	red-eye-removal \
 	ripple \
 	rotate \
@@ -154,12 +163,7 @@
 	softglow \
 	sparkle \
 	sphere-designer \
-	sunras \
-	$(SVG) \
-	tga \
 	threshold-alpha \
-	$(TIFF_LOAD) \
-	$(TIFF_SAVE) \
 	tile \
 	tile-glass \
 	tile-paper \
@@ -175,26 +179,22 @@
 	waves \
 	web-browser \
 	whirl-pinch \
-	wind \
-	$(WMF) \
-	xbm \
-	$(XPM) \
-	xwd
+	wind
 
 EXTRA_PROGRAMS = \
-	aa \
+	file-aa \
+	file-mng \
+	file-pdf \
+	file-png \
+	file-psp \
+	file-svg \
+	file-tiff-load \
+	file-tiff-save \
+	file-wmf \
+	file-xpm \
 	lcms \
 	mail \
-	mng \
-	png \
-	poppler \
-	psp \
-	screenshot \
-	svg \
-	tiff-load \
-	tiff-save \
-	wmf \
-	xpm
+	screenshot
 
 install-%: %
 	@$(NORMAL_INSTALL)
@@ -208,23 +208,6 @@
 	  $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(libexecdir)/$$f || exit 1; \
 	else :; fi
 
-aa_SOURCES = \
-	aa.c
-
-aa_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GTK_LIBS)		\
-	$(LIBAA)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 alien_map_SOURCES = \
 	alien-map.c
 
@@ -442,22 +425,6 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-cel_SOURCES = \
-	cel.c
-
-cel_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GTK_LIBS)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 channel_mixer_SOURCES = \
 	channel-mixer.c
 
@@ -728,22 +695,6 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-csource_SOURCES = \
-	csource.c
-
-csource_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GTK_LIBS)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 cubism_SOURCES = \
 	cubism.c
 
@@ -824,19 +775,6 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-desktop_link_SOURCES = \
-	desktop-link.c
-
-desktop_link_LDADD = \
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 despeckle_SOURCES = \
 	despeckle.c
 
@@ -869,22 +807,6 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-dicom_SOURCES = \
-	dicom.c
-
-dicom_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
-	$(libgimp)		\
-	$(libgimpmath)		\
-	$(libgimpconfig)	\
-	$(libgimpcolor)		\
-	$(libgimpbase)		\
-	$(GTK_LIBS)		\
-	$(RT_LIBS)		\
-	$(INTLLIBS)
-
 diffraction_SOURCES = \
 	diffraction.c
 
@@ -1026,10 +948,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-film_SOURCES = \
-	film.c
+file_aa_SOURCES = \
+	file-aa.c
 
-film_LDADD = \
+file_aa_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1039,13 +961,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(AA_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-filter_pack_SOURCES = \
-	filter-pack.c
+file_cel_SOURCES = \
+	file-cel.c
 
-filter_pack_LDADD = \
+file_cel_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1058,10 +981,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-fractal_trace_SOURCES = \
-	fractal-trace.c
+file_csource_SOURCES = \
+	file-csource.c
 
-fractal_trace_LDADD = \
+file_csource_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1074,26 +997,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gbr_SOURCES = \
-	gbr.c
+file_desktop_link_SOURCES = \
+	file-desktop-link.c
 
-gbr_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
+file_desktop_link_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GTK_LIBS)		\
+	$(GLIB_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gee_SOURCES = \
-	gee.c
+file_dicom_SOURCES = \
+	file-dicom.c
 
-gee_LDADD = \
+file_dicom_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1106,10 +1026,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gee_zoom_SOURCES = \
-	gee-zoom.c
+file_gbr_SOURCES = \
+	file-gbr.c
 
-gee_zoom_LDADD = \
+file_gbr_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1122,10 +1042,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gif_load_SOURCES = \
-	gif-load.c
+file_gif_load_SOURCES = \
+	file-gif-load.c
 
-gif_load_LDADD = \
+file_gif_load_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
@@ -1135,10 +1055,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gif_save_SOURCES = \
-	gif-save.c
+file_gif_save_SOURCES = \
+	file-gif-save.c
 
-gif_save_LDADD = \
+file_gif_save_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1151,10 +1071,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gih_SOURCES = \
-	gih.c
+file_gih_SOURCES = \
+	file-gih.c
 
-gih_LDADD = \
+file_gih_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1167,10 +1087,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-glob_SOURCES = \
-	glob.c
+file_glob_SOURCES = \
+	file-glob.c
 
-glob_LDADD = \
+file_glob_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
@@ -1180,23 +1100,26 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-gradient_map_SOURCES = \
-	gradient-map.c
+file_header_SOURCES = \
+	file-header.c
 
-gradient_map_LDADD = \
+file_header_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-grid_SOURCES = \
-	grid.c
+file_html_table_SOURCES = \
+	file-html-table.c
 
-grid_LDADD = \
+file_html_table_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1209,23 +1132,27 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-guillotine_SOURCES = \
-	guillotine.c
+file_mng_SOURCES = \
+	file-mng.c
 
-guillotine_LDADD = \
+file_mng_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
+	$(MNG_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-header_SOURCES = \
-	header.c
+file_pat_SOURCES = \
+	file-pat.c
 
-header_LDADD = \
+file_pat_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1238,10 +1165,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-hot_SOURCES = \
-	hot.c
+file_pcx_SOURCES = \
+	file-pcx.c
 
-hot_LDADD = \
+file_pcx_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1254,10 +1181,12 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-html_table_SOURCES = \
-	html-table.c
+file_pdf_CFLAGS = $(POPPLER_CFLAGS)
 
-html_table_LDADD = \
+file_pdf_SOURCES = \
+	file-pdf.c
+
+file_pdf_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1267,13 +1196,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(POPPLER_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-illusion_SOURCES = \
-	illusion.c
+file_pix_SOURCES = \
+	file-pix.c
 
-illusion_LDADD = \
+file_pix_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1286,10 +1216,12 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-iwarp_SOURCES = \
-	iwarp.c
+file_png_CFLAGS = $(PNG_CFLAGS)
 
-iwarp_LDADD = \
+file_png_SOURCES = \
+	file-png.c
+
+file_png_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1299,13 +1231,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(PNG_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-jigsaw_SOURCES = \
-	jigsaw.c
+file_pnm_SOURCES = \
+	file-pnm.c
 
-jigsaw_LDADD = \
+file_pnm_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1318,10 +1251,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-lcms_SOURCES = \
-	lcms.c
+file_ps_SOURCES = \
+	file-ps.c
 
-lcms_LDADD = \
+file_ps_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1331,14 +1264,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBLCMS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-lens_apply_SOURCES = \
-	lens-apply.c
+file_psp_SOURCES = \
+	file-psp.c
 
-lens_apply_LDADD = \
+file_psp_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1348,13 +1280,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(Z_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-lens_distortion_SOURCES = \
-	lens-distortion.c
+file_raw_SOURCES = \
+	file-raw.c
 
-lens_distortion_LDADD = \
+file_raw_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1367,10 +1300,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-lens_flare_SOURCES = \
-	lens-flare.c
+file_sunras_SOURCES = \
+	file-sunras.c
 
-lens_flare_LDADD = \
+file_sunras_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1383,10 +1316,12 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-mail_SOURCES = \
-	mail.c
+file_svg_CFLAGS = $(SVG_CFLAGS)
 
-mail_LDADD = \
+file_svg_SOURCES = \
+	file-svg.c
+
+file_svg_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1396,14 +1331,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBMAIL)		\
+	$(SVG_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-max_rgb_SOURCES = \
-	max-rgb.c
+file_tga_SOURCES = \
+	file-tga.c
 
-max_rgb_LDADD = \
+file_tga_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1416,10 +1351,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-mng_SOURCES = \
-	mng.c
+file_tiff_load_SOURCES = \
+	file-tiff-load.c
 
-mng_LDADD = \
+file_tiff_load_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1429,14 +1364,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBMNG)		\
+	$(TIFF_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-mosaic_SOURCES = \
-	mosaic.c
+file_tiff_save_SOURCES = \
+	file-tiff-save.c
 
-mosaic_LDADD = \
+file_tiff_save_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1446,13 +1381,16 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(TIFF_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-newsprint_SOURCES = \
-	newsprint.c
+file_wmf_CFLAGS = $(WMF_CFLAGS)
 
-newsprint_LDADD = \
+file_wmf_SOURCES = \
+	file-wmf.c
+
+file_wmf_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1462,13 +1400,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(WMF_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-nl_filter_SOURCES = \
-	nl-filter.c
+file_xbm_SOURCES = \
+	file-xbm.c
 
-nl_filter_LDADD = \
+file_xbm_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1481,10 +1420,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-noise_hsv_SOURCES = \
-	noise-hsv.c
+file_xpm_SOURCES = \
+	file-xpm.c
 
-noise_hsv_LDADD = \
+file_xpm_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1494,13 +1433,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(XPM_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-noise_randomize_SOURCES = \
-	noise-randomize.c
+file_xwd_SOURCES = \
+	file-xwd.c
 
-noise_randomize_LDADD = \
+file_xwd_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1513,10 +1453,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-noise_rgb_SOURCES = \
-	noise-rgb.c
+film_SOURCES = \
+	film.c
 
-noise_rgb_LDADD = \
+film_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1529,10 +1469,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-noise_solid_SOURCES = \
-	noise-solid.c
+filter_pack_SOURCES = \
+	filter-pack.c
 
-noise_solid_LDADD = \
+filter_pack_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1545,10 +1485,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-noise_spread_SOURCES = \
-	noise-spread.c
+fractal_trace_SOURCES = \
+	fractal-trace.c
 
-noise_spread_LDADD = \
+fractal_trace_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1561,10 +1501,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-nova_SOURCES = \
-	nova.c
+gee_SOURCES = \
+	gee.c
 
-nova_LDADD = \
+gee_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1577,10 +1517,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-oilify_SOURCES = \
-	oilify.c
+gee_zoom_SOURCES = \
+	gee-zoom.c
 
-oilify_LDADD = \
+gee_zoom_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1593,26 +1533,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-pat_SOURCES = \
-	pat.c
+gradient_map_SOURCES = \
+	gradient-map.c
 
-pat_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
+gradient_map_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GTK_LIBS)		\
+	$(GLIB_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-pcx_SOURCES = \
-	pcx.c
+grid_SOURCES = \
+	grid.c
 
-pcx_LDADD = \
+grid_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1625,26 +1562,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-photocopy_SOURCES = \
-	photocopy.c
+guillotine_SOURCES = \
+	guillotine.c
 
-photocopy_LDADD = \
-	$(libgimpui)		\
-	$(libgimpwidgets)	\
-	$(libgimpmodule)	\
+guillotine_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GTK_LIBS)		\
+	$(GLIB_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-pix_SOURCES = \
-	pix.c
+hot_SOURCES = \
+	hot.c
 
-pix_LDADD = \
+hot_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1657,10 +1591,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-pixelize_SOURCES = \
-	pixelize.c
+illusion_SOURCES = \
+	illusion.c
 
-pixelize_LDADD = \
+illusion_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1673,10 +1607,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-plasma_SOURCES = \
-	plasma.c
+iwarp_SOURCES = \
+	iwarp.c
 
-plasma_LDADD = \
+iwarp_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1689,10 +1623,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-plugin_browser_SOURCES = \
-	plugin-browser.c
+jigsaw_SOURCES = \
+	jigsaw.c
 
-plugin_browser_LDADD = \
+jigsaw_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1705,12 +1639,12 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-png_CFLAGS = $(PNG_CFLAGS)
+lcms_CFLAGS = $(LCMS_CFLAGS)
 
-png_SOURCES = \
-	png.c
+lcms_SOURCES = \
+	lcms.c
 
-png_LDADD = \
+lcms_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1720,14 +1654,14 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBPNG)		\
+	$(LCMS_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-pnm_SOURCES = \
-	pnm.c
+lens_apply_SOURCES = \
+	lens-apply.c
 
-pnm_LDADD = \
+lens_apply_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1740,10 +1674,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-polar_coords_SOURCES = \
-	polar-coords.c
+lens_distortion_SOURCES = \
+	lens-distortion.c
 
-polar_coords_LDADD = \
+lens_distortion_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1756,12 +1690,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-poppler_CFLAGS = $(POPPLER_CFLAGS)
-
-poppler_SOURCES = \
-	poppler.c
+lens_flare_SOURCES = \
+	lens-flare.c
 
-poppler_LDADD = \
+lens_flare_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1771,14 +1703,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBPOPPLER)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-postscript_SOURCES = \
-	postscript.c
+mail_SOURCES = \
+	mail.c
 
-postscript_LDADD = \
+mail_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1791,10 +1722,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-procedure_browser_SOURCES = \
-	procedure-browser.c
+max_rgb_SOURCES = \
+	max-rgb.c
 
-procedure_browser_LDADD = \
+max_rgb_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1807,10 +1738,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-psp_SOURCES = \
-	psp.c
+mosaic_SOURCES = \
+	mosaic.c
 
-psp_LDADD = \
+mosaic_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1820,14 +1751,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBZ)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-qbist_SOURCES = \
-	qbist.c
+newsprint_SOURCES = \
+	newsprint.c
 
-qbist_LDADD = \
+newsprint_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1840,10 +1770,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-raw_SOURCES = \
-	raw.c
+nl_filter_SOURCES = \
+	nl-filter.c
 
-raw_LDADD = \
+nl_filter_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1856,10 +1786,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-red_eye_removal_SOURCES = \
-	red-eye-removal.c
+noise_hsv_SOURCES = \
+	noise-hsv.c
 
-red_eye_removal_LDADD = \
+noise_hsv_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1872,10 +1802,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-ripple_SOURCES = \
-	ripple.c
+noise_randomize_SOURCES = \
+	noise-randomize.c
 
-ripple_LDADD = \
+noise_randomize_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1888,23 +1818,26 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-rotate_SOURCES = \
-	rotate.c
+noise_rgb_SOURCES = \
+	noise-rgb.c
 
-rotate_LDADD = \
+noise_rgb_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sample_colorize_SOURCES = \
-	sample-colorize.c
+noise_solid_SOURCES = \
+	noise-solid.c
 
-sample_colorize_LDADD = \
+noise_solid_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1917,12 +1850,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-screenshot_CFLAGS = $(XFIXES_CFLAGS)
-
-screenshot_SOURCES = \
-	screenshot.c
+noise_spread_SOURCES = \
+	noise-spread.c
 
-screenshot_LDADD = \
+noise_spread_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1932,27 +1863,29 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBSCREENSHOT)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-semi_flatten_SOURCES = \
-	semi-flatten.c
+nova_SOURCES = \
+	nova.c
 
-semi_flatten_LDADD = \
+nova_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sharpen_SOURCES = \
-	sharpen.c
+oilify_SOURCES = \
+	oilify.c
 
-sharpen_LDADD = \
+oilify_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1965,10 +1898,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-shift_SOURCES = \
-	shift.c
+photocopy_SOURCES = \
+	photocopy.c
 
-shift_LDADD = \
+photocopy_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1981,10 +1914,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sinus_SOURCES = \
-	sinus.c
+pixelize_SOURCES = \
+	pixelize.c
 
-sinus_LDADD = \
+pixelize_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -1997,10 +1930,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-smooth_palette_SOURCES = \
-	smooth-palette.c
+plasma_SOURCES = \
+	plasma.c
 
-smooth_palette_LDADD = \
+plasma_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2013,10 +1946,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-softglow_SOURCES = \
-	softglow.c
+plugin_browser_SOURCES = \
+	plugin-browser.c
 
-softglow_LDADD = \
+plugin_browser_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2029,10 +1962,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sparkle_SOURCES = \
-	sparkle.c
+polar_coords_SOURCES = \
+	polar-coords.c
 
-sparkle_LDADD = \
+polar_coords_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2045,10 +1978,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sphere_designer_SOURCES = \
-	sphere-designer.c
+procedure_browser_SOURCES = \
+	procedure-browser.c
 
-sphere_designer_LDADD = \
+procedure_browser_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2061,10 +1994,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-sunras_SOURCES = \
-	sunras.c
+qbist_SOURCES = \
+	qbist.c
 
-sunras_LDADD = \
+qbist_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2077,12 +2010,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-svg_CFLAGS = $(SVG_CFLAGS)
-
-svg_SOURCES = \
-	svg.c
+red_eye_removal_SOURCES = \
+	red-eye-removal.c
 
-svg_LDADD = \
+red_eye_removal_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2092,14 +2023,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBSVG)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tga_SOURCES = \
-	tga.c
+ripple_SOURCES = \
+	ripple.c
 
-tga_LDADD = \
+ripple_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2112,10 +2042,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-threshold_alpha_SOURCES = \
-	threshold-alpha.c
+rotate_SOURCES = \
+	rotate.c
 
-threshold_alpha_LDADD = \
+rotate_LDADD = \
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GLIB_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
+
+sample_colorize_SOURCES = \
+	sample-colorize.c
+
+sample_colorize_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2128,10 +2071,12 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tiff_load_SOURCES = \
-	tiff-load.c
+screenshot_CFLAGS = $(XFIXES_CFLAGS)
 
-tiff_load_LDADD = \
+screenshot_SOURCES = \
+	screenshot.c
+
+screenshot_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2141,14 +2086,27 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBTIFF)		\
+	$(SCREENSHOT_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
+
+semi_flatten_SOURCES = \
+	semi-flatten.c
+
+semi_flatten_LDADD = \
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GLIB_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tiff_save_SOURCES = \
-	tiff-save.c
+sharpen_SOURCES = \
+	sharpen.c
 
-tiff_save_LDADD = \
+sharpen_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2158,14 +2116,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBTIFF)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tile_SOURCES = \
-	tile.c
+shift_SOURCES = \
+	shift.c
 
-tile_LDADD = \
+shift_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2178,10 +2135,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tile_glass_SOURCES = \
-	tile-glass.c
+sinus_SOURCES = \
+	sinus.c
 
-tile_glass_LDADD = \
+sinus_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2194,10 +2151,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tile_paper_SOURCES = \
-	tile-paper.c
+smooth_palette_SOURCES = \
+	smooth-palette.c
 
-tile_paper_LDADD = \
+smooth_palette_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2210,23 +2167,26 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tile_seamless_SOURCES = \
-	tile-seamless.c
+softglow_SOURCES = \
+	softglow.c
 
-tile_seamless_LDADD = \
+softglow_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-tile_small_SOURCES = \
-	tile-small.c
+sparkle_SOURCES = \
+	sparkle.c
 
-tile_small_LDADD = \
+sparkle_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2239,10 +2199,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-unit_editor_SOURCES = \
-	unit-editor.c
+sphere_designer_SOURCES = \
+	sphere-designer.c
 
-unit_editor_LDADD = \
+sphere_designer_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2255,10 +2215,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-unsharp_mask_SOURCES = \
-	unsharp-mask.c
+threshold_alpha_SOURCES = \
+	threshold-alpha.c
 
-unsharp_mask_LDADD = \
+threshold_alpha_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2271,23 +2231,26 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-value_invert_SOURCES = \
-	value-invert.c
+tile_SOURCES = \
+	tile.c
 
-value_invert_LDADD = \
+tile_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
-	$(GLIB_LIBS)		\
+	$(GTK_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-value_propagate_SOURCES = \
-	value-propagate.c
+tile_glass_SOURCES = \
+	tile-glass.c
 
-value_propagate_LDADD = \
+tile_glass_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2300,10 +2263,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-van_gogh_lic_SOURCES = \
-	van-gogh-lic.c
+tile_paper_SOURCES = \
+	tile-paper.c
 
-van_gogh_lic_LDADD = \
+tile_paper_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2316,10 +2279,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-video_SOURCES = \
-	video.c
+tile_seamless_SOURCES = \
+	tile-seamless.c
 
-video_LDADD = \
+tile_seamless_LDADD = \
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GLIB_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
+
+tile_small_SOURCES = \
+	tile-small.c
+
+tile_small_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2332,10 +2308,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-warp_SOURCES = \
-	warp.c
+unit_editor_SOURCES = \
+	unit-editor.c
 
-warp_LDADD = \
+unit_editor_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2348,10 +2324,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-waves_SOURCES = \
-	waves.c
+unsharp_mask_SOURCES = \
+	unsharp-mask.c
 
-waves_LDADD = \
+unsharp_mask_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2364,10 +2340,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-web_browser_SOURCES = \
-	web-browser.c
+value_invert_SOURCES = \
+	value-invert.c
 
-web_browser_LDADD = \
+value_invert_LDADD = \
 	$(libgimp)		\
 	$(libgimpmath)		\
 	$(libgimpconfig)	\
@@ -2377,10 +2353,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-whirl_pinch_SOURCES = \
-	whirl-pinch.c
+value_propagate_SOURCES = \
+	value-propagate.c
 
-whirl_pinch_LDADD = \
+value_propagate_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2393,10 +2369,10 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-wind_SOURCES = \
-	wind.c
+van_gogh_lic_SOURCES = \
+	van-gogh-lic.c
 
-wind_LDADD = \
+van_gogh_lic_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2409,12 +2385,26 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-wmf_CFLAGS = $(WMF_CFLAGS)
+video_SOURCES = \
+	video.c
 
-wmf_SOURCES = \
-	wmf.c
+video_LDADD = \
+	$(libgimpui)		\
+	$(libgimpwidgets)	\
+	$(libgimpmodule)	\
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GTK_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
 
-wmf_LDADD = \
+warp_SOURCES = \
+	warp.c
+
+warp_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2424,14 +2414,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBWMF)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-xbm_SOURCES = \
-	xbm.c
+waves_SOURCES = \
+	waves.c
 
-xbm_LDADD = \
+waves_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2444,10 +2433,23 @@
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-xpm_SOURCES = \
-	xpm.c
+web_browser_SOURCES = \
+	web-browser.c
+
+web_browser_LDADD = \
+	$(libgimp)		\
+	$(libgimpmath)		\
+	$(libgimpconfig)	\
+	$(libgimpcolor)		\
+	$(libgimpbase)		\
+	$(GLIB_LIBS)		\
+	$(RT_LIBS)		\
+	$(INTLLIBS)
+
+whirl_pinch_SOURCES = \
+	whirl-pinch.c
 
-xpm_LDADD = \
+whirl_pinch_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\
@@ -2457,14 +2459,13 @@
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
-	$(LIBXPM)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)
 
-xwd_SOURCES = \
-	xwd.c
+wind_SOURCES = \
+	wind.c
 
-xwd_LDADD = \
+wind_LDADD = \
 	$(libgimpui)		\
 	$(libgimpwidgets)	\
 	$(libgimpmodule)	\

Modified: branches/soc-2008-text/plug-ins/common/cml-explorer.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/cml-explorer.c	(original)
+++ branches/soc-2008-text/plug-ins/common/cml-explorer.c	Sat Aug 16 23:02:21 2008
@@ -1816,7 +1816,7 @@
   GtkWidget *frame;
   GtkWidget *preview;
 
-  dialog = gimp_dialog_new (_("Graph of the Current Settings"), "cml_explorer",
+  dialog = gimp_dialog_new (_("Graph of the Current Settings"), PLUG_IN_BINARY,
                             gtk_widget_get_toplevel (widget), 0,
                             gimp_standard_help_func, PLUG_IN_PROC,
 

Modified: branches/soc-2008-text/plug-ins/common/depth-merge.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/depth-merge.c	(original)
+++ branches/soc-2008-text/plug-ins/common/depth-merge.c	Sat Aug 16 23:02:21 2008
@@ -41,6 +41,7 @@
 
 #define PLUG_IN_PROC    "plug-in-depth-merge"
 #define PLUG_IN_VERSION "August 1998"
+#define PLUG_IN_BINARY  "depth-merge"
 
 #define PREVIEW_SIZE    256
 
@@ -637,10 +638,10 @@
 
   dm->interface = g_new0 (DepthMergeInterface, 1);
 
-  gimp_ui_init ("depthmerge", TRUE);
+  gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
   dm->interface->dialog =
-    dialog = gimp_dialog_new (_("Depth Merge"), "depthmerge",
+    dialog = gimp_dialog_new (_("Depth Merge"), PLUG_IN_BINARY,
                               NULL, 0,
                               gimp_standard_help_func, PLUG_IN_PROC,
 

Modified: branches/soc-2008-text/plug-ins/common/filter-pack.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/filter-pack.c	(original)
+++ branches/soc-2008-text/plug-ins/common/filter-pack.c	Sat Aug 16 23:02:21 2008
@@ -888,7 +888,7 @@
 
   *preview = gimp_preview_area_new ();
   gtk_widget_set_size_request (*preview, preview_width, preview_height);
-  g_signal_connect (*preview, "size_allocate",
+  g_signal_connect (*preview, "size-allocate",
                     G_CALLBACK (fp_preview_size_allocate), NULL);
   gtk_widget_show (*preview);
   gtk_container_add (GTK_CONTAINER (*frame), *preview);

Modified: branches/soc-2008-text/plug-ins/common/grid.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/grid.c	(original)
+++ branches/soc-2008-text/plug-ins/common/grid.c	Sat Aug 16 23:02:21 2008
@@ -735,7 +735,7 @@
   gtk_table_attach_defaults (GTK_TABLE (width), chain_button, 1, 3, 2, 3);
   gtk_widget_show (chain_button);
 
-  /* connect to the 'value_changed' signal because we have to take care
+  /* connect to the 'value-changed' signal because we have to take care
    * of keeping the entries in sync when the chainbutton is active
    */
   g_signal_connect (width, "value-changed",
@@ -798,14 +798,14 @@
   gtk_table_attach_defaults (GTK_TABLE (space), chain_button, 1, 3, 2, 3);
   gtk_widget_show (chain_button);
 
-  /* connect to the 'value_changed' and "unit_changed" signals because
+  /* connect to the 'value-changed' and "unit-changed" signals because
    * we have to take care of keeping the entries in sync when the
    * chainbutton is active
    */
   g_signal_connect (space, "value-changed",
                     G_CALLBACK (entry_callback),
                     chain_button);
-  g_signal_connect (space, "unit_changed",
+  g_signal_connect (space, "unit-changed",
                     G_CALLBACK (entry_callback),
                     chain_button);
   g_signal_connect_swapped (space, "value-changed",
@@ -871,14 +871,14 @@
   gtk_table_attach_defaults (GTK_TABLE (table), chain_button, 0, 2, 0, 1);
   gtk_widget_show (chain_button);
 
-  /* connect to the 'value_changed' and "unit_changed" signals because
+  /* connect to the 'value-changed' and "unit-changed" signals because
    * we have to take care of keeping the entries in sync when the
    * chainbutton is active
    */
   g_signal_connect (offset, "value-changed",
                     G_CALLBACK (entry_callback),
                     chain_button);
-  g_signal_connect (offset, "unit_changed",
+  g_signal_connect (offset, "unit-changed",
                     G_CALLBACK (entry_callback),
                     chain_button);
   g_signal_connect_swapped (offset, "value-changed",

Modified: branches/soc-2008-text/plug-ins/common/lcms.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/lcms.c	(original)
+++ branches/soc-2008-text/plug-ins/common/lcms.c	Sat Aug 16 23:02:21 2008
@@ -25,11 +25,7 @@
 
 #include <glib.h>  /* lcms.h uses the "inline" keyword */
 
-#ifdef HAVE_LCMS_LCMS_H
-#include <lcms/lcms.h>
-#else
 #include <lcms.h>
-#endif
 
 #include <libgimp/gimp.h>
 #include <libgimp/gimpui.h>

Modified: branches/soc-2008-text/plug-ins/common/mkgen.pl
==============================================================================
--- branches/soc-2008-text/plug-ins/common/mkgen.pl	(original)
+++ branches/soc-2008-text/plug-ins/common/mkgen.pl	Sat Aug 16 23:02:21 2008
@@ -107,7 +107,9 @@
 
 foreach (sort keys %plugins) {
     my $makename = $_;
+    my $MAKENAME;
     $makename =~ s/-/_/g;
+    $MAKENAME = "\U$makename";
 
     my $libgimp = "";
 
@@ -136,15 +138,12 @@
     if (exists $plugins{$_}->{optional}) {
 	if (exists $plugins{$_}->{libs}) {
 		$optlib = "\n\t\$(" . $plugins{$_}->{libs} . ")\t\t\\";
-	} else {
-		my $name = exists $plugins{$_}->{libopt} ? $plugins{$_}->{libopt} : $_;
-		$optlib = "\n\t\$(LIB\U$name\E)\t\t\\";
 	}
     }
 
     if (exists $plugins{$_}->{cflags}) {
 	my $cflags = $plugins{$_}->{cflags};
-	my $optflags = $cflags =~ /FLAGS/ ? $cflags : "\U$_\E_CFLAGS";
+	my $optflags = $cflags =~ /FLAGS/ ? $cflags : "$MAKENAME\E_CFLAGS";
 
 	print MK <<EOT;
 

Modified: branches/soc-2008-text/plug-ins/common/mosaic.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/mosaic.c	(original)
+++ branches/soc-2008-text/plug-ins/common/mosaic.c	Sat Aug 16 23:02:21 2008
@@ -413,31 +413,30 @@
     case GIMP_RUN_NONINTERACTIVE:
       /*  Make sure all the arguments are there!  */
       if (nparams != 15)
-        status = GIMP_PDB_CALLING_ERROR;
-      if (status == GIMP_PDB_SUCCESS)
         {
-          mvals.tile_size = param[3].data.d_float;
-          mvals.tile_height = param[4].data.d_float;
-          mvals.tile_spacing = param[5].data.d_float;
-          mvals.tile_neatness = param[6].data.d_float;
-          mvals.tile_allow_split = (param[7].data.d_int32) ? TRUE : FALSE;
-          mvals.light_dir = param[8].data.d_float;
-          mvals.color_variation = param[9].data.d_float;
-          mvals.antialiasing = (param[10].data.d_int32) ? TRUE : FALSE;
-          mvals.color_averaging = (param[11].data.d_int32) ? TRUE : FALSE;
-          mvals.tile_type = param[12].data.d_int32;
-          mvals.tile_surface = param[13].data.d_int32;
-          mvals.grout_color = param[14].data.d_int32;
-        }
-      if (status == GIMP_PDB_SUCCESS &&
-          (mvals.tile_type < SQUARES || mvals.tile_type > TRIANGLES))
-        status = GIMP_PDB_CALLING_ERROR;
-      if (status == GIMP_PDB_SUCCESS &&
-          (mvals.tile_surface < SMOOTH || mvals.tile_surface > ROUGH))
-        status = GIMP_PDB_CALLING_ERROR;
-      if (status == GIMP_PDB_SUCCESS &&
-          (mvals.grout_color < BW || mvals.grout_color > FG_BG))
-        status = GIMP_PDB_CALLING_ERROR;
+          status = GIMP_PDB_CALLING_ERROR;
+          break;
+        }
+
+      mvals.tile_size = param[3].data.d_float;
+      mvals.tile_height = param[4].data.d_float;
+      mvals.tile_spacing = param[5].data.d_float;
+      mvals.tile_neatness = param[6].data.d_float;
+      mvals.tile_allow_split = (param[7].data.d_int32) ? TRUE : FALSE;
+      mvals.light_dir = param[8].data.d_float;
+      mvals.color_variation = param[9].data.d_float;
+      mvals.antialiasing = (param[10].data.d_int32) ? TRUE : FALSE;
+      mvals.color_averaging = (param[11].data.d_int32) ? TRUE : FALSE;
+      mvals.tile_type = param[12].data.d_int32;
+      mvals.tile_surface = param[13].data.d_int32;
+      mvals.grout_color = param[14].data.d_int32;
+
+      if (mvals.tile_type    < SQUARES || mvals.tile_type    > TRIANGLES ||
+          mvals.tile_surface < SMOOTH  || mvals.tile_surface > ROUGH     ||
+          mvals.grout_color  < BW      || mvals.grout_color  > FG_BG)
+        {
+          status = GIMP_PDB_CALLING_ERROR;
+        }
       break;
 
     case GIMP_RUN_WITH_LAST_VALS:
@@ -1573,7 +1572,7 @@
     }
 
   size = (grid_rows + grid_row_pad) * (grid_cols + grid_col_pad);
-  frac_size = (gint) (size * mvals.color_variation);
+  frac_size = size * mvals.color_variation;
   count = 0;
 
   for (i = -grid_row_pad; i < grid_rows; i++)
@@ -1786,7 +1785,7 @@
           }
 
         if (!preview)
-          gimp_progress_update ((double) count++ / (double) size);
+          gimp_progress_update ((gdouble) count++ / (gdouble) size);
       }
 
   if (preview)
@@ -1796,7 +1795,9 @@
                                 (x2 - x1) * bytes);
     }
   else
-    gimp_progress_update (1.0);
+    {
+      gimp_progress_update (1.0);
+    }
 }
 
 static void
@@ -1833,12 +1834,16 @@
   /*  If the magnitude of direction inside the polygon is greater than
    *  THRESHOLD, split the polygon into two new polygons
    */
-  if (magnitude > MAG_THRESHOLD && (2 * distance / mvals.tile_size) < 0.5 && allow_split)
-    split_poly (poly, drawable, col, dir, color_vary, x1, y1, x2, y2, dest);
-  /*  Otherwise, render the original polygon
-   */
+  if (magnitude > MAG_THRESHOLD &&
+      (2 * distance / mvals.tile_size) < 0.5 && allow_split)
+    {
+      split_poly (poly, drawable, col, dir, color_vary, x1, y1, x2, y2, dest);
+    }
   else
-    render_poly (poly, drawable, col, color_vary, x1, y1, x2, y2, dest);
+    {
+      /*  Otherwise, render the original polygon  */
+      render_poly (poly, drawable, col, color_vary, x1, y1, x2, y2, dest);
+    }
 }
 
 static void
@@ -1852,7 +1857,8 @@
              gint          y2,
              guchar       *dest)
 {
-  gdouble cx = 0.0, cy = 0.0;
+  gdouble cx = 0.0;
+  gdouble cy = 0.0;
 
   polygon_find_center (poly, &cx, &cy);
 
@@ -1881,7 +1887,8 @@
 {
   Polygon new_poly;
   gdouble spacing;
-  gdouble cx = 0.0, cy = 0.0;
+  gdouble cx = 0.0;
+  gdouble cy = 0.0;
   gdouble magnitude;
   gdouble vec[2];
   gdouble pt[2];
@@ -1925,7 +1932,9 @@
     {
       if (mvals.color_averaging)
         find_poly_color (&new_poly, drawable, col, vary, x1, y1, x2, y2);
+
       scale_poly (&new_poly, cx, cy, scale);
+
       if (mvals.color_averaging)
         fill_poly_color (&new_poly, drawable, col, x1, y1, x2, y2, dest);
       else
@@ -1934,10 +1943,10 @@
 }
 
 static void
-clip_poly (gdouble  *dir,
-           gdouble  *pt,
-           Polygon  *poly,
-           Polygon  *poly_new)
+clip_poly (gdouble *dir,
+           gdouble *pt,
+           Polygon *poly,
+           Polygon *poly_new)
 {
   gint    i;
   gdouble x1, y1, x2, y2;
@@ -1976,7 +1985,9 @@
 
   /*  If both points are to be clipped, ignore  */
   if (side1 < 0.0 && side2 < 0.0)
-    return;
+    {
+      return;
+    }
   /*  If both points are non-clipped, set point  */
   else if (side1 >= 0.0 && side2 >= 0.0)
     {
@@ -2010,11 +2021,12 @@
           polygon_add_point (poly_new, x2 + pt[0], y2 + pt[1]);
         }
       else
-        polygon_add_point (poly_new, dir[0] * t + pt[0], dir[1] * t + pt[1]);
+        {
+          polygon_add_point (poly_new, dir[0] * t + pt[0], dir[1] * t + pt[1]);
+        }
     }
 }
 
-
 static void
 find_poly_dir (Polygon *poly,
                guchar  *m_gr,
@@ -2050,15 +2062,18 @@
   loc[1] = 0.0;
 
   polygon_extents (poly, &dmin_x, &dmin_y, &dmax_x, &dmax_y);
+
   min_x = (gint) dmin_x;
   min_y = (gint) dmin_y;
   max_x = (gint) dmax_x;
   max_y = (gint) dmax_y;
+
   size_y = max_y - min_y;
   size_x = max_x - min_x;
 
   min_scanlines = g_new (gint, size_y);
   max_scanlines = g_new (gint, size_y);
+
   for (i = 0; i < size_y; i++)
     {
       min_scanlines[i] = max_x;
@@ -2155,6 +2170,7 @@
   bytes = drawable->bpp;
 
   polygon_extents (poly, &dmin_x, &dmin_y, &dmax_x, &dmax_y);
+
   min_x = (gint) dmin_x;
   min_y = (gint) dmin_y;
   max_x = (gint) dmax_x;
@@ -2165,6 +2181,7 @@
 
   min_scanlines = g_new (int, size_y);
   max_scanlines = g_new (int, size_y);
+
   for (i = 0; i < size_y; i++)
     {
       min_scanlines[i] = max_x;
@@ -2185,9 +2202,11 @@
   gimp_pixel_rgn_init (&src_rgn, drawable, 0, 0,
                        drawable->width, drawable->height,
                        FALSE, FALSE);
+
   for (i = 0; i < size_y; i++)
     {
       y = i + min_y;
+
       if (y >= y1 && y < y2)
         {
           for (j = min_scanlines[i]; j < max_scanlines[i]; j++)
@@ -2273,30 +2292,30 @@
 
   bytes = drawable->bpp;
 
-  /* begin loop */
-  if(poly_npts) {
-    pts_tmp = poly->pts;
-    xs = (gint) pts_tmp[poly_npts - 1].x;
-    ys = (gint) pts_tmp[poly_npts - 1].y;
-    xe = (gint) pts_tmp->x;
-    ye = (gint) pts_tmp->y;
+  if (poly_npts)
+    {
+      pts_tmp = poly->pts;
+      xs = (gint) pts_tmp[poly_npts - 1].x;
+      ys = (gint) pts_tmp[poly_npts - 1].y;
+      xe = (gint) pts_tmp->x;
+      ye = (gint) pts_tmp->y;
 
-    calc_spec_vec (vecs, xs, ys, xe, ye);
+      calc_spec_vec (vecs, xs, ys, xe, ye);
 
-    for (i = 1; i < poly_npts; i++)
-      {
-        xs = (gint) (pts_tmp->x);
-        ys = (gint) (pts_tmp->y);
-        pts_tmp++;
-        xe = (gint) pts_tmp->x;
-        ye = (gint) pts_tmp->y;
+      for (i = 1; i < poly_npts; i++)
+        {
+          xs = (gint) (pts_tmp->x);
+          ys = (gint) (pts_tmp->y);
+          pts_tmp++;
+          xe = (gint) pts_tmp->x;
+          ye = (gint) pts_tmp->y;
 
-        calc_spec_vec (vecs+i, xs, ys, xe, ye);
-      }
-  }
-  /* end loop */
+          calc_spec_vec (vecs+i, xs, ys, xe, ye);
+        }
+    }
 
   polygon_extents (poly, &dmin_x, &dmin_y, &dmax_x, &dmax_y);
+
   min_x = (gint) dmin_x;
   min_y = (gint) dmin_y;
   max_x = (gint) dmax_x;
@@ -2307,46 +2326,46 @@
 
   min_scanlines = min_scanlines_iter = g_new (gint, size_y);
   max_scanlines = max_scanlines_iter = g_new (gint, size_y);
+
   for (i = 0; i < size_y; i++)
     {
       min_scanlines[i] = max_x * supersample;
       max_scanlines[i] = min_x * supersample;
     }
 
-  /* begin loop */
-  if(poly_npts) {
-    pts_tmp = poly->pts;
-    xs = (gint) pts_tmp[poly_npts-1].x;
-    ys = (gint) pts_tmp[poly_npts-1].y;
-    xe = (gint) pts_tmp->x;
-    ye = (gint) pts_tmp->y;
-
-    xs *= supersample;
-    ys *= supersample;
-    xe *= supersample;
-    ye *= supersample;
+  if(poly_npts)
+    {
+      pts_tmp = poly->pts;
+      xs = (gint) pts_tmp[poly_npts-1].x;
+      ys = (gint) pts_tmp[poly_npts-1].y;
+      xe = (gint) pts_tmp->x;
+      ye = (gint) pts_tmp->y;
 
-    convert_segment (xs, ys, xe, ye, min_y * supersample,
-                     min_scanlines, max_scanlines);
+      xs *= supersample;
+      ys *= supersample;
+      xe *= supersample;
+      ye *= supersample;
 
-    for (i = 1; i < poly_npts; i++)
-      {
-        xs = (gint) pts_tmp->x;
-        ys = (gint) pts_tmp->y;
-        pts_tmp++;
-        xe = (gint) pts_tmp->x;
-        ye = (gint) pts_tmp->y;
-
-        xs *= supersample;
-        ys *= supersample;
-        xe *= supersample;
-        ye *= supersample;
+      convert_segment (xs, ys, xe, ye, min_y * supersample,
+                       min_scanlines, max_scanlines);
 
-        convert_segment (xs, ys, xe, ye, min_y * supersample,
-                         min_scanlines, max_scanlines);
-      }
-  }
-  /* end loop */
+      for (i = 1; i < poly_npts; i++)
+        {
+          xs = (gint) pts_tmp->x;
+          ys = (gint) pts_tmp->y;
+          pts_tmp++;
+          xe = (gint) pts_tmp->x;
+          ye = (gint) pts_tmp->y;
+
+          xs *= supersample;
+          ys *= supersample;
+          xe *= supersample;
+          ye *= supersample;
+
+          convert_segment (xs, ys, xe, ye, min_y * supersample,
+                           min_scanlines, max_scanlines);
+        }
+    }
 
   gimp_pixel_rgn_init (&src_rgn, drawable, 0, 0,
                        drawable->width, drawable->height,
@@ -2379,8 +2398,10 @@
                   if (x >= x1 && x < x2)
                     {
                       val = 0;
+
                       for (k = 0; k < supersample; k++)
                         val += vals[j + k];
+
                       val /= supersample2;
 
                       if (val > 0)
@@ -2466,6 +2487,7 @@
     }
 
   polygon_extents (poly, &dmin_x, &dmin_y, &dmax_x, &dmax_y);
+
   min_x = (gint) dmin_x;
   min_y = (gint) dmin_y;
   max_x = (gint) dmax_x;
@@ -2476,6 +2498,7 @@
 
   min_scanlines = g_new (gint, size_y);
   max_scanlines = g_new (gint, size_y);
+
   for (i = 0; i < size_y; i++)
     {
       min_scanlines[i] = max_x * supersample;
@@ -2505,6 +2528,7 @@
     gimp_pixel_rgn_init (&dest_rgn, drawable, 0, 0,
                          drawable->width, drawable->height,
                          TRUE, TRUE);
+
   vals = g_new (gint, size_x);
   for (i = 0; i < size_y; i++)
     {
@@ -2584,11 +2608,13 @@
 
   vec->base_x = x1;
   vec->base_y = y1;
+
   r = sqrt (SQR (x2 - x1) + SQR (y2 - y1));
+
   if (r > 0.0)
     {
       vec->norm_x = -(y2 - y1) / r;
-      vec->norm_y = (x2 - x1) / r;
+      vec->norm_y =  (x2 - x1) / r;
     }
   else
     {
@@ -2654,12 +2680,14 @@
       tmp = y2; y2 = y1; y1 = tmp;
       tmp = x2; x2 = x1; x1 = tmp;
     }
+
   ydiff = y2 - y1;
 
   if (ydiff)
     {
       xinc = (gdouble) (x2 - x1) / (gdouble) ydiff;
       xstart = x1 + 0.5 * xinc;
+
       for (y = y1; y < y2; y++)
         {
           min[y - offset] = MIN (min[y - offset], xstart);
@@ -2682,7 +2710,9 @@
       poly->npts++;
     }
   else
-    g_print ( _("Unable to add additional point.\n"));
+    {
+      g_warning ("can't add more points");
+    }
 }
 
 static gboolean

Modified: branches/soc-2008-text/plug-ins/common/newsprint.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/newsprint.c	(original)
+++ branches/soc-2008-text/plug-ins/common/newsprint.c	Sat Aug 16 23:02:21 2008
@@ -677,7 +677,7 @@
       gtk_widget_set_size_request (preview,
                                    PREVIEW_SIZE, PREVIEW_SIZE);
       gtk_widget_show (preview);
-      g_signal_connect_swapped (preview, "size_allocate",
+      g_signal_connect_swapped (preview, "size-allocate",
                                 G_CALLBACK (preview_update), st);
 
       label = gtk_label_new ("");

Modified: branches/soc-2008-text/plug-ins/common/oilify.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/oilify.c	(original)
+++ branches/soc-2008-text/plug-ins/common/oilify.c	Sat Aug 16 23:02:21 2008
@@ -31,9 +31,9 @@
 #include "libgimp/stdplugins-intl.h"
 
 
-#define OILIFY_PROC          "plug-in-oilify"
-#define OILIFY_ENHANCED_PROC "plug-in-oilify-enhanced"
-#define OILIFY_BINARY        "oilify"
+#define PLUG_IN_PROC          "plug-in-oilify"
+#define PLUG_IN_ENHANCED_PROC "plug-in-oilify-enhanced"
+#define PLUG_IN_BINARY        "oilify"
 
 #define SCALE_WIDTH    125
 #define HISTSIZE       256
@@ -115,7 +115,7 @@
     { GIMP_PDB_DRAWABLE, "exponent-map",  "Exponent control map"           }
   };
 
-  gimp_install_procedure (OILIFY_PROC,
+  gimp_install_procedure (PLUG_IN_PROC,
                           N_("Smear colors to simulate an oil painting"),
                           "This function performs the well-known oil-paint "
                           "effect on the specified drawable.",
@@ -128,9 +128,9 @@
                           G_N_ELEMENTS (args), 0,
                           args, NULL);
 
-  gimp_plugin_menu_register (OILIFY_PROC, "<Image>/Filters/Artistic");
+  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Artistic");
 
-  gimp_install_procedure (OILIFY_ENHANCED_PROC,
+  gimp_install_procedure (PLUG_IN_ENHANCED_PROC,
                           N_("Smear colors to simulate an oil painting"),
                           "This function performs the well-known oil-paint "
                           "effect on the specified drawable.",
@@ -174,7 +174,7 @@
     {
     case GIMP_RUN_INTERACTIVE:
       /*  Possibly retrieve data  */
-      gimp_get_data (OILIFY_PROC, &ovals);
+      gimp_get_data (PLUG_IN_PROC, &ovals);
 
       /*  First acquire information with a dialog  */
       if (! oilify_dialog (drawable))
@@ -183,7 +183,7 @@
 
     case GIMP_RUN_NONINTERACTIVE:
       /*  Interpret the arguments per the name used to invoke us  */
-      if (! strcmp (name, OILIFY_PROC))
+      if (! strcmp (name, PLUG_IN_PROC))
         {
           if (nparams != 5)
             {
@@ -195,7 +195,7 @@
               ovals.mode = param[4].data.d_int32;
             }
         }
-      else if (! strcmp (name, OILIFY_ENHANCED_PROC))
+      else if (! strcmp (name, PLUG_IN_ENHANCED_PROC))
         {
           if (nparams < 5 || nparams > 8)
             {
@@ -232,7 +232,7 @@
 
     case GIMP_RUN_WITH_LAST_VALS:
       /*  Possibly retrieve data  */
-      gimp_get_data (OILIFY_PROC, &ovals);
+      gimp_get_data (PLUG_IN_PROC, &ovals);
       break;
 
     default:
@@ -253,7 +253,7 @@
 
       /*  Store data  */
       if (run_mode == GIMP_RUN_INTERACTIVE)
-        gimp_set_data (OILIFY_PROC, &ovals, sizeof (OilifyVals));
+        gimp_set_data (PLUG_IN_PROC, &ovals, sizeof (OilifyVals));
     }
   else
     {
@@ -772,11 +772,11 @@
   if (! can_use_mode_inten && ovals.mode == MODE_INTEN)
     ovals.mode = MODE_RGB;
 
-  gimp_ui_init (OILIFY_BINARY, FALSE);
+  gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
-  dialog = gimp_dialog_new (_("Oilify"), OILIFY_BINARY,
+  dialog = gimp_dialog_new (_("Oilify"), PLUG_IN_BINARY,
                             NULL, 0,
-                            gimp_standard_help_func, OILIFY_PROC,
+                            gimp_standard_help_func, PLUG_IN_PROC,
 
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/common/pixelize.c
==============================================================================
--- branches/soc-2008-text/plug-ins/common/pixelize.c	(original)
+++ branches/soc-2008-text/plug-ins/common/pixelize.c	Sat Aug 16 23:02:21 2008
@@ -480,8 +480,10 @@
 
           gimp_pixel_rgn_init (&src_rgn, drawable,
                                x, y, x_step, y_step, FALSE, FALSE);
+
           for (b = 0; b < bpp; b++)
             average[b] = 0;
+
           count = 0;
 
           for (pr = gimp_pixel_rgns_register (1, &src_rgn);
@@ -489,9 +491,11 @@
                pr = gimp_pixel_rgns_process (pr))
             {
               src_row = src_rgn.data;
+
               for (row = 0; row < src_rgn.h; row++)
                 {
                   src = src_row;
+
                   if (has_alpha)
                     {
                       for (col = 0; col < src_rgn.w; col++)
@@ -513,14 +517,18 @@
                           src += src_rgn.bpp;
                         }
                     }
+
                   src_row += src_rgn.rowstride;
                 }
+
               count += src_rgn.w * src_rgn.h;
+
               if (!preview)
                 {
                   /* Update progress */
                   progress += src_rgn.w * src_rgn.h;
-                  gimp_progress_update ((double) progress / (double) max_progress);
+                  gimp_progress_update ((gdouble) progress /
+                                        (gdouble) max_progress);
                 }
             }
 
@@ -544,6 +552,7 @@
           if (preview)
             {
               dest_row = dest + ((y - y1) * width + (x - x1)) * bpp;
+
               for (j = 0; j < y_step; j++)
                 {
                   d = dest_row;
@@ -558,27 +567,33 @@
               gimp_pixel_rgn_init (&dest_rgn, drawable,
                                    x, y, x_step, y_step,
                                    TRUE, TRUE);
+
               for (pr = gimp_pixel_rgns_register (1, &dest_rgn);
                    pr != NULL;
                    pr = gimp_pixel_rgns_process (pr))
                 {
                   dest_row = dest_rgn.data;
+
                   for (row = 0; row < dest_rgn.h; row++)
                     {
-                    dest = dest_row;
-                    for (col = 0; col < dest_rgn.w; col++)
-                      {
-                        for (b = 0; b < bpp; b++)
-                          dest[b] = average[b];
-
-                        dest  += dest_rgn.bpp;
-                      }
-                    dest_row += dest_rgn.rowstride;
-                  }
-                /* Update progress */
-                progress += dest_rgn.w * dest_rgn.h;
-                gimp_progress_update ((double) progress / (double) max_progress);
-              }
+                      dest = dest_row;
+
+                      for (col = 0; col < dest_rgn.w; col++)
+                        {
+                          for (b = 0; b < bpp; b++)
+                            dest[b] = average[b];
+
+                          dest  += dest_rgn.bpp;
+                        }
+
+                      dest_row += dest_rgn.rowstride;
+                    }
+
+                  /* Update progress */
+                  progress += dest_rgn.w * dest_rgn.h;
+                  gimp_progress_update ((gdouble) progress /
+                                        (gdouble) max_progress);
+                }
             }
         }
     }
@@ -657,7 +672,7 @@
           /* Update progress */
           progress += area.w * area.h;
           gimp_progress_update ((double) progress / (double) max_progress);
-      }
+        }
     }
 
   g_free(area.data);
@@ -701,6 +716,7 @@
 
           for (i = 0; i < bpp; i++)
             average[i] = 0;
+
           count = 0;
 
           /* Read */
@@ -709,6 +725,7 @@
           for (row = 0; row < h; row++)
             {
               buf = buf_row;
+
               if (has_alpha)
                 {
                   for (col = 0; col < w; col++)
@@ -716,8 +733,10 @@
                       gulong alpha = buf[bpp-1];
 
                       average[bpp-1] += alpha;
+
                       for (i = 0; i < bpp-1; i++)
-                          average[i] += buf[i] * alpha;
+                        average[i] += buf[i] * alpha;
+
                       buf += bpp;
                     }
                 }
@@ -726,14 +745,16 @@
                   for (col = 0; col < w; col++)
                     {
                       for (i = 0; i < bpp; i++)
-                          average[i] += buf[i];
+                        average[i] += buf[i];
+
                       buf += bpp;
                     }
                 }
+
               buf_row += rowstride;
             }
 
-          count += w*h;
+          count += w * h;
 
           /* Average */
           if (count > 0)
@@ -761,6 +782,7 @@
           for (row = 0; row < h; row++)
             {
               buf = buf_row;
+
               for (col = 0; col < w; col++)
                 {
                   for (i = 0; i < bpp; i++)
@@ -769,6 +791,7 @@
                   count++;
                   buf += bpp;
                 }
+
               buf_row += rowstride;
             }
         }

Modified: branches/soc-2008-text/plug-ins/common/plugin-defs.pl
==============================================================================
--- branches/soc-2008-text/plug-ins/common/plugin-defs.pl	(original)
+++ branches/soc-2008-text/plug-ins/common/plugin-defs.pl	Sat Aug 16 23:02:21 2008
@@ -1,5 +1,4 @@
 %plugins = (
-    'aa' => { ui => 1, optional => 1 },
     'alien-map' => { ui => 1 },
     'align-layers' => { ui => 1 },
     'animation-optimize' => {},
@@ -14,7 +13,6 @@
     'border-average' => { ui => 1 },
     'bump-map' => { ui => 1 },
     'cartoon' => { ui => 1 },
-    'cel' => { ui => 1 },
     'channel-mixer' => { ui => 1 },
     'checkerboard' => { ui => 1 },
     'cml-explorer' => { ui => 1 },
@@ -33,51 +31,71 @@
     'convolution-matrix' => { ui => 1 },
     'crop-auto' => {},
     'crop-zealous' => {},
-    'csource' => { ui => 1 },
     'cubism' => { ui => 1 },
     'curve-bend' => { ui => 1 },
     'decompose' => { ui => 1 },
     'deinterlace' => { ui => 1 },
     'depth-merge' => { ui => 1 },
-    'desktop-link' => {},
     'despeckle' => { ui => 1 },
     'destripe' => { ui => 1 },
-    'dicom' => { ui => 1 },
     'diffraction' => { ui => 1 },
     'displace' => { ui => 1 },
     'edge' => { ui => 1 },
     'edge-dog' => { ui => 1 },
-    'edge-neon' => { ui => 1 },
     'edge-laplace' => {},
+    'edge-neon' => { ui => 1 },
     'edge-sobel' => { ui => 1 },
     'emboss' => { ui => 1 },
     'engrave' => { ui => 1 },
+    'file-aa' => { ui => 1, optional => 1, libs => 'AA_LIBS' },
+    'file-cel' => { ui => 1 },
+    'file-csource' => { ui => 1 },
+    'file-desktop-link' => {},
+    'file-dicom' => { ui => 1 },
+    'file-gbr' => { ui => 1 },
+    'file-gif-load' => {},
+    'file-gif-save' => { ui => 1 },
+    'file-gih' => { ui => 1 },
+    'file-glob' => {},
+    'file-header' => { ui => 1 },
+    'file-html-table' => { ui => 1 },
+    'file-mng' => { ui => 1, optional => 1, libs => 'MNG_LIBS' },
+    'file-pat' => { ui => 1 },
+    'file-pcx' => { ui => 1 },
+    'file-pix' => { ui => 1 },
+    'file-png' => { ui => 1, optional => 1, libs => 'PNG_LIBS', cflags => 'PNG_CFLAGS' },
+    'file-pnm' => { ui => 1 },
+    'file-pdf' => { ui => 1, optional => 1, libs => 'POPPLER_LIBS', cflags => 'POPPLER_CFLAGS' },
+    'file-ps' => { ui => 1 },
+    'file-psp' => { ui => 1, optional => 1, libs => 'Z_LIBS' },
+    'file-raw' => { ui => 1 },
+    'file-sunras' => { ui => 1 },
+    'file-svg' => { ui => 1, optional => 1, libs => 'SVG_LIBS', cflags => 'SVG_CFLAGS' },
+    'file-tga' => { ui => 1 },
+    'file-tiff-load' => { ui => 1, optional => 1, libs => 'TIFF_LIBS' },
+    'file-tiff-save' => { ui => 1, optional => 1, libs => 'TIFF_LIBS' },
+    'file-wmf' => { ui => 1, optional => 1, libs => 'WMF_LIBS', cflags => 'WMF_CFLAGS' },
+    'file-xbm' => { ui => 1 },
+    'file-xpm' => { ui => 1, optional => 1, libs => 'XPM_LIBS' },
+    'file-xwd' => {  ui => 1 },
     'film' => { ui => 1 },
     'filter-pack' => { ui => 1 },
     'fractal-trace' => { ui => 1 },
-    'gbr' => { ui => 1 },
     'gee' => { ui => 1 },
     'gee-zoom' => { ui => 1 },
-    'gif-load' => {},
-    'gif-save' => { ui => 1 },
-    'gih' => { ui => 1 },
-    'glob' => {},
     'gradient-map' => {},
     'grid' => { ui => 1 },
     'guillotine' => {},
-    'header' => { ui => 1 },
     'hot' => { ui => 1 },
-    'html-table' => { ui => 1 },
     'illusion' => { ui => 1 },
     'iwarp' => { ui => 1 },
     'jigsaw' => { ui => 1 },
-    'lcms' => { ui => 1, optional => 1 },
+    'lcms' => { ui => 1, optional => 1, libs => 'LCMS_LIBS', cflags => 'LCMS_CFLAGS' },
     'lens-apply' => { ui => 1 },
     'lens-distortion' => { ui => 1 },
     'lens-flare' => { ui => 1 },
     'mail' => { ui => 1, optional => 1 },
     'max-rgb' => { ui => 1 },
-    'mng' => { ui => 1, optional => 1 },
     'mosaic' => { ui => 1 },
     'newsprint' => { ui => 1 },
     'nl-filter' => { ui => 1 },
@@ -88,27 +106,18 @@
     'noise-spread' => { ui => 1 },
     'nova' => { ui => 1 },
     'oilify' => { ui => 1 },
-    'pat' => { ui => 1 },
-    'pcx' => { ui => 1 },
     'photocopy' => { ui => 1 },
-    'pix' => { ui => 1 },
     'pixelize' => { ui => 1 },
     'plasma' => { ui => 1 },
     'plugin-browser' => { ui => 1 },
-    'png' => { ui => 1, optional => 1, cflags => 1 },
-    'pnm' => { ui => 1 },
     'polar-coords' => { ui => 1 },
-    'poppler' => { ui => 1, optional => 1, cflags => 1 },
-    'postscript' => { ui => 1 },
     'procedure-browser' => { ui => 1 },
-    'psp' => { ui => 1, optional => 1, libopt => 'z' },
     'qbist' => { ui => 1 },
-    'raw' => { ui => 1 },
     'red-eye-removal' => { ui => 1 },
     'ripple' => { ui => 1 },
     'rotate' => {},
     'sample-colorize' => { ui => 1 },
-    'screenshot' => { ui => 1, optional => 1, cflags => XFIXES_CFLAGS },
+    'screenshot' => { ui => 1, optional => 1, libs => 'SCREENSHOT_LIBS', cflags => 'XFIXES_CFLAGS' },
     'semi-flatten' => {},
     'sharpen' => { ui => 1 },
     'shift' => { ui => 1 },
@@ -117,12 +126,7 @@
     'softglow' => { ui => 1 },
     'sparkle' => { ui => 1 },
     'sphere-designer' => { ui => 1 },
-    'sunras' => { ui => 1 },
-    'svg' => { ui => 1, optional => 1, cflags => 1 },
-    'tga' => { ui => 1 },
     'threshold-alpha' => { ui => 1 },
-    'tiff-load' => { ui => 1, optional => 1, libs => 'LIBTIFF' },
-    'tiff-save' => { ui => 1, optional => 1, libs => 'LIBTIFF' },
     'tile' => { ui => 1 },
     'tile-glass' => { ui => 1 },
     'tile-paper' => { ui => 1 },
@@ -138,9 +142,5 @@
     'waves' => { ui => 1 },
     'web-browser' => {},
     'whirl-pinch' => { ui => 1 },
-    'wind' => { ui => 1 },
-    'wmf' => { ui => 1, optional => 1, cflags => 1 },
-    'xbm' => { ui => 1 },
-    'xpm' => { ui => 1, optional => 1 },
-    'xwd' => {  ui => 1 }
+    'wind' => { ui => 1 }
 );

Modified: branches/soc-2008-text/plug-ins/flame/flame.c
==============================================================================
--- branches/soc-2008-text/plug-ins/flame/flame.c	(original)
+++ branches/soc-2008-text/plug-ins/flame/flame.c	Sat Aug 16 23:02:21 2008
@@ -36,6 +36,7 @@
 
 
 #define PLUG_IN_PROC      "plug-in-flame"
+#define PLUG_IN_BINARY    "flame"
 
 #define VARIATION_SAME    (-2)
 
@@ -642,7 +643,7 @@
       GtkObject *adj;
       gint       i, j;
 
-      edit_dialog = gimp_dialog_new (_("Edit Flame"), "flame",
+      edit_dialog = gimp_dialog_new (_("Edit Flame"), PLUG_IN_BINARY,
                                      parent, GTK_DIALOG_DESTROY_WITH_PARENT,
                                      gimp_standard_help_func, PLUG_IN_PROC,
 
@@ -962,9 +963,9 @@
   GtkObject *adj;
   gboolean   run;
 
-  gimp_ui_init ("flame", TRUE);
+  gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
-  dialog = gimp_dialog_new (_("Flame"), "flame",
+  dialog = gimp_dialog_new (_("Flame"), PLUG_IN_BINARY,
                             NULL, 0,
                             gimp_standard_help_func, PLUG_IN_PROC,
 

Modified: branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
==============================================================================
--- branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer-dialogs.c	(original)
+++ branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer-dialogs.c	Sat Aug 16 23:02:21 2008
@@ -528,7 +528,7 @@
   GSList    *group = NULL;
   gint       i;
 
-  gimp_ui_init ("fractal-explorer", TRUE);
+  gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
   path = gimp_gimprc_query ("fractalexplorer-path");
 
@@ -560,9 +560,9 @@
   elements    = g_new (DialogElements, 1);
 
   dialog = maindlg =
-    gimp_dialog_new ("Fractal Explorer", "fractal-explorer",
+    gimp_dialog_new ("Fractal Explorer", PLUG_IN_BINARY,
                      NULL, 0,
-                     gimp_standard_help_func, HELP_ID,
+                     gimp_standard_help_func, PLUG_IN_PROC,
 
                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                      GTK_STOCK_OK,     GTK_RESPONSE_OK,
@@ -1189,7 +1189,7 @@
   cmap_preview = gimp_preview_area_new ();
   gtk_widget_set_size_request (cmap_preview, 32, 32);
   gtk_container_add (GTK_CONTAINER (abox), cmap_preview);
-  g_signal_connect (cmap_preview, "size_allocate",
+  g_signal_connect (cmap_preview, "size-allocate",
                     G_CALLBACK (cmap_preview_size_allocate), NULL);
   gtk_widget_show (cmap_preview);
 

Modified: branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.c
==============================================================================
--- branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.c	(original)
+++ branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.c	Sat Aug 16 23:02:21 2008
@@ -71,8 +71,6 @@
 #include "libgimp/stdplugins-intl.h"
 
 
-#define PLUG_IN_PROC  "plug-in-fractalexplorer"
-
 /**********************************************************************
   Global variables
  *********************************************************************/
@@ -1047,7 +1045,7 @@
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
-  g_signal_connect (view, "row_activated",
+  g_signal_connect (view, "row-activated",
                     G_CALLBACK (activate_fractal_callback),
                     NULL);
   gtk_container_add (GTK_CONTAINER (scrolled_win), view);
@@ -1113,10 +1111,10 @@
       return;
     }
 
-  dlg = gimp_dialog_new (_("Rescan for Fractals"), "fractalexplorer",
+  dlg = gimp_dialog_new (_("Rescan for Fractals"), PLUG_IN_BINARY,
                          gtk_widget_get_toplevel (view),
                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-                         gimp_standard_help_func, NULL,
+                         gimp_standard_help_func, PLUG_IN_PROC,
 
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.h
==============================================================================
--- branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.h	(original)
+++ branches/soc-2008-text/plug-ins/fractal-explorer/fractal-explorer.h	Sat Aug 16 23:02:21 2008
@@ -15,7 +15,8 @@
 #define MAXNCOLORS 8192
 #define MAXSTRLEN 256
 
-#define HELP_ID "plug-in-fractalexplorer"
+#define PLUG_IN_PROC   "plug-in-fractalexplorer"
+#define PLUG_IN_BINARY "fractal-explorer"
 
 #define FRACTAL_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting mygale org>\n"
 #define fractalexplorer_HEADER "Fractal Explorer Plug-In Version 2 - (c) 1997 <cotting mygale org>\n"

Modified: branches/soc-2008-text/plug-ins/gimpressionist/gimp.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/gimp.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/gimp.c	Sat Aug 16 23:02:21 2008
@@ -86,7 +86,7 @@
     { GIMP_PDB_STRING,   "preset",    "Preset Name"    },
   };
 
-  gimp_install_procedure (PLUG_IN_NAME,
+  gimp_install_procedure (PLUG_IN_PROC,
                           N_("Performs various artistic operations"),
                           "Performs various artistic operations on an image",
                           "Vidar Madsen <vidar prosalg no>",
@@ -98,14 +98,14 @@
                           G_N_ELEMENTS (args), 0,
                           args, NULL);
 
-  gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Artistic");
+  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Artistic");
 }
 
 static void
 gimpressionist_get_data (void)
 {
   restore_default_values ();
-  gimp_get_data (PLUG_IN_NAME, &pcvals);
+  gimp_get_data (PLUG_IN_PROC, &pcvals);
 }
 
 static void
@@ -204,7 +204,7 @@
           gimp_displays_flush ();
 
           if (run_mode == GIMP_RUN_INTERACTIVE)
-            gimp_set_data (PLUG_IN_NAME,
+            gimp_set_data (PLUG_IN_PROC,
                            &pcvals,
                            sizeof (gimpressionist_vals_t));
         }

Modified: branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.c	Sat Aug 16 23:02:21 2008
@@ -134,11 +134,11 @@
   GtkWidget *hbox;
   GtkWidget *preview_box;
 
-  gimp_ui_init ("gimpressionist", TRUE);
+  gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
-  dialog = gimp_dialog_new (_("GIMPressionist"), "gimpressionist",
+  dialog = gimp_dialog_new (_("GIMPressionist"), PLUG_IN_BINARY,
                             NULL, 0,
-                            gimp_standard_help_func, PLUG_IN_NAME,
+                            gimp_standard_help_func, PLUG_IN_PROC,
 
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/gimpressionist.h	Sat Aug 16 23:02:21 2008
@@ -26,8 +26,9 @@
 #include "ppmtool.h"
 /* Defines */
 
-#define PLUG_IN_NAME    "plug-in-gimpressionist"
+#define PLUG_IN_PROC    "plug-in-gimpressionist"
 #define PLUG_IN_VERSION "v1.0, November 2003"
+#define PLUG_IN_BINARY  "gimpressionist"
 
 #define PREVIEWSIZE     150
 #define MAXORIENTVECT   50

Modified: branches/soc-2008-text/plug-ins/gimpressionist/orientmap.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/orientmap.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/orientmap.c	Sat Aug 16 23:02:21 2008
@@ -523,9 +523,9 @@
     }
 
   orient_map_window =
-    gimp_dialog_new (_("Orientation Map Editor"), "gimpressionist",
+    gimp_dialog_new (_("Orientation Map Editor"), PLUG_IN_BINARY,
                      gtk_widget_get_toplevel (parent), 0,
-                     gimp_standard_help_func, PLUG_IN_NAME,
+                     gimp_standard_help_func, PLUG_IN_PROC,
 
                      GTK_STOCK_APPLY,  GTK_RESPONSE_APPLY,
                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,

Modified: branches/soc-2008-text/plug-ins/gimpressionist/presets.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/presets.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/presets.c	Sat Aug 16 23:02:21 2008
@@ -635,9 +635,9 @@
     }
 
   window =
-    gimp_dialog_new (_("Save Current"), "gimpressionist",
+    gimp_dialog_new (_("Save Current"), PLUG_IN_BINARY,
                      gtk_widget_get_toplevel (parent), 0,
-                     gimp_standard_help_func, PLUG_IN_NAME,
+                     gimp_standard_help_func, PLUG_IN_PROC,
 
                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                      GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/gimpressionist/sizemap.c
==============================================================================
--- branches/soc-2008-text/plug-ins/gimpressionist/sizemap.c	(original)
+++ branches/soc-2008-text/plug-ins/gimpressionist/sizemap.c	Sat Aug 16 23:02:21 2008
@@ -398,9 +398,9 @@
     }
 
   smwindow =
-    gimp_dialog_new (_("Size Map Editor"), "gimpressionist",
+    gimp_dialog_new (_("Size Map Editor"), PLUG_IN_BINARY,
                      gtk_widget_get_toplevel (parent), 0,
-                     gimp_standard_help_func, PLUG_IN_NAME,
+                     gimp_standard_help_func, PLUG_IN_PROC,
 
                      GTK_STOCK_APPLY,  RESPONSE_APPLY,
                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,

Modified: branches/soc-2008-text/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-text/plug-ins/help-browser/dialog.c	(original)
+++ branches/soc-2008-text/plug-ins/help-browser/dialog.c	Sat Aug 16 23:02:21 2008
@@ -162,7 +162,7 @@
 /*  public functions  */
 
 void
-browser_dialog_open (void)
+browser_dialog_open (const gchar *plug_in_binary)
 {
   GtkWidget   *window;
   GtkWidget   *main_vbox;
@@ -175,14 +175,14 @@
   GtkAction   *action;
   DialogData   data = { 720, 560, 240, TRUE, 1.0 };
 
-  gimp_ui_init ("helpbrowser", TRUE);
+  gimp_ui_init (plug_in_binary, TRUE);
 
   gimp_get_data (GIMP_HELP_BROWSER_DIALOG_DATA, &data);
 
   /*  the dialog window  */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser"));
-  gtk_window_set_role (GTK_WINDOW (window), "help-browser");
+  gtk_window_set_role (GTK_WINDOW (window), plug_in_binary);
 
   gtk_window_set_default_size (GTK_WINDOW (window), data.width, data.height);
 
@@ -1202,11 +1202,17 @@
 search_entry_key_press (GtkWidget   *entry,
                         GdkEventKey *event)
 {
-  if (event->keyval == GDK_Escape)
+  switch (event->keyval)
     {
+    case GDK_Escape:
       gtk_widget_hide (searchbar);
       webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (view));
+      return TRUE;
 
+    case GDK_Return:
+    case GDK_KP_Enter:
+    case GDK_ISO_Enter:
+      search (gtk_entry_get_text (GTK_ENTRY (entry)), TRUE);
       return TRUE;
     }
 

Modified: branches/soc-2008-text/plug-ins/help-browser/dialog.h
==============================================================================
--- branches/soc-2008-text/plug-ins/help-browser/dialog.h	(original)
+++ branches/soc-2008-text/plug-ins/help-browser/dialog.h	Sat Aug 16 23:02:21 2008
@@ -26,7 +26,7 @@
 #define __DIALOG_H__
 
 
-void   browser_dialog_open       (void);
+void   browser_dialog_open       (const gchar    *plug_in_binary);
 void   browser_dialog_load       (const gchar    *uri);
 
 void   browser_dialog_make_index (GimpHelpDomain *domain,

Modified: branches/soc-2008-text/plug-ins/help-browser/help-browser.c
==============================================================================
--- branches/soc-2008-text/plug-ins/help-browser/help-browser.c	(original)
+++ branches/soc-2008-text/plug-ins/help-browser/help-browser.c	Sat Aug 16 23:02:21 2008
@@ -42,6 +42,7 @@
 
 #define GIMP_HELP_BROWSER_EXT_PROC       "extension-gimp-help-browser"
 #define GIMP_HELP_BROWSER_TEMP_EXT_PROC  "extension-gimp-help-browser-temp"
+#define PLUG_IN_BINARY                   "help-browser"
 
 
 /*  forward declarations  */
@@ -149,7 +150,7 @@
 
           if (status == GIMP_PDB_SUCCESS)
             {
-              browser_dialog_open ();
+              browser_dialog_open (PLUG_IN_BINARY);
 
               temp_proc_install ();
 

Modified: branches/soc-2008-text/plug-ins/help/gimphelplocale.c
==============================================================================
--- branches/soc-2008-text/plug-ins/help/gimphelplocale.c	(original)
+++ branches/soc-2008-text/plug-ins/help/gimphelplocale.c	Sat Aug 16 23:02:21 2008
@@ -235,7 +235,7 @@
 
   if (! stream)
     {
-      locale_set_error (error, 
+      locale_set_error (error,
                         _("Could not open '%s' for reading: %s"), file);
       g_object_unref (file);
 

Modified: branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose.c
==============================================================================
--- branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose.c	(original)
+++ branches/soc-2008-text/plug-ins/ifs-compose/ifs-compose.c	Sat Aug 16 23:02:21 2008
@@ -53,8 +53,9 @@
 
 #define UNDO_LEVELS             24
 
-#define IFSCOMPOSE_PARASITE "ifscompose-parasite"
-#define IFSCOMPOSE_PROC     "plug-in-ifscompose"
+#define PLUG_IN_PARASITE "ifscompose-parasite"
+#define PLUG_IN_PROC     "plug-in-ifscompose"
+#define PLUG_IN_BINARY   "ifs-compose"
 
 typedef enum
 {
@@ -329,7 +330,7 @@
   static const GimpParamDef *return_vals = NULL;
   static int nreturn_vals = 0;
 
-  gimp_install_procedure (IFSCOMPOSE_PROC,
+  gimp_install_procedure (PLUG_IN_PROC,
                           N_("Create an Iterated Function System (IFS) fractal"),
                           "Interactively create an Iterated Function System "
                           "fractal. Use the window on the upper left to adjust "
@@ -348,7 +349,7 @@
                           G_N_ELEMENTS (args), nreturn_vals,
                           args, return_vals);
 
-  gimp_plugin_menu_register (IFSCOMPOSE_PROC,
+  gimp_plugin_menu_register (PLUG_IN_PROC,
                              "<Image>/Filters/Render/Nature");
 }
 
@@ -387,7 +388,7 @@
        *  if not found, fall back to global values
        */
       parasite = gimp_drawable_parasite_find (drawable->drawable_id,
-                                              IFSCOMPOSE_PARASITE);
+                                              PLUG_IN_PARASITE);
       if (parasite)
         {
           found_parasite = ifsvals_parse_string (gimp_parasite_data (parasite),
@@ -397,13 +398,13 @@
 
       if (!found_parasite)
         {
-          gint length = gimp_get_data_size (IFSCOMPOSE_PROC);
+          gint length = gimp_get_data_size (PLUG_IN_PROC);
 
           if (length > 0)
             {
               gchar *data = g_new (gchar, length);
 
-              gimp_get_data (IFSCOMPOSE_PROC, data);
+              gimp_get_data (PLUG_IN_PROC, data);
               ifsvals_parse_string (data, &ifsvals, &elements);
               g_free (data);
             }
@@ -423,13 +424,13 @@
 
     case GIMP_RUN_WITH_LAST_VALS:
       {
-        gint length = gimp_get_data_size (IFSCOMPOSE_PROC);
+        gint length = gimp_get_data_size (PLUG_IN_PROC);
 
         if (length > 0)
           {
             gchar *data = g_new (gchar, length);
 
-            gimp_get_data (IFSCOMPOSE_PROC, data);
+            gimp_get_data (PLUG_IN_PROC, data);
             ifsvals_parse_string (data, &ifsvals, &elements);
             g_free (data);
           }
@@ -468,9 +469,9 @@
            */
           str = ifsvals_stringify (&ifsvals, elements);
 
-          gimp_set_data (IFSCOMPOSE_PROC, str, strlen (str) + 1);
+          gimp_set_data (PLUG_IN_PROC, str, strlen (str) + 1);
 
-          parasite = gimp_parasite_new (IFSCOMPOSE_PARASITE,
+          parasite = gimp_parasite_new (PLUG_IN_PARASITE,
                                         GIMP_PARASITE_PERSISTENT |
                                         GIMP_PARASITE_UNDOABLE,
                                         strlen (str) + 1, str);
@@ -764,11 +765,11 @@
   ifsD->preview_width   = design_width;
   ifsD->preview_height  = design_height;
 
-  gimp_ui_init ("ifscompose", TRUE);
+  gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
-  dialog = gimp_dialog_new (_("IFS Fractal"), "ifscompose",
+  dialog = gimp_dialog_new (_("IFS Fractal"), PLUG_IN_BINARY,
                             NULL, 0,
-                            gimp_standard_help_func, IFSCOMPOSE_PROC,
+                            gimp_standard_help_func, PLUG_IN_PROC,
 
                             GTK_STOCK_OPEN,   RESPONSE_OPEN,
                             GTK_STOCK_SAVE,   RESPONSE_SAVE,
@@ -1173,8 +1174,9 @@
       ifsOptD = g_new0 (IfsOptionsDialog, 1);
 
       ifsOptD->dialog =
-        gimp_dialog_new (_("IFS Fractal Render Options"), "ifscompose",
-                         parent, 0, NULL, NULL,
+        gimp_dialog_new (_("IFS Fractal Render Options"), PLUG_IN_BINARY,
+                         parent, 0,
+                         gimp_standard_help_func, PLUG_IN_PROC,
 
                          GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
 

Modified: branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_default_dialog.c	Sat Aug 16 23:02:21 2008
@@ -93,11 +93,9 @@
    data->apply_cb = NULL;
    data->cancel_cb = NULL;
 
-   data->dialog = gimp_dialog_new (title, "imagemap",
+   data->dialog = gimp_dialog_new (title, PLUG_IN_BINARY,
                                    get_dialog(), 0,
-                                   /* gimp_standard_help_func,
-                                      "plug-in-imagemap", */
-                                   gimp_standard_help_func, NULL,
+                                   gimp_standard_help_func, PLUG_IN_PROC,
                                    NULL);
 
    data->apply = gtk_dialog_add_button (GTK_DIALOG (data->dialog),

Modified: branches/soc-2008-text/plug-ins/imagemap/imap_main.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_main.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_main.c	Sat Aug 16 23:02:21 2008
@@ -61,8 +61,6 @@
 #define ZOOMED(x) (_zoom_factor * (x))
 #define GET_REAL_COORD(x) ((x) / _zoom_factor)
 
-#define PLUG_IN_PROC "plug-in-imagemap"
-
 static gint             zoom_in         (void);
 static gint             zoom_out        (void);
 
@@ -1260,7 +1258,7 @@
    GtkWidget    *tools;
    Menu_t       *menu;
 
-   gimp_ui_init ("imagemap", TRUE);
+   gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
    set_arrow_func ();
 
@@ -1270,18 +1268,18 @@
    gtk_window_set_resizable(GTK_WINDOW(dlg), TRUE);
 
    main_set_title(NULL);
-   gimp_help_connect (dlg, gimp_standard_help_func, "plug-in-imagemap", NULL);
+   gimp_help_connect (dlg, gimp_standard_help_func, PLUG_IN_PROC, NULL);
 
-   gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE);
+   gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
 
    gimp_window_set_transient (GTK_WINDOW (dlg));
 
-   g_signal_connect(dlg, "delete-event",
-                    G_CALLBACK(close_callback), NULL);
-   g_signal_connect(dlg, "key-press-event",
-                    G_CALLBACK(key_press_cb), NULL);
-   g_signal_connect(dlg, "key_release_event",
-                    G_CALLBACK(key_release_cb), NULL);
+   g_signal_connect (dlg, "delete-event",
+                     G_CALLBACK (close_callback), NULL);
+   g_signal_connect (dlg, "key-press-event",
+                     G_CALLBACK (key_press_cb), NULL);
+   g_signal_connect (dlg, "key-release-event",
+                     G_CALLBACK (key_release_cb), NULL);
 
    g_signal_connect (dlg, "destroy",
                      G_CALLBACK (gtk_main_quit),

Modified: branches/soc-2008-text/plug-ins/imagemap/imap_main.h
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_main.h	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_main.h	Sat Aug 16 23:02:21 2008
@@ -28,6 +28,9 @@
 #include "imap_object.h"
 #include "imap_preferences.h"
 
+#define PLUG_IN_PROC   "plug-in-imagemap"
+#define PLUG_IN_BINARY "imagemap"
+
 typedef enum {NCSA, CERN, CSIM} MapFormat_t;
 
 typedef struct {

Modified: branches/soc-2008-text/plug-ins/imagemap/imap_selection.c
==============================================================================
--- branches/soc-2008-text/plug-ins/imagemap/imap_selection.c	(original)
+++ branches/soc-2008-text/plug-ins/imagemap/imap_selection.c	Sat Aug 16 23:02:21 2008
@@ -435,7 +435,7 @@
   /* Drop support */
   gtk_drag_dest_set (list, GTK_DEST_DEFAULT_ALL, target_table, 2,
 		     GDK_ACTION_COPY);
-  g_signal_connect (list, "drag_data_received", G_CALLBACK(handle_drop), NULL);
+  g_signal_connect (list, "drag-data-received", G_CALLBACK(handle_drop), NULL);
 
   /* For handling doubleclick */
 

Modified: branches/soc-2008-text/plug-ins/lighting/lighting-main.c
==============================================================================
--- branches/soc-2008-text/plug-ins/lighting/lighting-main.c	(original)
+++ branches/soc-2008-text/plug-ins/lighting/lighting-main.c	Sat Aug 16 23:02:21 2008
@@ -36,9 +36,6 @@
 #include "libgimp/stdplugins-intl.h"
 
 
-#define PLUG_IN_PROC "plug-in-lighting"
-
-
 LightingValues mapvals;
 
 /******************/

Modified: branches/soc-2008-text/plug-ins/lighting/lighting-main.h
==============================================================================
--- branches/soc-2008-text/plug-ins/lighting/lighting-main.h	(original)
+++ branches/soc-2008-text/plug-ins/lighting/lighting-main.h	Sat Aug 16 23:02:21 2008
@@ -4,6 +4,9 @@
 /* Defines and stuff */
 /* ================= */
 
+#define PLUG_IN_PROC   "plug-in-lighting"
+#define PLUG_IN_BINARY "lighting"
+
 #define TILE_CACHE_SIZE 16
 #define NUM_LIGHTS      6
 

Modified: branches/soc-2008-text/plug-ins/lighting/lighting-ui.c
==============================================================================
--- branches/soc-2008-text/plug-ins/lighting/lighting-ui.c	(original)
+++ branches/soc-2008-text/plug-ins/lighting/lighting-ui.c	Sat Aug 16 23:02:21 2008
@@ -1005,7 +1005,7 @@
   GtkWidget *image;
   */
 
-  gimp_ui_init ("Lighting", FALSE);
+  gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
   path = gimp_gimprc_query ("lighting-effects-path");
   if (path)
@@ -1016,9 +1016,9 @@
 
   lighting_stock_init ();
 
-  appwin = gimp_dialog_new (_("Lighting Effects"), "Lighting",
+  appwin = gimp_dialog_new (_("Lighting Effects"), PLUG_IN_BINARY,
                             NULL, 0,
-                            gimp_standard_help_func, "plug-in-lighting",
+                            gimp_standard_help_func, PLUG_IN_PROC,
 
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/map-object/map-object-main.c
==============================================================================
--- branches/soc-2008-text/plug-ins/map-object/map-object-main.c	(original)
+++ branches/soc-2008-text/plug-ins/map-object/map-object-main.c	Sat Aug 16 23:02:21 2008
@@ -36,9 +36,6 @@
 #include "libgimp/stdplugins-intl.h"
 
 
-#define PLUG_IN_PROC "plug-in-map-object"
-
-
 /* Global variables */
 /* ================ */
 

Modified: branches/soc-2008-text/plug-ins/map-object/map-object-main.h
==============================================================================
--- branches/soc-2008-text/plug-ins/map-object/map-object-main.h	(original)
+++ branches/soc-2008-text/plug-ins/map-object/map-object-main.h	Sat Aug 16 23:02:21 2008
@@ -4,6 +4,9 @@
 /* Defines and stuff */
 /* ================= */
 
+#define PLUG_IN_PROC   "plug-in-map-object"
+#define PLUG_IN_BINARY "map-object"
+
 #define TILE_CACHE_SIZE 16
 
 /* Typedefs */

Modified: branches/soc-2008-text/plug-ins/map-object/map-object-ui.c
==============================================================================
--- branches/soc-2008-text/plug-ins/map-object/map-object-ui.c	(original)
+++ branches/soc-2008-text/plug-ins/map-object/map-object-ui.c	Sat Aug 16 23:02:21 2008
@@ -1330,11 +1330,11 @@
   GimpZoomModel *model;
   gboolean       run = FALSE;
 
-  gimp_ui_init ("map-object", FALSE);
+  gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
-  appwin = gimp_dialog_new (_("Map to Object"), "map-object",
+  appwin = gimp_dialog_new (_("Map to Object"), PLUG_IN_BINARY,
                             NULL, 0,
-			    gimp_standard_help_func, "plug-in-map-object",
+			    gimp_standard_help_func, PLUG_IN_PROC,
 
 			    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 			    GTK_STOCK_OK,     GTK_RESPONSE_OK,

Modified: branches/soc-2008-text/plug-ins/print/print.c
==============================================================================
--- branches/soc-2008-text/plug-ins/print/print.c	(original)
+++ branches/soc-2008-text/plug-ins/print/print.c	Sat Aug 16 23:02:21 2008
@@ -60,7 +60,7 @@
                                              PrintData         *data);
 static void        end_print                (GtkPrintOperation *operation,
                                              GtkPrintContext   *context,
-                                             gint32            *image_ID);
+                                             gint32            *layer_ID);
 static void        draw_page                (GtkPrintOperation *print,
                                              GtkPrintContext   *context,
                                              gint               page_nr,
@@ -189,32 +189,24 @@
              gboolean  interactive)
 {
   GtkPrintOperation *operation;
-  GError            *error         = NULL;
-  gint32             orig_image_ID = image_ID;
-  gint32             drawable_ID   = gimp_image_get_active_drawable (image_ID);
   gchar             *temp_proc;
+  GError            *error = NULL;
+  gint32             layer;
   PrintData          data;
-  GimpExportReturn   export;
 
-  /* export the image */
-  export = gimp_export_image (&image_ID, &drawable_ID, NULL,
-                              GIMP_EXPORT_CAN_HANDLE_RGB   |
-                              GIMP_EXPORT_CAN_HANDLE_GRAY  |
-                              GIMP_EXPORT_CAN_HANDLE_ALPHA);
-
-  if (export == GIMP_EXPORT_CANCEL)
-    return GIMP_PDB_EXECUTION_ERROR;
+  /*  create a print layer from the projection  */
+  layer = gimp_layer_new_from_visible (image_ID, image_ID, PRINT_PROC_NAME);
 
   operation = gtk_print_operation_new ();
 
   gtk_print_operation_set_n_pages (operation, 1);
-  print_operation_set_name (operation, orig_image_ID);
+  print_operation_set_name (operation, image_ID);
 
-  print_page_setup_load (operation, orig_image_ID);
+  print_page_setup_load (operation, image_ID);
 
   /* fill in the PrintData struct */
-  data.image_id      = orig_image_ID;
-  data.drawable_id   = drawable_ID;
+  data.image_id      = image_ID;
+  data.drawable_id   = layer;
   data.unit          = gimp_get_default_unit ();
   data.image_unit    = gimp_image_get_unit (image_ID);
   data.offset_x      = 0;
@@ -227,9 +219,6 @@
 
   print_settings_load (&data);
 
-  if (export != GIMP_EXPORT_EXPORT)
-    image_ID = -1;
-
   gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);
 
   g_signal_connect (operation, "begin-print",
@@ -243,7 +232,7 @@
                     &image_ID);
 
   print_operation = operation;
-  temp_proc = print_temp_proc_install (orig_image_ID);
+  temp_proc = print_temp_proc_install (image_ID);
   gimp_extension_enable ();
 
   if (interactive)
@@ -277,8 +266,8 @@
 
   g_object_unref (operation);
 
-  if (gimp_image_is_valid (image_ID))
-    gimp_image_delete (image_ID);
+  if (gimp_drawable_is_valid (layer))
+    gimp_drawable_delete (layer);
 
   if (error)
     {
@@ -377,13 +366,13 @@
 static void
 end_print (GtkPrintOperation *operation,
            GtkPrintContext   *context,
-           gint32            *image_ID)
+           gint32            *layer_ID)
 {
-  /* we don't need the export image any longer, delete it */
-  if (gimp_image_is_valid (*image_ID))
+  /* we don't need the print layer any longer, delete it */
+  if (gimp_drawable_is_valid (*layer_ID))
     {
-      gimp_image_delete (*image_ID);
-      *image_ID = -1;
+      gimp_drawable_delete (*layer_ID);
+      *layer_ID = -1;
     }
 
   gimp_progress_end ();

Modified: branches/soc-2008-text/plug-ins/pygimp/gimpmodule.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/gimpmodule.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/gimpmodule.c	Sat Aug 16 23:02:21 2008
@@ -1541,7 +1541,7 @@
             Py_XDECREF(read_method);
             PyErr_SetString(PyExc_TypeError,
                             "svg_file must be an object that has a \"read\" "
-                            "method, or a filename (str)");   
+                            "method, or a filename (str)");
             return NULL;
         }
 
@@ -1583,7 +1583,8 @@
     }
 
     if (!success) {
-        PyErr_SetString(pygimp_error, "Vectors import failed");
+        PyErr_Format(pygimp_error,
+                     "Vectors import failed: %s", gimp_get_pdb_error());
         return NULL;
     }
 
@@ -1614,7 +1615,8 @@
                                               &num_vectors, &vectors);
 
     if (!success) {
-        PyErr_SetString(pygimp_error, "Vectors import failed");
+        PyErr_Format(pygimp_error,
+                     "Vectors import failed: %s", gimp_get_pdb_error());
         return NULL;
     }
 

Modified: branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/plug-ins/python-console.py	Sat Aug 16 23:02:21 2008
@@ -41,7 +41,18 @@
         if s[0] != '_':
             namespace[s] = getattr(gimpenums, s)
 
-    class Console(gimpui.Dialog):
+    class GimpConsole(pyconsole.Console):
+        def __init__(self, quit_func=None):
+            banner = ('GIMP %s Python Console\nPython %s\n' %
+                      (gimp.pdb.gimp_version(), sys.version))
+            pyconsole.Console.__init__(self,
+                                       locals=namespace, banner=banner,
+                                       quit_func=quit_func)
+        def _commit(self):
+            pyconsole.Console._commit(self)
+            gimp.displays_flush()
+
+    class ConsoleDialog(gimpui.Dialog):
         def __init__(self):
             gimpui.Dialog.__init__(self, title=_("Python Console"),
                                    role=PROC_NAME, help_id=PROC_NAME,
@@ -55,11 +66,7 @@
                                                RESPONSE_CLEAR,
                                                RESPONSE_SAVE))
 
-            banner = ('GIMP %s Python Console\nPython %s\n' %
-                      (gimp.pdb.gimp_version(), sys.version))
-
-            self.cons = pyconsole.Console(locals=namespace, banner=banner,
-                                          quit_func=lambda: gtk.main_quit())
+            self.cons = GimpConsole(quit_func=lambda: gtk.main_quit())
 
             self.connect('response', self.response)
 
@@ -201,17 +208,9 @@
 
         def run(self):
             self.show_all()
-
-            # flush the displays every half second
-            def timeout():
-                gimp.displays_flush()
-                return True
-
-            gobject.timeout_add(500, timeout)
             gtk.main()
 
-    console = Console()
-    console.run()
+    ConsoleDialog().run()
 
 register(
     PROC_NAME,

Modified: branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/pygimp-colors.c	Sat Aug 16 23:02:21 2008
@@ -667,7 +667,7 @@
     PyObject *r_f = NULL, *g_f = NULL, *b_f = NULL, *a_f = NULL;
     PyObject *r = NULL, *g = NULL, *b = NULL, *a = NULL;
     reprfunc repr;
-    char *prefix;
+    const char *prefix;
 
     if (inexact) {
 	repr = PyObject_Str;
@@ -1190,7 +1190,7 @@
     PyObject *h_f = NULL, *s_f = NULL, *v_f = NULL, *a_f = NULL;
     PyObject *h = NULL, *s = NULL, *v = NULL, *a = NULL;
     reprfunc repr;
-    char *prefix;
+    const char *prefix;
 
     if (inexact) {
 	repr = PyObject_Str;
@@ -1703,7 +1703,7 @@
     PyObject *h_f = NULL, *s_f = NULL, *l_f = NULL, *a_f = NULL;
     PyObject *h = NULL, *s = NULL, *l = NULL, *a = NULL;
     reprfunc repr;
-    char *prefix;
+    const char *prefix;
 
     if (inexact) {
 	repr = PyObject_Str;
@@ -2212,7 +2212,7 @@
     PyObject *c_f = NULL, *m_f = NULL, *y_f = NULL, *k_f = NULL, *a_f = NULL;
     PyObject *c = NULL, *m = NULL, *y = NULL, *k = NULL, *a = NULL;
     reprfunc repr;
-    char *prefix;
+    const char *prefix;
 
     if (inexact) {
 	repr = PyObject_Str;

Modified: branches/soc-2008-text/plug-ins/pygimp/pygimp-pdb.c
==============================================================================
--- branches/soc-2008-text/plug-ins/pygimp/pygimp-pdb.c	(original)
+++ branches/soc-2008-text/plug-ins/pygimp/pygimp-pdb.c	Sat Aug 16 23:02:21 2008
@@ -620,9 +620,7 @@
 PyObject *
 pygimp_pdb_new(void)
 {
-    PyGimpPDB *self;
-	
-    self = PyObject_NEW(PyGimpPDB, &PyGimpPDB_Type);
+    PyGimpPDB *self = PyObject_NEW(PyGimpPDB, &PyGimpPDB_Type);
 
     if (self == NULL)
 	return NULL;
@@ -925,36 +923,42 @@
     }
 
     switch(ret[0].data.d_status) {
+    case GIMP_PDB_SUCCESS:
+#if PG_DEBUG > 0
+	g_printerr("success\n");
+#endif
+	t = pygimp_param_to_tuple(nret-1, ret+1);
+	gimp_destroy_params(ret, nret);
+
+	if (t == NULL) {
+	    PyErr_SetString(pygimp_error, "could not make return value");
+	    return NULL;
+	}
+	break;
+
     case GIMP_PDB_EXECUTION_ERROR:
 #if PG_DEBUG > 0
 	g_printerr("execution error\n");
 #endif
+        PyErr_SetString(PyExc_RuntimeError, gimp_get_pdb_error());
 	gimp_destroy_params(ret, nret);
-	PyErr_SetString(PyExc_RuntimeError, "execution error");
 	return NULL;
-	break;
 
     case GIMP_PDB_CALLING_ERROR:
 #if PG_DEBUG > 0
 	g_printerr("calling error\n");
 #endif
+        PyErr_SetString(PyExc_RuntimeError, gimp_get_pdb_error());
 	gimp_destroy_params(ret, nret);
-	PyErr_SetString(PyExc_TypeError, "invalid arguments");
 	return NULL;
-	break;
 
-    case GIMP_PDB_SUCCESS:
+    case GIMP_PDB_CANCEL:
 #if PG_DEBUG > 0
-	g_printerr("success\n");
+	g_printerr("cancel\n");
 #endif
-	t = pygimp_param_to_tuple(nret-1, ret+1);
+        PyErr_SetString(PyExc_RuntimeError, gimp_get_pdb_error());
 	gimp_destroy_params(ret, nret);
-
-	if (t == NULL) {
-	    PyErr_SetString(pygimp_error, "could not make return value");
-	    return NULL;
-	}
-	break;
+	return NULL;
 
     default:
 #if PG_DEBUG > 0
@@ -963,7 +967,6 @@
 #endif
 	PyErr_SetString(pygimp_error, "unknown return code");
 	return NULL;
-	break;
     }
 
     if (PyTuple_Size(t) == 1) {

Modified: branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/script-fu-console.c	Sat Aug 16 23:02:21 2008
@@ -609,6 +609,7 @@
                                        output->len,
                                        console);
         }
+
       g_string_free (output, TRUE);
 
       gimp_displays_flush ();

Modified: branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm
==============================================================================
--- branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm	(original)
+++ branches/soc-2008-text/plug-ins/script-fu/scripts/frosty-logo.scm	Sat Aug 16 23:02:21 2008
@@ -1,33 +1,48 @@
 ;  FROZEN-TEXT effect
 ;  Thanks to Ed Mackey for this one
-;   Written by Spencer Kimball
+;  Written by Spencer Kimball
 
 (define (apply-frosty-logo-effect img
                                   logo-layer
                                   size
-                                  bg-color)
+                                  bg-color
+                                  isnew) ; The parameter isnew is used
+                                         ; when the script is called
+                                         ; using the logo script (not
+                                         ; alpha to logo), in order to
+                                         ; make sure some actions are
+                                         ; performed only then
   (let* (
         (border (/ size 5))
         (width (+ (car (gimp-drawable-width logo-layer)) border))
         (height (+ (car (gimp-drawable-height logo-layer)) border))
         (logo-layer-mask (car (gimp-layer-create-mask logo-layer
-                                                      ADD-BLACK-MASK)))
+						      ADD-BLACK-MASK)))
         (sparkle-layer (car (gimp-layer-new img width height RGBA-IMAGE
                                             "Sparkle" 100 NORMAL-MODE)))
         (matte-layer (car (gimp-layer-new img width height RGBA-IMAGE
-                                          "Matte" 100 NORMAL-MODE)))
-        (shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE
+                                          _"Matte" 100 NORMAL-MODE)))
+        (shadow-layer (car (gimp-layer-new img
+					   (+ border width)
+					   (+ border height)
+					   RGBA-IMAGE
                                            "Shadow" 90 MULTIPLY-MODE)))
         (bg-layer (car (gimp-layer-new img width height RGB-IMAGE
                                        "Background" 100 NORMAL-MODE)))
         (selection 0)
+        (stack (car(gimp-image-get-layer-position img logo-layer)))
         )
 
     (gimp-context-push)
 
+    (if ( = isnew 1) (script-fu-util-image-resize-from-layer img shadow-layer))
+
     (gimp-layer-add-mask logo-layer logo-layer-mask)
-    (script-fu-util-image-resize-from-layer img shadow-layer)
-    (script-fu-util-image-add-layers img sparkle-layer matte-layer shadow-layer bg-layer)
+    (gimp-image-add-layer img sparkle-layer (+ 1 stack))
+    (gimp-image-add-layer img matte-layer (+ 2 stack))
+    (gimp-image-add-layer img shadow-layer (+ 3 stack))
+    (gimp-layer-translate shadow-layer (- border) (- border))
+    (gimp-image-add-layer img bg-layer 5)
     (gimp-selection-none img)
     (gimp-edit-clear sparkle-layer)
     (gimp-edit-clear matte-layer)
@@ -71,17 +86,9 @@
     (gimp-selection-none img)
     (gimp-image-remove-channel img selection)
 
-    (for-each (lambda (the-layer)
-              (gimp-layer-resize the-layer (- width border) (- height border)
-                                           (- border) (- border))
-              )
-              (list sparkle-layer matte-layer bg-layer)
-    )
-
-    (gimp-layer-resize shadow-layer (- width border) (- height border) 0 0)
     (gimp-layer-translate shadow-layer border border)
 
-    (script-fu-util-image-resize-from-layer img logo-layer)
+    (if ( = isnew 1) (script-fu-util-image-resize-from-layer img logo-layer))
 
     (gimp-layer-translate bg-layer (- 0 border) (- 0 border))
 
@@ -94,47 +101,31 @@
                                      size
                                      bg-color)
 
-  (let* (
-        (position (- (car(gimp-image-get-layer-position img logo-layer)) 1))
-        (duplicate (car (gimp-layer-new-from-drawable logo-layer img)))
-        (name (car (gimp-layer-get-name logo-layer)))
-        (select (cons-array 4 'byte))
-        (crop 0)
-        (temp 0)
-        )
-
     (gimp-image-undo-group-start img)
 
+    ;Checking if the effect size is to big or not
     (gimp-selection-layer-alpha logo-layer)
-    (gimp-image-add-layer img duplicate -1)
-    (gimp-layer-resize-to-image-size duplicate)
-    (gimp-selection-none img)
-    (apply-frosty-logo-effect img duplicate size bg-color)
-    (set! crop (aref (cadr (gimp-image-get-layers img)) (+ position 6)))
-    (set! temp (aref (cadr (gimp-image-get-layers img)) (+ position 3)))
-    (gimp-selection-layer-alpha temp)
-    (aset select 0 (cadr (gimp-selection-bounds img)))
-    (aset select 1 (caddr (gimp-selection-bounds img)))
-    (aset select 2 (cadddr (gimp-selection-bounds img)))
-    (aset select 3 (cadddr (cdr(gimp-selection-bounds img))))
-
-    (gimp-layer-resize crop
-           (+ 20 (- (aref select 2) (aref select 0)))
-           (+ 20 (- (aref select 3) (aref select 1)))
-           (- 0 (+ 0 (aref select 0)))
-           (- 0 (+ 0 (aref select 1))))
-    (gimp-layer-resize duplicate
-           (car (gimp-drawable-width logo-layer))
-           (car (gimp-drawable-height logo-layer))
-           (- 0 (car (gimp-drawable-offsets logo-layer)))
-           (- 0 (cadr (gimp-drawable-offsets logo-layer))))
-    (gimp-image-remove-layer img logo-layer)
-    (gimp-layer-set-name duplicate name)
+    (gimp-selection-feather img (/ size 5))
+    (gimp-selection-sharpen img)
 
-    (gimp-selection-none img)
-    (gimp-image-undo-group-end img)
-    (gimp-displays-flush)
-  )
+    (if (= 1 (car(gimp-selection-is-empty img)))
+	(begin
+	  (gimp-image-undo-group-end img)
+	  (gimp-selection-none img)
+	  (gimp-message "Your layer's opaque parts are either too small for
+this effect size, or they are not inside the canvas.")
+	  ))
+
+    (if (= 0 (car(gimp-selection-is-empty img)))
+	(begin
+	  (gimp-selection-none img)
+	  (gimp-layer-resize-to-image-size logo-layer)
+	  (apply-frosty-logo-effect img logo-layer size bg-color 0)
+
+	  (gimp-selection-none img)
+	  (gimp-image-undo-group-end img)
+	  (gimp-displays-flush)
+	  ))
 )
 
 (script-fu-register "script-fu-frosty-logo-alpha"
@@ -162,12 +153,36 @@
         (img (car (gimp-image-new 256 256 RGB)))
         (border (/ size 5))
         (text-layer (car (gimp-text-fontname img -1 0 0 text (* border 2) TRUE size PIXELS font)))
-        )
-    (gimp-image-undo-disable img)
-    (apply-frosty-logo-effect img text-layer size bg-color)
-    (gimp-image-undo-enable img)
-    (gimp-display-new img)
-  )
+        (error-string "The text you entered contains only spaces.")
+	)
+     (if (= text-layer -1)  ; checking that the text layer was created
+			    ; succesfully - it has more then just
+			    ; empty charcters
+	 (begin
+	   (gimp-image-delete img)
+	   (gimp-message error-string)
+	   )
+	 (begin     ; Checking if the effect size is too big or not
+	   (gimp-image-undo-disable img)
+	   (gimp-selection-layer-alpha text-layer)
+	   (gimp-selection-feather img border)
+	   (gimp-selection-sharpen img)
+
+	   (if (= 0 (car(gimp-selection-is-empty img))) ; Checking whether
+					                ; the effect size
+						        ; is too big
+	       (begin
+		 (apply-frosty-logo-effect img text-layer size bg-color 1)
+		 (gimp-selection-all img)
+		 (gimp-image-undo-enable img)
+		 (gimp-display-new img)
+		 ))
+	   (if (= 1 (car(gimp-selection-is-empty img)))
+	       (begin
+		 (gimp-image-delete img)
+		 (gimp-message error-string)
+		 ))))
+     )
 )
 
 (script-fu-register "script-fu-frosty-logo"
@@ -177,10 +192,10 @@
   "Spencer Kimball & Ed Mackey"
   "1997"
   ""
-  SF-STRING _"Text"                   "GIMP"
-  SF-ADJUSTMENT _"Font size (pixels)" '(100 2 1000 1 10 0 1)
-  SF-FONT   _"Font"                   "Becker"
-  SF-COLOR  _"Background color"       "white"
+  SF-STRING     _"Text"                "GIMP"
+  SF-ADJUSTMENT _"Font size (pixels)"  '(100 2 1000 1 10 0 1)
+  SF-FONT       _"Font"                "Becker"
+  SF-COLOR      _"Background color"    "white"
 )
 
 (script-fu-menu-register "script-fu-frosty-logo"

Modified: branches/soc-2008-text/plug-ins/selection-to-path/selection-to-path.c
==============================================================================
--- branches/soc-2008-text/plug-ins/selection-to-path/selection-to-path.c	(original)
+++ branches/soc-2008-text/plug-ins/selection-to-path/selection-to-path.c	Sat Aug 16 23:02:21 2008
@@ -46,6 +46,8 @@
 #include "libgimp/stdplugins-intl.h"
 
 
+#define PLUG_IN_BINARY "selection-to-path"
+
 #define RESPONSE_RESET 1
 #define MID_POINT      127
 
@@ -295,9 +297,10 @@
 
   retVal = FALSE;
 
-  gimp_ui_init ("sel2path", FALSE);
+  gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
-  dlg = gimp_dialog_new (_("Selection to Path Advanced Settings"), "sel2path",
+  dlg = gimp_dialog_new (_("Selection to Path Advanced Settings"),
+                         PLUG_IN_BINARY,
                          NULL, 0,
                          gimp_standard_help_func, "plug-in-sel2path-advanced",
 

Modified: branches/soc-2008-text/plug-ins/win-snap/Makefile.am
==============================================================================
--- branches/soc-2008-text/plug-ins/win-snap/Makefile.am	(original)
+++ branches/soc-2008-text/plug-ins/win-snap/Makefile.am	Sat Aug 16 23:02:21 2008
@@ -8,16 +8,16 @@
 libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
 libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
 
-winsnap_LDFLAGS = -mwindows
-
 libexecdir = $(gimpplugindir)/plug-ins
 
-libexec_PROGRAMS = winsnap
+libexec_PROGRAMS = win-snap
 
-winsnap_SOURCES = \
+win_snap_SOURCES = \
 	winsnap.c	\
 	winsnap.h
 
+win_snap_LDFLAGS = -mwindows
+
 EXTRA_DIST = \
 	resource.h	\
 	select.cur	\

Modified: branches/soc-2008-text/plug-ins/win-snap/winsnap.c
==============================================================================
--- branches/soc-2008-text/plug-ins/win-snap/winsnap.c	(original)
+++ branches/soc-2008-text/plug-ins/win-snap/winsnap.c	Sat Aug 16 23:02:21 2008
@@ -55,12 +55,13 @@
  * Plug-in Definitions
  */
 #define PLUG_IN_NAME        "plug_in_winsnap"
-#define HELP_ID             "plug-in-winsnap"
+#define PLUG_IN_PROC        "plug-in-winsnap"
 #define PLUG_IN_PRINT_NAME  "WinSnap"
 #define PLUG_IN_HELP        "This plug-in will capture an image of a Win32 window or desktop"
 #define PLUG_IN_AUTHOR      "Craig Setera (setera home com)"
 #define PLUG_IN_COPYRIGHT   "Craig Setera"
 #define PLUG_IN_VERSION     "v0.70 (07/16/1999)"
+#define PLUG_IN_BINARY      "win-snap"
 
 /*
  * Application definitions
@@ -853,12 +854,12 @@
   decorations      = winsnapvals.decor;
 
   /* Init GTK  */
-  gimp_ui_init ("winsnap", FALSE);
+  gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
   /* Main Dialog */
-  dialog = gimp_dialog_new (PLUG_IN_PRINT_NAME, "winsnap",
+  dialog = gimp_dialog_new (PLUG_IN_PRINT_NAME, PLUG_IN_BINARY,
                             NULL, 0,
-			    gimp_standard_help_func, HELP_ID,
+			    gimp_standard_help_func, PLUG_IN_PROC,
 
 			    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             _("Grab"),        GTK_RESPONSE_OK,
@@ -866,9 +867,9 @@
 			    NULL);
 
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                              GTK_RESPONSE_OK,
-                                              GTK_RESPONSE_CANCEL,
-                                              -1);
+                                           GTK_RESPONSE_OK,
+                                           GTK_RESPONSE_CANCEL,
+                                           -1);
 
   vbox = gtk_vbox_new (FALSE, 12);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
@@ -984,7 +985,7 @@
   static const GimpParamDef return_vals[] = { OUT_ARGS };
 
   /* the installation of the plugin */
-  gimp_install_procedure (PLUG_IN_NAME,
+  gimp_install_procedure (PLUG_IN_PROC,
                           N_("Capture a window or desktop image"),
                           PLUG_IN_HELP,
                           PLUG_IN_AUTHOR,
@@ -998,7 +999,7 @@
                           args,
                           return_vals);
 
-  gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/New/Acquire");
+  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/New/Acquire");
 }
 
 /* Return values storage */
@@ -1037,7 +1038,7 @@
   values[1].data.d_int32 = 0;
 
   /* Get the data from last run */
-  gimp_get_data(PLUG_IN_NAME, &winsnapvals);
+  gimp_get_data (PLUG_IN_PROC, &winsnapvals);
 
   /* How are we running today? */
   switch (run_mode) {
@@ -1072,7 +1073,7 @@
      */
     if (run_mode == GIMP_RUN_INTERACTIVE) {
       /* Store variable states for next run */
-      gimp_set_data(PLUG_IN_NAME, &winsnapvals, sizeof(WinSnapValues));
+      gimp_set_data (PLUG_IN_PROC, &winsnapvals, sizeof(WinSnapValues));
     }
 
     /* Set return values */

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	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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-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	Sat Aug 16 23:02:21 2008
@@ -11,19 +11,23 @@
 #
 # - 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
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE -plug-ins
 XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2
 
 PACKAGE = @PACKAGE@
 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	Sat Aug 16 23:02:21 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
@@ -43,16 +38,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 +54,46 @@
 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-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-python/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-python/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-python/Makefile.in.in	Sat Aug 16 23:02:21 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-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	Sat Aug 16 23:02:21 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-tips/Makefile.in.in
==============================================================================
--- branches/soc-2008-text/po-tips/Makefile.in.in	(original)
+++ branches/soc-2008-text/po-tips/Makefile.in.in	Sat Aug 16 23:02:21 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/POTFILES.in
==============================================================================
--- branches/soc-2008-text/po/POTFILES.in	(original)
+++ branches/soc-2008-text/po/POTFILES.in	Sat Aug 16 23:02:21 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/tools/Makefile.am
==============================================================================
--- branches/soc-2008-text/tools/Makefile.am	(original)
+++ branches/soc-2008-text/tools/Makefile.am	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/pdb/fileops.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/fileops.pdb	Sat Aug 16 23:02:21 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/image.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/image.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/image.pdb	Sat Aug 16 23:02:21 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	Sat Aug 16 23:02:21 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/vectors.pdb
==============================================================================
--- branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb	(original)
+++ branches/soc-2008-text/tools/pdbgen/pdb/vectors.pdb	Sat Aug 16 23:02:21 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]