gimp r26174 - in branches/soc-2008-tagging: . app app/actions app/base app/composite app/config app/core app/dialogs app/display app/gegl app/gui app/paint app/tools app/vectors app/widgets data/tips docs libgimp libgimpwidgets modules plug-ins/color-rotate plug-ins/common plug-ins/gfig plug-ins/gimpressionist plug-ins/help plug-ins/help-browser plug-ins/ifs-compose plug-ins/imagemap plug-ins/jpeg plug-ins/print plug-ins/pygimp plug-ins/selection-to-path plug-ins/uri plug-ins/win-snap po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default/images
- From: aurisj svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26174 - in branches/soc-2008-tagging: . app app/actions app/base app/composite app/config app/core app/dialogs app/display app/gegl app/gui app/paint app/tools app/vectors app/widgets data/tips docs libgimp libgimpwidgets modules plug-ins/color-rotate plug-ins/common plug-ins/gfig plug-ins/gimpressionist plug-ins/help plug-ins/help-browser plug-ins/ifs-compose plug-ins/imagemap plug-ins/jpeg plug-ins/print plug-ins/pygimp plug-ins/selection-to-path plug-ins/uri plug-ins/win-snap po po-libgimp po-plug-ins po-python po-script-fu po-tips themes/Default/images
- Date: Sun, 13 Jul 2008 12:11:52 +0000 (UTC)
Author: aurisj
Date: Sun Jul 13 12:11:51 2008
New Revision: 26174
URL: http://svn.gnome.org/viewvc/gimp?rev=26174&view=rev
Log:
Merged from trunk revisions 25970:26170
Added:
branches/soc-2008-tagging/app/display/gimpdisplayshell-private.h
- copied unchanged from r26173, /trunk/app/display/gimpdisplayshell-private.h
branches/soc-2008-tagging/app/gui/gui-unique.c
- copied unchanged from r26173, /trunk/app/gui/gui-unique.c
branches/soc-2008-tagging/app/gui/gui-unique.h
- copied unchanged from r26173, /trunk/app/gui/gui-unique.h
branches/soc-2008-tagging/app/unique.c
- copied unchanged from r26173, /trunk/app/unique.c
branches/soc-2008-tagging/app/unique.h
- copied unchanged from r26173, /trunk/app/unique.h
branches/soc-2008-tagging/app/widgets/gimpsettingseditor.c
- copied unchanged from r26173, /trunk/app/widgets/gimpsettingseditor.c
branches/soc-2008-tagging/app/widgets/gimpsettingseditor.h
- copied unchanged from r26173, /trunk/app/widgets/gimpsettingseditor.h
branches/soc-2008-tagging/app/widgets/gtkscalebutton.c
- copied unchanged from r26173, /trunk/app/widgets/gtkscalebutton.c
branches/soc-2008-tagging/app/widgets/gtkscalebutton.h
- copied unchanged from r26173, /trunk/app/widgets/gtkscalebutton.h
branches/soc-2008-tagging/plug-ins/pygimp/ChangeLog.old
- copied unchanged from r26173, /trunk/plug-ins/pygimp/ChangeLog.old
branches/soc-2008-tagging/themes/Default/images/stock-gegl-16.svg
- copied unchanged from r26173, /trunk/themes/Default/images/stock-gegl-16.svg
branches/soc-2008-tagging/themes/Default/images/stock-gegl-22.svg
- copied unchanged from r26173, /trunk/themes/Default/images/stock-gegl-22.svg
branches/soc-2008-tagging/themes/Default/images/stock-gegl.svg
- copied unchanged from r26173, /trunk/themes/Default/images/stock-gegl.svg
Removed:
branches/soc-2008-tagging/plug-ins/pygimp/ChangeLog
Modified:
branches/soc-2008-tagging/ (props changed)
branches/soc-2008-tagging/ChangeLog
branches/soc-2008-tagging/HACKING
branches/soc-2008-tagging/INSTALL
branches/soc-2008-tagging/NEWS
branches/soc-2008-tagging/app/Makefile.am
branches/soc-2008-tagging/app/actions/dialogs-actions.c
branches/soc-2008-tagging/app/actions/layers-commands.c
branches/soc-2008-tagging/app/actions/tools-commands.c
branches/soc-2008-tagging/app/actions/view-actions.c
branches/soc-2008-tagging/app/app.c
branches/soc-2008-tagging/app/base/color-balance.c
branches/soc-2008-tagging/app/composite/gimp-composite-3dnow-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-altivec-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-mmx-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-sse-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-sse2-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-test.c
branches/soc-2008-tagging/app/composite/gimp-composite-vis-test.c
branches/soc-2008-tagging/app/config/gimprc-blurbs.h
branches/soc-2008-tagging/app/core/gimp-user-install.c
branches/soc-2008-tagging/app/core/gimpdata.c
branches/soc-2008-tagging/app/core/gimpdata.h
branches/soc-2008-tagging/app/core/gimpdatafactory.c
branches/soc-2008-tagging/app/core/gimpdatafactory.h
branches/soc-2008-tagging/app/core/gimpgrid.c
branches/soc-2008-tagging/app/core/gimpmarshal.list
branches/soc-2008-tagging/app/core/gimpparamspecs.c
branches/soc-2008-tagging/app/core/gimpparamspecs.h
branches/soc-2008-tagging/app/core/gimpscanconvert.c
branches/soc-2008-tagging/app/dialogs/about-dialog.c
branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c
branches/soc-2008-tagging/app/dialogs/file-open-dialog.c
branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c
branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c
branches/soc-2008-tagging/app/dialogs/preferences-dialog.c
branches/soc-2008-tagging/app/display/Makefile.am
branches/soc-2008-tagging/app/display/gimpcanvas.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-progress.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h
branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c
branches/soc-2008-tagging/app/display/gimpdisplayshell.c
branches/soc-2008-tagging/app/display/gimpdisplayshell.h
branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
branches/soc-2008-tagging/app/display/gimpstatusbar.c
branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c
branches/soc-2008-tagging/app/gui/Makefile.am
branches/soc-2008-tagging/app/gui/gui.c
branches/soc-2008-tagging/app/main.c
branches/soc-2008-tagging/app/paint/gimppaintoptions.c
branches/soc-2008-tagging/app/tools/gimpbrightnesscontrasttool.c
branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c
branches/soc-2008-tagging/app/tools/gimpcolorizetool.c
branches/soc-2008-tagging/app/tools/gimpcurvestool.c
branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c
branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h
branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
branches/soc-2008-tagging/app/tools/gimpgegltool.c
branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
branches/soc-2008-tagging/app/tools/gimplevelstool.c
branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c
branches/soc-2008-tagging/app/tools/gimppainttool.c
branches/soc-2008-tagging/app/tools/gimpposterizetool.c
branches/soc-2008-tagging/app/tools/gimprectangletool.c
branches/soc-2008-tagging/app/tools/gimprotatetool.c
branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c
branches/soc-2008-tagging/app/vectors/gimpvectors.c
branches/soc-2008-tagging/app/widgets/Makefile.am
branches/soc-2008-tagging/app/widgets/gimpaction.c
branches/soc-2008-tagging/app/widgets/gimpactionview.c
branches/soc-2008-tagging/app/widgets/gimpblobeditor.c
branches/soc-2008-tagging/app/widgets/gimpbrusheditor.c
branches/soc-2008-tagging/app/widgets/gimpbrushfactoryview.c
branches/soc-2008-tagging/app/widgets/gimpbrushselect.c
branches/soc-2008-tagging/app/widgets/gimpcellrendererdashes.c
branches/soc-2008-tagging/app/widgets/gimpcellrendererviewable.c
branches/soc-2008-tagging/app/widgets/gimpcolorbar.c
branches/soc-2008-tagging/app/widgets/gimpcoloreditor.c
branches/soc-2008-tagging/app/widgets/gimpcolorframe.c
branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c
branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c
branches/soc-2008-tagging/app/widgets/gimpcontainerbox.c
branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.c
branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.h
branches/soc-2008-tagging/app/widgets/gimpcontainergridview.c
branches/soc-2008-tagging/app/widgets/gimpcontainerpopup.c
branches/soc-2008-tagging/app/widgets/gimpcontainertreeview-dnd.c
branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c
branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.h
branches/soc-2008-tagging/app/widgets/gimpcurveview.c
branches/soc-2008-tagging/app/widgets/gimpdasheditor.c
branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c
branches/soc-2008-tagging/app/widgets/gimpdbusservice.c
branches/soc-2008-tagging/app/widgets/gimpdock.c
branches/soc-2008-tagging/app/widgets/gimpdockable.c
branches/soc-2008-tagging/app/widgets/gimpdockseparator.c
branches/soc-2008-tagging/app/widgets/gimpfgbgeditor.c
branches/soc-2008-tagging/app/widgets/gimpfgbgview.c
branches/soc-2008-tagging/app/widgets/gimpgradienteditor.c
branches/soc-2008-tagging/app/widgets/gimphandlebar.c
branches/soc-2008-tagging/app/widgets/gimphelp.c
branches/soc-2008-tagging/app/widgets/gimphelp.h
branches/soc-2008-tagging/app/widgets/gimphistogrambox.c
branches/soc-2008-tagging/app/widgets/gimphistogramview.c
branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c
branches/soc-2008-tagging/app/widgets/gimplanguagestore-parser.c
branches/soc-2008-tagging/app/widgets/gimpmenudock.c
branches/soc-2008-tagging/app/widgets/gimpmessagebox.c
branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c
branches/soc-2008-tagging/app/widgets/gimppaletteview.c
branches/soc-2008-tagging/app/widgets/gimppropwidgets.c
branches/soc-2008-tagging/app/widgets/gimpscalebutton.c
branches/soc-2008-tagging/app/widgets/gimpscalebutton.h
branches/soc-2008-tagging/app/widgets/gimpsessioninfo-book.c
branches/soc-2008-tagging/app/widgets/gimpsessioninfo-dock.c
branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c
branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h
branches/soc-2008-tagging/app/widgets/gimpstrokeeditor.c
branches/soc-2008-tagging/app/widgets/gimptemplateeditor.c
branches/soc-2008-tagging/app/widgets/gimptemplateview.c
branches/soc-2008-tagging/app/widgets/gimpthumbbox.c
branches/soc-2008-tagging/app/widgets/gimptoolbox.c
branches/soc-2008-tagging/app/widgets/gimptooloptionseditor.c
branches/soc-2008-tagging/app/widgets/gimptoolview.c
branches/soc-2008-tagging/app/widgets/gimpuimanager.c
branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c
branches/soc-2008-tagging/app/widgets/gimpviewrendererimagefile.c
branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c
branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c
branches/soc-2008-tagging/app/widgets/widgets-types.h
branches/soc-2008-tagging/configure.in
branches/soc-2008-tagging/data/tips/gimp-tips.xml.in
branches/soc-2008-tagging/docs/Makefile.am
branches/soc-2008-tagging/docs/gimp.1.in
branches/soc-2008-tagging/libgimp/gimpgradientselectbutton.c
branches/soc-2008-tagging/libgimp/gimpmenu.c
branches/soc-2008-tagging/libgimpwidgets/gimpbrowser.c
branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderercolor.c
branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderertoggle.c
branches/soc-2008-tagging/libgimpwidgets/gimpchainbutton.c
branches/soc-2008-tagging/libgimpwidgets/gimpcolorarea.c
branches/soc-2008-tagging/libgimpwidgets/gimpcolorscale.c
branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c
branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c
branches/soc-2008-tagging/libgimpwidgets/gimpenumwidgets.c
branches/soc-2008-tagging/libgimpwidgets/gimpframe.c
branches/soc-2008-tagging/libgimpwidgets/gimphelpui.c
branches/soc-2008-tagging/libgimpwidgets/gimpoffsetarea.c
branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c
branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c
branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c
branches/soc-2008-tagging/modules/colorsel_water.c
branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c
branches/soc-2008-tagging/plug-ins/common/animation-play.c
branches/soc-2008-tagging/plug-ins/common/cml-explorer.c
branches/soc-2008-tagging/plug-ins/common/convolution-matrix.c
branches/soc-2008-tagging/plug-ins/common/curve-bend.c
branches/soc-2008-tagging/plug-ins/common/despeckle.c
branches/soc-2008-tagging/plug-ins/common/filter-pack.c
branches/soc-2008-tagging/plug-ins/common/gee-zoom.c
branches/soc-2008-tagging/plug-ins/common/gee.c
branches/soc-2008-tagging/plug-ins/common/lens-flare.c
branches/soc-2008-tagging/plug-ins/common/newsprint.c
branches/soc-2008-tagging/plug-ins/common/nova.c
branches/soc-2008-tagging/plug-ins/common/postscript.c
branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
branches/soc-2008-tagging/plug-ins/common/sphere-designer.c
branches/soc-2008-tagging/plug-ins/common/tiff-load.c
branches/soc-2008-tagging/plug-ins/common/tile-small.c
branches/soc-2008-tagging/plug-ins/gfig/gfig-grid.c
branches/soc-2008-tagging/plug-ins/gimpressionist/general.c
branches/soc-2008-tagging/plug-ins/gimpressionist/orientmap.c
branches/soc-2008-tagging/plug-ins/gimpressionist/paper.c
branches/soc-2008-tagging/plug-ins/gimpressionist/placement.c
branches/soc-2008-tagging/plug-ins/gimpressionist/sizemap.c
branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c
branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
branches/soc-2008-tagging/plug-ins/help/gimphelpdomain.c
branches/soc-2008-tagging/plug-ins/help/gimphelpitem.h
branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c
branches/soc-2008-tagging/plug-ins/imagemap/imap_grid.c
branches/soc-2008-tagging/plug-ins/jpeg/jpeg-save.c
branches/soc-2008-tagging/plug-ins/print/print-preview.c
branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-display.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp-vectors.c
branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h
branches/soc-2008-tagging/plug-ins/selection-to-path/pxl-outline.c
branches/soc-2008-tagging/plug-ins/uri/uri-backend-gvfs.c
branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c
branches/soc-2008-tagging/po-libgimp/ChangeLog
branches/soc-2008-tagging/po-libgimp/POTFILES.in
branches/soc-2008-tagging/po-libgimp/ca.po
branches/soc-2008-tagging/po-libgimp/de.po
branches/soc-2008-tagging/po-libgimp/ja.po
branches/soc-2008-tagging/po-libgimp/oc.po
branches/soc-2008-tagging/po-libgimp/sv.po
branches/soc-2008-tagging/po-plug-ins/ChangeLog
branches/soc-2008-tagging/po-plug-ins/ca.po
branches/soc-2008-tagging/po-plug-ins/de.po
branches/soc-2008-tagging/po-plug-ins/ja.po
branches/soc-2008-tagging/po-plug-ins/oc.po
branches/soc-2008-tagging/po-plug-ins/sv.po
branches/soc-2008-tagging/po-python/ChangeLog
branches/soc-2008-tagging/po-python/ca.po
branches/soc-2008-tagging/po-python/de.po
branches/soc-2008-tagging/po-python/ja.po
branches/soc-2008-tagging/po-python/oc.po
branches/soc-2008-tagging/po-script-fu/ChangeLog
branches/soc-2008-tagging/po-script-fu/ca.po
branches/soc-2008-tagging/po-script-fu/de.po
branches/soc-2008-tagging/po-script-fu/ja.po
branches/soc-2008-tagging/po-script-fu/oc.po
branches/soc-2008-tagging/po-script-fu/sv.po
branches/soc-2008-tagging/po-tips/ChangeLog
branches/soc-2008-tagging/po-tips/ca.po
branches/soc-2008-tagging/po-tips/ja.po
branches/soc-2008-tagging/po-tips/oc.po
branches/soc-2008-tagging/po/ChangeLog
branches/soc-2008-tagging/po/POTFILES.in
branches/soc-2008-tagging/po/POTFILES.skip
branches/soc-2008-tagging/po/ca.po
branches/soc-2008-tagging/po/de.po
branches/soc-2008-tagging/po/ja.po
branches/soc-2008-tagging/po/oc.po
branches/soc-2008-tagging/po/sv.po
branches/soc-2008-tagging/themes/Default/images/stock-gegl-16.png
branches/soc-2008-tagging/themes/Default/images/stock-gegl-22.png
branches/soc-2008-tagging/themes/Default/images/stock-user-manual-64.png
Modified: branches/soc-2008-tagging/HACKING
==============================================================================
--- branches/soc-2008-tagging/HACKING (original)
+++ branches/soc-2008-tagging/HACKING Sun Jul 13 12:11:51 2008
@@ -16,9 +16,6 @@
* pkg-config 0.16.0 (or preferably a newer version)
- http://www.freedesktop.org/software/pkgconfig/
- * intltoolize 0.35.5 (or preferably a newer version)
- - ftp://ftp.gnome.org/pub/gnome/sources/intltool/
-
* gtkdocize
- http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/
Modified: branches/soc-2008-tagging/INSTALL
==============================================================================
--- branches/soc-2008-tagging/INSTALL (original)
+++ branches/soc-2008-tagging/INSTALL Sun Jul 13 12:11:51 2008
@@ -28,18 +28,22 @@
1. You need to have installed a recent version of pkg-config available
from http://www.freedesktop.org/software/pkgconfig/.
- 2. You need to have GEGL version 0.0.18 or newer and babl version
+ 2. You need intltool (at least 0.35.5, but preferably a newer version).
+ Intltool can be downloaded from
+ http://ftp.gnome.org/pub/gnome/sources/intltool/
+
+ 3. You need to have GEGL version 0.0.18 or newer and babl version
0.0.22 or newer. You can get it from http://gegl.org/ or check
it out from the subversion repository:
http://svn.gnome.org/svn/babl/trunk
http://svn.gnome.org/svn/gegl/trunk
- 3. You need to have installed GTK+ version 2.12.1 or newer. GIMP
+ 4. You need to have installed GTK+ version 2.12.1 or newer. GIMP
also need a recent versions of GLib (>= 2.16.1) and Pango (>= 1.18.0).
Sources for these can be grabbed from ftp://ftp.gtk.org/.
- 4. We require PangoFT2, a Pango backend that uses FreeType2. Make
+ 5. We require PangoFT2, a Pango backend that uses FreeType2. Make
sure you have FreeType2 and fontconfig installed before you
compile Pango. FreeType2 can be downloaded from
http://www.freetype.org/. Fontconfig from
@@ -48,28 +52,28 @@
Older versions are known to have bugs that seriously affect the
stability of GIMP.
- 5. We use cairo, which is hosted at http://www.cairographics.org/.
+ 6. We use cairo, which is hosted at http://www.cairographics.org/.
- 6. We use dbus-glib if available. Grab it from
+ 7. We use dbus-glib if available. Grab it from
http://dbus.freedesktop.org/releases/dbus-glib/
- 7. You may want to install other third party libraries or programs
+ 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.
- 8. The Python extension requires Python development headers to be
+ 9. The Python extension requires Python development headers to be
present. You will also need PyGTK and the respective development
headers.
- 9. Configure GIMP by running the `configure' script. You may want
+ 10. Configure GIMP by running the `configure' script. You may want
to pass some options to it, see below.
- 10. Build GIMP by running `make'. The use of GNU make is recommended.
+ 11. Build GIMP by running `make'. The use of GNU make is recommended.
If you need to tweak the build to make it work with other flavours
of make, we'd appreciate if you'd send us a patch with the changes.
- 11. Install GIMP by running `make install'. In order to avoid clashes
+ 12. Install GIMP by running `make install'. In order to avoid clashes
with other versions of GIMP, we install a binary called gimp-2.5.
By default there's also a link created so that you can type 'gimp'
to start gimp-2.5.
@@ -226,6 +230,10 @@
gimp-console binary to be built in addition to the standard binary.
gimp-console is useful for command-line batch mode or as a server.
+ --enable-gimp-remote. Use this option if you want the gimp-remote
+ binary to be built. This only works with X11 and it is obsolete if#
+ your platform has DBus support.
+
--disable-python. If for some reason you don't want to build the
Python based pygimp plug-in, you can use --disable-python.
Modified: branches/soc-2008-tagging/NEWS
==============================================================================
--- branches/soc-2008-tagging/NEWS (original)
+++ branches/soc-2008-tagging/NEWS Sun Jul 13 12:11:51 2008
@@ -7,6 +7,27 @@
towards the next stable release, which will be GIMP 2.6.
+Changes in GIMP 2.5.2
+=====================
+
+ - final touches on the combined Freehand/Polygon Select tool
+ - added a dockable dialog for managing Color tool settings
+ - prepared the code for changes in the upcoming GTK+ release
+ - improved popup scale button
+ - mark the center of rectangles/bounding rectangles during moves
+ - added dialog to query for using the online user manual
+ - allow to map dynamics to hardness for the Eraser tool
+ - provide gimp-remote functionality on Windows
+ - disable the build and install of the gimp-remote tool by default
+ - bug fixes and code cleanup
+
+
+Contributors:
+
+ Sven Neumann, Michael Natterer, Martin Nordholts, Manish Singh,
+ Lars-Peter Clausen, Alexia Death, Tor Lillqvist, Jakub Steiner
+
+
Changes in GIMP 2.5.1
=====================
Modified: branches/soc-2008-tagging/app/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/Makefile.am (original)
+++ branches/soc-2008-tagging/app/Makefile.am Sun Jul 13 12:11:51 2008
@@ -49,6 +49,8 @@
main.c \
sanity.c \
sanity.h \
+ unique.c \
+ unique.h \
units.c \
units.h \
version.c \
Modified: branches/soc-2008-tagging/app/actions/dialogs-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/dialogs-actions.c (original)
+++ branches/soc-2008-tagging/app/actions/dialogs-actions.c Sun Jul 13 12:11:51 2008
@@ -222,7 +222,7 @@
{ "dialogs-tips", GIMP_STOCK_INFO,
N_("_Tip of the Day"), NULL,
- N_("Show the tip of the day"),
+ N_("Show some helpful tips on using GIMP"),
"gimp-tips-dialog",
GIMP_HELP_TIPS_DIALOG },
Modified: branches/soc-2008-tagging/app/actions/layers-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/layers-commands.c (original)
+++ branches/soc-2008-tagging/app/actions/layers-commands.c Sun Jul 13 12:11:51 2008
@@ -988,7 +988,7 @@
{
g_object_set (layer,
"auto-rename",
- GTK_TOGGLE_BUTTON (dialog->rename_toggle)->active,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->rename_toggle)),
NULL);
}
}
Modified: branches/soc-2008-tagging/app/actions/tools-commands.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/tools-commands.c (original)
+++ branches/soc-2008-tagging/app/actions/tools-commands.c Sun Jul 13 12:11:51 2008
@@ -555,12 +555,7 @@
if (GIMP_IS_ENUM_ACTION (action) &&
GIMP_ENUM_ACTION (action)->value_variable)
{
- gint old_value;
-
- old_value = GIMP_ENUM_ACTION (action)->value;
- GIMP_ENUM_ACTION (action)->value = value;
- gtk_action_activate (action);
- GIMP_ENUM_ACTION (action)->value = old_value;
+ gimp_enum_action_selected (GIMP_ENUM_ACTION (action), value);
}
}
Modified: branches/soc-2008-tagging/app/actions/view-actions.c
==============================================================================
--- branches/soc-2008-tagging/app/actions/view-actions.c (original)
+++ branches/soc-2008-tagging/app/actions/view-actions.c Sun Jul 13 12:11:51 2008
@@ -633,11 +633,11 @@
if (shell->canvas)
{
- GimpRGB color;
+ GtkStyle *style = gtk_widget_get_style (shell->canvas);
+ GimpRGB color;
gtk_widget_ensure_style (shell->canvas);
- gimp_rgb_set_gdk_color (&color,
- shell->canvas->style->bg + GTK_STATE_NORMAL);
+ gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
gimp_rgb_set_alpha (&color, GIMP_OPACITY_OPAQUE);
SET_COLOR ("view-padding-color-theme", &color);
Modified: branches/soc-2008-tagging/app/app.c
==============================================================================
--- branches/soc-2008-tagging/app/app.c (original)
+++ branches/soc-2008-tagging/app/app.c Sun Jul 13 12:11:51 2008
@@ -32,8 +32,6 @@
#include <gegl.h>
-#include <gegl.h>
-
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
@@ -64,6 +62,7 @@
#include "gimp-intl.h"
+
/* local prototypes */
static void app_init_update_none (const gchar *text1,
Modified: branches/soc-2008-tagging/app/base/color-balance.c
==============================================================================
--- branches/soc-2008-tagging/app/base/color-balance.c (original)
+++ branches/soc-2008-tagging/app/base/color-balance.c Sun Jul 13 12:11:51 2008
@@ -85,53 +85,78 @@
transfer_initialized = TRUE;
}
- /* Set the transfer arrays (for speed) */
+ /* Prepare the transfer arrays (for speed) */
+
cyan_red_transfer[GIMP_SHADOWS] =
(cb->cyan_red[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
+
cyan_red_transfer[GIMP_MIDTONES] =
(cb->cyan_red[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
+
cyan_red_transfer[GIMP_HIGHLIGHTS] =
(cb->cyan_red[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
+
magenta_green_transfer[GIMP_SHADOWS] =
(cb->magenta_green[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
+
magenta_green_transfer[GIMP_MIDTONES] =
(cb->magenta_green[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
+
magenta_green_transfer[GIMP_HIGHLIGHTS] =
(cb->magenta_green[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
+
yellow_blue_transfer[GIMP_SHADOWS] =
(cb->yellow_blue[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
+
yellow_blue_transfer[GIMP_MIDTONES] =
(cb->yellow_blue[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
+
yellow_blue_transfer[GIMP_HIGHLIGHTS] =
(cb->yellow_blue[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
+
for (i = 0; i < 256; i++)
{
r_n = i;
g_n = i;
b_n = i;
- r_n += cb->cyan_red[GIMP_SHADOWS] * cyan_red_transfer[GIMP_SHADOWS][r_n];
+ r_n += (cb->cyan_red[GIMP_SHADOWS] *
+ cyan_red_transfer[GIMP_SHADOWS][r_n]);
r_n = CLAMP0255 (r_n);
- r_n += cb->cyan_red[GIMP_MIDTONES] * cyan_red_transfer[GIMP_MIDTONES][r_n];
+
+ r_n += (cb->cyan_red[GIMP_MIDTONES] *
+ cyan_red_transfer[GIMP_MIDTONES][r_n]);
r_n = CLAMP0255 (r_n);
- r_n += cb->cyan_red[GIMP_HIGHLIGHTS] * cyan_red_transfer[GIMP_HIGHLIGHTS][r_n];
+
+ r_n += (cb->cyan_red[GIMP_HIGHLIGHTS] *
+ cyan_red_transfer[GIMP_HIGHLIGHTS][r_n]);
r_n = CLAMP0255 (r_n);
- g_n += cb->magenta_green[GIMP_SHADOWS] * magenta_green_transfer[GIMP_SHADOWS][g_n];
+ g_n += (cb->magenta_green[GIMP_SHADOWS] *
+ magenta_green_transfer[GIMP_SHADOWS][g_n]);
g_n = CLAMP0255 (g_n);
- g_n += cb->magenta_green[GIMP_MIDTONES] * magenta_green_transfer[GIMP_MIDTONES][g_n];
+
+ g_n += (cb->magenta_green[GIMP_MIDTONES] *
+ magenta_green_transfer[GIMP_MIDTONES][g_n]);
g_n = CLAMP0255 (g_n);
- g_n += cb->magenta_green[GIMP_HIGHLIGHTS] * magenta_green_transfer[GIMP_HIGHLIGHTS][g_n];
+
+ g_n += (cb->magenta_green[GIMP_HIGHLIGHTS] *
+ magenta_green_transfer[GIMP_HIGHLIGHTS][g_n]);
g_n = CLAMP0255 (g_n);
- b_n += cb->yellow_blue[GIMP_SHADOWS] * yellow_blue_transfer[GIMP_SHADOWS][b_n];
+ b_n += (cb->yellow_blue[GIMP_SHADOWS] *
+ yellow_blue_transfer[GIMP_SHADOWS][b_n]);
b_n = CLAMP0255 (b_n);
- b_n += cb->yellow_blue[GIMP_MIDTONES] * yellow_blue_transfer[GIMP_MIDTONES][b_n];
+
+ b_n += (cb->yellow_blue[GIMP_MIDTONES] *
+ yellow_blue_transfer[GIMP_MIDTONES][b_n]);
b_n = CLAMP0255 (b_n);
- b_n += cb->yellow_blue[GIMP_HIGHLIGHTS] * yellow_blue_transfer[GIMP_HIGHLIGHTS][b_n];
+
+ b_n += (cb->yellow_blue[GIMP_HIGHLIGHTS] *
+ yellow_blue_transfer[GIMP_HIGHLIGHTS][b_n]);
b_n = CLAMP0255 (b_n);
cb->r_lookup[i] = r_n;
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-3dnow-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-3dnow-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-3dnow-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-3dnow.h"
-int
+static int
gimp_composite_3dnow_test (int iterations, int n_pixels)
{
#if defined(COMPILE_3DNOW_IS_OKAY)
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-altivec-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-altivec-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-altivec-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-altivec.h"
-int
+static int
gimp_composite_altivec_test (int iterations, int n_pixels)
{
#if defined(COMPILE_ALTIVEC_IS_OKAY)
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-mmx-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-mmx-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-mmx-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-mmx.h"
-int
+static int
gimp_composite_mmx_test (int iterations, int n_pixels)
{
#if defined(COMPILE_MMX_IS_OKAY)
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-sse-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-sse-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-sse-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-sse.h"
-int
+static int
gimp_composite_sse_test (int iterations, int n_pixels)
{
#if defined(COMPILE_SSE_IS_OKAY)
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-sse2-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-sse2-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-sse2-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-sse2.h"
-int
+static int
gimp_composite_sse2_test (int iterations, int n_pixels)
{
#if defined(COMPILE_SSE2_IS_OKAY)
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-test.c Sun Jul 13 12:11:51 2008
@@ -12,7 +12,7 @@
#include "gimp-composite-util.h"
#include "gimp-composite-generic.h"
-int
+static int
gimp_composite_regression(int iterations, int n_pixels)
{
GimpCompositeContext generic_ctx;
Modified: branches/soc-2008-tagging/app/composite/gimp-composite-vis-test.c
==============================================================================
--- branches/soc-2008-tagging/app/composite/gimp-composite-vis-test.c (original)
+++ branches/soc-2008-tagging/app/composite/gimp-composite-vis-test.c Sun Jul 13 12:11:51 2008
@@ -13,7 +13,7 @@
#include "gimp-composite-generic.h"
#include "gimp-composite-vis.h"
-int
+static int
gimp_composite_vis_test (int iterations, int n_pixels)
{
#if defined(COMPILE_VIS_IS_OKAY)
Modified: branches/soc-2008-tagging/app/config/gimprc-blurbs.h
==============================================================================
--- branches/soc-2008-tagging/app/config/gimprc-blurbs.h (original)
+++ branches/soc-2008-tagging/app/config/gimprc-blurbs.h Sun Jul 13 12:11:51 2008
@@ -420,8 +420,8 @@
N_("When enabled, pressing F1 will open the help browser.")
#define USER_MANUAL_ONLINE_BLURB \
-N_("When enabled, the online user manual will be used by the help system. " \
- "Otherwise the locally installed copy is used.")
+"When enabled, the online user manual will be used by the help system. " \
+"Otherwise the locally installed copy is used."
#define USER_MANUAL_ONLINE_URI_BLURB \
"The location of the online user manual. This is used if " \
Modified: branches/soc-2008-tagging/app/core/gimp-user-install.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimp-user-install.c (original)
+++ branches/soc-2008-tagging/app/core/gimp-user-install.c Sun Jul 13 12:11:51 2008
@@ -219,11 +219,11 @@
migrate = g_file_test (dir, G_FILE_TEST_IS_DIR);
-#ifdef GIMP_UNSTABLE
- g_printerr ("gimp-user-install: migrating from %s\n", dir);
-#endif
if (migrate)
{
+#ifdef GIMP_UNSTABLE
+ g_printerr ("gimp-user-install: migrating from %s\n", dir);
+#endif
install->old_major = 2;
install->old_minor = i;
Modified: branches/soc-2008-tagging/app/core/gimpdata.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdata.c (original)
+++ branches/soc-2008-tagging/app/core/gimpdata.c Sun Jul 13 12:11:51 2008
@@ -766,26 +766,31 @@
}
/**
- * gimp_data_name_compare:
+ * gimp_data_compare:
* @data1: a #GimpData object.
* @data2: another #GimpData object.
*
- * Compares the names of the two objects for use in sorting; see
- * gimp_object_name_collate() for the method. Objects marked as
- * "internal" are considered to come before any objects that are not.
+ * Compares two data objects for use in sorting. Objects marked as
+ * "internal" come first, then user-writable objects, then system data
+ * files. In these three groups, the objects are sorted alphabetically
+ * by name, using gimp_object_name_collate().
*
* Return value: -1 if @data1 compares before @data2,
* 0 if they compare equal,
* 1 if @data1 compares after @data2.
**/
gint
-gimp_data_name_compare (GimpData *data1,
- GimpData *data2)
+gimp_data_compare (GimpData *data1,
+ GimpData *data2)
{
/* move the internal objects (like the FG -> BG) gradient) to the top */
if (data1->internal != data2->internal)
return data1->internal ? -1 : 1;
+ /* keep user-writable objects about system resource files */
+ if (data1->writable != data2->writable)
+ return data1->writable ? -1 : 1;
+
return gimp_object_name_collate ((GimpObject *) data1,
(GimpObject *) data2);
}
Modified: branches/soc-2008-tagging/app/core/gimpdata.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdata.h (original)
+++ branches/soc-2008-tagging/app/core/gimpdata.h Sun Jul 13 12:11:51 2008
@@ -106,6 +106,8 @@
void gimp_data_make_internal (GimpData *data,
const gchar *internal_name);
+gint gimp_data_compare (GimpData *data1,
+ GimpData *data2);
gint gimp_data_name_compare (GimpData *data1,
GimpData *data2);
Modified: branches/soc-2008-tagging/app/core/gimpdatafactory.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdatafactory.c (original)
+++ branches/soc-2008-tagging/app/core/gimpdatafactory.c Sun Jul 13 12:11:51 2008
@@ -137,7 +137,7 @@
const GimpDataFactoryLoaderEntry *loader_entries,
gint n_loader_entries,
GimpDataNewFunc new_func,
- GimpDataGetStandardFunc standard_func)
+ GimpDataGetStandardFunc get_standard_func)
{
GimpDataFactory *factory;
@@ -153,7 +153,7 @@
factory->gimp = gimp;
factory->container = gimp_list_new (data_type, TRUE);
gimp_list_set_sort_func (GIMP_LIST (factory->container),
- (GCompareFunc) gimp_data_name_compare);
+ (GCompareFunc) gimp_data_compare);
factory->path_property_name = g_strdup (path_property_name);
factory->writable_property_name = g_strdup (writable_property_name);
@@ -162,7 +162,7 @@
factory->n_loader_entries = n_loader_entries;
factory->data_new_func = new_func;
- factory->data_get_standard_func = standard_func;
+ factory->data_get_standard_func = get_standard_func;
return factory;
}
Modified: branches/soc-2008-tagging/app/core/gimpdatafactory.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpdatafactory.h (original)
+++ branches/soc-2008-tagging/app/core/gimpdatafactory.h Sun Jul 13 12:11:51 2008
@@ -84,7 +84,7 @@
const GimpDataFactoryLoaderEntry *loader_entries,
gint n_loader_entries,
GimpDataNewFunc new_func,
- GimpDataGetStandardFunc standard_func);
+ GimpDataGetStandardFunc get_standard_func);
void gimp_data_factory_data_init (GimpDataFactory *factory,
gboolean no_data);
Modified: branches/soc-2008-tagging/app/core/gimpgrid.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpgrid.c (original)
+++ branches/soc-2008-tagging/app/core/gimpgrid.c Sun Jul 13 12:11:51 2008
@@ -83,7 +83,7 @@
"style",
N_("Line style used for the grid."),
GIMP_TYPE_GRID_STYLE,
- GIMP_GRID_INTERSECTIONS,
+ GIMP_GRID_SOLID,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_FGCOLOR,
"fgcolor",
@@ -99,12 +99,12 @@
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_XSPACING,
"xspacing",
N_("Horizontal spacing of grid lines."),
- 1.0, GIMP_MAX_IMAGE_SIZE, 32.0,
+ 1.0, GIMP_MAX_IMAGE_SIZE, 10.0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_YSPACING,
"yspacing",
N_("Vertical spacing of grid lines."),
- 1.0, GIMP_MAX_IMAGE_SIZE, 32.0,
+ 1.0, GIMP_MAX_IMAGE_SIZE, 10.0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_SPACING_UNIT,
"spacing-unit", NULL,
Modified: branches/soc-2008-tagging/app/core/gimpmarshal.list
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpmarshal.list (original)
+++ branches/soc-2008-tagging/app/core/gimpmarshal.list Sun Jul 13 12:11:51 2008
@@ -26,6 +26,7 @@
BOOLEAN: ENUM, INT
BOOLEAN: OBJECT, POINTER
BOOLEAN: OBJECT, POINTER, STRING
+BOOLEAN: STRING
VOID: BOOLEAN
VOID: BOOLEAN, INT, INT, INT, INT
@@ -33,6 +34,7 @@
VOID: BOXED, ENUM
VOID: DOUBLE
VOID: DOUBLE, DOUBLE
+VOID: DOUBLE, DOUBLE, DOUBLE, DOUBLE
VOID: ENUM
VOID: ENUM, ENUM, BOXED, INT
VOID: ENUM, OBJECT
Modified: branches/soc-2008-tagging/app/core/gimpparamspecs.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpparamspecs.c (original)
+++ branches/soc-2008-tagging/app/core/gimpparamspecs.c Sun Jul 13 12:11:51 2008
@@ -2805,3 +2805,128 @@
g_value_take_boxed (value, array);
}
+
+
+/*
+ * GIMP_TYPE_COLOR_ARRAY
+ */
+
+GType
+gimp_color_array_get_type (void)
+{
+ static GType type = 0;
+
+ if (! type)
+ type = g_boxed_type_register_static ("GimpColorArray",
+ (GBoxedCopyFunc) gimp_array_copy,
+ (GBoxedFreeFunc) gimp_array_free);
+
+ return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_COLOR_ARRAY
+ */
+
+static void gimp_param_color_array_class_init (GParamSpecClass *klass);
+static void gimp_param_color_array_init (GParamSpec *pspec);
+
+GType
+gimp_param_color_array_get_type (void)
+{
+ static GType type = 0;
+
+ if (! type)
+ {
+ const GTypeInfo info =
+ {
+ sizeof (GParamSpecClass),
+ NULL, NULL,
+ (GClassInitFunc) gimp_param_color_array_class_init,
+ NULL, NULL,
+ sizeof (GimpParamSpecArray),
+ 0,
+ (GInstanceInitFunc) gimp_param_color_array_init
+ };
+
+ type = g_type_register_static (G_TYPE_PARAM_BOXED,
+ "GimpParamColorArray", &info, 0);
+ }
+
+ return type;
+}
+
+static void
+gimp_param_color_array_class_init (GParamSpecClass *klass)
+{
+ klass->value_type = GIMP_TYPE_COLOR_ARRAY;
+}
+
+static void
+gimp_param_color_array_init (GParamSpec *pspec)
+{
+}
+
+GParamSpec *
+gimp_param_spec_color_array (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GParamFlags flags)
+{
+ GimpParamSpecColorArray *array_spec;
+
+ array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_COLOR_ARRAY,
+ name, nick, blurb, flags);
+
+ return G_PARAM_SPEC (array_spec);
+}
+
+const GimpRGB *
+gimp_value_get_colorarray (const GValue *value)
+{
+ g_return_val_if_fail (GIMP_VALUE_HOLDS_COLOR_ARRAY (value), NULL);
+
+ return (const GimpRGB *) gimp_value_get_array (value);
+}
+
+GimpRGB *
+gimp_value_dup_colorarray (const GValue *value)
+{
+ g_return_val_if_fail (GIMP_VALUE_HOLDS_COLOR_ARRAY (value), NULL);
+
+ return (GimpRGB *) gimp_value_dup_array (value);
+}
+
+void
+gimp_value_set_colorarray (GValue *value,
+ const GimpRGB *data,
+ gsize length)
+{
+ g_return_if_fail (GIMP_VALUE_HOLDS_COLOR_ARRAY (value));
+
+ gimp_value_set_array (value, (const guint8 *) data,
+ length * sizeof (GimpRGB));
+}
+
+void
+gimp_value_set_static_colorarray (GValue *value,
+ const GimpRGB *data,
+ gsize length)
+{
+ g_return_if_fail (GIMP_VALUE_HOLDS_COLOR_ARRAY (value));
+
+ gimp_value_set_static_array (value, (const guint8 *) data,
+ length * sizeof (GimpRGB));
+}
+
+void
+gimp_value_take_colorarray (GValue *value,
+ GimpRGB *data,
+ gsize length)
+{
+ g_return_if_fail (GIMP_VALUE_HOLDS_COLOR_ARRAY (value));
+
+ gimp_value_take_array (value, (guint8 *) data,
+ length * sizeof (GimpRGB));
+}
Modified: branches/soc-2008-tagging/app/core/gimpparamspecs.h
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpparamspecs.h (original)
+++ branches/soc-2008-tagging/app/core/gimpparamspecs.h Sun Jul 13 12:11:51 2008
@@ -859,4 +859,49 @@
gsize length);
+/*
+ * GIMP_TYPE_COLOR_ARRAY
+ */
+
+#define GIMP_TYPE_COLOR_ARRAY (gimp_color_array_get_type ())
+#define GIMP_VALUE_HOLDS_COLOR_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_COLOR_ARRAY))
+
+GType gimp_color_array_get_type (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_COLOR_ARRAY
+ */
+
+#define GIMP_TYPE_PARAM_COLOR_ARRAY (gimp_param_color_array_get_type ())
+#define GIMP_PARAM_SPEC_COLOR_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_COLOR_ARRAY, GimpParamSpecColorArray))
+#define GIMP_IS_PARAM_SPEC_COLOR_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_COLOR_ARRAY))
+
+typedef struct _GimpParamSpecColorArray GimpParamSpecColorArray;
+
+struct _GimpParamSpecColorArray
+{
+ GParamSpecBoxed parent_instance;
+};
+
+GType gimp_param_color_array_get_type (void) G_GNUC_CONST;
+
+GParamSpec * gimp_param_spec_color_array (const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ GParamFlags flags);
+
+const GimpRGB * gimp_value_get_colorarray (const GValue *value);
+GimpRGB * gimp_value_dup_colorarray (const GValue *value);
+void gimp_value_set_colorarray (GValue *value,
+ const GimpRGB *array,
+ gsize length);
+void gimp_value_set_static_colorarray (GValue *value,
+ const GimpRGB *array,
+ gsize length);
+void gimp_value_take_colorarray (GValue *value,
+ GimpRGB *array,
+ gsize length);
+
+
#endif /* __GIMP_PARAM_SPECS_H__ */
Modified: branches/soc-2008-tagging/app/core/gimpscanconvert.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpscanconvert.c (original)
+++ branches/soc-2008-tagging/app/core/gimpscanconvert.c Sun Jul 13 12:11:51 2008
@@ -22,7 +22,7 @@
#include <glib-object.h>
-#include <cairo/cairo.h>
+#include <cairo.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
Modified: branches/soc-2008-tagging/app/dialogs/about-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/about-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/about-dialog.c Sun Jul 13 12:11:51 2008
@@ -288,14 +288,15 @@
GdkEventExpose *event,
GimpAboutDialog *dialog)
{
- GdkGC *text_gc;
- gint x, y;
- gint width, height;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ GdkGC *text_gc;
+ gint x, y;
+ gint width, height;
if (! dialog->visible)
return FALSE;
- text_gc = widget->style->text_gc[GTK_STATE_NORMAL];
+ text_gc = style->text_gc[GTK_STATE_NORMAL];
pango_layout_get_pixel_size (dialog->layout, &width, &height);
@@ -366,6 +367,7 @@
gint anim_type,
gdouble time)
{
+ GtkStyle *style = gtk_widget_get_style (dialog->anim_area);
const gchar *text;
const gchar *ptr;
gint letter_count = 0;
@@ -379,8 +381,8 @@
PangoRectangle lrect = {0, 0, 0, 0};
GdkColor mix;
- mix_colors (dialog->anim_area->style->bg + GTK_STATE_NORMAL,
- dialog->anim_area->style->fg + GTK_STATE_NORMAL, &mix, time);
+ mix_colors (style->bg + GTK_STATE_NORMAL,
+ style->fg + GTK_STATE_NORMAL, &mix, time);
text = pango_layout_get_text (dialog->layout);
g_return_if_fail (text != NULL);
@@ -476,8 +478,8 @@
else
pos = ((gdouble) (letter_count - border)) / 15;
- mix_colors (dialog->anim_area->style->fg + GTK_STATE_NORMAL,
- dialog->anim_area->style->bg + GTK_STATE_NORMAL,
+ mix_colors (style->fg + GTK_STATE_NORMAL,
+ style->bg + GTK_STATE_NORMAL,
&mix, pos);
ptr = g_utf8_next_char (ptr);
Modified: branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/channel-options-dialog.c Sun Jul 13 12:11:51 2008
@@ -191,7 +191,7 @@
GimpRGB color;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
- gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
+ gimp_rgb_set_alpha (&color, gtk_adjustment_get_value (adjustment) / 100.0);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
}
Modified: branches/soc-2008-tagging/app/dialogs/file-open-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/file-open-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/file-open-dialog.c Sun Jul 13 12:11:51 2008
@@ -170,6 +170,10 @@
gtk_widget_destroy (open_dialog);
}
+ else
+ {
+ gimp_file_dialog_set_sensitive (dialog, TRUE);
+ }
g_slist_foreach (uris, (GFunc) g_free, NULL);
g_slist_free (uris);
Modified: branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/layer-options-dialog.c Sun Jul 13 12:11:51 2008
@@ -239,7 +239,7 @@
layer_options_dialog_toggle_rename (GtkWidget *widget,
LayerOptionsDialog *options)
{
- if (GTK_TOGGLE_BUTTON (widget)->active &&
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) &&
gimp_drawable_is_text_layer (GIMP_DRAWABLE (options->layer)))
{
GimpTextLayer *text_layer = GIMP_TEXT_LAYER (options->layer);
Modified: branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/palette-import-dialog.c Sun Jul 13 12:11:51 2008
@@ -726,7 +726,8 @@
ImportDialog *dialog)
{
if (dialog->palette)
- gimp_palette_set_columns (dialog->palette, ROUND (adj->value));
+ gimp_palette_set_columns (dialog->palette,
+ ROUND (gtk_adjustment_get_value (adj)));
}
/* functions & callbacks to keep the import dialog uptodate ****************/
@@ -772,9 +773,9 @@
if (! palette_name || ! strlen (palette_name))
palette_name = _("Untitled");
- n_colors = ROUND (dialog->num_colors->value);
- n_columns = ROUND (dialog->columns->value);
- threshold = ROUND (dialog->threshold->value);
+ n_colors = ROUND (gtk_adjustment_get_value (dialog->num_colors));
+ n_columns = ROUND (gtk_adjustment_get_value (dialog->columns));
+ threshold = ROUND (gtk_adjustment_get_value (dialog->threshold));
switch (dialog->import_type)
{
Modified: branches/soc-2008-tagging/app/dialogs/preferences-dialog.c
==============================================================================
--- branches/soc-2008-tagging/app/dialogs/preferences-dialog.c (original)
+++ branches/soc-2008-tagging/app/dialogs/preferences-dialog.c Sun Jul 13 12:11:51 2008
@@ -43,6 +43,7 @@
#include "widgets/gimpdevices.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpgrideditor.h"
+#include "widgets/gimphelp.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
@@ -437,7 +438,7 @@
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
- from_gdk = GTK_TOGGLE_BUTTON (widget)->active;
+ from_gdk = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
if (from_gdk)
{
@@ -1798,15 +1799,49 @@
GTK_BOX (vbox2));
{
- GtkWidget *combo;
+ GtkWidget *combo;
+ GtkWidget *hbox;
+ GtkWidget *image;
+ GtkWidget *label;
+ const gchar *icon;
+ const gchar *text;
- table = prefs_table_new (1, GTK_CONTAINER (vbox2));
+ table = prefs_table_new (2, GTK_CONTAINER (vbox2));
combo = prefs_boolean_combo_box_add (object, "user-manual-online",
_("Use the online version"),
_("Use a locally installed copy"),
_("User manual:"),
GTK_TABLE (table), 0, size_group);
gimp_help_set_help_data (combo, NULL, NULL);
+
+ if (gimp_help_user_manual_is_installed (gimp))
+ {
+ icon = GIMP_STOCK_INFO;
+ text = _("There's a local installation of the user manual.");
+ }
+ else
+ {
+ icon = GIMP_STOCK_WARNING;
+ text = _("The user manual is not installed locally.");
+ }
+
+ hbox = gtk_hbox_new (FALSE, 6);
+ gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 1, 2);
+ gtk_widget_show (hbox);
+
+ image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_BUTTON);
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ gtk_widget_show (image);
+
+ label = gtk_label_new (text);
+ gimp_label_set_attributes (GTK_LABEL (label),
+ PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
+ -1);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+
+ gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
}
/* Help Browser */
Modified: branches/soc-2008-tagging/app/display/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/display/Makefile.am (original)
+++ branches/soc-2008-tagging/app/display/Makefile.am Sun Jul 13 12:11:51 2008
@@ -45,6 +45,7 @@
gimpdisplayshell-icon.h \
gimpdisplayshell-preview.c \
gimpdisplayshell-preview.h \
+ gimpdisplayshell-private.h \
gimpdisplayshell-progress.c \
gimpdisplayshell-progress.h \
gimpdisplayshell-render.c \
Modified: branches/soc-2008-tagging/app/display/gimpcanvas.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpcanvas.c (original)
+++ branches/soc-2008-tagging/app/display/gimpcanvas.c Sun Jul 13 12:11:51 2008
@@ -828,6 +828,7 @@
cairo_t *cr)
{
GtkWidget *widget = GTK_WIDGET (canvas);
+ GtkStyle *style = gtk_widget_get_style (widget);
gdouble wilber_width;
gdouble wilber_height;
gdouble width;
@@ -857,9 +858,9 @@
widget->allocation.height / factor - wilber_height * 1.1);
cairo_set_source_rgba (cr,
- widget->style->fg[widget->state].red / 65535.0,
- widget->style->fg[widget->state].green / 65535.0,
- widget->style->fg[widget->state].blue / 65535.0,
+ style->fg[widget->state].red / 65535.0,
+ style->fg[widget->state].green / 65535.0,
+ style->fg[widget->state].blue / 65535.0,
0.15);
cairo_fill (cr);
}
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-appearance.c Sun Jul 13 12:11:51 2008
@@ -180,7 +180,7 @@
g_object_set (options, "show-rulers", show, NULL);
- table = GTK_TABLE (GTK_WIDGET (shell->canvas)->parent);
+ table = GTK_TABLE (gtk_widget_get_parent (GTK_WIDGET (shell->canvas)));
if (show)
{
@@ -220,6 +220,7 @@
gboolean show)
{
GimpDisplayOptions *options;
+ GtkWidget *parent;
GtkBox *hbox;
GtkBox *vbox;
@@ -229,8 +230,11 @@
g_object_set (options, "show-scrollbars", show, NULL);
- hbox = GTK_BOX (shell->vsb->parent->parent);
- vbox = GTK_BOX (shell->hsb->parent->parent);
+ parent = gtk_widget_get_parent (shell->vsb);
+ hbox = GTK_BOX (gtk_widget_get_parent (parent));
+
+ parent = gtk_widget_get_parent (shell->hsb);
+ vbox = GTK_BOX (gtk_widget_get_parent (parent));
if (show)
{
@@ -585,9 +589,13 @@
case GIMP_CANVAS_PADDING_MODE_DEFAULT:
if (shell->canvas)
{
+ GtkStyle *style;
+
gtk_widget_ensure_style (shell->canvas);
- gimp_rgb_set_gdk_color (&color,
- shell->canvas->style->bg + GTK_STATE_NORMAL);
+
+ style = gtk_widget_get_style (shell->canvas);
+
+ gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
}
break;
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-autoscroll.c Sun Jul 13 12:11:51 2008
@@ -26,6 +26,7 @@
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-autoscroll.h"
#include "gimpdisplayshell-coords.h"
+#include "gimpdisplayshell-private.h"
#include "gimpdisplayshell-scroll.h"
#include "gimpdisplayshell-transform.h"
@@ -135,9 +136,9 @@
info->time += AUTOSCROLL_DT;
- gimp_display_shell_scroll (shell,
- AUTOSCROLL_DX * (gdouble) dx,
- AUTOSCROLL_DX * (gdouble) dy);
+ gimp_display_shell_scroll_private (shell,
+ AUTOSCROLL_DX * (gdouble) dx,
+ AUTOSCROLL_DX * (gdouble) dy);
gimp_display_shell_untransform_coordinate (shell,
&device_coords,
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-callbacks.c Sun Jul 13 12:11:51 2008
@@ -67,6 +67,7 @@
#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"
@@ -84,7 +85,15 @@
GimpDisplayShell *shell);
static void gimp_display_shell_hscrollbar_update (GtkAdjustment *adjustment,
GimpDisplayShell *shell);
+static gboolean gimp_display_shell_vscrollbar_update_range (GtkRange *range,
+ GtkScrollType scroll,
+ gdouble value,
+ GimpDisplayShell *shell);
+static gboolean gimp_display_shell_hscrollbar_update_range (GtkRange *range,
+ GtkScrollType scroll,
+ gdouble value,
+ GimpDisplayShell *shell);
static GdkModifierType
gimp_display_shell_key_to_state (gint key);
@@ -175,11 +184,7 @@
case GDK_KP_Enter:
case GDK_ISO_Enter:
case GDK_BackSpace:
- break;
-
case GDK_Escape:
- if (event->type == GDK_KEY_PRESS)
- gimp_display_shell_set_fullscreen (shell, FALSE);
break;
default:
@@ -242,6 +247,14 @@
G_CALLBACK (gimp_display_shell_vscrollbar_update),
shell);
+ g_signal_connect (shell->hsb, "change-value",
+ G_CALLBACK (gimp_display_shell_hscrollbar_update_range),
+ shell);
+
+ g_signal_connect (shell->vsb, "change-value",
+ G_CALLBACK (gimp_display_shell_vscrollbar_update_range),
+ shell);
+
/* allow shrinking */
gtk_widget_set_size_request (GTK_WIDGET (shell), 0, 0);
@@ -327,6 +340,52 @@
}
}
+gboolean
+gimp_display_shell_hscrollbar_update_range (GtkRange *range,
+ GtkScrollType scroll,
+ gdouble value,
+ GimpDisplayShell *shell)
+{
+ g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), TRUE);
+
+ if (! shell->display)
+ return TRUE;
+
+ if ((scroll == GTK_SCROLL_JUMP) ||
+ (scroll == GTK_SCROLL_PAGE_BACKWARD) ||
+ (scroll == GTK_SCROLL_PAGE_FORWARD))
+ return FALSE;
+
+ gimp_display_shell_setup_hscrollbar_with_value (shell, value);
+
+ gtk_adjustment_changed (shell->hsbdata);
+
+ return FALSE;
+}
+
+gboolean
+gimp_display_shell_vscrollbar_update_range (GtkRange *range,
+ GtkScrollType scroll,
+ gdouble value,
+ GimpDisplayShell *shell)
+{
+ g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), TRUE);
+
+ if (! shell->display)
+ return TRUE;
+
+ if ((scroll == GTK_SCROLL_JUMP) ||
+ (scroll == GTK_SCROLL_PAGE_BACKWARD) ||
+ (scroll == GTK_SCROLL_PAGE_FORWARD))
+ return FALSE;
+
+ gimp_display_shell_setup_vscrollbar_with_value (shell, value);
+
+ gtk_adjustment_changed (shell->vsbdata);
+
+ return FALSE;
+}
+
static void
gimp_display_shell_check_device_cursor (GimpDisplayShell *shell)
{
@@ -987,10 +1046,11 @@
break;
}
- value = adj->value + ((direction == GDK_SCROLL_UP ||
- direction == GDK_SCROLL_LEFT) ?
- -adj->page_increment / 2 :
- adj->page_increment / 2);
+ value = (gtk_adjustment_get_value (adj) +
+ ((direction == GDK_SCROLL_UP ||
+ direction == GDK_SCROLL_LEFT) ?
+ -adj->page_increment / 2 :
+ adj->page_increment / 2));
value = CLAMP (value, adj->lower, adj->upper - adj->page_size);
gtk_adjustment_set_value (adj, value);
@@ -1096,11 +1156,11 @@
if (shell->scrolling)
{
- gimp_display_shell_scroll (shell,
- (shell->scroll_start_x - mevent->x -
- shell->offset_x),
- (shell->scroll_start_y - mevent->y -
- shell->offset_y));
+ gimp_display_shell_scroll_private (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)
{
@@ -1651,14 +1711,20 @@
gimp_display_shell_vscrollbar_update (GtkAdjustment *adjustment,
GimpDisplayShell *shell)
{
- gimp_display_shell_scroll (shell, 0, (adjustment->value - shell->offset_y));
+ gimp_display_shell_scroll_private (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 (shell, (adjustment->value - shell->offset_x), 0);
+ gimp_display_shell_scroll_private (shell,
+ gtk_adjustment_get_value (adjustment) -
+ shell->offset_x,
+ 0);
}
static GdkModifierType
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-close.c Sun Jul 13 12:11:51 2008
@@ -90,7 +90,19 @@
image->dirty &&
shell->display->config->confirm_on_close)
{
- gimp_display_shell_close_dialog (shell, image);
+ /* If there's a save dialog active for this image, then raise it.
+ * (see bug #511965)
+ */
+ GtkWidget *dialog = g_object_get_data (G_OBJECT (image),
+ "gimp-file-save-dialog");
+ if (dialog)
+ {
+ gtk_window_present (GTK_WINDOW (dialog));
+ }
+ else
+ {
+ gimp_display_shell_close_dialog (shell, image);
+ }
}
else if (image)
{
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-draw.c Sun Jul 13 12:11:51 2008
@@ -48,6 +48,7 @@
#include "gimpdisplayshell-appearance.h"
#include "gimpdisplayshell-draw.h"
#include "gimpdisplayshell-render.h"
+#include "gimpdisplayshell-scroll.h"
#include "gimpdisplayshell-transform.h"
@@ -511,35 +512,16 @@
gint w,
gint h)
{
- GimpProjection *proj;
- TileManager *tiles;
- gint level;
- gint level_width;
- gint level_height;
- gint sx, sy;
- gint sw, sh;
+ gint sx, sy;
+ gint sw, sh;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (! shell->display->image)
return;
- 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);
-
- /* the image's size in display coordinates */
- sx = shell->disp_xoffset - shell->offset_x;
- sy = shell->disp_yoffset - shell->offset_y;
-
- /* SCALE[XY] with pyramid level taken into account. */
- sw = PROJ_ROUND (level_width * (shell->scale_x * (1 << level)));
- sh = PROJ_ROUND (level_height * (shell->scale_y * (1 << level)));
+ gimp_display_shell_get_scaled_image_viewport_offset (shell, &sx, &sy);
+ gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
/* check if the passed in area intersects with
* both the display and the image
@@ -574,14 +556,19 @@
{
for (j = x; j < x2; j += GIMP_DISPLAY_RENDER_BUF_WIDTH)
{
+ gint disp_xoffset, disp_yoffset;
gint dx, dy;
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_render (shell,
- j - shell->disp_xoffset,
- i - shell->disp_yoffset,
+ j - disp_xoffset,
+ i - disp_yoffset,
dx, dy,
shell->highlight ? &rect : NULL);
}
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-progress.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-progress.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-progress.c Sun Jul 13 12:11:51 2008
@@ -144,12 +144,17 @@
/* warning messages go to the statusbar, if it's visible */
if (! gimp_statusbar_get_visible (GIMP_STATUSBAR (shell->statusbar)))
break;
- /* else fallthrough */
+ else
+ return gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
+ severity, domain, message);
case GIMP_MESSAGE_INFO:
- /* info messages go to the statusbar, no matter if it's visible or not */
- return gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
- severity, domain, message);
+ /* info messages go to the statusbar;
+ * if they are not handled there, they are swallowed
+ */
+ gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
+ severity, domain, message);
+ return TRUE;
}
return FALSE;
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-render.c Sun Jul 13 12:11:51 2008
@@ -44,6 +44,7 @@
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-filter.h"
#include "gimpdisplayshell-render.h"
+#include "gimpdisplayshell-scroll.h"
#define GIMP_DISPLAY_ZOOM_FAST (1 << 0) /* use the fastest possible code
path trading quality for speed
@@ -223,6 +224,8 @@
GimpImage *image;
RenderInfo info;
GimpImageType type;
+ gint offset_x;
+ gint offset_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (w > 0 && h > 0);
@@ -230,13 +233,15 @@
image = shell->display->image;
projection = image->projection;
+ gimp_display_shell_get_render_start_offset (shell, &offset_x, &offset_y);
+
/* Initialize RenderInfo with values that don't change during the
* call of this function.
*/
info.shell = shell;
- info.x = x + shell->offset_x;
- info.y = y + shell->offset_y;
+ info.x = x + offset_x;
+ info.y = y + offset_y;
info.w = w;
info.h = h;
@@ -310,12 +315,20 @@
}
/* put it to the screen */
- gimp_canvas_draw_rgb (GIMP_CANVAS (shell->canvas), GIMP_CANVAS_STYLE_RENDER,
- x + shell->disp_xoffset, y + shell->disp_yoffset,
+ {
+ 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_canvas_draw_rgb (GIMP_CANVAS (shell->canvas), GIMP_CANVAS_STYLE_RENDER,
+ x + disp_xoffset, y + disp_yoffset,
w, h,
shell->render_buf,
3 * GIMP_DISPLAY_RENDER_BUF_WIDTH,
- shell->offset_x, shell->offset_y);
+ offset_x, offset_y);
+ }
}
@@ -338,16 +351,20 @@
{
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);
- rect.x = shell->offset_x + x;
- rect.y = shell->offset_y + y;
+ rect.x = x + offset_x;
+ rect.y = y + offset_y;
rect.width = w;
rect.height = h;
if (gdk_rectangle_intersect (highlight, &rect, &rect))
{
- rect.x -= shell->offset_x + x;
- rect.y -= shell->offset_y + y;
+ rect.x -= x + offset_x;
+ rect.y -= y + offset_y;
for (y = 0; y < rect.y; y++)
{
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c Sun Jul 13 12:11:51 2008
@@ -89,10 +89,7 @@
gimp_display_shell_scale_setup (GimpDisplayShell *shell)
{
GimpImage *image;
- gdouble lower;
- gdouble upper;
- gdouble max_size;
- gfloat sx, sy;
+ gfloat sw, sh;
gint image_width;
gint image_height;
@@ -108,126 +105,113 @@
image_width = gimp_image_get_width (image);
image_height = gimp_image_get_height (image);
- sx = SCALEX (shell, image_width);
- sy = SCALEY (shell, image_height);
+ sw = SCALEX (shell, image_width);
+ sh = SCALEY (shell, image_height);
}
else
{
image_width = shell->disp_width;
image_height = shell->disp_height;
- sx = image_width;
- sy = image_height;
+ sw = image_width;
+ sh = image_height;
}
+
+ /* Horizontal scrollbar */
+
shell->hsbdata->value = shell->offset_x;
- shell->hsbdata->upper = sx;
- shell->hsbdata->page_size = MIN (sx, shell->disp_width);
+ shell->hsbdata->page_size = shell->disp_width;
shell->hsbdata->page_increment = shell->disp_width / 2;
shell->hsbdata->step_increment = shell->scale_x;
- shell->vsbdata->value = shell->offset_y;
- shell->vsbdata->upper = sy;
- shell->vsbdata->page_size = MIN (sy, shell->disp_height);
- shell->vsbdata->page_increment = shell->disp_height / 2;
- shell->vsbdata->step_increment = shell->scale_y;
+ gimp_display_shell_setup_hscrollbar_with_value (shell, shell->offset_x);
gtk_adjustment_changed (shell->hsbdata);
- gtk_adjustment_changed (shell->vsbdata);
-
- /* horizontal ruler */
-
- lower = 0;
-
- if (image)
- {
- upper = img2real (shell, TRUE, FUNSCALEX (shell, shell->disp_width));
- max_size = img2real (shell, TRUE, MAX (image_width, image_height));
- }
- else
- {
- upper = image_width;
- max_size = MAX (image_width, image_height);
- }
-
- if (image && sx < shell->disp_width)
- {
- shell->disp_xoffset = (shell->disp_width - sx) / 2;
-
- lower -= img2real (shell, TRUE,
- FUNSCALEX (shell, (gdouble) shell->disp_xoffset));
- upper -= img2real (shell, TRUE,
- FUNSCALEX (shell, (gdouble) shell->disp_xoffset));
- }
- else if (image)
- {
- shell->disp_xoffset = 0;
-
- lower += img2real (shell, TRUE,
- FUNSCALEX (shell, (gdouble) shell->offset_x));
- upper += img2real (shell, TRUE,
- FUNSCALEX (shell, (gdouble) shell->offset_x));
- }
- else
- {
- shell->disp_xoffset = 0;
- }
- gimp_ruler_set_range (GIMP_RULER (shell->hrule), lower, upper, max_size);
- gimp_ruler_set_unit (GIMP_RULER (shell->hrule), shell->unit);
- /* vertical ruler */
-
- lower = 0;
-
- if (image)
- {
- upper = img2real (shell, FALSE, FUNSCALEY (shell, shell->disp_height));
- max_size = img2real (shell, FALSE, MAX (image_width, image_height));
- }
- else
- {
- upper = image_height;
- max_size = MAX (image_width, image_height);
- }
+ /* Vertcal scrollbar */
- if (image && sy < shell->disp_height)
- {
- shell->disp_yoffset = (shell->disp_height - sy) / 2;
+ shell->vsbdata->value = shell->offset_y;
+ shell->vsbdata->page_size = shell->disp_height;
+ shell->vsbdata->page_increment = shell->disp_height / 2;
+ shell->vsbdata->step_increment = shell->scale_y;
- lower -= img2real (shell, FALSE,
- FUNSCALEY (shell, (gdouble) shell->disp_yoffset));
- upper -= img2real (shell, FALSE,
- FUNSCALEY (shell, (gdouble) shell->disp_yoffset));
- }
- else if (image)
- {
- shell->disp_yoffset = 0;
+ gimp_display_shell_setup_vscrollbar_with_value (shell, shell->offset_y);
- lower += img2real (shell, FALSE,
- FUNSCALEY (shell, (gdouble) shell->offset_y));
- upper += img2real (shell, FALSE,
- FUNSCALEY (shell, (gdouble) shell->offset_y));
- }
- else
- {
- shell->disp_yoffset = 0;
- }
+ gtk_adjustment_changed (shell->vsbdata);
- gimp_ruler_set_range (GIMP_RULER (shell->vrule), lower, upper, max_size);
- gimp_ruler_set_unit (GIMP_RULER (shell->vrule), shell->unit);
-#if 0
- g_printerr ("offset_x: %d\n"
- "offset_y: %d\n"
- "disp_width: %d\n"
- "disp_height: %d\n"
- "disp_xoffset: %d\n"
- "disp_yoffset: %d\n\n",
- shell->offset_x, shell->offset_y,
- shell->disp_width, shell->disp_height,
- shell->disp_xoffset, shell->disp_yoffset);
-#endif
+ /* Setup rulers */
+ {
+ gdouble horizontal_lower;
+ gdouble horizontal_upper;
+ gdouble horizontal_max_size;
+ gdouble vertical_lower;
+ gdouble vertical_upper;
+ gdouble vertical_max_size;
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
+
+
+ /* Initialize values */
+
+ horizontal_lower = 0;
+ vertical_lower = 0;
+
+ 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 */
+
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+
+ horizontal_lower -= img2real (shell, TRUE,
+ FUNSCALEX (shell, (gdouble) scaled_image_viewport_offset_x));
+ horizontal_upper -= img2real (shell, TRUE,
+ FUNSCALEX (shell, (gdouble) scaled_image_viewport_offset_x));
+
+ vertical_lower -= img2real (shell, FALSE,
+ FUNSCALEY (shell, (gdouble) scaled_image_viewport_offset_y));
+ vertical_upper -= img2real (shell, FALSE,
+ FUNSCALEY (shell, (gdouble) scaled_image_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);
+ }
}
/**
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c Sun Jul 13 12:11:51 2008
@@ -26,24 +26,61 @@
#include "display-types.h"
+#include "base/tile-manager.h"
+
#include "core/gimpimage.h"
+#include "core/gimpprojection.h"
#include "gimpdisplay.h"
#include "gimpdisplay-foreach.h"
#include "gimpdisplayshell.h"
+#include "gimpdisplayshell-private.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-scroll.h"
-gboolean
-gimp_display_shell_scroll (GimpDisplayShell *shell,
- gint x_offset,
- gint y_offset)
+#define OVERPAN_FACTOR 0.5
+
+
+/**
+ * gimp_display_shell_center_around_image_coordinate:
+ * @shell:
+ * @image_x:
+ * @image_y:
+ *
+ * Center the viewport around the passed image coordinate
+ *
+ **/
+void
+gimp_display_shell_center_around_image_coordinate (GimpDisplayShell *shell,
+ gdouble image_x,
+ gdouble image_y)
+{
+ gint scaled_image_x;
+ gint scaled_image_y;
+ gint offset_to_apply_x;
+ gint offset_to_apply_y;
+
+ scaled_image_x = RINT (image_x * shell->scale_x);
+ scaled_image_y = RINT (image_y * shell->scale_y);
+
+ 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);
+}
+
+void
+gimp_display_shell_scroll_private (GimpDisplayShell *shell,
+ gint x_offset,
+ gint y_offset)
{
gint old_x;
gint old_y;
- g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
old_x = shell->offset_x;
old_y = shell->offset_y;
@@ -80,11 +117,7 @@
gimp_display_shell_resume (shell);
gimp_display_shell_scrolled (shell);
-
- return TRUE;
}
-
- return FALSE;
}
void
@@ -94,16 +127,47 @@
if (shell->display->image)
{
- gint sx, sy;
-
- sx = SCALEX (shell, gimp_image_get_width (shell->display->image));
- sy = SCALEY (shell, gimp_image_get_height (shell->display->image));
+ gint sw, sh;
+ gint min_offset_x;
+ gint max_offset_x;
+ gint min_offset_y;
+ gint max_offset_y;
+
+ sw = SCALEX (shell, gimp_image_get_width (shell->display->image));
+ sh = SCALEY (shell, gimp_image_get_height (shell->display->image));
+
+ if (shell->disp_width < sw)
+ {
+ min_offset_x = 0 - shell->disp_width * OVERPAN_FACTOR;
+ max_offset_x = sw - shell->disp_width * (1.0 - OVERPAN_FACTOR);
+ }
+ else
+ {
+ gint overpan_amount;
+
+ overpan_amount = shell->disp_width - sw * (1.0 - OVERPAN_FACTOR);
+
+ min_offset_x = 0 - overpan_amount;
+ max_offset_x = sw + overpan_amount - shell->disp_width;
+ }
+
+ if (shell->disp_height < sh)
+ {
+ min_offset_y = 0 - shell->disp_height * OVERPAN_FACTOR;
+ max_offset_y = sh - shell->disp_height * (1.0 - OVERPAN_FACTOR);
+ }
+ else
+ {
+ gint overpan_amount;
+
+ overpan_amount = shell->disp_height - sh * (1.0 - OVERPAN_FACTOR);
+
+ min_offset_y = 0 - overpan_amount;
+ max_offset_y = sh + overpan_amount - shell->disp_height;
+ }
- shell->offset_x = CLAMP (shell->offset_x, 0,
- MAX (sx - shell->disp_width, 0));
-
- shell->offset_y = CLAMP (shell->offset_y, 0,
- MAX (sy - shell->disp_height, 0));
+ shell->offset_x = CLAMP (shell->offset_x, min_offset_x, max_offset_x);
+ shell->offset_y = CLAMP (shell->offset_y, min_offset_y, max_offset_y);
}
else
{
@@ -111,3 +175,261 @@
shell->offset_y = 0;
}
}
+
+/**
+ * gimp_display_shell_get_scaled_viewport:
+ * @shell:
+ * @x:
+ * @y:
+ * @w:
+ * @h:
+ *
+ * Gets the viewport in screen coordinates, with origin at (0, 0) in
+ * the image
+ *
+ **/
+void
+gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y,
+ gint *w,
+ gint *h)
+{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
+
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+ if (x) *x = -scaled_image_viewport_offset_x;
+ if (y) *y = -scaled_image_viewport_offset_y;
+ if (w) *w = shell->disp_width;
+ if (h) *h = shell->disp_height;
+}
+
+/**
+ * gimp_display_shell_get_viewport:
+ * @shell:
+ * @x:
+ * @y:
+ * @w:
+ * @h:
+ *
+ * Gets the viewport in image coordinates
+ *
+ **/
+void
+gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
+ gdouble *x,
+ gdouble *y,
+ gdouble *w,
+ gdouble *h)
+{
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (x) *x = shell->offset_x / shell->scale_x;
+ if (y) *y = shell->offset_y / shell->scale_y;
+ if (w) *w = shell->disp_width / shell->scale_x;
+ if (h) *h = shell->disp_height / shell->scale_y;
+}
+
+/**
+ * gimp_display_shell_get_scaled_image_viewport_offset:
+ * @shell:
+ * @x:
+ * @y:
+ *
+ * Gets the scaled image offset in viewport coordinates
+ *
+ **/
+void
+gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y)
+{
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (x) *x = -shell->offset_x;
+ if (y) *y = -shell->offset_y;
+}
+
+/**
+ * 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:
+ * @shell:
+ * @disp_xoffset:
+ * @disp_yoffset:
+ *
+ * In viewport coordinates, get the offset of where to start rendering
+ * the scaled image.
+ *
+ **/
+void
+gimp_display_shell_get_disp_offset (const GimpDisplayShell *shell,
+ gint *disp_xoffset,
+ gint *disp_yoffset)
+{
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (disp_xoffset)
+ {
+ if (shell->offset_x < 0)
+ {
+ *disp_xoffset = -shell->offset_x;
+ }
+ else
+ {
+ *disp_xoffset = 0;
+ }
+ }
+
+ if (disp_yoffset)
+ {
+ if (shell->offset_y < 0)
+ {
+ *disp_yoffset = -shell->offset_y;
+ }
+ else
+ {
+ *disp_yoffset = 0;
+ }
+ }
+}
+
+/**
+ * gimp_display_shell_get_render_start_offset:
+ * @shell:
+ * @offset_x:
+ * @offset_y:
+ *
+ * Get the offset into the scaled image that we should start render
+ * from
+ *
+ **/
+void
+gimp_display_shell_get_render_start_offset (const GimpDisplayShell *shell,
+ gint *offset_x,
+ gint *offset_y)
+{
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (offset_x) *offset_x = MAX (0, shell->offset_x);
+ if (offset_y) *offset_y = MAX (0, shell->offset_y);
+}
+
+/**
+ * gimp_display_shell_setup_hscrollbar_with_value:
+ * @shell:
+ * @value:
+ *
+ * Setup the limits of the horizontal scrollbar
+ *
+ **/
+void
+gimp_display_shell_setup_hscrollbar_with_value (GimpDisplayShell *shell,
+ gdouble value)
+{
+ gint sw;
+
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (! shell->display ||
+ ! shell->display->image)
+ return;
+
+ sw = SCALEX (shell, gimp_image_get_width (shell->display->image));
+
+ if (shell->disp_width < sw)
+ {
+ shell->hsbdata->upper = MAX (value + shell->disp_width,
+ sw);
+
+ shell->hsbdata->lower = MIN (value,
+ 0);
+ }
+ else
+ {
+ shell->hsbdata->lower = MIN (value,
+ -(shell->disp_width - sw) / 2);
+
+ shell->hsbdata->upper = MAX (value + shell->disp_width,
+ sw + (shell->disp_width - sw) / 2);
+ }
+}
+
+/**
+ * gimp_display_shell_setup_vscrollbar_with_value:
+ * @shell:
+ * @value:
+ *
+ * Setup the limits of the vertical scrollbar
+ *
+ **/
+void
+gimp_display_shell_setup_vscrollbar_with_value (GimpDisplayShell *shell,
+ gdouble value)
+{
+ gint sh;
+
+ g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+ if (! shell->display ||
+ ! shell->display->image)
+ return;
+
+ sh = SCALEY (shell, gimp_image_get_height (shell->display->image));
+
+ if (shell->disp_height < sh)
+ {
+ shell->vsbdata->upper = MAX (value + shell->disp_height,
+ sh);
+
+ shell->vsbdata->lower = MIN (value,
+ 0);
+ }
+ else
+ {
+ shell->vsbdata->lower = MIN (value,
+ -(shell->disp_height - sh) / 2);
+
+ shell->vsbdata->upper = MAX (value + shell->disp_height,
+ sh + (shell->disp_height - sh) / 2);
+ }
+}
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.h Sun Jul 13 12:11:51 2008
@@ -20,11 +20,44 @@
#define __GIMP_DISPLAY_SHELL_SCROLL_H__
-gboolean gimp_display_shell_scroll (GimpDisplayShell *shell,
- gint x_offset,
- gint y_offset);
+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_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_image_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);
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_H__ */
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-transform.c Sun Jul 13 12:11:51 2008
@@ -31,6 +31,7 @@
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
+#include "gimpdisplayshell-scroll.h"
#include "gimpdisplayshell-transform.h"
@@ -48,6 +49,9 @@
GimpCoords *image_coords,
GimpCoords *display_coords)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
+
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (image_coords != NULL);
g_return_if_fail (display_coords != NULL);
@@ -57,8 +61,12 @@
display_coords->x = SCALEX (shell, image_coords->x);
display_coords->y = SCALEY (shell, image_coords->y);
- display_coords->x += - shell->offset_x + shell->disp_xoffset;
- display_coords->y += - shell->offset_y + shell->disp_yoffset;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+
+ display_coords->x += scaled_image_viewport_offset_x;
+ display_coords->y += scaled_image_viewport_offset_y;
}
/**
@@ -75,14 +83,21 @@
GimpCoords *display_coords,
GimpCoords *image_coords)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
+
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (display_coords != NULL);
g_return_if_fail (image_coords != NULL);
*image_coords = *display_coords;
- image_coords->x = display_coords->x - shell->disp_xoffset + shell->offset_x;
- image_coords->y = display_coords->y - shell->disp_yoffset + shell->offset_y;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+
+ image_coords->x = display_coords->x - scaled_image_viewport_offset_x;
+ image_coords->y = display_coords->y - scaled_image_viewport_offset_y;
image_coords->x /= shell->scale_x;
image_coords->y /= shell->scale_y;
@@ -96,6 +111,8 @@
gint *ny,
gboolean use_offsets)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
gint64 tx;
@@ -119,8 +136,11 @@
tx = ((gint64) x * shell->x_src_dec) / shell->x_dest_inc;
ty = ((gint64) y * shell->y_src_dec) / shell->y_dest_inc;
- tx += shell->disp_xoffset - shell->offset_x;
- ty += shell->disp_yoffset - shell->offset_y;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+ tx += scaled_image_viewport_offset_x;
+ ty += scaled_image_viewport_offset_y;
/* The projected coordinates might overflow a gint in the case of big
images at high zoom levels, so we clamp them here to avoid problems. */
@@ -153,6 +173,8 @@
gboolean round,
gboolean use_offsets)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
gint64 tx;
@@ -170,8 +192,11 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- tx = (gint64) x + shell->offset_x - shell->disp_xoffset;
- ty = (gint64) y + shell->offset_y - shell->disp_yoffset;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+ tx = (gint64) x - scaled_image_viewport_offset_x;
+ ty = (gint64) y - scaled_image_viewport_offset_y;
tx *= shell->x_dest_inc;
ty *= shell->y_dest_inc;
@@ -207,6 +232,8 @@
gdouble *ny,
gboolean use_offsets)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
@@ -222,11 +249,12 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- *nx = SCALEX (shell, x + offset_x) - shell->offset_x;
- *ny = SCALEY (shell, y + offset_y) - shell->offset_y;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
- *nx += shell->disp_xoffset;
- *ny += shell->disp_yoffset;
+ *nx = SCALEX (shell, x + offset_x) + scaled_image_viewport_offset_x;
+ *ny = SCALEY (shell, y + offset_y) + scaled_image_viewport_offset_y;
}
/**
@@ -251,6 +279,8 @@
gdouble *ny,
gboolean use_offsets)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
@@ -258,9 +288,6 @@
g_return_if_fail (nx != NULL);
g_return_if_fail (ny != NULL);
- x -= shell->disp_xoffset;
- y -= shell->disp_yoffset;
-
if (use_offsets)
{
GimpItem *item;
@@ -269,8 +296,12 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- *nx = (x + shell->offset_x) / shell->scale_x - offset_x;
- *ny = (y + shell->offset_y) / shell->scale_y - offset_y;
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+
+ *nx = (x - scaled_image_viewport_offset_x) / shell->scale_x - offset_x;
+ *ny = (y - scaled_image_viewport_offset_y) / shell->scale_y - offset_y;
}
/**
@@ -308,17 +339,22 @@
for (i = 0; i < n_points ; i++)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gdouble x = points[i].x + offset_x;
gdouble y = points[i].y + offset_y;
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_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
coords[i].x = CLAMP (PROJ_ROUND64 (x) +
- shell->disp_xoffset - shell->offset_x,
+ scaled_image_viewport_offset_x,
G_MININT, G_MAXINT);
coords[i].y = CLAMP (PROJ_ROUND64 (y) +
- shell->disp_yoffset - shell->offset_y,
+ scaled_image_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
@@ -358,17 +394,22 @@
for (i = 0; i < n_coords ; i++)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gdouble x = image_coords[i].x + offset_x;
gdouble y = image_coords[i].y + offset_y;
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_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) +
- shell->disp_xoffset - shell->offset_x,
+ scaled_image_viewport_offset_x,
G_MININT, G_MAXINT);
disp_coords[i].y = CLAMP (PROJ_ROUND64 (y) +
- shell->disp_yoffset - shell->offset_y,
+ scaled_image_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
@@ -408,6 +449,8 @@
for (i = 0; i < n_segs ; i++)
{
+ gint scaled_image_viewport_offset_x;
+ gint scaled_image_viewport_offset_y;
gint64 x1, x2;
gint64 y1, y2;
@@ -421,13 +464,17 @@
y1 = (y1 * shell->y_src_dec) / shell->y_dest_inc;
y2 = (y2 * shell->y_src_dec) / shell->y_dest_inc;
- dest_segs[i].x1 = CLAMP (x1 + shell->disp_xoffset - shell->offset_x,
+ gimp_display_shell_get_scaled_image_viewport_offset (shell,
+ &scaled_image_viewport_offset_x,
+ &scaled_image_viewport_offset_y);
+
+ dest_segs[i].x1 = CLAMP (x1 + scaled_image_viewport_offset_x,
G_MININT, G_MAXINT);
- dest_segs[i].x2 = CLAMP (x2 + shell->disp_xoffset - shell->offset_x,
+ dest_segs[i].x2 = CLAMP (x2 + scaled_image_viewport_offset_x,
G_MININT, G_MAXINT);
- dest_segs[i].y1 = CLAMP (y1 + shell->disp_yoffset - shell->offset_y,
+ dest_segs[i].y1 = CLAMP (y1 + scaled_image_viewport_offset_y,
G_MININT, G_MAXINT);
- dest_segs[i].y2 = CLAMP (y2 + shell->disp_yoffset - shell->offset_y,
+ dest_segs[i].y2 = CLAMP (y2 + scaled_image_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell.c (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell.c Sun Jul 13 12:11:51 2008
@@ -257,8 +257,6 @@
shell->disp_width = 0;
shell->disp_height = 0;
- shell->disp_xoffset = 0;
- shell->disp_yoffset = 0;
shell->proximity = FALSE;
shell->snap_to_guides = TRUE;
@@ -937,12 +935,20 @@
shell->hsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_width,
1, 1, image_width));
shell->hsb = gtk_hscrollbar_new (shell->hsbdata);
+
+ gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
+ gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
+
GTK_WIDGET_UNSET_FLAGS (shell->hsb, GTK_CAN_FOCUS);
/* the vertical scrollbar */
shell->vsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_height,
1, 1, image_height));
shell->vsb = gtk_vscrollbar_new (shell->vsbdata);
+
+ gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
+ gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
+
GTK_WIDGET_UNSET_FLAGS (shell->vsb, GTK_CAN_FOCUS);
/* create the contents of the inner_table ********************************/
@@ -1334,9 +1340,6 @@
GimpUnit unit,
gdouble scale)
{
- gint display_width;
- gint display_height;
-
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
g_return_if_fail (GIMP_IS_IMAGE (image));
@@ -1345,8 +1348,7 @@
GTK_WIDGET (shell));
gimp_display_shell_set_unit (shell, unit);
- gimp_display_shell_set_initial_scale (shell, scale,
- &display_width, &display_height);
+ gimp_display_shell_set_initial_scale (shell, scale, NULL, NULL);
gimp_display_shell_scale_changed (shell);
gimp_statusbar_fill (GIMP_STATUSBAR (shell->statusbar));
Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell.h (original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell.h Sun Jul 13 12:11:51 2008
@@ -99,8 +99,6 @@
gint disp_width; /* width of drawing area */
gint disp_height; /* height of drawing area */
- gint disp_xoffset;
- gint disp_yoffset;
gboolean proximity; /* is a device in proximity */
gboolean snap_to_guides; /* should the guides be snapped to? */
Modified: branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpnavigationeditor.c (original)
+++ branches/soc-2008-tagging/app/display/gimpnavigationeditor.c Sun Jul 13 12:11:51 2008
@@ -53,6 +53,9 @@
#include "gimp-intl.h"
+#define BORDER_PEN_WIDTH 3
+
+
static void gimp_navigation_editor_docked_iface_init (GimpDockedInterface *iface);
static void gimp_navigation_editor_destroy (GtkObject *object);
@@ -71,6 +74,8 @@
static void gimp_navigation_editor_marker_changed (GimpNavigationView *view,
gdouble x,
gdouble y,
+ gdouble width,
+ gdouble height,
GimpNavigationEditor *editor);
static void gimp_navigation_editor_zoom (GimpNavigationView *view,
GimpZoomType direction,
@@ -220,6 +225,7 @@
gint click_x,
gint click_y)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GimpNavigationEditor *editor;
GimpNavigationView *view;
GdkScreen *screen;
@@ -266,17 +272,15 @@
/* decide where to put the popup */
gdk_window_get_origin (widget->window, &x_org, &y_org);
-#define BORDER_PEN_WIDTH 3
-
x = (x_org + click_x -
view->p_x -
0.5 * (view->p_width - BORDER_PEN_WIDTH) -
- 2 * widget->style->xthickness);
+ 2 * style->xthickness);
y = (y_org + click_y -
view->p_y -
0.5 * (view->p_height - BORDER_PEN_WIDTH) -
- 2 * widget->style->ythickness);
+ 2 * style->ythickness);
/* If the popup doesn't fit into the screen, we have a problem.
* We move the popup onscreen and risk that the pointer is not
@@ -290,10 +294,10 @@
x = CLAMP (x, 0, (gdk_screen_get_width (screen) -
GIMP_VIEW (view)->renderer->width -
- 4 * widget->style->xthickness));
+ 4 * style->xthickness));
y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
GIMP_VIEW (view)->renderer->height -
- 4 * widget->style->ythickness));
+ 4 * style->ythickness));
gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
gtk_widget_show (shell->nav_popup);
@@ -304,8 +308,6 @@
view->motion_offset_x = 0.5 * (view->p_width - BORDER_PEN_WIDTH);
view->motion_offset_y = 0.5 * (view->p_height - BORDER_PEN_WIDTH);
-#undef BORDER_PEN_WIDTH
-
gimp_navigation_view_grab_pointer (view);
}
@@ -490,15 +492,17 @@
gimp_navigation_editor_marker_changed (GimpNavigationView *view,
gdouble x,
gdouble y,
+ gdouble width,
+ gdouble height,
GimpNavigationEditor *editor)
{
if (editor->shell)
{
GimpDisplayShell *shell = editor->shell;
- gimp_display_shell_scroll (shell,
- RINT (x * shell->scale_x - shell->offset_x),
- RINT (y * shell->scale_y - shell->offset_y));
+ gimp_display_shell_center_around_image_coordinate (shell,
+ x + width / 2,
+ y + height / 2);
}
}
@@ -540,7 +544,7 @@
g_assert (adj != NULL);
- value = adj->value;
+ value = gtk_adjustment_get_value (adj);
switch (direction)
{
@@ -565,7 +569,8 @@
gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
GimpNavigationEditor *editor)
{
- gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO, pow (2.0, adj->value));
+ gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO,
+ pow (2.0, gtk_adjustment_get_value (adj)));
}
static void
@@ -640,9 +645,13 @@
gimp_view_renderer_set_dot_for_dot (renderer, shell->dot_for_dot);
if (renderer->viewable)
- gimp_navigation_view_set_marker (GIMP_NAVIGATION_VIEW (editor->view),
- shell->offset_x / shell->scale_x,
- shell->offset_y / shell->scale_y,
- shell->disp_width / shell->scale_x,
- shell->disp_height / shell->scale_y);
+ {
+ GimpNavigationView *view = GIMP_NAVIGATION_VIEW (editor->view);
+ gdouble x, y;
+ gdouble w, h;
+
+ gimp_display_shell_get_viewport (shell, &x, &y, &w, &h);
+
+ gimp_navigation_view_set_marker (view, x, y, w, h);
+ }
}
Modified: branches/soc-2008-tagging/app/display/gimpstatusbar.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpstatusbar.c (original)
+++ branches/soc-2008-tagging/app/display/gimpstatusbar.c Sun Jul 13 12:11:51 2008
@@ -493,13 +493,18 @@
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
GtkWidget *label = GTK_STATUSBAR (statusbar)->label;
PangoLayout *layout;
- const gchar *stock_id = gimp_get_message_stock_id (severity);
+ const gchar *stock_id;
gboolean handle_msg = FALSE;
- /* we can only handle short one-liners */
+ /* don't accept a message if we are already displaying one */
+ if (statusbar->temp_timeout_id)
+ return FALSE;
+ /* we can only handle short one-liners */
layout = gtk_widget_create_pango_layout (label, message);
+ stock_id = gimp_get_message_stock_id (severity);
+
if (pango_layout_get_line_count (layout) == 1)
{
gint width;
Modified: branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c
==============================================================================
--- branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c (original)
+++ branches/soc-2008-tagging/app/gegl/gimpcurvesconfig.c Sun Jul 13 12:11:51 2008
@@ -420,9 +420,14 @@
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
for (j = 0; j < GIMP_CURVE_N_CRUFT_POINTS; j++)
- gimp_curve_set_point (curve, j,
- (gdouble) index[i][j] / 255.0,
- (gdouble) value[i][j] / 255.0);
+ {
+ if (index[i][j] < 0 || value[i][j] < 0)
+ gimp_curve_set_point (curve, j, -1, -1);
+ else
+ gimp_curve_set_point (curve, j,
+ (gdouble) index[i][j] / 255.0,
+ (gdouble) value[i][j] / 255.0);
+ }
gimp_data_thaw (GIMP_DATA (curve));
}
Modified: branches/soc-2008-tagging/app/gui/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/gui/Makefile.am (original)
+++ branches/soc-2008-tagging/app/gui/Makefile.am Sun Jul 13 12:11:51 2008
@@ -22,6 +22,8 @@
gui.h \
gui-message.c \
gui-message.h \
+ gui-unique.c \
+ gui-unique.h \
gui-vtable.c \
gui-vtable.h \
gui-types.h \
Modified: branches/soc-2008-tagging/app/gui/gui.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui.c (original)
+++ branches/soc-2008-tagging/app/gui/gui.c Sun Jul 13 12:11:51 2008
@@ -22,12 +22,6 @@
#include <gtk/gtk.h>
-#if HAVE_DBUS_GLIB
-#define DBUS_API_SUBJECT_TO_CHANGE
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
-#endif
-
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "libgimpwidgets/gimpwidgets-private.h"
@@ -57,7 +51,6 @@
#include "widgets/gimpclipboard.h"
#include "widgets/gimpcolorselectorpalette.h"
#include "widgets/gimpcontrollers.h"
-#include "widgets/gimpdbusservice.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpdevicestatus.h"
#include "widgets/gimpdialogfactory.h"
@@ -80,6 +73,7 @@
#include "color-history.h"
#include "gui.h"
+#include "gui-unique.h"
#include "gui-vtable.h"
#include "session.h"
#include "splash.h"
@@ -136,18 +130,11 @@
Gimp *gimp);
static void gui_display_remove (GimpContainer *displays);
-static void gui_dbus_service_init (Gimp *gimp);
-static void gui_dbus_service_exit (void);
-
/* private variables */
-static Gimp *the_gui_gimp = NULL;
-static GimpUIManager *image_ui_manager = NULL;
-
-#if HAVE_DBUS_GLIB
-static DBusGConnection *dbus_connection = NULL;
-#endif
+static Gimp *the_gui_gimp = NULL;
+static GimpUIManager *image_ui_manager = NULL;
/* public functions */
@@ -525,7 +512,7 @@
display = GIMP_DISPLAY (gimp_create_display (gimp,
NULL, GIMP_UNIT_PIXEL, 1.0));
- gui_dbus_service_init (gimp);
+ gui_unique_init (gimp);
if (gui_config->restore_session)
session_restore (gimp);
@@ -559,9 +546,7 @@
gimp->message_handler = GIMP_CONSOLE;
-#if HAVE_DBUS_GLIB
- gui_dbus_service_exit ();
-#endif
+ gui_unique_exit ();
if (gui_config->save_session_info)
session_save (gimp, FALSE);
@@ -761,43 +746,3 @@
if (gimp_container_is_empty (displays))
windows_show_toolbox ();
}
-
-static void
-gui_dbus_service_init (Gimp *gimp)
-{
-#if HAVE_DBUS_GLIB
- GError *error = NULL;
-
- g_return_if_fail (dbus_connection == NULL);
-
- dbus_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
- if (dbus_connection)
- {
- GObject *service = gimp_dbus_service_new (gimp);
-
- dbus_bus_request_name (dbus_g_connection_get_connection (dbus_connection),
- GIMP_DBUS_SERVICE_NAME, 0, NULL);
-
- dbus_g_connection_register_g_object (dbus_connection,
- GIMP_DBUS_SERVICE_PATH, service);
- }
- else
- {
- g_printerr ("%s\n", error->message);
- g_error_free (error);
- }
-#endif
-}
-
-static void
-gui_dbus_service_exit (void)
-{
-#if HAVE_DBUS_GLIB
- if (dbus_connection)
- {
- dbus_g_connection_unref (dbus_connection);
- dbus_connection = NULL;
- }
-#endif
-}
Modified: branches/soc-2008-tagging/app/main.c
==============================================================================
--- branches/soc-2008-tagging/app/main.c (original)
+++ branches/soc-2008-tagging/app/main.c Sun Jul 13 12:11:51 2008
@@ -41,10 +41,6 @@
#include <io.h> /* get_osfhandle */
#endif
-#if HAVE_DBUS_GLIB
-#include <dbus/dbus-glib.h>
-#endif
-
#ifndef GIMP_CONSOLE_COMPILATION
#include <gdk/gdk.h>
#endif
@@ -59,14 +55,11 @@
#include "core/gimp.h"
-#include "file/file-utils.h"
-
-#include "widgets/gimpdbusservice.h"
-
#include "about.h"
#include "app.h"
#include "errors.h"
#include "sanity.h"
+#include "unique.h"
#include "units.h"
#include "version.h"
@@ -113,11 +106,6 @@
#define gimp_open_console_window() /* as nothing */
#endif
-static gboolean gimp_dbus_open (const gchar **filenames,
- gboolean as_new,
- gboolean be_verbose);
-
-
static const gchar *system_gimprc = NULL;
static const gchar *user_gimprc = NULL;
static const gchar *session_name = NULL;
@@ -386,11 +374,18 @@
if (no_interface)
new_instance = TRUE;
- if (! new_instance)
+#ifndef GIMP_CONSOLE_COMPILATION
+ if (! new_instance && gimp_unique_open (filenames, as_new))
{
- if (gimp_dbus_open (filenames, as_new, be_verbose))
- return EXIT_SUCCESS;
+ if (be_verbose)
+ g_print ("%s\n",
+ _("Another GIMP instance is already running."));
+
+ gdk_notify_startup_complete ();
+
+ return EXIT_SUCCESS;
}
+#endif
abort_message = sanity_check ();
if (abort_message)
@@ -607,9 +602,6 @@
*
* An alternative to tuning this parameter would be to use
* malloc_trim(), for example after releasing a large tile-manager.
- *
- * Another possibility is to switch to using GSlice as soon as this
- * API is available in a stable GLib release.
*/
mallopt (M_MMAP_THRESHOLD, TILE_WIDTH * TILE_HEIGHT);
#endif
@@ -698,113 +690,3 @@
}
#endif /* ! G_OS_WIN32 */
-
-
-static gboolean
-gimp_dbus_open (const gchar **filenames,
- gboolean as_new,
- gboolean be_verbose)
-{
-#ifndef GIMP_CONSOLE_COMPILATION
-#if HAVE_DBUS_GLIB
- DBusGConnection *connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
-
- if (connection)
- {
- DBusGProxy *proxy;
- gboolean success;
- GError *error = NULL;
-
- proxy = dbus_g_proxy_new_for_name (connection,
- GIMP_DBUS_SERVICE_NAME,
- GIMP_DBUS_SERVICE_PATH,
- GIMP_DBUS_SERVICE_INTERFACE);
-
- if (filenames)
- {
- const gchar *method = as_new ? "OpenAsNew" : "Open";
- gchar *cwd = NULL;
- gint i;
-
- for (i = 0, success = TRUE; filenames[i] && success; i++)
- {
- const gchar *filename = filenames[i];
- gchar *uri = NULL;
-
- if (file_utils_filename_is_uri (filename, &error))
- {
- uri = g_strdup (filename);
- }
- else if (! error)
- {
- if (! g_path_is_absolute (filename))
- {
- gchar *absolute;
-
- if (! cwd)
- cwd = g_get_current_dir ();
-
- absolute = g_build_filename (cwd, filename, NULL);
-
- uri = g_filename_to_uri (absolute, NULL, &error);
-
- g_free (absolute);
- }
- else
- {
- uri = g_filename_to_uri (filename, NULL, &error);
- }
- }
-
- if (uri)
- {
- gboolean retval; /* ignored */
-
- success = dbus_g_proxy_call (proxy, method, &error,
- G_TYPE_STRING, uri,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &retval,
- G_TYPE_INVALID);
- g_free (uri);
- }
- else
- {
- g_printerr ("conversion to uri failed: %s\n", error->message);
- g_clear_error (&error);
- }
- }
-
- g_free (cwd);
- }
- else
- {
- success = dbus_g_proxy_call (proxy, "Activate", &error,
- G_TYPE_INVALID, G_TYPE_INVALID);
- }
-
- g_object_unref (proxy);
- dbus_g_connection_unref (connection);
-
- if (success)
- {
- if (be_verbose)
- g_print ("%s\n",
- _("Another GIMP instance is already running."));
-
- gdk_notify_startup_complete ();
-
- return TRUE;
- }
- else if (! (error->domain == DBUS_GERROR &&
- error->code == DBUS_GERROR_SERVICE_UNKNOWN))
- {
- g_print ("%s\n", error->message);
- }
-
- g_clear_error (&error);
- }
-#endif
-#endif
-
- return FALSE;
-}
Modified: branches/soc-2008-tagging/app/paint/gimppaintoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintoptions.c (original)
+++ branches/soc-2008-tagging/app/paint/gimppaintoptions.c Sun Jul 13 12:11:51 2008
@@ -1163,9 +1163,9 @@
g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), 1.0);
g_return_val_if_fail (coords != NULL, 1.0);
- if (paint_options->pressure_options->rate ||
- paint_options->velocity_options->rate ||
- paint_options->random_options->rate)
+ if (paint_options->pressure_options->hardness ||
+ paint_options->velocity_options->hardness ||
+ paint_options->random_options->hardness)
{
gdouble pressure = -1.0;
gdouble velocity = -1.0;
Modified: branches/soc-2008-tagging/app/tools/gimpbrightnesscontrasttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpbrightnesscontrasttool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpbrightnesscontrasttool.c Sun Jul 13 12:11:51 2008
@@ -386,7 +386,9 @@
GimpBrightnessContrastTool *bc_tool)
{
GimpBrightnessContrastConfig *config = bc_tool->config;
- gdouble value = adjustment->value / 127.0;
+ gdouble value;
+
+ value = gtk_adjustment_get_value (adjustment) / 127.0;
if (config->brightness != value)
{
@@ -401,7 +403,9 @@
GimpBrightnessContrastTool *bc_tool)
{
GimpBrightnessContrastConfig *config = bc_tool->config;
- gdouble value = adjustment->value / 127.0;
+ gdouble value;
+
+ value = gtk_adjustment_get_value (adjustment) / 127.0;
if (config->contrast != value)
{
Modified: branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpcolorbalancetool.c Sun Jul 13 12:11:51 2008
@@ -424,12 +424,11 @@
color_balance_preserve_toggled (GtkWidget *widget,
GimpColorBalanceTool *cb_tool)
{
- GimpColorBalanceConfig *config = cb_tool->config;
- gboolean active = GTK_TOGGLE_BUTTON (widget)->active;
+ gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
- if (config->preserve_luminosity != active)
+ if (cb_tool->config->preserve_luminosity != active)
{
- g_object_set (config,
+ g_object_set (cb_tool->config,
"preserve-luminosity", active,
NULL);
}
@@ -439,12 +438,11 @@
color_balance_cr_changed (GtkAdjustment *adjustment,
GimpColorBalanceTool *cb_tool)
{
- GimpColorBalanceConfig *config = cb_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->cyan_red[config->range] != value)
+ if (cb_tool->config->cyan_red[cb_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (cb_tool->config,
"cyan-red", value,
NULL);
}
@@ -454,12 +452,11 @@
color_balance_mg_changed (GtkAdjustment *adjustment,
GimpColorBalanceTool *cb_tool)
{
- GimpColorBalanceConfig *config = cb_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->magenta_green[config->range] != value)
+ if (cb_tool->config->magenta_green[cb_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (cb_tool->config,
"magenta-green", value,
NULL);
}
@@ -469,12 +466,11 @@
color_balance_yb_changed (GtkAdjustment *adjustment,
GimpColorBalanceTool *cb_tool)
{
- GimpColorBalanceConfig *config = cb_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->yellow_blue[config->range] != value)
+ if (cb_tool->config->yellow_blue[cb_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (cb_tool->config,
"yellow-blue", value,
NULL);
}
Modified: branches/soc-2008-tagging/app/tools/gimpcolorizetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolorizetool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpcolorizetool.c Sun Jul 13 12:11:51 2008
@@ -312,7 +312,7 @@
colorize_hue_changed (GtkAdjustment *adjustment,
GimpColorizeTool *col_tool)
{
- gdouble value = adjustment->value / 360.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 360.0;
if (col_tool->config->hue != value)
{
@@ -326,7 +326,7 @@
colorize_saturation_changed (GtkAdjustment *adjustment,
GimpColorizeTool *col_tool)
{
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
if (col_tool->config->saturation != value)
{
@@ -340,7 +340,7 @@
colorize_lightness_changed (GtkAdjustment *adjustment,
GimpColorizeTool *col_tool)
{
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
if (col_tool->config->lightness != value)
{
Modified: branches/soc-2008-tagging/app/tools/gimpcurvestool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcurvestool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpcurvestool.c Sun Jul 13 12:11:51 2008
@@ -584,6 +584,7 @@
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
FILE *file;
gboolean success;
+ gchar header[64];
file = g_fopen (filename, "rt");
@@ -596,11 +597,32 @@
return FALSE;
}
- success = gimp_curves_config_load_cruft (tool->config, file, error);
+ if (! fgets (header, sizeof (header), file))
+ {
+ g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+ _("Could not read header from '%s': %s"),
+ gimp_filename_to_utf8 (filename),
+ g_strerror (errno));
+ fclose (file);
+ return FALSE;
+ }
+
+ if (g_str_has_prefix (header, "# GIMP Curves File\n"))
+ {
+ rewind (file);
+
+ success = gimp_curves_config_load_cruft (tool->config, file, error);
+
+ fclose (file);
+
+ return success;
+ }
fclose (file);
- return success;
+ return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_import (image_map_tool,
+ filename,
+ error);
}
static gboolean
Modified: branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpeditselectiontool.c Sun Jul 13 12:11:51 2008
@@ -62,6 +62,42 @@
#define EDIT_SELECT_SCROLL_LOCK FALSE
#define ARROW_VELOCITY 25
+#define CENTER_CROSS_SIZE 6
+
+
+typedef struct _GimpEditSelectionTool
+{
+ GimpDrawTool parent_instance;
+
+ gint origx, origy; /* Last x and y coords */
+ gint cumlx, cumly; /* Cumulative changes to x and yed */
+ gint x, y; /* Current x and y coords */
+ gint num_segs_in; /* Num seg in selection boundary */
+ gint num_segs_out; /* Num seg in selection boundary */
+ BoundSeg *segs_in; /* Pointer to the channel sel. segs */
+ BoundSeg *segs_out; /* Pointer to the channel sel. segs */
+
+ gint x1, y1; /* Bounding box of selection mask */
+ gint x2, y2;
+
+ gdouble center_x; /* Where to draw the mark of center */
+ gdouble center_y;
+
+ GimpTranslateMode edit_mode; /* Translate the mask or layer? */
+
+ gboolean first_move; /* Don't push undos after the first */
+
+ gboolean propagate_release;
+
+ gboolean constrain; /* Constrain the movement */
+ gdouble start_x, start_y;/* Coords when button was pressed */
+ gdouble last_x, last_y; /* Previous coords sent to _motion */
+} GimpEditSelectionTool;
+
+typedef struct _GimpEditSelectionToolClass
+{
+ GimpDrawToolClass parent_class;
+} GimpEditSelectionToolClass;
static void gimp_edit_selection_tool_button_release (GimpTool *tool,
@@ -398,6 +434,10 @@
y1 - coords->y,
x2 - x1,
y2 - y1);
+
+ /* Save where to draw the mark of the center */
+ edit_select->center_x = (x1 + x2) / 2.0;
+ edit_select->center_y = (y1 + y2) / 2.0;
}
gimp_tool_control_activate (GIMP_TOOL (edit_select)->control);
@@ -919,6 +959,15 @@
break;
}
+ /* Mark the center because we snap to it */
+ gimp_draw_tool_draw_cross_by_anchor (draw_tool,
+ edit_select->center_x + edit_select->cumlx,
+ edit_select->center_y + edit_select->cumly,
+ CENTER_CROSS_SIZE,
+ CENTER_CROSS_SIZE,
+ GTK_ANCHOR_CENTER,
+ FALSE);
+
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}
Modified: branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h (original)
+++ branches/soc-2008-tagging/app/tools/gimpeditselectiontool.h Sun Jul 13 12:11:51 2008
@@ -30,41 +30,6 @@
#define GIMP_IS_EDIT_SELECTION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_EDIT_SELECTION_TOOL))
-typedef struct _GimpEditSelectionTool GimpEditSelectionTool;
-typedef struct _GimpEditSelectionToolClass GimpEditSelectionToolClass;
-
-struct _GimpEditSelectionTool
-{
- GimpDrawTool parent_instance;
-
- gint origx, origy; /* Last x and y coords */
- gint cumlx, cumly; /* Cumulative changes to x and yed */
- gint x, y; /* Current x and y coords */
- gint num_segs_in; /* Num seg in selection boundary */
- gint num_segs_out; /* Num seg in selection boundary */
- BoundSeg *segs_in; /* Pointer to the channel sel. segs */
- BoundSeg *segs_out; /* Pointer to the channel sel. segs */
-
- gint x1, y1; /* Bounding box of selection mask */
- gint x2, y2;
-
- GimpTranslateMode edit_mode; /* Translate the mask or layer? */
-
- gboolean first_move; /* Don't push undos after the first */
-
- gboolean propagate_release;
-
- gboolean constrain; /* Constrain the movement */
- gdouble start_x, start_y;/* Coords when button was pressed */
- gdouble last_x, last_y; /* Previous coords sent to _motion */
-};
-
-struct _GimpEditSelectionToolClass
-{
- GimpDrawToolClass parent_class;
-};
-
-
GType gimp_edit_selection_tool_get_type (void) G_GNUC_CONST;
void gimp_edit_selection_tool_start (GimpTool *parent_tool,
Modified: branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpfreeselecttool.c Sun Jul 13 12:11:51 2008
@@ -1029,17 +1029,30 @@
{
priv->polygon_modified = TRUE;
- if (priv->constrain_angle &&
- priv->grabbed_segment_index > 0 &&
- priv->n_points > 0 )
+ if (priv->constrain_angle &&
+ priv->n_segment_indices > 1 )
{
gdouble start_point_x;
gdouble start_point_y;
+ gint segment_index;
+
+ /* Base constraints on the last segment vertex if we move
+ * the first one, otherwise base on the previous segment
+ * vertex
+ */
+ if (priv->grabbed_segment_index == 0)
+ {
+ segment_index = priv->n_segment_indices - 1;
+ }
+ else
+ {
+ segment_index = priv->grabbed_segment_index - 1;
+ }
gimp_free_select_tool_get_segment_point (fst,
&start_point_x,
&start_point_y,
- priv->grabbed_segment_index - 1);
+ segment_index);
gimp_tool_motion_constrain (start_point_x,
start_point_y,
@@ -1438,16 +1451,16 @@
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
Private *priv = GET_PRIVATE (tool);
- if (tool->display != display)
- return;
-
- gimp_draw_tool_pause (draw_tool);
+ if (tool->display == display)
+ {
+ gimp_draw_tool_pause (draw_tool);
- priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
+ priv->constrain_angle = state & GDK_CONTROL_MASK ? TRUE : FALSE;
- priv->supress_handles = state & GDK_SHIFT_MASK ? TRUE : FALSE;
+ priv->supress_handles = state & GDK_SHIFT_MASK ? TRUE : FALSE;
- gimp_draw_tool_resume (draw_tool);
+ gimp_draw_tool_resume (draw_tool);
+ }
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool,
key,
Modified: branches/soc-2008-tagging/app/tools/gimpgegltool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpgegltool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpgegltool.c Sun Jul 13 12:11:51 2008
@@ -286,7 +286,6 @@
GimpGeglTool *tool = GIMP_GEGL_TOOL (image_map_tool);
GtkListStore *store;
GtkCellRenderer *cell;
- GtkSizeGroup *label_group;
GtkWidget *main_vbox;
GtkWidget *hbox;
GtkWidget *label;
@@ -294,8 +293,7 @@
GList *opclasses;
GList *iter;
- main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
- label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
+ main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
/* The operation combo box */
hbox = gtk_hbox_new (FALSE, 6);
@@ -306,8 +304,6 @@
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- gtk_size_group_add_widget (label_group, label);
-
store = gtk_list_store_new (1, G_TYPE_STRING);
opclasses = gimp_get_geglopclasses ();
Modified: branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimphuesaturationtool.c Sun Jul 13 12:11:51 2008
@@ -568,12 +568,11 @@
hue_saturation_hue_changed (GtkAdjustment *adjustment,
GimpHueSaturationTool *hs_tool)
{
- GimpHueSaturationConfig *config = hs_tool->config;
- gdouble value = adjustment->value / 180.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 180.0;
- if (config->hue[config->range] != value)
+ if (hs_tool->config->hue[hs_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (hs_tool->config,
"hue", value,
NULL);
}
@@ -583,12 +582,11 @@
hue_saturation_lightness_changed (GtkAdjustment *adjustment,
GimpHueSaturationTool *hs_tool)
{
- GimpHueSaturationConfig *config = hs_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->lightness[config->range] != value)
+ if (hs_tool->config->lightness[hs_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (hs_tool->config,
"lightness", value,
NULL);
}
@@ -598,12 +596,11 @@
hue_saturation_saturation_changed (GtkAdjustment *adjustment,
GimpHueSaturationTool *hs_tool)
{
- GimpHueSaturationConfig *config = hs_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->saturation[config->range] != value)
+ if (hs_tool->config->saturation[hs_tool->config->range] != value)
{
- g_object_set (config,
+ g_object_set (hs_tool->config,
"saturation", value,
NULL);
}
@@ -613,12 +610,11 @@
hue_saturation_overlap_changed (GtkAdjustment *adjustment,
GimpHueSaturationTool *hs_tool)
{
- GimpHueSaturationConfig *config = hs_tool->config;
- gdouble value = adjustment->value / 100.0;
+ gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
- if (config->overlap != value)
+ if (hs_tool->config->overlap != value)
{
- g_object_set (config,
+ g_object_set (hs_tool->config,
"overlap", value,
NULL);
}
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool-settings.c Sun Jul 13 12:11:51 2008
@@ -49,20 +49,13 @@
/* local function prototypes */
-static void gimp_image_map_tool_import_activate (GtkWidget *widget,
+static gboolean gimp_image_map_tool_settings_import (GimpSettingsBox *box,
+ const gchar *filename,
GimpImageMapTool *tool);
-static void gimp_image_map_tool_export_activate (GtkWidget *widget,
+static gboolean gimp_image_map_tool_settings_export (GimpSettingsBox *box,
+ const gchar *filename,
GimpImageMapTool *tool);
-static void gimp_image_map_tool_settings_dialog (GimpImageMapTool *im_tool,
- const gchar *title,
- gboolean save);
-
-static gboolean gimp_image_map_tool_settings_import (GimpImageMapTool *tool,
- const gchar *filename);
-static gboolean gimp_image_map_tool_settings_export (GimpImageMapTool *tool,
- const gchar *filename);
-
/* public functions */
@@ -74,6 +67,7 @@
GtkWidget *hbox;
GtkWidget *label;
gchar *filename;
+ gchar *folder;
klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool);
@@ -93,26 +87,33 @@
g_object_unref (image_map_tool->label_group);
filename = gimp_tool_info_build_options_filename (tool_info, ".settings");
+ folder = g_build_filename (gimp_directory (), klass->settings_name, NULL);
image_map_tool->settings_box = gimp_settings_box_new (tool_info->gimp,
image_map_tool->config,
klass->recent_settings,
- filename);
+ filename,
+ klass->import_dialog_title,
+ klass->export_dialog_title,
+ tool_info->help_id,
+ folder,
+ NULL);
gtk_box_pack_start (GTK_BOX (hbox), image_map_tool->settings_box,
TRUE, TRUE, 0);
gtk_widget_show (image_map_tool->settings_box);
g_free (filename);
+ g_free (folder);
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
GIMP_SETTINGS_BOX (image_map_tool->settings_box)->combo);
g_signal_connect (image_map_tool->settings_box, "import",
- G_CALLBACK (gimp_image_map_tool_import_activate),
+ G_CALLBACK (gimp_image_map_tool_settings_import),
image_map_tool);
g_signal_connect (image_map_tool->settings_box, "export",
- G_CALLBACK (gimp_image_map_tool_export_activate),
+ G_CALLBACK (gimp_image_map_tool_settings_export),
image_map_tool);
return TRUE;
@@ -165,144 +166,10 @@
/* private functions */
-static void
-gimp_image_map_tool_import_activate (GtkWidget *widget,
- GimpImageMapTool *tool)
-{
- GimpImageMapToolClass *klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool);
-
- gimp_image_map_tool_settings_dialog (tool, klass->import_dialog_title, FALSE);
-}
-
-static void
-gimp_image_map_tool_export_activate (GtkWidget *widget,
- GimpImageMapTool *tool)
-{
- GimpImageMapToolClass *klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool);
-
- gimp_image_map_tool_settings_dialog (tool, klass->export_dialog_title, TRUE);
-}
-
-static void
-settings_dialog_response (GtkWidget *dialog,
- gint response_id,
- GimpImageMapTool *tool)
-{
- gboolean save;
-
- save = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "save"));
-
- if (response_id == GTK_RESPONSE_OK)
- {
- gchar *filename;
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
-
- if (save)
- gimp_image_map_tool_settings_export (tool, filename);
- else
- gimp_image_map_tool_settings_import (tool, filename);
-
- g_free (filename);
- }
-
- if (save)
- gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->import_item, TRUE);
- else
- gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->export_item, TRUE);
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-gimp_image_map_tool_settings_dialog (GimpImageMapTool *tool,
- const gchar *title,
- gboolean save)
-{
- GimpImageMapOptions *options = GIMP_IMAGE_MAP_TOOL_GET_OPTIONS (tool);
- GtkFileChooser *chooser;
- const gchar *settings_name;
- gchar *folder;
-
- settings_name = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name;
-
- g_return_if_fail (settings_name != NULL);
-
- if (tool->settings_dialog)
- {
- gtk_window_present (GTK_WINDOW (tool->settings_dialog));
- return;
- }
-
- if (save)
- gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->import_item, FALSE);
- else
- gtk_widget_set_sensitive (GIMP_SETTINGS_BOX (tool->settings_box)->export_item, FALSE);
-
- tool->settings_dialog =
- gtk_file_chooser_dialog_new (title, GTK_WINDOW (tool->shell),
- save ?
- GTK_FILE_CHOOSER_ACTION_SAVE :
- GTK_FILE_CHOOSER_ACTION_OPEN,
-
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- save ? GTK_STOCK_SAVE : GTK_STOCK_OPEN,
- GTK_RESPONSE_OK,
-
- NULL);
-
- chooser = GTK_FILE_CHOOSER (tool->settings_dialog);
-
- g_object_set_data (G_OBJECT (chooser), "save", GINT_TO_POINTER (save));
-
- gtk_window_set_role (GTK_WINDOW (chooser), "gimp-import-export-settings");
- gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
-
- g_object_add_weak_pointer (G_OBJECT (chooser),
- (gpointer) &tool->settings_dialog);
-
- gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser), TRUE);
-
- gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK);
-
- if (save)
- gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
-
- g_signal_connect (chooser, "response",
- G_CALLBACK (settings_dialog_response),
- tool);
- g_signal_connect (chooser, "delete-event",
- G_CALLBACK (gtk_true),
- NULL);
-
- folder = g_build_filename (gimp_directory (), settings_name, NULL);
-
- if (g_file_test (folder, G_FILE_TEST_IS_DIR))
- {
- gtk_file_chooser_add_shortcut_folder (chooser, folder, NULL);
- }
- else
- {
- g_free (folder);
- folder = g_strdup (g_get_home_dir ());
- }
-
- if (options->settings)
- gtk_file_chooser_set_filename (chooser, options->settings);
- else
- gtk_file_chooser_set_current_folder (chooser, folder);
-
- g_free (folder);
-
- gimp_help_connect (tool->settings_dialog, gimp_standard_help_func,
- GIMP_TOOL (tool)->tool_info->help_id, NULL);
-
- gtk_widget_show (tool->settings_dialog);
-}
-
static gboolean
-gimp_image_map_tool_settings_import (GimpImageMapTool *tool,
- const gchar *filename)
+gimp_image_map_tool_settings_import (GimpSettingsBox *box,
+ const gchar *filename,
+ GimpImageMapTool *tool)
{
GimpImageMapToolClass *tool_class = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool);
GError *error = NULL;
@@ -328,8 +195,9 @@
}
static gboolean
-gimp_image_map_tool_settings_export (GimpImageMapTool *tool,
- const gchar *filename)
+gimp_image_map_tool_settings_export (GimpSettingsBox *box,
+ const gchar *filename,
+ GimpImageMapTool *tool)
{
GimpImageMapToolClass *tool_class = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool);
GError *error = NULL;
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.c Sun Jul 13 12:11:51 2008
@@ -190,16 +190,15 @@
GIMP_DIRTY_DRAWABLE |
GIMP_DIRTY_SELECTION);
- image_map_tool->drawable = NULL;
- image_map_tool->operation = NULL;
- image_map_tool->config = NULL;
- image_map_tool->image_map = NULL;
-
- image_map_tool->shell = NULL;
- image_map_tool->main_vbox = NULL;
- image_map_tool->settings_box = NULL;
- image_map_tool->label_group = NULL;
- image_map_tool->settings_dialog = NULL;
+ image_map_tool->drawable = NULL;
+ image_map_tool->operation = NULL;
+ image_map_tool->config = NULL;
+ image_map_tool->image_map = NULL;
+
+ image_map_tool->shell = NULL;
+ image_map_tool->main_vbox = NULL;
+ image_map_tool->settings_box = NULL;
+ image_map_tool->label_group = NULL;
}
static GObject *
Modified: branches/soc-2008-tagging/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpimagemaptool.h (original)
+++ branches/soc-2008-tagging/app/tools/gimpimagemaptool.h Sun Jul 13 12:11:51 2008
@@ -53,9 +53,6 @@
GtkWidget *main_vbox;
GtkWidget *settings_box;
GtkSizeGroup *label_group;
-
- /* settings file dialog */
- GtkWidget *settings_dialog;
};
struct _GimpImageMapToolClass
Modified: branches/soc-2008-tagging/app/tools/gimplevelstool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimplevelstool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimplevelstool.c Sun Jul 13 12:11:51 2008
@@ -797,10 +797,10 @@
gtk_adjustment_set_value (tool->high_input,
config->high_input[config->channel] * 255.0);
- tool->low_input->upper = tool->high_input->value;
- tool->high_input->lower = tool->low_input->value;
- tool->gamma_linear->lower = tool->low_input->value;
- tool->gamma_linear->upper = tool->high_input->value;
+ tool->low_input->upper = gtk_adjustment_get_value (tool->high_input);
+ tool->high_input->lower = gtk_adjustment_get_value (tool->low_input);
+ tool->gamma_linear->lower = gtk_adjustment_get_value (tool->low_input);
+ tool->gamma_linear->upper = gtk_adjustment_get_value (tool->high_input);
gtk_adjustment_changed (tool->low_input);
gtk_adjustment_changed (tool->high_input);
gtk_adjustment_changed (tool->gamma_linear);
@@ -938,10 +938,12 @@
static void
levels_linear_gamma_update (GimpLevelsTool *tool)
{
+ gdouble low_input = gtk_adjustment_get_value (tool->low_input);
+ gdouble high_input = gtk_adjustment_get_value (tool->high_input);
gdouble delta, mid, tmp, value;
- delta = (tool->high_input->value - tool->low_input->value) / 2.0;
- mid = tool->low_input->value + delta;
+ delta = (high_input - low_input) / 2.0;
+ mid = low_input + delta;
tmp = log10 (1.0 / tool->config->gamma[tool->config->channel]);
value = mid + delta * tmp;
@@ -952,14 +954,16 @@
levels_linear_gamma_changed (GtkAdjustment *adjustment,
GimpLevelsTool *tool)
{
+ gdouble low_input = gtk_adjustment_get_value (tool->low_input);
+ gdouble high_input = gtk_adjustment_get_value (tool->high_input);
gdouble delta, mid, tmp, value;
- delta = (tool->high_input->value - tool->low_input->value) / 2.0;
+ delta = (high_input - low_input) / 2.0;
if (delta >= 0.5)
{
- mid = tool->low_input->value + delta;
- tmp = (adjustment->value - mid) / delta;
+ mid = low_input + delta;
+ tmp = (gtk_adjustment_get_value (adjustment) - mid) / delta;
value = 1.0 / pow (10, tmp);
/* round the gamma value to the nearest 1/100th */
@@ -974,7 +978,7 @@
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (adjustment->value);
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
tool->high_input->lower = value;
tool->gamma_linear->lower = value;
@@ -996,11 +1000,12 @@
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
+ gdouble value = gtk_adjustment_get_value (adjustment);
- if (config->gamma[config->channel] != adjustment->value)
+ if (config->gamma[config->channel] != value)
{
g_object_set (config,
- "gamma", adjustment->value,
+ "gamma", value,
NULL);
}
@@ -1012,7 +1017,7 @@
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (adjustment->value);
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
tool->low_input->upper = value;
tool->gamma_linear->upper = value;
@@ -1034,7 +1039,7 @@
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (adjustment->value);
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
if (config->low_output[config->channel] != value / 255.0)
{
@@ -1049,7 +1054,7 @@
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (adjustment->value);
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
if (config->high_output[config->channel] != value / 255.0)
{
Modified: branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c (original)
+++ branches/soc-2008-tagging/app/tools/gimppaintoptions-gui.c Sun Jul 13 12:11:51 2008
@@ -183,7 +183,7 @@
gboolean rtl = gtk_widget_get_direction (vbox) == GTK_TEXT_DIR_RTL;
frame = gimp_prop_expander_new (config, "dynamics-expanded",
- _("Dynamics sensitivity"));
+ _("Brush Dynamics"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
@@ -235,7 +235,7 @@
for (i = 0; i < n_dynamics; i++)
{
gtk_label_set_angle (GTK_LABEL (dynamics_labels[i]),
- rtl ? 45 : 315);
+ rtl ? 315 : 45);
gtk_misc_set_alignment (GTK_MISC (dynamics_labels[i]), 1.0, 1.0);
gtk_fixed_put (GTK_FIXED (fixed), dynamics_labels[i], 0, 0);
gtk_widget_show (dynamics_labels[i]);
@@ -299,10 +299,10 @@
tool_has_opacity_dynamics (GType tool_type)
{
return (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
- tool_type == GIMP_TYPE_CLONE_TOOL ||
- tool_type == GIMP_TYPE_HEAL_TOOL ||
- tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
- tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
+ tool_type == GIMP_TYPE_CLONE_TOOL ||
+ tool_type == GIMP_TYPE_HEAL_TOOL ||
+ tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
+ tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
tool_type == GIMP_TYPE_ERASER_TOOL);
}
@@ -314,6 +314,7 @@
tool_type == GIMP_TYPE_HEAL_TOOL ||
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
+ tool_type == GIMP_TYPE_ERASER_TOOL ||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
tool_type == GIMP_TYPE_SMUDGE_TOOL);
@@ -322,23 +323,21 @@
static gboolean
tool_has_rate_dynamics (GType tool_type)
{
- return (tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
- tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
+ return (tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
+ tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
tool_type == GIMP_TYPE_SMUDGE_TOOL);
}
static gboolean
tool_has_size_dynamics (GType tool_type)
{
- return (tool_type == GIMP_TYPE_CLONE_TOOL ||
+ return (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
+ tool_type == GIMP_TYPE_CLONE_TOOL ||
tool_type == GIMP_TYPE_HEAL_TOOL ||
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
- tool_type == GIMP_TYPE_ERASER_TOOL ||
- tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
- tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
- tool_type == GIMP_TYPE_PENCIL_TOOL);
+ tool_type == GIMP_TYPE_ERASER_TOOL);
}
static gboolean
@@ -373,9 +372,9 @@
gint x, y;
if (gtk_widget_get_direction (label) == GTK_TEXT_DIR_LTR)
- x = allocation->x + allocation->width - label->allocation.width;
- else
x = allocation->x;
+ else
+ x = allocation->x + allocation->width - label->allocation.width;
x -= fixed->allocation.x;
Modified: branches/soc-2008-tagging/app/tools/gimppainttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimppainttool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimppainttool.c Sun Jul 13 12:11:51 2008
@@ -453,8 +453,11 @@
core->cur_coords.x -= off_x;
core->cur_coords.y -= off_y;
- GIMP_TOOL_CLASS (parent_class)->motion (tool, coords, time, state,
- display);
+ GIMP_TOOL_CLASS (parent_class)->motion (tool, coords, time, state, display);
+
+ /* don't paint while the Shift key is pressed for line drawing */
+ if (paint_tool->draw_line)
+ return;
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
@@ -550,7 +553,7 @@
gimp_tool_pop_status (tool, display);
- if (tool->display &&
+ if (tool->display &&
tool->display != display &&
tool->display->image == display->image)
{
Modified: branches/soc-2008-tagging/app/tools/gimpposterizetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpposterizetool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimpposterizetool.c Sun Jul 13 12:11:51 2008
@@ -260,12 +260,11 @@
gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment,
GimpPosterizeTool *posterize_tool)
{
- GimpPosterizeConfig *config = posterize_tool->config;
- gint value = ROUND (adjustment->value);
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
- if (config->levels != value)
+ if (posterize_tool->config->levels != value)
{
- g_object_set (config,
+ g_object_set (posterize_tool->config,
"levels", value,
NULL);
}
Modified: branches/soc-2008-tagging/app/tools/gimprectangletool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprectangletool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimprectangletool.c Sun Jul 13 12:11:51 2008
@@ -41,6 +41,7 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
+#include "display/gimpdisplayshell-scroll.h"
#include "display/gimpdisplayshell-transform.h"
#include "gimpdrawtool.h"
@@ -64,6 +65,7 @@
#define MIN_HANDLE_SIZE 15
#define NARROW_MODE_HANDLE_SIZE 15
#define NARROW_MODE_THRESHOLD 45
+#define CENTER_CROSS_SIZE 6
#define SQRT5 2.236067977
@@ -1666,9 +1668,23 @@
switch (private->function)
{
case GIMP_RECTANGLE_TOOL_MOVING:
+
if (gimp_tool_control_is_active (tool->control))
- break;
- /* else fallthrough */
+ {
+ /* Mark the center because we snap to it */
+ gimp_draw_tool_draw_cross_by_anchor (draw_tool,
+ (pub_x1 + pub_x2) / 2.0,
+ (pub_y1 + pub_y2) / 2.0,
+ CENTER_CROSS_SIZE,
+ CENTER_CROSS_SIZE,
+ GTK_ANCHOR_CENTER,
+ FALSE);
+ break;
+ }
+ else
+ {
+ /* Fallthrough */
+ }
case GIMP_RECTANGLE_TOOL_DEAD:
case GIMP_RECTANGLE_TOOL_CREATING:
@@ -1832,15 +1848,14 @@
/* Calculate rectangles of the selection rectangle and the display shell,
* with origin at (0, 0) of image, and in screen coordinate scale.
*/
- gint x1 = pub_x1 * shell->scale_x;
- gint y1 = pub_y1 * shell->scale_y;
- gint w1 = (pub_x2 - pub_x1) * shell->scale_x;
- gint h1 = (pub_y2 - pub_y1) * shell->scale_y;
-
- gint x2 = -shell->disp_xoffset + shell->offset_x;
- gint y2 = -shell->disp_yoffset + shell->offset_y;
- gint w2 = shell->disp_width;
- gint h2 = shell->disp_height;
+ gint x1 = pub_x1 * shell->scale_x;
+ gint y1 = pub_y1 * shell->scale_y;
+ gint w1 = (pub_x2 - pub_x1) * shell->scale_x;
+ gint h1 = (pub_y2 - pub_y1) * shell->scale_y;
+
+ gint x2, y2, w2, h2;
+
+ gimp_display_shell_get_scaled_viewport (shell, &x2, &y2, &w2, &h2);
rectangle_width = w1;
rectangle_height = h1;
@@ -1932,8 +1947,9 @@
shell = GIMP_DISPLAY_SHELL (tool->display->shell);
- return shell->scale_x != private->scale_x_used_for_handle_size_calculations ||
- shell->scale_y != private->scale_y_used_for_handle_size_calculations;
+ return (shell->scale_x != private->scale_x_used_for_handle_size_calculations
+ ||
+ shell->scale_y != private->scale_y_used_for_handle_size_calculations);
}
static void
@@ -2177,10 +2193,8 @@
* signal which we don't want in the middle of a rectangle change.
*/
if (gimp_tool_control_is_active (GIMP_TOOL (rect_tool)->control))
- {
- return;
- }
-
+ return;
+
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (rect_tool);
old_function = private->function;
@@ -2528,10 +2542,10 @@
y1_b = pub_y1 - (narrow_mode ? private->corner_handle_h / shell->scale_y : 0);
y2_b = pub_y2 + (narrow_mode ? private->corner_handle_h / shell->scale_y : 0);
- return coord->x < x1_b ||
- coord->x > x2_b ||
- coord->y < y1_b ||
- coord->y > y2_b;
+ return (coord->x < x1_b ||
+ coord->x > x2_b ||
+ coord->y < y1_b ||
+ coord->y > y2_b);
}
/**
Modified: branches/soc-2008-tagging/app/tools/gimprotatetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimprotatetool.c (original)
+++ branches/soc-2008-tagging/app/tools/gimprotatetool.c Sun Jul 13 12:11:51 2008
@@ -130,49 +130,37 @@
GdkEventKey *kevent,
GimpDisplay *display)
{
- GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
- GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tool);
- gboolean handled_key = FALSE;
- GtkSpinButton *angle_spin = GTK_SPIN_BUTTON (rotate->angle_spin_button);
+ GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
if (display == draw_tool->display)
{
+ GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tool);
+ GtkSpinButton *angle_spin = GTK_SPIN_BUTTON (rotate->angle_spin_button);
+
switch (kevent->keyval)
{
case GDK_Up:
- handled_key = TRUE;
gtk_spin_button_spin (angle_spin, GTK_SPIN_STEP_FORWARD, 0.0);
- break;
+ return TRUE;
case GDK_Down:
- handled_key = TRUE;
gtk_spin_button_spin (angle_spin, GTK_SPIN_STEP_BACKWARD, 0.0);
- break;
+ return TRUE;
case GDK_Left:
- handled_key = TRUE;
gtk_spin_button_spin (angle_spin, GTK_SPIN_PAGE_FORWARD, 0.0);
- break;
+ return TRUE;
case GDK_Right:
- handled_key = TRUE;
gtk_spin_button_spin (angle_spin, GTK_SPIN_PAGE_BACKWARD, 0.0);
- break;
+ return TRUE;
default:
- handled_key = FALSE;
break;
}
}
- if (! handled_key)
- {
- handled_key = GIMP_TOOL_CLASS (parent_class)->key_press (tool,
- kevent,
- display);
- }
-
- return handled_key;
+ return GIMP_TOOL_CLASS (parent_class)->key_press (tool, kevent, display);
}
static void
Modified: branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c (original)
+++ branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c Sun Jul 13 12:11:51 2008
@@ -22,7 +22,7 @@
#include "config.h"
#include <glib-object.h>
-#include <cairo/cairo.h>
+#include <cairo.h>
#include "libgimpmath/gimpmath.h"
Modified: branches/soc-2008-tagging/app/vectors/gimpvectors.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpvectors.c (original)
+++ branches/soc-2008-tagging/app/vectors/gimpvectors.c Sun Jul 13 12:11:51 2008
@@ -22,7 +22,7 @@
#include "config.h"
#include <glib-object.h>
-#include <cairo/cairo.h>
+#include <cairo.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
Modified: branches/soc-2008-tagging/app/widgets/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/widgets/Makefile.am (original)
+++ branches/soc-2008-tagging/app/widgets/Makefile.am Sun Jul 13 12:11:51 2008
@@ -259,6 +259,8 @@
gimpsessioninfo-dockable.h \
gimpsettingsbox.c \
gimpsettingsbox.h \
+ gimpsettingseditor.c \
+ gimpsettingseditor.h \
gimpsizebox.c \
gimpsizebox.h \
gimpstringaction.c \
@@ -343,6 +345,8 @@
gimpwidgets-utils.h \
gimpwindow.c \
gimpwindow.h \
+ gtkscalebutton.c \
+ gtkscalebutton.h \
gtkwrapbox.c \
gtkwrapbox.h \
gtkhwrapbox.c \
Modified: branches/soc-2008-tagging/app/widgets/gimpaction.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpaction.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpaction.c Sun Jul 13 12:11:51 2008
@@ -128,9 +128,10 @@
static void
gimp_action_init (GimpAction *action)
{
- action->color = NULL;
- action->viewable = NULL;
- action->ellipsize = PANGO_ELLIPSIZE_NONE;
+ action->color = NULL;
+ action->viewable = NULL;
+ action->ellipsize = PANGO_ELLIPSIZE_NONE;
+ action->max_width_chars = -1;
g_signal_connect (action, "notify::tooltip",
G_CALLBACK (gimp_action_tooltip_notify),
@@ -301,32 +302,26 @@
area = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (proxy));
- if (area && ! GIMP_IS_COLOR_AREA (area))
+ if (GIMP_IS_COLOR_AREA (area))
{
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), NULL);
- area = NULL;
+ gimp_color_area_set_color (GIMP_COLOR_AREA (area), action->color);
}
-
- if (! area)
+ else
{
- GtkSettings *settings = gtk_widget_get_settings (proxy);
- gint width, height;
+ gint width, height;
area = gimp_color_area_new (action->color,
GIMP_COLOR_AREA_SMALL_CHECKS, 0);
gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
- gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
+ gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (proxy),
+ GTK_ICON_SIZE_MENU,
&width, &height);
gtk_widget_set_size_request (area, width, height);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), area);
gtk_widget_show (area);
}
- else
- {
- gimp_color_area_set_color (GIMP_COLOR_AREA (area), action->color);
- }
}
else if (action->viewable)
{
@@ -334,20 +329,17 @@
view = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (proxy));
- if (view && (! GIMP_IS_VIEW (view) ||
- ! g_type_is_a (G_TYPE_FROM_INSTANCE (action->viewable),
- GIMP_VIEW (view)->renderer->viewable_type)))
+ if (GIMP_IS_VIEW (view) &&
+ g_type_is_a (G_TYPE_FROM_INSTANCE (action->viewable),
+ GIMP_VIEW (view)->renderer->viewable_type))
{
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), NULL);
- view = NULL;
+ gimp_view_set_viewable (GIMP_VIEW (view), action->viewable);
}
-
- if (! view)
+ else
{
- GtkSettings *settings = gtk_widget_get_settings (proxy);
- GtkIconSize size;
- gint width, height;
- gint border_width;
+ GtkIconSize size;
+ gint width, height;
+ gint border_width;
if (GIMP_IS_IMAGEFILE (action->viewable))
{
@@ -360,7 +352,8 @@
border_width = 1;
}
- gtk_icon_size_lookup_for_settings (settings, size, &width, &height);
+ gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (proxy),
+ size, &width, &height);
view = gimp_view_new_full (action->context, action->viewable,
width, height, border_width,
@@ -368,10 +361,6 @@
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), view);
gtk_widget_show (view);
}
- else
- {
- gimp_view_set_viewable (GIMP_VIEW (view), action->viewable);
- }
}
else
{
Modified: branches/soc-2008-tagging/app/widgets/gimpactionview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpactionview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpactionview.c Sun Jul 13 12:11:51 2008
@@ -341,8 +341,10 @@
gtk_tree_view_column_set_title (column, _("Shortcut"));
cell = gtk_cell_renderer_accel_new ();
- cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (cell)->editable = TRUE;
+ g_object_set (cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell,
"accel-key",
Modified: branches/soc-2008-tagging/app/widgets/gimpblobeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpblobeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpblobeditor.c Sun Jul 13 12:11:51 2008
@@ -188,6 +188,7 @@
GdkEventExpose *event)
{
GimpBlobEditor *editor = GIMP_BLOB_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
GdkRectangle rect;
gint r0;
@@ -208,10 +209,10 @@
cairo_rectangle (cr,
rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.width - 1);
- gdk_cairo_set_source_color (cr, &widget->style->light[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->light[widget->state]);
cairo_fill_preserve (cr);
- gdk_cairo_set_source_color (cr, &widget->style->dark[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->dark[widget->state]);
cairo_set_line_width (cr, 1);
cairo_stroke (cr);
@@ -319,6 +320,7 @@
gdouble radius)
{
GtkWidget *widget = GTK_WIDGET (editor);
+ GtkStyle *style = gtk_widget_get_style (widget);
Blob *blob;
BlobFunc function = blob_ellipse;
gint i;
@@ -373,6 +375,6 @@
g_free (blob);
- gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
cairo_fill (cr);
}
Modified: branches/soc-2008-tagging/app/widgets/gimpbrusheditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpbrusheditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpbrusheditor.c Sun Jul 13 12:11:51 2008
@@ -347,12 +347,12 @@
brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data);
- radius = editor->radius_data->value;
- spikes = ROUND (editor->spikes_data->value);
- hardness = editor->hardness_data->value;
- ratio = editor->aspect_ratio_data->value;
- angle = editor->angle_data->value;
- spacing = editor->spacing_data->value;
+ radius = gtk_adjustment_get_value (editor->radius_data);
+ spikes = ROUND (gtk_adjustment_get_value (editor->spikes_data));
+ hardness = gtk_adjustment_get_value (editor->hardness_data);
+ ratio = gtk_adjustment_get_value (editor->aspect_ratio_data);
+ angle = gtk_adjustment_get_value (editor->angle_data);
+ spacing = gtk_adjustment_get_value (editor->spacing_data);
if (radius != gimp_brush_generated_get_radius (brush) ||
spikes != gimp_brush_generated_get_spikes (brush) ||
Modified: branches/soc-2008-tagging/app/widgets/gimpbrushfactoryview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpbrushfactoryview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpbrushfactoryview.c Sun Jul 13 12:11:51 2008
@@ -155,7 +155,7 @@
/* eek */
gtk_box_pack_end (GTK_BOX (editor->view),
- factory_view->spacing_scale->parent,
+ gtk_widget_get_parent (factory_view->spacing_scale),
FALSE, FALSE, 0);
factory_view->spacing_changed_handler_id =
@@ -242,7 +242,7 @@
gimp_brush_factory_view_spacing_changed,
view);
- gimp_brush_set_spacing (brush, adjustment->value);
+ gimp_brush_set_spacing (brush, gtk_adjustment_get_value (adjustment));
g_signal_handlers_unblock_by_func (brush,
gimp_brush_factory_view_spacing_changed,
Modified: branches/soc-2008-tagging/app/widgets/gimpbrushselect.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpbrushselect.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpbrushselect.c Sun Jul 13 12:11:51 2008
@@ -168,7 +168,7 @@
gtk_widget_show (dialog->view);
/* Create the frame and the table for the options */
- table = GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale->parent;
+ table = gtk_widget_get_parent (GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
@@ -332,7 +332,7 @@
GimpBrushSelect *select)
{
gimp_context_set_opacity (GIMP_PDB_DIALOG (select)->context,
- adjustment->value / 100.0);
+ gtk_adjustment_get_value (adjustment) / 100.0);
}
static void
@@ -353,9 +353,11 @@
gimp_brush_select_spacing_update (GtkAdjustment *adjustment,
GimpBrushSelect *select)
{
- if (select->spacing != adjustment->value)
+ gdouble value = gtk_adjustment_get_value (adjustment);
+
+ if (select->spacing != value)
{
- select->spacing = adjustment->value;
+ select->spacing = value;
gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE);
}
Modified: branches/soc-2008-tagging/app/widgets/gimpcellrendererdashes.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcellrendererdashes.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcellrendererdashes.c Sun Jul 13 12:11:51 2008
@@ -191,6 +191,7 @@
GtkCellRendererState flags)
{
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state;
cairo_t *cr;
gint width;
@@ -240,7 +241,7 @@
}
}
- gdk_cairo_set_source_color (cr, &widget->style->text[state]);
+ gdk_cairo_set_source_color (cr, &style->text[state]);
cairo_fill (cr);
cairo_destroy (cr);
Modified: branches/soc-2008-tagging/app/widgets/gimpcellrendererviewable.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcellrendererviewable.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcellrendererviewable.c Sun Jul 13 12:11:51 2008
@@ -123,7 +123,9 @@
static void
gimp_cell_renderer_viewable_init (GimpCellRendererViewable *cellviewable)
{
- GTK_CELL_RENDERER (cellviewable)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
+ g_object_set (cellviewable,
+ "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ NULL);
}
static void
Modified: branches/soc-2008-tagging/app/widgets/gimpcolorbar.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcolorbar.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcolorbar.c Sun Jul 13 12:11:51 2008
@@ -154,15 +154,15 @@
gimp_color_bar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GimpColorBar *bar = GIMP_COLOR_BAR (widget);
+ GimpColorBar *bar = GIMP_COLOR_BAR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf;
guchar *b;
gint x, y;
gint width, height;
gint i, j;
- x = GTK_CONTAINER (bar)->border_width;
- y = GTK_CONTAINER (bar)->border_width;
+ x = y = gtk_container_get_border_width (GTK_CONTAINER (bar));
width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y;
@@ -205,7 +205,7 @@
break;
}
- gdk_draw_rgb_image (widget->window, widget->style->black_gc,
+ gdk_draw_rgb_image (widget->window, style->black_gc,
widget->allocation.x + x, widget->allocation.y + y,
width, height,
GDK_RGB_DITHER_NORMAL,
Modified: branches/soc-2008-tagging/app/widgets/gimpcoloreditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcoloreditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcoloreditor.c Sun Jul 13 12:11:51 2008
@@ -582,7 +582,7 @@
gimp_color_editor_tab_toggled (GtkWidget *widget,
GimpColorEditor *editor)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GtkWidget *selector;
Modified: branches/soc-2008-tagging/app/widgets/gimpcolorframe.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcolorframe.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcolorframe.c Sun Jul 13 12:11:51 2008
@@ -271,13 +271,14 @@
if (frame->has_number)
{
- cairo_t *cr;
- gchar buf[8];
- gint w, h;
- gdouble scale;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ cairo_t *cr;
+ gchar buf[8];
+ gint w, h;
+ gdouble scale;
cr = gdk_cairo_create (widget->window);
- gdk_cairo_set_source_color (cr, &widget->style->light[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
g_snprintf (buf, sizeof (buf), "%d", frame->number);
Modified: branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcolormapeditor.c Sun Jul 13 12:11:51 2008
@@ -829,7 +829,9 @@
if (HAVE_COLORMAP (image))
{
- gimp_colormap_editor_set_index (editor, adjustment->value + 0.5, NULL);
+ gint index = ROUND (gtk_adjustment_get_value (adjustment));
+
+ gimp_colormap_editor_set_index (editor, index, NULL);
gimp_colormap_editor_update_entries (editor);
}
Modified: branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcomponenteditor.c Sun Jul 13 12:11:51 2008
@@ -286,6 +286,7 @@
gint view_size)
{
GtkWidget *tree_widget;
+ GtkStyle *tree_style;
GtkIconSize icon_size;
GtkTreeIter iter;
gboolean iter_valid;
@@ -295,14 +296,15 @@
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
tree_widget = GTK_WIDGET (editor->view);
+ tree_style = gtk_widget_get_style (tree_widget);
icon_size = gimp_get_icon_size (tree_widget,
GIMP_STOCK_VISIBLE,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * tree_style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * tree_style->ythickness);
g_object_set (editor->eye_cell,
"stock-size", icon_size,
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainerbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainerbox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainerbox.c Sun Jul 13 12:11:51 2008
@@ -106,6 +106,7 @@
{
GimpContainerView *view;
GtkScrolledWindowClass *sw_class;
+ GtkStyle *sw_style;
GtkRequisition req;
gint view_size;
gint scrollbar_width;
@@ -134,11 +135,12 @@
&req);
scrollbar_width += req.width;
- border_x = GTK_CONTAINER (box)->border_width;
- border_y = GTK_CONTAINER (box)->border_width;
+ border_x = border_y = gtk_container_get_border_width (GTK_CONTAINER (box));
- border_x += box->scrolled_win->style->xthickness * 2 + scrollbar_width;
- border_y += box->scrolled_win->style->ythickness * 2;
+ sw_style = gtk_widget_get_style (box->scrolled_win);
+
+ border_x += sw_style->xthickness * 2 + scrollbar_width;
+ border_y += sw_style->ythickness * 2;
gtk_widget_set_size_request (box->scrolled_win,
width > 0 ? width + border_x : -1,
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.c Sun Jul 13 12:11:51 2008
@@ -43,12 +43,6 @@
PROP_ELLIPSIZE = GIMP_CONTAINER_VIEW_PROP_LAST + 1
};
-enum
-{
- COLUMN_RENDERER,
- COLUMN_NAME,
- NUM_COLUMNS
-};
static void gimp_container_combo_box_view_iface_init (GimpContainerViewInterface *iface);
@@ -144,7 +138,7 @@
GtkCellLayout *layout;
GtkCellRenderer *cell;
- store = gtk_list_store_new (NUM_COLUMNS,
+ store = gtk_list_store_new (GIMP_CONTAINER_COMBO_BOX_N_COLUMNS,
GIMP_TYPE_VIEW_RENDERER,
G_TYPE_STRING);
@@ -157,7 +151,8 @@
cell = gimp_cell_renderer_viewable_new ();
gtk_cell_layout_pack_start (layout, cell, FALSE);
gtk_cell_layout_set_attributes (layout, cell,
- "renderer", COLUMN_RENDERER,
+ "renderer",
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER,
NULL);
combo_box->viewable_renderer = cell;
@@ -165,7 +160,8 @@
cell = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (layout, cell, TRUE);
gtk_cell_layout_set_attributes (layout, cell,
- "text", COLUMN_NAME,
+ "text",
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_NAME,
NULL);
combo_box->text_renderer = cell;
@@ -277,8 +273,8 @@
view);
gtk_list_store_set (GTK_LIST_STORE (model), iter,
- COLUMN_RENDERER, renderer,
- COLUMN_NAME, name,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER, renderer,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_NAME, name,
-1);
g_object_unref (renderer);
@@ -308,7 +304,7 @@
GimpViewRenderer *renderer;
gtk_tree_model_get (model, &iter,
- COLUMN_RENDERER, &renderer,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER, &renderer,
-1);
gimp_view_renderer_set_context (renderer, context);
@@ -429,7 +425,7 @@
gchar *name = gimp_viewable_get_description (viewable, NULL);
gtk_list_store_set (GTK_LIST_STORE (model), iter,
- COLUMN_NAME, name,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_NAME, name,
-1);
g_free (name);
@@ -494,7 +490,7 @@
GimpViewRenderer *renderer;
gtk_tree_model_get (model, &iter,
- COLUMN_RENDERER, &renderer,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER, &renderer,
-1);
gimp_view_renderer_set_size (renderer, view_size, border_width);
@@ -516,7 +512,7 @@
GimpViewRenderer *renderer;
gtk_tree_model_get (gtk_combo_box_get_model (combo_box), &iter,
- COLUMN_RENDERER, &renderer,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER, &renderer,
-1);
gimp_container_view_item_selected (view, renderer->viewable);
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainercombobox.h Sun Jul 13 12:11:51 2008
@@ -23,6 +23,14 @@
#define __GIMP_CONTAINER_COMBO_BOX_H__
+enum
+{
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_RENDERER,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_NAME,
+ GIMP_CONTAINER_COMBO_BOX_N_COLUMNS
+};
+
+
#define GIMP_TYPE_CONTAINER_COMBO_BOX (gimp_container_combo_box_get_type ())
#define GIMP_CONTAINER_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CONTAINER_COMBO_BOX, GimpContainerComboBox))
#define GIMP_CONTAINER_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CONTAINER_COMBO_BOX, GimpContainerComboBoxClass))
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainergridview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainergridview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainergridview.c Sun Jul 13 12:11:51 2008
@@ -179,6 +179,7 @@
gimp_container_grid_view_init (GimpContainerGridView *grid_view)
{
GimpContainerBox *box = GIMP_CONTAINER_BOX (grid_view);
+ GtkWidget *viewport;
grid_view->rows = 1;
grid_view->columns = 1;
@@ -195,14 +196,14 @@
grid_view->wrap_box = gtk_hwrap_box_new (FALSE);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (box->scrolled_win),
grid_view->wrap_box);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (grid_view->wrap_box->parent),
- GTK_SHADOW_NONE);
+ viewport = gtk_widget_get_parent (grid_view->wrap_box);
+ gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_widget_show (grid_view->wrap_box);
- g_signal_connect (grid_view->wrap_box->parent, "size-allocate",
+ g_signal_connect (viewport, "size-allocate",
G_CALLBACK (gimp_container_grid_view_viewport_resized),
grid_view);
- g_signal_connect (grid_view->wrap_box->parent, "button-press-event",
+ g_signal_connect (viewport, "button-press-event",
G_CALLBACK (gimp_container_grid_view_button_press),
grid_view);
@@ -374,8 +375,10 @@
}
else
{
- *x += widget->style->xthickness;
- *y += widget->style->ythickness;
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ *x += style->xthickness;
+ *y += style->ythickness;
}
gimp_menu_position (menu, x, y);
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainerpopup.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainerpopup.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainerpopup.c Sun Jul 13 12:11:51 2008
@@ -588,7 +588,7 @@
gimp_container_popup_view_type_toggled (GtkWidget *button,
GimpContainerPopup *popup)
{
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
GimpViewType view_type;
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainertreeview-dnd.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainertreeview-dnd.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainertreeview-dnd.c Sun Jul 13 12:11:51 2008
@@ -185,9 +185,9 @@
#endif
if (tree_view->scroll_dir == GDK_SCROLL_UP)
- new_value = adj->value - SCROLL_STEP;
+ new_value = gtk_adjustment_get_value (adj) - SCROLL_STEP;
else
- new_value = adj->value + SCROLL_STEP;
+ new_value = gtk_adjustment_get_value (adj) + SCROLL_STEP;
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.c Sun Jul 13 12:11:51 2008
@@ -350,8 +350,10 @@
}
else
{
- *x += widget->style->xthickness;
- *y += widget->style->ythickness;
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ *x += style->xthickness;
+ *y += style->ythickness;
}
gimp_menu_position (menu, x, y);
@@ -398,6 +400,28 @@
return GTK_WIDGET (tree_view);
}
+void
+gimp_container_tree_view_connect_name_edited (GimpContainerTreeView *tree_view,
+ GCallback callback,
+ gpointer data)
+{
+ g_return_if_fail (GIMP_IS_CONTAINER_TREE_VIEW (tree_view));
+ g_return_if_fail (callback != NULL);
+
+ g_object_set (tree_view->name_cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
+
+ if (! g_list_find (tree_view->editable_cells, tree_view->name_cell))
+ tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
+ tree_view->name_cell);
+
+ g_signal_connect (tree_view->name_cell, "edited",
+ callback,
+ data);
+}
+
static void
gimp_container_tree_view_set (GimpContainerTreeView *tree_view,
GtkTreeIter *iter,
@@ -761,13 +785,15 @@
if (stock_id)
{
+ GtkStyle *style = gtk_widget_get_style (tree_widget);
+
icon_size = gimp_get_icon_size (tree_widget,
stock_id,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * style->ythickness);
g_object_set (list->data, "stock-size", icon_size, NULL);
Modified: branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontainertreeview.h Sun Jul 13 12:11:51 2008
@@ -117,5 +117,10 @@
gint view_size,
gint view_border_width);
+void
+ gimp_container_tree_view_connect_name_edited (GimpContainerTreeView *tree_view,
+ GCallback callback,
+ gpointer data);
+
#endif /* __GIMP_CONTAINER_TREE_VIEW_H__ */
Modified: branches/soc-2008-tagging/app/widgets/gimpcurveview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcurveview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpcurveview.c Sun Jul 13 12:11:51 2008
@@ -339,7 +339,7 @@
GdkEventExpose *event)
{
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
- GtkStyle *style = widget->style;
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gint border;
gint width;
Modified: branches/soc-2008-tagging/app/widgets/gimpdasheditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdasheditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdasheditor.c Sun Jul 13 12:11:51 2008
@@ -238,6 +238,7 @@
GdkEventExpose *event)
{
GimpDashEditor *editor = GIMP_DASH_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr = gdk_cairo_create (widget->window);
gint x;
gint w, h;
@@ -249,7 +250,7 @@
/* draw the background */
- gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
cairo_paint (cr);
w = editor->block_width;
@@ -273,7 +274,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_fill (cr);
for (; x < editor->x0 + editor->n_segments * w; x += w)
@@ -284,7 +285,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
cairo_fill (cr);
for (; x < widget->allocation.width + w; x += w)
@@ -295,7 +296,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_fill (cr);
/* draw rulers */
@@ -330,7 +331,7 @@
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 - 1);
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 + h);
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_set_line_width (cr, 1.0);
cairo_stroke (cr);
Modified: branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdatafactoryview.c Sun Jul 13 12:11:51 2008
@@ -171,15 +171,9 @@
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
-
- tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
- tree_view->name_cell);
-
- g_signal_connect (tree_view->name_cell, "edited",
- G_CALLBACK (gimp_data_factory_view_tree_name_edited),
- factory_view);
+ gimp_container_tree_view_connect_name_edited (tree_view,
+ G_CALLBACK (gimp_data_factory_view_tree_name_edited),
+ factory_view);
}
str = g_strdup_printf ("%s-edit", action_group);
Modified: branches/soc-2008-tagging/app/widgets/gimpdbusservice.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdbusservice.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdbusservice.c Sun Jul 13 12:11:51 2008
@@ -23,9 +23,10 @@
#if HAVE_DBUS_GLIB
+#include <gtk/gtk.h>
#include <dbus/dbus-glib.h>
-#include "core/core-types.h"
+#include "widgets-types.h"
#include "core/gimp.h"
@@ -33,7 +34,7 @@
#include "gimpdbusservice.h"
#include "gimpdbusservice-glue.h"
-#include "gimpuimanager.c"
+#include "gimpuimanager.h"
static void gimp_dbus_service_class_init (GimpDBusServiceClass *klass);
Modified: branches/soc-2008-tagging/app/widgets/gimpdock.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdock.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdock.c Sun Jul 13 12:11:51 2008
@@ -465,13 +465,13 @@
else
old_book = g_list_nth_data (dock->dockbooks, index - 1);
- parent = old_book->parent;
+ parent = gtk_widget_get_parent (old_book);
if ((old_length > 1) && (index > 0))
{
GtkWidget *grandparent;
- grandparent = parent->parent;
+ grandparent = gtk_widget_get_parent (parent);
old_book = parent;
parent = grandparent;
@@ -553,8 +553,8 @@
GtkWidget *parent;
GtkWidget *grandparent;
- parent = GTK_WIDGET (dockbook)->parent;
- grandparent = parent->parent;
+ parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
+ grandparent = gtk_widget_get_parent (parent);
if (index == 0)
other_book = gtk_paned_get_child2 (GTK_PANED (parent));
Modified: branches/soc-2008-tagging/app/widgets/gimpdockable.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockable.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockable.c Sun Jul 13 12:11:51 2008
@@ -312,9 +312,12 @@
GimpDockable *dockable = GIMP_DOCKABLE (widget);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
GtkRequisition child_requisition;
+ gint border_width;
- requisition->width = container->border_width * 2;
- requisition->height = container->border_width * 2;
+ border_width = gtk_container_get_border_width (container);
+
+ requisition->width = border_width * 2;
+ requisition->height = border_width * 2;
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
{
@@ -345,9 +348,12 @@
GtkRequisition button_requisition = { 0, };
GtkAllocation child_allocation;
+ gint border_width;
widget->allocation = *allocation;
+ border_width = gtk_container_get_border_width (container);
+
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
{
gtk_widget_size_request (dockable->menu_button, &button_requisition);
@@ -355,12 +361,12 @@
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = (allocation->x +
allocation->width -
- container->border_width -
+ border_width -
button_requisition.width);
else
- child_allocation.x = allocation->x + container->border_width;
+ child_allocation.x = allocation->x + border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = button_requisition.width;
child_allocation.height = button_requisition.height;
@@ -369,13 +375,13 @@
if (child && GTK_WIDGET_VISIBLE (child))
{
- child_allocation.x = allocation->x + container->border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.x = allocation->x + border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = MAX (allocation->width -
- container->border_width * 2,
+ border_width * 2,
0);
child_allocation.height = MAX (allocation->height -
- container->border_width * 2 -
+ border_width * 2 -
button_requisition.height,
0);
@@ -541,6 +547,7 @@
if (GTK_WIDGET_DRAWABLE (widget))
{
GimpDockable *dockable = GIMP_DOCKABLE (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkRectangle title_area;
GdkRectangle expose_area;
@@ -555,7 +562,7 @@
if (dockable->blink_counter & 1)
{
- gtk_paint_box (widget->style, widget->window,
+ gtk_paint_box (style, widget->window,
GTK_STATE_SELECTED, GTK_SHADOW_NONE,
&expose_area, widget, "",
title_area.x, title_area.y,
@@ -583,7 +590,7 @@
text_y = title_area.y + (title_area.height - layout_height) / 2;
- gtk_paint_layout (widget->style, widget->window,
+ gtk_paint_layout (style, widget->window,
(dockable->blink_counter & 1) ?
GTK_STATE_SELECTED : widget->state, TRUE,
&expose_area, widget, NULL,
@@ -1062,7 +1069,7 @@
GdkRectangle *area)
{
GtkWidget *widget = GTK_WIDGET (dockable);
- gint border = GTK_CONTAINER (dockable)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (dockable));
area->x = widget->allocation.x + border;
area->y = widget->allocation.y + border;
Modified: branches/soc-2008-tagging/app/widgets/gimpdockseparator.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpdockseparator.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpdockseparator.c Sun Jul 13 12:11:51 2008
@@ -196,13 +196,16 @@
if (dockable)
{
GtkWidget *dockbook;
+ GtkWidget *parent;
GList *children;
gint index;
g_object_set_data (G_OBJECT (dockable),
"gimp-dock-drag-widget", NULL);
- children = gtk_container_get_children (GTK_CONTAINER (widget->parent));
+ parent = gtk_widget_get_parent (widget);
+
+ children = gtk_container_get_children (GTK_CONTAINER (parent));
index = g_list_index (children, widget);
g_list_free (children);
Modified: branches/soc-2008-tagging/app/widgets/gimpfgbgeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpfgbgeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpfgbgeditor.c Sun Jul 13 12:11:51 2008
@@ -286,6 +286,7 @@
GdkEventExpose *eevent)
{
GimpFgBgEditor *editor = GIMP_FG_BG_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint width, height;
gint default_w, default_h;
gint swap_w, swap_h;
@@ -348,14 +349,14 @@
gimp_context_get_background (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
(width - rect_w),
(height - rect_h),
rect_w, rect_h,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_FOREGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
@@ -371,13 +372,13 @@
gimp_context_get_foreground (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
0, 0,
rect_w, rect_h,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_BACKGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
Modified: branches/soc-2008-tagging/app/widgets/gimpfgbgview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpfgbgview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpfgbgview.c Sun Jul 13 12:11:51 2008
@@ -206,7 +206,8 @@
gimp_fg_bg_view_expose (GtkWidget *widget,
GdkEventExpose *eevent)
{
- GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
+ GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint x, y;
gint width, height;
gint rect_w, rect_h;
@@ -230,14 +231,14 @@
gimp_context_get_background (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
x + width - rect_w + 1,
y + height - rect_h + 1,
rect_w - 2, rect_h - 2,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
GTK_SHADOW_IN,
NULL, widget, NULL,
x + width - rect_w, y + height - rect_h, rect_w, rect_h);
@@ -249,13 +250,13 @@
gimp_context_get_foreground (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
x + 1, y + 1,
rect_w - 2, rect_h - 2,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL, widget, NULL,
x, y, rect_w, rect_h);
Modified: branches/soc-2008-tagging/app/widgets/gimpgradienteditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpgradienteditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpgradienteditor.c Sun Jul 13 12:11:51 2008
@@ -586,7 +586,7 @@
adjustment = GTK_ADJUSTMENT (editor->scroll_data);
- old_value = adjustment->value;
+ old_value = gtk_adjustment_get_value (adjustment);
old_page_size = adjustment->page_size;
switch (zoom_type)
@@ -776,8 +776,9 @@
editor->zoom_factor);
str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"),
- adjustment->value,
- adjustment->value + adjustment->page_size);
+ gtk_adjustment_get_value (adjustment),
+ gtk_adjustment_get_value (adjustment) +
+ adjustment->page_size);
gradient_editor_set_hint (editor, str1, str2, NULL, NULL);
@@ -787,8 +788,8 @@
renderer = GIMP_VIEW_RENDERER_GRADIENT (GIMP_VIEW (data_editor->view)->renderer);
gimp_view_renderer_gradient_set_offsets (renderer,
- adjustment->value,
- adjustment->value +
+ gtk_adjustment_get_value (adjustment),
+ gtk_adjustment_get_value (adjustment) +
adjustment->page_size,
editor->instant_update);
gimp_gradient_editor_update (editor);
@@ -798,7 +799,7 @@
gradient_editor_instant_update_update (GtkWidget *widget,
GimpGradientEditor *editor)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
editor->instant_update = TRUE;
gtk_range_set_update_policy (GTK_RANGE (editor->scrollbar),
@@ -923,7 +924,7 @@
else
{
GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
- gfloat value = adj->value;
+ gfloat value = gtk_adjustment_get_value (adj);
switch (sevent->direction)
{
@@ -1122,9 +1123,10 @@
gfloat new_value;
- new_value = adj->value + ((sevent->direction == GDK_SCROLL_UP) ?
- - adj->page_increment / 2 :
- adj->page_increment / 2);
+ new_value = (gtk_adjustment_get_value (adj) +
+ ((sevent->direction == GDK_SCROLL_UP) ?
+ - adj->page_increment / 2 :
+ adj->page_increment / 2));
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
@@ -1238,8 +1240,9 @@
GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data),
cr,
width, height,
- adj->value,
- adj->value + adj->page_size);
+ gtk_adjustment_get_value (adj),
+ gtk_adjustment_get_value (adj) +
+ adj->page_size);
cairo_destroy (cr);
@@ -1746,6 +1749,7 @@
gdouble left,
gdouble right)
{
+ GtkStyle *control_style;
GimpGradientSegment *seg;
GradientEditorDragMode handle;
gint sel_l;
@@ -1758,16 +1762,18 @@
/* Draw selection */
+ control_style = gtk_widget_get_style (editor->control);
+
sel_l = control_calc_p_pos (editor, editor->control_sel_l->left);
sel_r = control_calc_p_pos (editor, editor->control_sel_r->right);
gdk_cairo_set_source_color (cr,
- &editor->control->style->base[GTK_STATE_NORMAL]);
+ &control_style->base[GTK_STATE_NORMAL]);
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
gdk_cairo_set_source_color (cr,
- &editor->control->style->base[GTK_STATE_SELECTED]);
+ &control_style->base[GTK_STATE_SELECTED]);
cairo_rectangle (cr, sel_l, 0, sel_r - sel_l + 1, height);
cairo_fill (cr);
@@ -1835,11 +1841,12 @@
gint height,
gboolean selected)
{
- GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
+ GtkStyle *style = gtk_widget_get_style (editor->control);
+ GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
control_draw_handle (cr,
- &editor->control->style->text_aa[state],
- &editor->control->style->black,
+ &style->text_aa[state],
+ &style->black,
control_calc_p_pos (editor, pos), height);
}
@@ -1850,11 +1857,12 @@
gint height,
gboolean selected)
{
- GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
+ GtkStyle *style = gtk_widget_get_style (editor->control);
+ GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
control_draw_handle (cr,
- &editor->control->style->text_aa[state],
- &editor->control->style->white,
+ &style->text_aa[state],
+ &style->white,
control_calc_p_pos (editor, pos), height);
}
Modified: branches/soc-2008-tagging/app/widgets/gimphandlebar.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphandlebar.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimphandlebar.c Sun Jul 13 12:11:51 2008
@@ -151,8 +151,7 @@
gint width, height;
gint i;
- x = GTK_CONTAINER (widget)->border_width;
- y = GTK_CONTAINER (widget)->border_width;
+ x = y = gtk_container_get_border_width (GTK_CONTAINER (widget));
width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y;
@@ -214,7 +213,7 @@
GdkEventButton *bevent)
{
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
- gint border = GTK_CONTAINER (widget)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint width = widget->allocation.width - 2 * border;
gdouble value;
gint min_dist;
@@ -258,7 +257,7 @@
GdkEventMotion *mevent)
{
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
- gint border = GTK_CONTAINER (widget)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint width = widget->allocation.width - 2 * border;
gdouble value;
Modified: branches/soc-2008-tagging/app/widgets/gimphelp.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp.c Sun Jul 13 12:11:51 2008
@@ -47,6 +47,8 @@
#include "gimphelp-ids.h"
#include "gimpmessagebox.h"
#include "gimpmessagedialog.h"
+#include "gimpmessagedialog.h"
+#include "gimpwidgets-utils.c"
#include "gimp-log.h"
#include "gimp-intl.h"
@@ -66,10 +68,13 @@
/* local function prototypes */
-static gint gimp_idle_help (GimpIdleHelp *idle_help);
+static gboolean gimp_idle_help (GimpIdleHelp *idle_help);
+static void gimp_idle_help_free (GimpIdleHelp *idle_help);
-static gboolean gimp_help_browser (Gimp *gimp);
+static gboolean gimp_help_browser (Gimp *gimp,
+ GimpProgress *progress);
static void gimp_help_browser_error (Gimp *gimp,
+ GimpProgress *progress,
const gchar *title,
const gchar *primary,
const gchar *text);
@@ -81,11 +86,15 @@
const gchar *help_locales,
const gchar *help_id);
-static gint gimp_help_get_help_domains (Gimp *gimp,
- gchar ***domain_names,
- gchar ***domain_uris);
-static gchar * gimp_help_get_default_domain_uri (Gimp *gimp);
-static gchar * gimp_help_get_locales (Gimp *gimp);
+static gint gimp_help_get_help_domains (Gimp *gimp,
+ gchar ***domain_names,
+ gchar ***domain_uris);
+static gchar * gimp_help_get_default_domain_uri (Gimp *gimp);
+static gchar * gimp_help_get_locales (Gimp *gimp);
+
+static gchar * gimp_help_get_user_manual_basedir (void);
+
+static void gimp_help_query_user_manual_online (GimpIdleHelp *idle_help);
/* public functions */
@@ -118,13 +127,55 @@
if (help_id && strlen (help_id))
idle_help->help_id = g_strdup (help_id);
+ GIMP_LOG (HELP, "request for help-id '%s' from help-domain '%s'",
+ help_id ? help_id : "(null)",
+ help_domain ? help_domain : "(null)");
+
g_idle_add ((GSourceFunc) gimp_idle_help, idle_help);
+ }
+}
+
+gboolean
+gimp_help_user_manual_is_installed (Gimp *gimp)
+{
+ gchar *basedir;
+ gboolean found = FALSE;
+
+ g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
+
+ /* if GIMP2_HELP_URI is set, assume that the manual can be found there */
+ if (g_getenv ("GIMP2_HELP_URI"))
+ return TRUE;
+
+ basedir = gimp_help_get_user_manual_basedir ();
+
+ if (g_file_test (basedir, G_FILE_TEST_IS_DIR))
+ {
+ gchar *locales = gimp_help_get_locales (gimp);
+ const gchar *s = locales;
+ const gchar *p;
+
+ for (p = strchr (s, ':'); p && !found; p = strchr (s, ':'))
+ {
+ gchar *locale = g_strndup (s, p - s);
+ gchar *path;
+
+ path = g_build_filename (basedir, locale, "gimp-help.xml", NULL);
+
+ found = g_file_test (path, G_FILE_TEST_IS_REGULAR);
- if (gimp->be_verbose)
- g_print ("HELP: request for help-id '%s' from help-domain '%s'\n",
- help_id ? help_id : "(null)",
- help_domain ? help_domain : "(null)");
+ g_free (path);
+ g_free (locale);
+
+ s = p + 1;
+ }
+
+ g_free (locales);
}
+
+ g_free (basedir);
+
+ return found;
}
@@ -136,13 +187,21 @@
GimpGuiConfig *config = GIMP_GUI_CONFIG (idle_help->gimp->config);
const gchar *procedure_name = NULL;
- GIMP_LOG (HELP, "Domain = '%s', ID = '%s'",
- idle_help->help_domain ? idle_help->help_domain : "NULL",
- idle_help->help_id ? idle_help->help_id : "NULL");
+ if (! idle_help->help_domain &&
+ ! config->user_manual_online &&
+ ! gimp_help_user_manual_is_installed (idle_help->gimp))
+ {
+ /* The user manual is not installed locally, ask the user
+ * if the online version should be used instead.
+ */
+ gimp_help_query_user_manual_online (idle_help);
+
+ return FALSE;
+ }
if (config->help_browser == GIMP_HELP_BROWSER_GIMP)
{
- if (gimp_help_browser (idle_help->gimp))
+ if (gimp_help_browser (idle_help->gimp, idle_help->progress))
procedure_name = "extension-gimp-help-browser-temp";
}
@@ -160,17 +219,24 @@
idle_help->help_locales,
idle_help->help_id);
+ gimp_idle_help_free (idle_help);
+
+ return FALSE;
+}
+
+static void
+gimp_idle_help_free (GimpIdleHelp *idle_help)
+{
g_free (idle_help->help_domain);
g_free (idle_help->help_locales);
g_free (idle_help->help_id);
g_slice_free (GimpIdleHelp, idle_help);
-
- return FALSE;
}
static gboolean
-gimp_help_browser (Gimp *gimp)
+gimp_help_browser (Gimp *gimp,
+ GimpProgress *progress)
{
static gboolean busy = FALSE;
GimpProcedure *procedure;
@@ -197,11 +263,13 @@
if (! procedure)
{
- gimp_help_browser_error (gimp,
- _("Help browser not found"),
- _("Could not find GIMP help browser."),
+ gimp_help_browser_error (gimp, progress,
+ _("Help browser is missing"),
+ _("The GIMP help browser is not available."),
_("The GIMP help browser plug-in appears "
- "to be missing from your installation."));
+ "to be missing from your installation. "
+ "You may instead use the web browser "
+ "for reading the help pages."));
busy = FALSE;
return FALSE;
@@ -226,7 +294,7 @@
if (error)
{
- gimp_message (gimp, NULL, GIMP_MESSAGE_ERROR,
+ gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
"%s", error->message);
g_error_free (error);
}
@@ -238,9 +306,10 @@
if (! procedure)
{
- gimp_help_browser_error (gimp,
+ gimp_help_browser_error (gimp, progress,
_("Help browser doesn't start"),
- _("Could not start the GIMP help browser plug-in."),
+ _("Could not start the GIMP help browser "
+ "plug-in."),
NULL);
busy = FALSE;
@@ -253,28 +322,36 @@
}
static void
-gimp_help_browser_error (Gimp *gimp,
- const gchar *title,
- const gchar *primary,
- const gchar *text)
+gimp_help_browser_error (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *title,
+ const gchar *primary,
+ const gchar *text)
{
GtkWidget *dialog;
- dialog =
- gimp_message_dialog_new (title, GIMP_STOCK_WARNING,
- NULL, 0,
- NULL, NULL,
+ dialog = gimp_message_dialog_new (title, GIMP_STOCK_USER_MANUAL,
+ NULL, 0,
+ NULL, NULL,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- _("Use _web browser instead"), GTK_RESPONSE_OK,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ _("Use _Web Browser"), GTK_RESPONSE_OK,
- NULL);
+ NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
+ if (progress)
+ {
+ guint32 window = gimp_progress_get_window (progress);
+
+ if (window)
+ gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
+ }
+
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
primary);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box, text);
@@ -454,7 +531,7 @@
if (config->user_manual_online)
return g_strdup (config->user_manual_online_uri);
- dir = g_build_filename (gimp_data_directory (), "help", NULL);
+ dir = gimp_help_get_user_manual_basedir ();
uri = g_filename_to_uri (dir, NULL, NULL);
g_free (dir);
@@ -471,3 +548,79 @@
return g_strjoinv (":", (gchar **) g_get_language_names ());
}
+
+static gchar *
+gimp_help_get_user_manual_basedir (void)
+{
+ return g_build_filename (gimp_data_directory (), "help", NULL);
+}
+
+
+static void
+gimp_help_query_online_response (GtkWidget *dialog,
+ gint response,
+ GimpIdleHelp *idle_help)
+{
+ gtk_widget_destroy (dialog);
+
+ if (response == GTK_RESPONSE_ACCEPT)
+ {
+ g_object_set (idle_help->gimp->config,
+ "user-manual-online", TRUE,
+ NULL);
+
+ gimp_help_show (idle_help->gimp,
+ idle_help->progress,
+ idle_help->help_domain,
+ idle_help->help_id);
+ }
+
+ gimp_idle_help_free (idle_help);
+}
+
+static void
+gimp_help_query_user_manual_online (GimpIdleHelp *idle_help)
+{
+ GtkWidget *dialog;
+ GtkWidget *button;
+
+ dialog = gimp_message_dialog_new (_("GIMP user manual is missing"),
+ GIMP_STOCK_USER_MANUAL,
+ NULL, 0, NULL, NULL,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL);
+
+ button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+ _("_Read Online"), GTK_RESPONSE_ACCEPT);
+ gtk_button_set_image (GTK_BUTTON (button),
+ gtk_image_new_from_stock (GIMP_STOCK_WEB,
+ GTK_ICON_SIZE_BUTTON));
+
+ gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
+ GTK_RESPONSE_ACCEPT,
+ GTK_RESPONSE_CANCEL,
+ -1);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
+
+ if (idle_help->progress)
+ {
+ guint32 window = gimp_progress_get_window (idle_help->progress);
+
+ if (window)
+ gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
+ }
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gimp_help_query_online_response),
+ idle_help);
+
+ gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
+ _("The GIMP user manual is not installed "
+ "on your computer."));
+ gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
+ _("You may either install the additional help "
+ "package or change your preferences to use "
+ "the online version."));
+
+ gtk_widget_show (dialog);
+}
Modified: branches/soc-2008-tagging/app/widgets/gimphelp.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphelp.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimphelp.h Sun Jul 13 12:11:51 2008
@@ -27,10 +27,15 @@
*
* there should be no need to use it directly
*/
-void gimp_help_show (Gimp *gimp,
- GimpProgress *progress,
- const gchar *help_domain,
- const gchar *help_id);
+void gimp_help_show (Gimp *gimp,
+ GimpProgress *progress,
+ const gchar *help_domain,
+ const gchar *help_id);
+
+
+/* checks if the user manual is installed locally
+ */
+gboolean gimp_help_user_manual_is_installed (Gimp *gimp);
#endif /* __GIMP_HELP_H__ */
Modified: branches/soc-2008-tagging/app/widgets/gimphistogrambox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphistogrambox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimphistogrambox.c Sun Jul 13 12:11:51 2008
@@ -193,28 +193,30 @@
gimp_histogram_box_low_adj_update (GtkAdjustment *adjustment,
GimpHistogramBox *box)
{
- if ((gdouble) box->view->start == adjustment->value)
- return;
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
- box->high_adj->lower = adjustment->value;
- gtk_adjustment_changed (box->high_adj);
+ if (box->view->start != value)
+ {
+ box->high_adj->lower = value;
+ gtk_adjustment_changed (box->high_adj);
- gimp_histogram_view_set_range (box->view,
- adjustment->value, box->view->end);
+ gimp_histogram_view_set_range (box->view, value, box->view->end);
+ }
}
static void
gimp_histogram_box_high_adj_update (GtkAdjustment *adjustment,
GimpHistogramBox *box)
{
- if ((gdouble) box->view->end == adjustment->value)
- return;
+ gint value = ROUND (gtk_adjustment_get_value (adjustment));
- box->low_adj->upper = adjustment->value;
- gtk_adjustment_changed (box->low_adj);
+ if (box->view->end != value)
+ {
+ box->low_adj->upper = value;
+ gtk_adjustment_changed (box->low_adj);
- gimp_histogram_view_set_range (box->view,
- box->view->start, adjustment->value);
+ gimp_histogram_view_set_range (box->view, box->view->start, value);
+ }
}
static void
@@ -245,8 +247,9 @@
GParamSpec *pspec,
GimpHistogramBox *box)
{
- gtk_container_set_border_width (GTK_CONTAINER (box->color_bar->parent),
- view->border_width);
+ GtkWidget *vbox = gtk_widget_get_parent (box->color_bar);
+
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), view->border_width);
}
Modified: branches/soc-2008-tagging/app/widgets/gimphistogramview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimphistogramview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimphistogramview.c Sun Jul 13 12:11:51 2008
@@ -279,7 +279,8 @@
gimp_histogram_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
+ GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint x;
gint x1, x2;
gint border;
@@ -304,14 +305,14 @@
x2 = CLAMP (MAX (view->start, view->end), 0, 255);
gdk_draw_rectangle (widget->window,
- widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+ style->base_gc[GTK_STATE_NORMAL], TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
/* Draw the outer border */
gdk_draw_rectangle (widget->window,
- widget->style->dark_gc[GTK_STATE_NORMAL], FALSE,
+ style->dark_gc[GTK_STATE_NORMAL], FALSE,
border, border,
width - 1, height - 1);
@@ -323,11 +324,11 @@
bg_max = gimp_histogram_view_get_maximum (view, view->bg_histogram,
view->channel);
- gc_in = widget->style->text_gc[GTK_STATE_SELECTED];
- gc_out = widget->style->text_gc[GTK_STATE_NORMAL];
+ gc_in = style->text_gc[GTK_STATE_SELECTED];
+ gc_out = style->text_gc[GTK_STATE_NORMAL];
- bg_gc_in = widget->style->mid_gc[GTK_STATE_SELECTED];
- bg_gc_out = widget->style->mid_gc[GTK_STATE_NORMAL];
+ bg_gc_in = style->mid_gc[GTK_STATE_SELECTED];
+ bg_gc_out = style->mid_gc[GTK_STATE_NORMAL];
if (view->channel == GIMP_HISTOGRAM_RGB)
{
@@ -369,7 +370,7 @@
if (view->subdivisions > 1 && x >= (xstop * width / view->subdivisions))
{
gdk_draw_line (widget->window,
- widget->style->dark_gc[GTK_STATE_NORMAL],
+ style->dark_gc[GTK_STATE_NORMAL],
x + border, border,
x + border, border + height - 1);
xstop++;
@@ -377,7 +378,7 @@
else if (in_selection)
{
gdk_draw_line (widget->window,
- widget->style->base_gc[GTK_STATE_SELECTED],
+ style->base_gc[GTK_STATE_SELECTED],
x + border, border,
x + border, border + height - 1);
}
@@ -388,7 +389,7 @@
for (c = 0; c < 3; c++)
gimp_histogram_view_draw_spike (view, GIMP_HISTOGRAM_RED + c,
- widget->style->black_gc,
+ style->black_gc,
NULL,
x, i, j, max, bg_max, height, border);
Modified: branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpitemtreeview.c Sun Jul 13 12:11:51 2008
@@ -283,15 +283,9 @@
item_view = GIMP_ITEM_TREE_VIEW (object);
item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (object);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
-
- tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
- tree_view->name_cell);
-
- g_signal_connect (tree_view->name_cell, "edited",
- G_CALLBACK (gimp_item_tree_view_name_edited),
- item_view);
+ gimp_container_tree_view_connect_name_edited (tree_view,
+ G_CALLBACK (gimp_item_tree_view_name_edited),
+ item_view);
column = gtk_tree_view_column_new ();
gtk_tree_view_insert_column (tree_view->view, column, 0);
@@ -874,10 +868,13 @@
-1);
g_free (name);
- gimp_message (view->image->gimp, G_OBJECT (view),
- GIMP_MESSAGE_WARNING,
- "%s", error->message);
- g_clear_error (&error);
+ if (error)
+ {
+ gimp_message (view->image->gimp, G_OBJECT (view),
+ GIMP_MESSAGE_WARNING,
+ "%s", error->message);
+ g_clear_error (&error);
+ }
}
g_object_unref (renderer);
Modified: branches/soc-2008-tagging/app/widgets/gimplanguagestore-parser.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimplanguagestore-parser.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimplanguagestore-parser.c Sun Jul 13 12:11:51 2008
@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
-#include "libgimpbase/gimpenv.h"
+#include "libgimpbase/gimpbase.h"
#include "widgets-types.h"
Modified: branches/soc-2008-tagging/app/widgets/gimpmenudock.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpmenudock.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpmenudock.c Sun Jul 13 12:11:51 2008
@@ -201,12 +201,13 @@
/* remove the image menu and the auto button manually here because
* of weird cross-connections with GimpDock's context
*/
- if (GIMP_DOCK (dock)->main_vbox &&
- dock->image_combo &&
- dock->image_combo->parent)
+ if (GIMP_DOCK (dock)->main_vbox && dock->image_combo)
{
- gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
- dock->image_combo->parent);
+ GtkWidget *parent = gtk_widget_get_parent (dock->image_combo);
+
+ if (parent)
+ gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
+ parent);
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
@@ -217,6 +218,7 @@
GtkStyle *prev_style)
{
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (widget);
+ GtkStyle *button_style;
gint minimal_width;
GtkIconSize menu_view_size;
GtkSettings *settings;
@@ -244,7 +246,8 @@
"focus-padding", &focus_padding,
NULL);
- ythickness = menu_dock->auto_button->style->ythickness;
+ button_style = gtk_widget_get_style (widget);
+ ythickness = button_style->ythickness;
gtk_widget_set_size_request (widget, minimal_width, -1);
@@ -452,12 +455,16 @@
gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
gboolean show)
{
+ GtkWidget *parent;
+
g_return_if_fail (GIMP_IS_MENU_DOCK (menu_dock));
+ parent = gtk_widget_get_parent (menu_dock->image_combo);
+
if (show)
- gtk_widget_show (menu_dock->image_combo->parent);
+ gtk_widget_show (parent);
else
- gtk_widget_hide (menu_dock->image_combo->parent);
+ gtk_widget_hide (parent);
menu_dock->show_image_menu = show ? TRUE : FALSE;
}
Modified: branches/soc-2008-tagging/app/widgets/gimpmessagebox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpmessagebox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpmessagebox.c Sun Jul 13 12:11:51 2008
@@ -243,13 +243,16 @@
if (box->image && GTK_WIDGET_VISIBLE (box->image))
{
GtkRequisition child_requisition;
+ gint border_width;
gtk_widget_size_request (box->image, &child_requisition);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
requisition->width += child_requisition.width + GIMP_MESSAGE_BOX_SPACING;
requisition->height = MAX (requisition->height,
child_requisition.height +
- 2 * GTK_CONTAINER (widget)->border_width);
+ 2 * border_width);
}
}
@@ -268,25 +271,28 @@
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
+ gint border_width;
gint height;
gtk_widget_size_request (box->image, &child_requisition);
- width = MIN (allocation->width - 2 * container->border_width,
+ border_width = gtk_container_get_border_width (container);
+
+ width = MIN (allocation->width - 2 * border_width,
child_requisition.width + GIMP_MESSAGE_BOX_SPACING);
width = MAX (1, width);
- height = allocation->height - 2 * container->border_width;
+ height = allocation->height - 2 * border_width;
height = MAX (1, height);
if (rtl)
- child_allocation.x = (allocation->width -
- container->border_width -
+ child_allocation.x = (allocation->width -
+ border_width -
child_requisition.width);
else
- child_allocation.x = allocation->x + container->border_width;
+ child_allocation.x = allocation->x + border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = width;
child_allocation.height = height;
Modified: branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpnavigationview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpnavigationview.c Sun Jul 13 12:11:51 2008
@@ -90,8 +90,10 @@
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpNavigationViewClass, marker_changed),
NULL, NULL,
- gimp_marshal_VOID__DOUBLE_DOUBLE,
- G_TYPE_NONE, 2,
+ gimp_marshal_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE,
+ G_TYPE_NONE, 4,
+ G_TYPE_DOUBLE,
+ G_TYPE_DOUBLE,
G_TYPE_DOUBLE,
G_TYPE_DOUBLE);
@@ -239,7 +241,8 @@
x = tx * ratiox;
y = ty * ratioy;
- g_signal_emit (view, view_signals[MARKER_CHANGED], 0, x, y);
+ g_signal_emit (view, view_signals[MARKER_CHANGED], 0,
+ x, y, nav_view->width, nav_view->height);
}
void
Modified: branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimppaletteeditor.c Sun Jul 13 12:11:51 2008
@@ -823,7 +823,8 @@
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
- gimp_palette_set_columns (palette, ROUND (adj->value));
+ gimp_palette_set_columns (palette,
+ ROUND (gtk_adjustment_get_value (adj)));
}
}
Modified: branches/soc-2008-tagging/app/widgets/gimppaletteview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimppaletteview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimppaletteview.c Sun Jul 13 12:11:51 2008
@@ -174,6 +174,7 @@
if (view->renderer->viewable && pal_view->selected)
{
GimpViewRendererPalette *renderer;
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gint row, col;
@@ -193,12 +194,12 @@
renderer->cell_height);
cairo_set_line_width (cr, 1.0);
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_SELECTED]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_SELECTED]);
cairo_stroke_preserve (cr);
if (gimp_cairo_set_focus_line_pattern (cr, widget))
{
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
cairo_stroke (cr);
}
Modified: branches/soc-2008-tagging/app/widgets/gimppropwidgets.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimppropwidgets.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimppropwidgets.c Sun Jul 13 12:11:51 2008
@@ -25,6 +25,9 @@
#include <string.h>
#include <stdlib.h>
+#define __GTK_SCALE_BUTTON_H__
+#define __GTK_VOLUME_BUTTON_H__
+
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
@@ -433,7 +436,7 @@
gimp_prop_scale_button_callback,
config);
- gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), value);
+ gimp_gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), value);
g_signal_handlers_unblock_by_func (button,
gimp_prop_scale_button_callback,
Modified: branches/soc-2008-tagging/app/widgets/gimpscalebutton.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpscalebutton.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpscalebutton.c Sun Jul 13 12:11:51 2008
@@ -21,6 +21,9 @@
#include "config.h"
+#define __GTK_SCALE_BUTTON_H__
+#define __GTK_VOLUME_BUTTON_H__
+
#include <gtk/gtk.h>
#include "widgets-types.h"
@@ -54,6 +57,12 @@
{
GtkWidget *image = gtk_bin_get_child (GTK_BIN (button));
+ gtk_widget_hide (GTK_SCALE_BUTTON (button)->plus_button);
+ gtk_widget_set_no_show_all (GTK_SCALE_BUTTON (button)->plus_button, TRUE);
+
+ gtk_widget_hide (GTK_SCALE_BUTTON (button)->minus_button);
+ gtk_widget_set_no_show_all (GTK_SCALE_BUTTON (button)->minus_button, TRUE);
+
g_signal_connect (image, "expose-event",
G_CALLBACK (gimp_scale_button_image_expose),
button);
@@ -81,14 +90,21 @@
{
GtkAdjustment *adj;
gchar *text;
-
- adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
+ gdouble value;
+ gdouble lower;
+ gdouble upper;
+
+ adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
+
+ value = gtk_adjustment_get_value (adj);
+ lower = adj->lower;
+ upper = adj->upper;
/* use U+2009 THIN SPACE to seperate the percent sign from the number */
text = g_strdup_printf ("%d\342\200\211%%",
- (gint) (0.5 + ((adj->value - adj->lower) * 100.0 /
- (adj->upper - adj->lower))));
+ (gint) (0.5 + ((value - lower) * 100.0 /
+ (upper - lower))));
gtk_widget_set_tooltip_text (GTK_WIDGET (button), text);
g_free (text);
@@ -99,6 +115,7 @@
GdkEventExpose *event,
GimpScaleButton *button)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkAdjustment *adj;
cairo_t *cr;
gint value;
@@ -107,7 +124,7 @@
steps = MIN (widget->allocation.width, widget->allocation.height) / 2;
- adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
+ adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
if (steps < 1)
return TRUE;
@@ -143,7 +160,7 @@
cairo_line_to (cr, i, i + 0.5);
}
- gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
cairo_stroke (cr);
for ( ; i < steps; i++)
@@ -152,7 +169,7 @@
cairo_line_to (cr, i, i + 0.5);
}
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_INSENSITIVE]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_INSENSITIVE]);
cairo_stroke (cr);
cairo_destroy (cr);
@@ -174,7 +191,8 @@
adj = gtk_adjustment_new (value, min, max, step, step, 0);
return g_object_new (GIMP_TYPE_SCALE_BUTTON,
- "adjustment", adj,
- "size", GTK_ICON_SIZE_MENU,
+ "orientation", GTK_ORIENTATION_HORIZONTAL,
+ "adjustment", adj,
+ "size", GTK_ICON_SIZE_MENU,
NULL);
}
Modified: branches/soc-2008-tagging/app/widgets/gimpscalebutton.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpscalebutton.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimpscalebutton.h Sun Jul 13 12:11:51 2008
@@ -23,6 +23,9 @@
#define __GIMP_SCALE_BUTTON_H__
+#include "gtkscalebutton.h"
+
+
#define GIMP_TYPE_SCALE_BUTTON (gimp_scale_button_get_type ())
#define GIMP_SCALE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SCALE_BUTTON, GimpScaleButton))
#define GIMP_SCALE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SCALE_BUTTON, GimpScaleButtonClass))
Modified: branches/soc-2008-tagging/app/widgets/gimpsessioninfo-book.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsessioninfo-book.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpsessioninfo-book.c Sun Jul 13 12:11:51 2008
@@ -194,6 +194,7 @@
gimp_session_info_book_from_widget (GimpDockbook *dockbook)
{
GimpSessionInfoBook *info;
+ GtkWidget *parent;
GList *children;
GList *list;
@@ -201,9 +202,11 @@
info = gimp_session_info_book_new ();
- if (GTK_IS_VPANED (GTK_WIDGET (dockbook)->parent))
+ parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
+
+ if (GTK_IS_VPANED (parent))
{
- GtkPaned *paned = GTK_PANED (GTK_WIDGET (dockbook)->parent);
+ GtkPaned *paned = GTK_PANED (parent);
if (GTK_WIDGET (dockbook) == gtk_paned_get_child2 (paned))
info->position = gtk_paned_get_position (paned);
Modified: branches/soc-2008-tagging/app/widgets/gimpsessioninfo-dock.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsessioninfo-dock.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpsessioninfo-dock.c Sun Jul 13 12:11:51 2008
@@ -191,12 +191,15 @@
{
GimpSessionInfoBook *book_info = books->data;
GtkWidget *dockbook;
+ GtkWidget *parent;
dockbook = GTK_WIDGET (gimp_session_info_book_restore (book_info, dock));
- if (GTK_IS_VPANED (dockbook->parent))
+ parent = gtk_widget_get_parent (dockbook);
+
+ if (GTK_IS_VPANED (parent))
{
- GtkPaned *paned = GTK_PANED (dockbook->parent);
+ GtkPaned *paned = GTK_PANED (parent);
if (dockbook == gtk_paned_get_child2 (paned))
g_signal_connect_after (paned, "map",
Modified: branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpsettingsbox.c Sun Jul 13 12:11:51 2008
@@ -31,10 +31,12 @@
#include "core/gimp.h"
#include "core/gimplist.h"
+#include "core/gimpmarshal.h"
#include "gimpcontainercombobox.h"
#include "gimpcontainerview.h"
#include "gimpsettingsbox.h"
+#include "gimpsettingseditor.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
@@ -94,10 +96,23 @@
GimpSettingsBox *box);
static void gimp_settings_box_export_activate (GtkWidget *widget,
GimpSettingsBox *box);
+static void gimp_settings_box_manage_activate (GtkWidget *widget,
+ GimpSettingsBox *box);
static void gimp_settings_box_favorite_callback (GtkWidget *query_box,
const gchar *string,
gpointer data);
+static void gimp_settings_box_file_dialog (GimpSettingsBox *box,
+ const gchar *title,
+ gboolean save);
+static void gimp_settings_box_file_response (GtkWidget *dialog,
+ gint response_id,
+ GimpSettingsBox *box);
+static void gimp_settings_box_manage_response (GtkWidget *widget,
+ gint response_id,
+ GimpSettingsBox *box);
+static void gimp_settings_box_toplevel_unmap (GtkWidget *toplevel,
+ GtkWidget *dialog);
G_DEFINE_TYPE (GimpSettingsBox, gimp_settings_box, GTK_TYPE_HBOX)
@@ -115,26 +130,31 @@
settings_box_signals[IMPORT] =
g_signal_new ("import",
G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpSettingsBoxClass, import),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gimp_marshal_BOOLEAN__STRING,
+ G_TYPE_BOOLEAN, 1,
+ G_TYPE_STRING);
settings_box_signals[EXPORT] =
g_signal_new ("export",
G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpSettingsBoxClass, export),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gimp_marshal_BOOLEAN__STRING,
+ G_TYPE_BOOLEAN, 1,
+ G_TYPE_STRING);
object_class->constructor = gimp_settings_box_constructor;
object_class->finalize = gimp_settings_box_finalize;
object_class->set_property = gimp_settings_box_set_property;
object_class->get_property = gimp_settings_box_get_property;
+ klass->import = NULL;
+ klass->export = NULL;
+
g_object_class_install_property (object_class, PROP_GIMP,
g_param_spec_object ("gimp",
NULL, NULL,
@@ -177,7 +197,9 @@
{
GObject *object;
GimpSettingsBox *box;
+ GtkWidget *hbox2;
GtkWidget *button;
+ GtkWidget *image;
GtkWidget *arrow;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@@ -208,10 +230,30 @@
G_CALLBACK (gimp_settings_box_setting_selected),
box);
+ hbox2 = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box), hbox2, FALSE, FALSE, 0);
+ gtk_widget_show (hbox2);
+
button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+
+ image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_MENU);
+ gtk_container_add (GTK_CONTAINER (button), image);
+ gtk_widget_show (image);
+
+ gimp_help_set_help_data (button, _("Add settings to favorites"), NULL);
+
+ g_signal_connect (button, "clicked",
+ G_CALLBACK (gimp_settings_box_favorite_activate),
+ box);
+
+ button = gtk_button_new ();
+ GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
+ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+ gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
arrow = gtk_image_new_from_stock (GIMP_STOCK_MENU_LEFT, GTK_ICON_SIZE_MENU);
@@ -227,11 +269,6 @@
box->menu = gtk_menu_new ();
gtk_menu_attach_to_widget (GTK_MENU (box->menu), button, NULL);
- gimp_settings_box_menu_item_add (box,
- GTK_STOCK_ADD,
- _("Add Settings to _Favorites..."),
- G_CALLBACK (gimp_settings_box_favorite_activate));
-
box->import_item =
gimp_settings_box_menu_item_add (box,
GTK_STOCK_OPEN,
@@ -244,6 +281,13 @@
_("_Export Settings to File..."),
G_CALLBACK (gimp_settings_box_export_activate));
+ gimp_settings_box_menu_item_add (box, NULL, NULL, NULL);
+
+ gimp_settings_box_menu_item_add (box,
+ GTK_STOCK_EDIT,
+ _("_Manage Settings..."),
+ G_CALLBACK (gimp_settings_box_manage_activate));
+
return object;
}
@@ -270,6 +314,36 @@
box->filename = NULL;
}
+ g_free (box->import_dialog_title);
+ g_free (box->export_dialog_title);
+ g_free (box->file_dialog_help_id);
+ g_free (box->default_folder);
+ g_free (box->last_filename);
+
+ if (box->editor_dialog)
+ {
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+
+ if (toplevel)
+ g_signal_handlers_disconnect_by_func (toplevel,
+ gimp_settings_box_toplevel_unmap,
+ box->editor_dialog);
+
+ gtk_widget_destroy (box->editor_dialog);
+ }
+
+ if (box->file_dialog)
+ {
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+
+ if (toplevel)
+ g_signal_handlers_disconnect_by_func (toplevel,
+ gimp_settings_box_toplevel_unmap,
+ box->file_dialog);
+
+ gtk_widget_destroy (box->file_dialog);
+ }
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -411,19 +485,27 @@
GCallback callback)
{
GtkWidget *item;
- GtkWidget *image;
- item = gtk_image_menu_item_new_with_mnemonic (label);
- image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ if (label)
+ {
+ GtkWidget *image;
+
+ item = gtk_image_menu_item_new_with_mnemonic (label);
+ image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+
+ g_signal_connect (item, "activate",
+ callback,
+ box);
+ }
+ else
+ {
+ item = gtk_separator_menu_item_new ();
+ }
gtk_menu_shell_append (GTK_MENU_SHELL (box->menu), item);
gtk_widget_show (item);
- g_signal_connect (item, "activate",
- callback,
- box);
-
return item;
}
@@ -434,13 +516,9 @@
{
gchar *name = NULL;
-#ifdef __GNUC__
-#warning FIXME: dont use magic model column
-#endif
gtk_tree_model_get (model, iter,
- 1, &name,
+ GIMP_CONTAINER_COMBO_BOX_COLUMN_NAME, &name,
-1);
-
g_free (name);
return name == NULL;
@@ -508,14 +586,58 @@
gimp_settings_box_import_activate (GtkWidget *widget,
GimpSettingsBox *box)
{
- g_signal_emit (box, settings_box_signals[IMPORT], 0);
+ gimp_settings_box_file_dialog (box, box->import_dialog_title, FALSE);
}
static void
gimp_settings_box_export_activate (GtkWidget *widget,
GimpSettingsBox *box)
{
- g_signal_emit (box, settings_box_signals[EXPORT], 0);
+ gimp_settings_box_file_dialog (box, box->export_dialog_title, TRUE);
+}
+
+static void
+gimp_settings_box_manage_activate (GtkWidget *widget,
+ GimpSettingsBox *box)
+{
+ GtkWidget *toplevel;
+ GtkWidget *editor;
+
+ if (box->editor_dialog)
+ {
+ gtk_window_present (GTK_WINDOW (box->editor_dialog));
+ return;
+ }
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+
+ box->editor_dialog = gimp_dialog_new (_("Manage Saved Settings"),
+ "gimp-settings-editor-dialog",
+ toplevel, 0,
+ NULL, NULL,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_CLOSE,
+ NULL);
+
+ g_object_add_weak_pointer (G_OBJECT (box->editor_dialog),
+ (gpointer) &box->editor_dialog);
+ g_signal_connect (toplevel, "unmap",
+ G_CALLBACK (gimp_settings_box_toplevel_unmap),
+ box->editor_dialog);
+
+ g_signal_connect (box->editor_dialog, "response",
+ G_CALLBACK (gimp_settings_box_manage_response),
+ box);
+
+ editor = gimp_settings_editor_new (box->gimp,
+ box->config,
+ box->container);
+ gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (box->editor_dialog)->vbox),
+ editor);
+ gtk_widget_show (editor);
+
+ gtk_widget_show (box->editor_dialog);
}
static void
@@ -534,6 +656,162 @@
gimp_settings_box_serialize (box);
}
+static void
+gimp_settings_box_file_dialog (GimpSettingsBox *box,
+ const gchar *title,
+ gboolean save)
+{
+ GtkWidget *toplevel;
+ GtkWidget *dialog;
+
+ if (box->file_dialog)
+ {
+ gtk_window_present (GTK_WINDOW (box->file_dialog));
+ return;
+ }
+
+ if (save)
+ gtk_widget_set_sensitive (box->import_item, FALSE);
+ else
+ gtk_widget_set_sensitive (box->export_item, FALSE);
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+
+ box->file_dialog = dialog =
+ gtk_file_chooser_dialog_new (title, GTK_WINDOW (toplevel),
+ save ?
+ GTK_FILE_CHOOSER_ACTION_SAVE :
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ save ? GTK_STOCK_SAVE : GTK_STOCK_OPEN,
+ GTK_RESPONSE_OK,
+
+ NULL);
+
+ gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
+ GTK_RESPONSE_OK,
+ GTK_RESPONSE_CANCEL,
+ -1);
+
+ g_object_set_data (G_OBJECT (dialog), "save", GINT_TO_POINTER (save));
+
+ gtk_window_set_role (GTK_WINDOW (dialog), "gimp-import-export-settings");
+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
+
+ g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer) &box->file_dialog);
+ g_signal_connect (toplevel, "unmap",
+ G_CALLBACK (gimp_settings_box_toplevel_unmap),
+ dialog);
+
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+
+ if (save)
+ gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog),
+ TRUE);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gimp_settings_box_file_response),
+ box);
+ g_signal_connect (dialog, "delete-event",
+ G_CALLBACK (gtk_true),
+ NULL);
+
+ if (box->default_folder &&
+ g_file_test (box->default_folder, G_FILE_TEST_IS_DIR))
+ {
+ gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
+ box->default_folder, NULL);
+
+ if (! box->last_filename)
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
+ box->default_folder);
+ }
+ else if (! box->last_filename)
+ {
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
+ g_get_home_dir ());
+ }
+
+ if (box->last_filename)
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog),
+ box->last_filename);
+
+ gimp_help_connect (box->file_dialog, gimp_standard_help_func,
+ box->file_dialog_help_id, NULL);
+
+ gtk_widget_show (box->file_dialog);
+}
+
+static void
+gimp_settings_box_file_response (GtkWidget *dialog,
+ gint response_id,
+ GimpSettingsBox *box)
+{
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+ gboolean save;
+
+ if (toplevel)
+ g_signal_handlers_disconnect_by_func (toplevel,
+ gimp_settings_box_toplevel_unmap,
+ dialog);
+
+ save = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "save"));
+
+ if (response_id == GTK_RESPONSE_OK)
+ {
+ gchar *filename;
+ gboolean success = FALSE;
+
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+
+ if (save)
+ g_signal_emit (box, settings_box_signals[EXPORT], 0, filename,
+ &success);
+ else
+ g_signal_emit (box, settings_box_signals[IMPORT], 0, filename,
+ &success);
+
+ if (success)
+ {
+ g_free (box->last_filename);
+ box->last_filename = g_strdup (filename);
+ }
+
+ g_free (filename);
+ }
+
+ if (save)
+ gtk_widget_set_sensitive (box->import_item, TRUE);
+ else
+ gtk_widget_set_sensitive (box->export_item, TRUE);
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
+gimp_settings_box_manage_response (GtkWidget *dialog,
+ gint response_id,
+ GimpSettingsBox *box)
+{
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+
+ if (toplevel)
+ g_signal_handlers_disconnect_by_func (toplevel,
+ gimp_settings_box_toplevel_unmap,
+ dialog);
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
+gimp_settings_box_toplevel_unmap (GtkWidget *toplevel,
+ GtkWidget *dialog)
+{
+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_DELETE_EVENT);
+}
+
/* public functions */
@@ -541,19 +819,34 @@
gimp_settings_box_new (Gimp *gimp,
GObject *config,
GimpContainer *container,
- const gchar *filename)
+ const gchar *filename,
+ const gchar *import_dialog_title,
+ const gchar *export_dialog_title,
+ const gchar *file_dialog_help_id,
+ const gchar *default_folder,
+ const gchar *last_filename)
{
+ GimpSettingsBox *box;
+
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONFIG (config), NULL);
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
g_return_val_if_fail (filename != NULL, NULL);
- return g_object_new (GIMP_TYPE_SETTINGS_BOX,
- "gimp", gimp,
- "config", config,
- "container", container,
- "filename", filename,
- NULL);
+ box = g_object_new (GIMP_TYPE_SETTINGS_BOX,
+ "gimp", gimp,
+ "config", config,
+ "container", container,
+ "filename", filename,
+ NULL);
+
+ box->import_dialog_title = g_strdup (import_dialog_title);
+ box->export_dialog_title = g_strdup (export_dialog_title);
+ box->file_dialog_help_id = g_strdup (file_dialog_help_id);
+ box->default_folder = g_strdup (default_folder);
+ box->last_filename = g_strdup (last_filename);
+
+ return GTK_WIDGET (box);
}
void
Modified: branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h (original)
+++ branches/soc-2008-tagging/app/widgets/gimpsettingsbox.h Sun Jul 13 12:11:51 2008
@@ -41,19 +41,29 @@
GtkWidget *menu;
GtkWidget *import_item;
GtkWidget *export_item;
+ GtkWidget *file_dialog;
+ GtkWidget *editor_dialog;
Gimp *gimp;
GObject *config;
GimpContainer *container;
gchar *filename;
+
+ gchar *import_dialog_title;
+ gchar *export_dialog_title;
+ gchar *file_dialog_help_id;
+ gchar *default_folder;
+ gchar *last_filename;
};
struct _GimpSettingsBoxClass
{
GtkHBoxClass parent_class;
- void (* import) (GimpSettingsBox *box);
- void (* export) (GimpSettingsBox *box);
+ void (* import) (GimpSettingsBox *box,
+ const gchar *filename);
+ void (* export) (GimpSettingsBox *box,
+ const gchar *filename);
};
@@ -62,7 +72,12 @@
GtkWidget * gimp_settings_box_new (Gimp *gimp,
GObject *config,
GimpContainer *container,
- const gchar *filename);
+ const gchar *filename,
+ const gchar *import_dialog_title,
+ const gchar *export_dialog_title,
+ const gchar *file_dialog_help_id,
+ const gchar *default_folder,
+ const gchar *last_filename);
void gimp_settings_box_add_current (GimpSettingsBox *box);
Modified: branches/soc-2008-tagging/app/widgets/gimpstrokeeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpstrokeeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpstrokeeditor.c Sun Jul 13 12:11:51 2008
@@ -360,10 +360,11 @@
GdkEventExpose *event,
gpointer data)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkAllocation *alloc = &widget->allocation;
gint w = MIN (alloc->width, alloc->height) * 2 / 3;
- gtk_paint_arrow (widget->style, widget->window,
+ gtk_paint_arrow (style, widget->window,
widget->state, GTK_SHADOW_IN,
&event->area, widget, NULL,
data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
Modified: branches/soc-2008-tagging/app/widgets/gimptemplateeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptemplateeditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptemplateeditor.c Sun Jul 13 12:11:51 2008
@@ -572,7 +572,8 @@
gimp_template_editor_aspect_callback (GtkWidget *widget,
GimpTemplateEditor *editor)
{
- if (! editor->block_aspect && GTK_TOGGLE_BUTTON (widget)->active)
+ if (! editor->block_aspect &&
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GimpTemplate *template = editor->template;
gint width = template->width;
Modified: branches/soc-2008-tagging/app/widgets/gimptemplateview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptemplateview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptemplateview.c Sun Jul 13 12:11:51 2008
@@ -111,15 +111,9 @@
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
-
- tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
- tree_view->name_cell);
-
- g_signal_connect (tree_view->name_cell, "edited",
- G_CALLBACK (gimp_template_view_tree_name_edited),
- template_view);
+ gimp_container_tree_view_connect_name_edited (tree_view,
+ G_CALLBACK (gimp_template_view_tree_name_edited),
+ template_view);
}
template_view->create_button =
Modified: branches/soc-2008-tagging/app/widgets/gimpthumbbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpthumbbox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpthumbbox.c Sun Jul 13 12:11:51 2008
@@ -171,22 +171,23 @@
gimp_thumb_box_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
- GimpThumbBox *box = GIMP_THUMB_BOX (widget);
+ GimpThumbBox *box = GIMP_THUMB_BOX (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkWidget *ebox;
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
gtk_widget_modify_bg (box->preview, GTK_STATE_NORMAL,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
gtk_widget_modify_bg (box->preview, GTK_STATE_INSENSITIVE,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
ebox = gtk_bin_get_child (GTK_BIN (widget));
gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
gtk_widget_modify_bg (ebox, GTK_STATE_INSENSITIVE,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
}
static GimpProgress *
Modified: branches/soc-2008-tagging/app/widgets/gimptoolbox.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoolbox.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptoolbox.c Sun Jul 13 12:11:51 2008
@@ -307,7 +307,8 @@
gimp_toolbox_dnd_init (GIMP_TOOLBOX (toolbox));
- gimp_toolbox_style_set (GTK_WIDGET (toolbox), GTK_WIDGET (toolbox)->style);
+ gimp_toolbox_style_set (GTK_WIDGET (toolbox),
+ gtk_widget_get_style (GTK_WIDGET (toolbox)));
toolbox_separator_expand (toolbox);
@@ -510,12 +511,13 @@
&toolbox->header->allocation,
&clip_rect))
{
- cairo_t *cr;
- gint header_height;
- gint header_width;
- gdouble wilber_width;
- gdouble wilber_height;
- gdouble factor;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ cairo_t *cr;
+ gint header_height;
+ gint header_width;
+ gdouble wilber_width;
+ gdouble wilber_height;
+ gdouble factor;
cr = gdk_cairo_create (widget->window);
gdk_cairo_rectangle (cr, &clip_rect);
@@ -535,9 +537,9 @@
(header_height / factor - wilber_height) / 2.0);
cairo_set_source_rgba (cr,
- widget->style->fg[widget->state].red / 65535.0,
- widget->style->fg[widget->state].green / 65535.0,
- widget->style->fg[widget->state].blue / 65535.0,
+ style->fg[widget->state].red / 65535.0,
+ style->fg[widget->state].green / 65535.0,
+ style->fg[widget->state].blue / 65535.0,
0.10);
cairo_fill (cr);
@@ -811,7 +813,8 @@
GParamSpec *pspec,
GtkWidget *area)
{
- gboolean visible;
+ GtkWidget *parent = gtk_widget_get_parent (area);
+ gboolean visible;
if (config->toolbox_color_area ||
config->toolbox_foo_area ||
@@ -819,18 +822,18 @@
{
GtkRequisition req;
- gtk_widget_show (area->parent);
+ gtk_widget_show (parent);
#ifdef __GNUC__
#warning FIXME: fix GtkWrapBox child requisition/allocation instead of hacking badly (bug #162500).
#endif
gtk_widget_size_request (area, &req);
- gtk_widget_set_size_request (area->parent, req.width, req.height);
+ gtk_widget_set_size_request (parent, req.width, req.height);
}
else
{
- gtk_widget_hide (area->parent);
- gtk_widget_set_size_request (area->parent, -1, -1);
+ gtk_widget_hide (parent);
+ gtk_widget_set_size_request (parent, -1, -1);
}
g_object_get (config, pspec->name, &visible, NULL);
@@ -847,7 +850,8 @@
GtkWidget *toolbox_button = g_object_get_data (G_OBJECT (tool_info),
TOOL_BUTTON_DATA_KEY);
- if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active)
+ if (toolbox_button &&
+ ! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toolbox_button)))
{
g_signal_handlers_block_by_func (toolbox_button,
toolbox_tool_button_toggled,
@@ -895,7 +899,7 @@
{
GtkWidget *toolbox = gtk_widget_get_toplevel (widget);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
gimp_context_set_tool (GIMP_DOCK (toolbox)->context, tool_info);
}
Modified: branches/soc-2008-tagging/app/widgets/gimptooloptionseditor.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptooloptionseditor.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptooloptionseditor.c Sun Jul 13 12:11:51 2008
@@ -410,7 +410,7 @@
options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
"gimp-tool-options-gui");
- if (! options_gui->parent)
+ if (! gtk_widget_get_parent (options_gui))
gtk_box_pack_start (GTK_BOX (editor->options_vbox), options_gui,
FALSE, FALSE, 0);
Modified: branches/soc-2008-tagging/app/widgets/gimptoolview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptoolview.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptoolview.c Sun Jul 13 12:11:51 2008
@@ -152,8 +152,9 @@
if (view_type == GIMP_VIEW_TYPE_LIST)
{
- GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
+ GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
GtkWidget *tree_widget = GTK_WIDGET (tree_view);
+ GtkStyle *tree_style = gtk_widget_get_style (tree_widget);
GtkTreeViewColumn *column;
GtkCellRenderer *eye_cell;
GtkIconSize icon_size;
@@ -167,9 +168,9 @@
GIMP_STOCK_VISIBLE,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * tree_style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * tree_style->ythickness);
g_object_set (eye_cell, "stock-size", icon_size, NULL);
gtk_tree_view_column_pack_start (column, eye_cell, FALSE);
Modified: branches/soc-2008-tagging/app/widgets/gimpuimanager.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpuimanager.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpuimanager.c Sun Jul 13 12:11:51 2008
@@ -865,13 +865,16 @@
gimp_ui_manager_item_realize (GtkWidget *widget,
GimpUIManager *manager)
{
+ GtkWidget *menu;
GtkWidget *submenu;
g_signal_handlers_disconnect_by_func (widget,
gimp_ui_manager_item_realize,
manager);
- if (GTK_IS_MENU_SHELL (widget->parent))
+ menu = gtk_widget_get_parent (widget);
+
+ if (GTK_IS_MENU_SHELL (menu))
{
static GQuark quark_key_press_connected = 0;
@@ -879,14 +882,14 @@
quark_key_press_connected =
g_quark_from_static_string ("gimp-menu-item-key-press-connected");
- if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (widget->parent),
+ if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (menu),
quark_key_press_connected)))
{
- g_signal_connect (widget->parent, "key-press-event",
+ g_signal_connect (menu, "key-press-event",
G_CALLBACK (gimp_ui_manager_item_key_press),
manager);
- g_object_set_qdata (G_OBJECT (widget->parent),
+ g_object_set_qdata (G_OBJECT (menu),
quark_key_press_connected,
GINT_TO_POINTER (TRUE));
}
@@ -971,7 +974,7 @@
if (! menu_item)
break;
- widget = menu_item->parent;
+ widget = gtk_widget_get_parent (menu_item);
if (! widget)
break;
Modified: branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewabledialog.c Sun Jul 13 12:11:51 2008
@@ -322,15 +322,18 @@
if (viewable)
{
+ GtkWidget *box;
+
g_signal_connect_object (viewable,
GIMP_VIEWABLE_GET_CLASS (viewable)->name_changed_signal,
G_CALLBACK (gimp_viewable_dialog_name_changed),
dialog,
0);
+ box = gtk_widget_get_parent (dialog->icon);
+
dialog->view = gimp_view_new (context, viewable, 32, 1, TRUE);
- gtk_box_pack_end (GTK_BOX (dialog->icon->parent), dialog->view,
- FALSE, FALSE, 2);
+ gtk_box_pack_end (GTK_BOX (box), dialog->view, FALSE, FALSE, 2);
gtk_widget_show (dialog->view);
g_object_add_weak_pointer (G_OBJECT (dialog->view),
Modified: branches/soc-2008-tagging/app/widgets/gimpviewrendererimagefile.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrendererimagefile.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrendererimagefile.c Sun Jul 13 12:11:51 2008
@@ -40,6 +40,7 @@
GtkWidget *widget);
static GdkPixbuf * gimp_view_renderer_imagefile_get_icon (GimpImagefile *imagefile,
+ GtkWidget *widget,
gint size);
@@ -75,6 +76,7 @@
GimpImagefile *imagefile = GIMP_IMAGEFILE (renderer->viewable);
pixbuf = gimp_view_renderer_imagefile_get_icon (imagefile,
+ widget,
MIN (renderer->width,
renderer->height));
}
@@ -151,42 +153,55 @@
}
static GdkPixbuf *
-get_icon_fallback (const gchar *icon_name,
- gint size)
-{
- return gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), icon_name,
- size,
- GTK_ICON_LOOKUP_USE_BUILTIN,
- NULL);
-}
-
-static GdkPixbuf *
gimp_view_renderer_imagefile_get_icon (GimpImagefile *imagefile,
+ GtkWidget *widget,
gint size)
{
- GdkPixbuf *retval = NULL;
+ GdkScreen *screen = gtk_widget_get_screen (widget);
+ GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (screen);
+ GdkPixbuf *pixbuf = NULL;
if (! gimp_object_get_name (GIMP_OBJECT (imagefile)))
return NULL;
- if (imagefile->thumbnail->image_mimetype)
+#if GTK_CHECK_VERSION (2, 13, 4)
+ if (! pixbuf)
+ {
+ GFile *file;
+ GFileInfo *file_info;
+ GIcon *icon;
+ GtkIconInfo *info;
+
+ file = g_file_new_for_uri (gimp_object_get_name (GIMP_OBJECT (imagefile)));
+ file_info = g_file_query_info (file, "standard::icon", 0, NULL, NULL);
+ icon = g_file_info_get_icon (file_info);
+
+ info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, size, 0);
+ pixbuf = gtk_icon_info_load_icon (info, NULL);
+
+ g_object_unref (file);
+ g_object_unref (file_info);
+ }
+#endif
+
+ if (! pixbuf && imagefile->thumbnail->image_mimetype)
{
- retval = get_icon_for_mime_type (imagefile->thumbnail->image_mimetype,
+ pixbuf = get_icon_for_mime_type (imagefile->thumbnail->image_mimetype,
size);
}
- if (! retval)
+ if (! pixbuf)
{
const gchar *icon_name = GTK_STOCK_FILE;
if (imagefile->thumbnail->image_state == GIMP_THUMB_STATE_FOLDER)
icon_name = GTK_STOCK_DIRECTORY;
- retval = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ pixbuf = gtk_icon_theme_load_icon (icon_theme,
icon_name, size,
GTK_ICON_LOOKUP_USE_BUILTIN,
NULL);
}
- return retval;
+ return pixbuf;
}
Modified: branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpviewrenderervectors.c Sun Jul 13 12:11:51 2008
@@ -69,13 +69,14 @@
cairo_t *cr,
const GdkRectangle *area)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GimpVectors *vectors = GIMP_VECTORS (renderer->viewable);
GimpBezierDesc *bezdesc;
gdouble xscale;
gdouble yscale;
gint x, y;
- gdk_cairo_set_source_color (cr, &widget->style->white);
+ gdk_cairo_set_source_color (cr, &style->white);
x = area->x + (area->width - renderer->width) / 2;
y = area->y + (area->height - renderer->height) / 2;
@@ -94,7 +95,7 @@
cairo_device_to_user_distance (cr, &xscale, &yscale);
cairo_set_line_width (cr, MAX (xscale, yscale));
- gdk_cairo_set_source_color (cr, &widget->style->black);
+ gdk_cairo_set_source_color (cr, &style->black);
bezdesc = gimp_vectors_make_bezier (vectors);
Modified: branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimpwidgets-utils.c Sun Jul 13 12:11:51 2008
@@ -277,6 +277,7 @@
gint indicator_spacing;
gint focus_width;
gint focus_padding;
+ gint border_width;
gtk_widget_style_get (radio,
"indicator-size", &indicator_size,
@@ -285,6 +286,8 @@
"focus-padding", &focus_padding,
NULL);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (radio));
+
hbox = gtk_hbox_new (FALSE, 0);
spacer = gtk_vbox_new (FALSE, 0);
@@ -293,7 +296,7 @@
3 * indicator_spacing +
focus_width +
focus_padding +
- GTK_CONTAINER (radio)->border_width,
+ border_width,
-1);
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
gtk_widget_show (spacer);
@@ -307,7 +310,7 @@
NULL);
gtk_widget_set_sensitive (hbox,
- GTK_TOGGLE_BUTTON (list->data)->active);
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (list->data)));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (vbox), hbox, pos);
@@ -343,7 +346,8 @@
g_return_val_if_fail (width > 0, icon_size);
g_return_val_if_fail (height > 0, icon_size);
- icon_set = gtk_style_lookup_icon_set (widget->style, stock_id);
+ icon_set = gtk_style_lookup_icon_set (gtk_widget_get_style (widget),
+ stock_id);
if (! icon_set)
return GTK_ICON_SIZE_INVALID;
Modified: branches/soc-2008-tagging/app/widgets/widgets-types.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/widgets-types.h (original)
+++ branches/soc-2008-tagging/app/widgets/widgets-types.h Sun Jul 13 12:11:51 2008
@@ -177,6 +177,7 @@
typedef struct _GimpProgressBox GimpProgressBox;
typedef struct _GimpScaleButton GimpScaleButton;
typedef struct _GimpSettingsBox GimpSettingsBox;
+typedef struct _GimpSettingsEditor GimpSettingsEditor;
typedef struct _GimpSizeBox GimpSizeBox;
typedef struct _GimpStrokeEditor GimpStrokeEditor;
typedef struct _GimpTagEntry GimpTagEntry;
Modified: branches/soc-2008-tagging/configure.in
==============================================================================
--- branches/soc-2008-tagging/configure.in (original)
+++ branches/soc-2008-tagging/configure.in Sun Jul 13 12:11:51 2008
@@ -431,7 +431,7 @@
PKG_CHECK_MODULES(BABL, babl >= babl_required_version, :,
- AC_MSG_ERROR([Test for BABL failed. Please get it from http://gegl.org/]))
+ AC_MSG_ERROR([Test for babl failed. Please get it from http://gegl.org/]))
PKG_CHECK_MODULES(GEGL, gegl >= gegl_required_version, :,
@@ -888,16 +888,25 @@
[Define to 1 to enable support for multiple processors.])
fi
+###################################################
+# gimp-remote is obsolete, but can still be enabled
+###################################################
+
+AC_ARG_ENABLE(gimp-remote,
+ [ --enable-gimp-remote build gimp-remote utility (default=no)],
+ enable_gimp_remote=yes,
+ enable_gimp_remote="no (not enabled)")
+
################################
# Some plug-ins are X11 specific
################################
-GIMP_COMMAND='gimp-gimp_app_version'
-
# Check if building for GTK+-X11
gdk_target=`$PKG_CONFIG --variable=target gtk+-2.0`
+have_libxmu="no (building for $gdk_target)"
+
if test "$gdk_target" = x11; then
# doc-shooter is X11 specific
@@ -912,16 +921,13 @@
LDFLAGS="$LDFLAGS $X_LIBS"
# Test for Xmu
- enable_gimp_remote=yes
if test -z "$LIBXMU"; then
AC_CHECK_LIB(Xmu, XmuClientWindow,
[AC_CHECK_HEADERS(X11/Xmu/WinUtil.h,
- GIMP_REMOTE='gimp-remote-gimp_app_version$(EXEEXT)';
- GIMP_COMMAND='gimp-remote-gimp_app_version'
have_libxmu=yes
LIBXMU="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt",
- [enable_gimp_remote="no (XMU header file not found)"],[#include <gdk/gdkx.h>])],
- [enable_gimp_remote="no (XMU library not found)"], -lXt -lX11)
+ [have_libxmu="no (XMU header file not found)"],[#include <gdk/gdkx.h>])],
+ [have_libxmu="no (XMU library not found)"], -lXt -lX11)
LIBSCREENSHOT="$LIBXMU"
fi
@@ -940,9 +946,6 @@
[Define to 1 to if the XFIXES X extension is available])
LIBSCREENSHOT="$LIBSCREENSHOT $XFIXES_LIBS",
true)
-
-else
- enable_gimp_remote="no (building for $gdk_target)"
fi
AC_SUBST(LIBXMU)
@@ -950,7 +953,21 @@
AC_SUBST(DOC_SHOOTER)
+
+if test x"$enable_gimp_remote" = xyes; then
+ enable_gimp_remote="$have_libxmu"
+fi
+
+if test x"$enable_gimp_remote" = xyes; then
+ GIMP_REMOTE='gimp-remote-gimp_app_version$(EXEEXT)'
+ GIMP_REMOTE_MANPAGE='gimp-remote-gimp_app_version.1'
+ GIMP_COMMAND='gimp-remote-gimp_app_version'
+else
+ GIMP_COMMAND='gimp-gimp_app_version'
+fi
+
AC_SUBST(GIMP_REMOTE)
+AC_SUBST(GIMP_REMOTE_MANPAGE)
AC_SUBST(GIMP_COMMAND)
Modified: branches/soc-2008-tagging/data/tips/gimp-tips.xml.in
==============================================================================
--- branches/soc-2008-tagging/data/tips/gimp-tips.xml.in (original)
+++ branches/soc-2008-tagging/data/tips/gimp-tips.xml.in Sun Jul 13 12:11:51 2008
@@ -224,15 +224,6 @@
</tip>
<tip level="advanced">
<_thetip>
- To create a circle-shaped selection, hold <tt>Shift</tt> while
- doing an ellipse select. To place a circle precisely, drag
- horizontal and vertical guides tangent to the circle you want to
- select, place your cursor at the intersection of the guides, and
- the resulting selection will just touch the guides.
- </_thetip>
- </tip>
- <tip level="advanced">
- <_thetip>
If some of your scanned photos do not look colorful enough, you
can easily improve their tonal range with the "Auto"
button in the Levels tool (ColorsâLevels). If there are any
Modified: branches/soc-2008-tagging/docs/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/docs/Makefile.am (original)
+++ branches/soc-2008-tagging/docs/Makefile.am Sun Jul 13 12:11:51 2008
@@ -1,6 +1,7 @@
## Process this file with automake to produce Makefile.in
EXTRA_DIST = \
+ gimp-remote.1.in \
Wilber.xcf.gz \
Wilber.xcf.gz.README \
Wilber_Construction_Kit.xcf.gz
@@ -8,7 +9,7 @@
mans = \
gimp-$(GIMP_APP_VERSION).1 \
gimprc-$(GIMP_APP_VERSION).5 \
- gimp-remote-$(GIMP_APP_VERSION).1
+ $(GIMP_REMOTE_MANPAGE)
man_MANS = \
$(mans) \
Modified: branches/soc-2008-tagging/docs/gimp.1.in
==============================================================================
--- branches/soc-2008-tagging/docs/gimp.1.in (original)
+++ branches/soc-2008-tagging/docs/gimp.1.in Sun Jul 13 12:11:51 2008
@@ -60,6 +60,9 @@
.B \-\-help-gtk
Show GTK+ command\-line options.
.TP 8
+.B \-\-help-gegl
+Show GEGL command\-line options.
+.TP 8
.B \-v, \-\-version
Output version information and exit. When combined with the \-\-verbose
option, version information about libraries used by GIMP is shown as well.
@@ -193,7 +196,7 @@
together with the tool, colors, brush, pattern and gradient
associated to that device.
-\fB$HOME\fP/@gimpdir@/gtkrc - users set of GIMP-specific GTK config
+\fB$HOME\fP/@gimpdir@/gtkrc - users set of GIMP-specific GTK+ config
settings. Options such as widget color and fonts sizes can be set
here.
@@ -316,7 +319,7 @@
bugs, please check to see if the bug has already been reported.
When reporting GIMP bugs, it is important to include a reliable way to
-reproduce the bug, version number of GIMP (and probably GTK), OS name
+reproduce the bug, version number of GIMP (and probably GTK+), OS name
and version, and any relevant hardware specs. If a bug is causing a
crash, it is very useful if a stack trace can be provided. And of
course, patches to rectify the bug are even better.
@@ -345,4 +348,3 @@
.SH "SEE ALSO"
.BR gimprc (5),
.BR gimptool (1),
-.BR gimp\-remote (1)
Modified: branches/soc-2008-tagging/libgimp/gimpgradientselectbutton.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpgradientselectbutton.c (original)
+++ branches/soc-2008-tagging/libgimp/gimpgradientselectbutton.c Sun Jul 13 12:11:51 2008
@@ -528,10 +528,11 @@
for (y = event->area.y; y < event->area.y + event->area.height; y++)
{
- guchar *buf = ((y / GIMP_CHECK_SIZE_SM) & 1) ? odd : even;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ guchar *buf = ((y / GIMP_CHECK_SIZE_SM) & 1) ? odd : even;
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
event->area.x, y,
event->area.width, 1,
GDK_RGB_DITHER_MAX,
Modified: branches/soc-2008-tagging/libgimp/gimpmenu.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpmenu.c (original)
+++ branches/soc-2008-tagging/libgimp/gimpmenu.c Sun Jul 13 12:11:51 2008
@@ -484,12 +484,13 @@
gimp_menu_callback (GtkWidget *widget,
gpointer any_ID)
{
- GimpMenuCallback callback;
- gpointer callback_data;
+ GtkWidget *parent = gtk_widget_get_parent (widget);
+ GimpMenuCallback callback;
+ gpointer callback_data;
- callback = (GimpMenuCallback) g_object_get_data (G_OBJECT (widget->parent),
+ callback = (GimpMenuCallback) g_object_get_data (G_OBJECT (parent),
"gimp-menu-callback");
- callback_data = g_object_get_data (G_OBJECT (widget->parent),
+ callback_data = g_object_get_data (G_OBJECT (parent),
"gimp-menu-callback-data");
(* callback) (GPOINTER_TO_INT (any_ID), callback_data);
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpbrowser.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpbrowser.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpbrowser.c Sun Jul 13 12:11:51 2008
@@ -207,8 +207,8 @@
browser->search_type_combo = combo;
browser->search_type = first_type_id;
- gtk_box_pack_end (GTK_BOX (browser->search_entry->parent), combo,
- FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (gtk_widget_get_parent (browser->search_entry)),
+ combo, FALSE, FALSE, 0);
gtk_widget_show (combo);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderercolor.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderercolor.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderercolor.c Sun Jul 13 12:11:51 2008
@@ -237,7 +237,8 @@
if (rect.width > 2 && rect.height > 2)
{
- cairo_t *cr = gdk_cairo_create (window);
+ cairo_t *cr = gdk_cairo_create (window);
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state;
cairo_rectangle (cr,
@@ -285,13 +286,13 @@
}
cairo_set_line_width (cr, 1);
- gdk_cairo_set_source_color (cr, &widget->style->fg[state]);
+ gdk_cairo_set_source_color (cr, &style->fg[state]);
cairo_stroke_preserve (cr);
if (state == GTK_STATE_SELECTED &&
gimp_cairo_set_focus_line_pattern (cr, widget))
{
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
cairo_stroke (cr);
}
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderertoggle.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderertoggle.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcellrenderertoggle.c Sun Jul 13 12:11:51 2008
@@ -220,6 +220,7 @@
gint *height)
{
GimpCellRendererToggle *toggle = GIMP_CELL_RENDERER_TOGGLE (cell);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint calc_width;
gint calc_height;
gint pixbuf_width;
@@ -242,9 +243,9 @@
pixbuf_height = gdk_pixbuf_get_height (toggle->pixbuf);
calc_width = (pixbuf_width +
- (gint) cell->xpad * 2 + widget->style->xthickness * 2);
+ (gint) cell->xpad * 2 + style->xthickness * 2);
calc_height = (pixbuf_height +
- (gint) cell->ypad * 2 + widget->style->ythickness * 2);
+ (gint) cell->ypad * 2 + style->ythickness * 2);
if (width)
*width = calc_width;
@@ -280,6 +281,7 @@
GtkCellRendererState flags)
{
GimpCellRendererToggle *toggle = GIMP_CELL_RENDERER_TOGGLE (cell);
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkRectangle toggle_rect;
GdkRectangle draw_rect;
GtkStateType state;
@@ -328,7 +330,7 @@
if (gdk_rectangle_intersect (expose_area, cell_area, &draw_rect) &&
(flags & GTK_CELL_RENDERER_PRELIT))
- gtk_paint_shadow (widget->style,
+ gtk_paint_shadow (style,
window,
state,
active ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
@@ -339,14 +341,14 @@
if (active)
{
- toggle_rect.x += widget->style->xthickness;
- toggle_rect.y += widget->style->ythickness;
- toggle_rect.width -= widget->style->xthickness * 2;
- toggle_rect.height -= widget->style->ythickness * 2;
+ toggle_rect.x += style->xthickness;
+ toggle_rect.y += style->ythickness;
+ toggle_rect.width -= style->xthickness * 2;
+ toggle_rect.height -= style->ythickness * 2;
if (gdk_rectangle_intersect (&draw_rect, &toggle_rect, &draw_rect))
gdk_draw_pixbuf (window,
- widget->style->black_gc,
+ style->black_gc,
toggle->pixbuf,
/* pixbuf 0, 0 is at toggle_rect.x, toggle_rect.y */
draw_rect.x - toggle_rect.x,
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpchainbutton.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpchainbutton.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpchainbutton.c Sun Jul 13 12:11:51 2008
@@ -443,7 +443,8 @@
points[2] = buf;
}
- gtk_paint_polygon (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_polygon (gtk_widget_get_style (widget),
+ widget->window, GTK_STATE_NORMAL,
shadow,
&event->area,
widget,
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorarea.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorarea.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorarea.c Sun Jul 13 12:11:51 2008
@@ -323,7 +323,8 @@
gimp_color_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GimpColorArea *area = GIMP_COLOR_AREA (widget);
+ GimpColorArea *area = GIMP_COLOR_AREA (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf;
if (! area->buf || ! GTK_WIDGET_DRAWABLE (widget))
@@ -335,7 +336,7 @@
buf = area->buf + event->area.y * area->rowstride + event->area.x * 3;
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->black_gc,
+ style->black_gc,
event->area.x,
event->area.y,
event->area.width,
@@ -348,7 +349,7 @@
if (area->draw_border)
gdk_draw_rectangle (widget->window,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
FALSE,
0, 0,
area->width - 1, area->height - 1);
@@ -505,19 +506,22 @@
guint rowstride,
GimpRGB *color)
{
- guint x, y;
- guint check_size = 0;
- guchar light[3];
- guchar dark[3];
- guchar opaque[3];
- guchar insens[3];
- guchar *p;
- gdouble frac;
+ GtkStyle *style;
+ guint x, y;
+ guint check_size = 0;
+ guchar light[3];
+ guchar dark[3];
+ guchar opaque[3];
+ guchar insens[3];
+ guchar *p;
+ gdouble frac;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (buf != NULL);
g_return_if_fail (color != NULL);
+ style = gtk_widget_get_style (widget);
+
switch (type)
{
case GIMP_COLOR_AREA_FLAT:
@@ -535,9 +539,9 @@
gimp_rgb_get_uchar (color, opaque, opaque + 1, opaque + 2);
- insens[0] = widget->style->bg[GTK_STATE_INSENSITIVE].red >> 8;
- insens[1] = widget->style->bg[GTK_STATE_INSENSITIVE].green >> 8;
- insens[2] = widget->style->bg[GTK_STATE_INSENSITIVE].blue >> 8;
+ insens[0] = style->bg[GTK_STATE_INSENSITIVE].red >> 8;
+ insens[1] = style->bg[GTK_STATE_INSENSITIVE].green >> 8;
+ insens[2] = style->bg[GTK_STATE_INSENSITIVE].blue >> 8;
if (insensitive || check_size == 0 || color->a == 1.0)
{
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorscale.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorscale.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorscale.c Sun Jul 13 12:11:51 2008
@@ -235,7 +235,8 @@
GdkEventExpose *event)
{
GimpColorScale *scale = GIMP_COLOR_SCALE (widget);
- GtkRange *range;
+ GtkRange *range = GTK_RANGE (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkRectangle expose_area; /* Relative to widget->allocation */
GdkRectangle area;
gint focus = 0;
@@ -247,8 +248,6 @@
if (! scale->buf || ! GTK_WIDGET_DRAWABLE (widget))
return FALSE;
- range = GTK_RANGE (scale);
-
/* This is ugly as it relies heavily on GTK+ internals, but I see no
* other way to force the range to recalculate its layout. Might
* break if GtkRange internals change.
@@ -304,19 +303,19 @@
area.x += widget->allocation.x;
area.y += widget->allocation.y;
- gtk_paint_box (widget->style, widget->window,
+ gtk_paint_box (style, widget->window,
sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN,
&area, widget, "trough",
x, y, w, h);
- gdk_gc_set_clip_rectangle (widget->style->black_gc, &area);
+ gdk_gc_set_clip_rectangle (style->black_gc, &area);
switch (range->orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->black_gc,
+ style->black_gc,
x + trough_border + slider_size,
y + trough_border + 1,
scale->width,
@@ -329,7 +328,7 @@
case GTK_ORIENTATION_VERTICAL:
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->black_gc,
+ style->black_gc,
x + trough_border + 1,
y + trough_border + slider_size,
scale->width,
@@ -341,11 +340,11 @@
break;
}
- gdk_gc_set_clip_rectangle (widget->style->black_gc, NULL);
+ gdk_gc_set_clip_rectangle (style->black_gc, NULL);
}
if (GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_HAS_FOCUS (range))
- gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+ gtk_paint_focus (style, widget->window, GTK_WIDGET_STATE (widget),
&area, widget, "trough",
widget->allocation.x + range->range_rect.x,
widget->allocation.y + range->range_rect.y,
@@ -374,8 +373,8 @@
GdkGC *gc;
gc = (GTK_WIDGET_IS_SENSITIVE (widget) ?
- widget->style->black_gc :
- widget->style->dark_gc[GTK_STATE_INSENSITIVE]);
+ style->black_gc :
+ style->dark_gc[GTK_STATE_INSENSITIVE]);
gdk_gc_set_clip_rectangle (gc, &expose_area);
switch (range->orientation)
@@ -394,8 +393,8 @@
gdk_gc_set_clip_rectangle (gc, NULL);
gc = (GTK_WIDGET_IS_SENSITIVE (widget) ?
- widget->style->white_gc :
- widget->style->light_gc[GTK_STATE_INSENSITIVE]);
+ style->white_gc :
+ style->light_gc[GTK_STATE_INSENSITIVE]);
gdk_gc_set_clip_rectangle (gc, &expose_area);
switch (range->orientation)
@@ -739,6 +738,7 @@
gimp_color_scale_render_stipple (GimpColorScale *scale)
{
GtkWidget *widget = GTK_WIDGET (scale);
+ GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf;
guchar insensitive[3];
guint x, y;
@@ -746,9 +746,9 @@
if ((buf = scale->buf) == NULL)
return;
- insensitive[0] = widget->style->bg[GTK_STATE_INSENSITIVE].red >> 8;
- insensitive[1] = widget->style->bg[GTK_STATE_INSENSITIVE].green >> 8;
- insensitive[2] = widget->style->bg[GTK_STATE_INSENSITIVE].blue >> 8;
+ insensitive[0] = style->bg[GTK_STATE_INSENSITIVE].red >> 8;
+ insensitive[1] = style->bg[GTK_STATE_INSENSITIVE].green >> 8;
+ insensitive[2] = style->bg[GTK_STATE_INSENSITIVE].blue >> 8;
for (y = 0; y < scale->height; y++, buf += scale->rowstride)
{
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorscales.c Sun Jul 13 12:11:51 2008
@@ -325,7 +325,7 @@
{
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
gint i;
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpcolorselect.c Sun Jul 13 12:11:51 2008
@@ -440,7 +440,7 @@
gimp_color_select_channel_toggled (GtkWidget *widget,
GimpColorSelect *select)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (select);
GimpColorSelectorChannel channel;
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpenumwidgets.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpenumwidgets.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpenumwidgets.c Sun Jul 13 12:11:51 2008
@@ -419,10 +419,14 @@
if (GTK_IS_MISC (child))
{
GtkMisc *misc = GTK_MISC (child);
+ gint misc_xpad;
+ gint misc_ypad;
+
+ gtk_misc_get_padding (misc, &misc_xpad, &misc_ypad);
gtk_misc_set_padding (misc,
- xpad < 0 ? misc->xpad : xpad,
- ypad < 0 ? misc->ypad : ypad);
+ xpad < 0 ? misc_xpad : xpad,
+ ypad < 0 ? misc_ypad : ypad);
}
}
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpframe.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpframe.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpframe.c Sun Jul 13 12:11:51 2008
@@ -98,13 +98,15 @@
gimp_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- GtkFrame *frame = GTK_FRAME (widget);
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+ GtkFrame *frame = GTK_FRAME (widget);
+ GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
+ GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
GtkRequisition child_requisition;
+ gint border_width;
- if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
+ if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
{
- gtk_widget_size_request (frame->label_widget, requisition);
+ gtk_widget_size_request (label_widget, requisition);
}
else
{
@@ -125,16 +127,19 @@
requisition->height += child_requisition.height;
}
- requisition->width += 2 * GTK_CONTAINER (widget)->border_width;
- requisition->height += 2 * GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+ requisition->width += 2 * border_width;
+ requisition->height += 2 * border_width;
}
static void
gimp_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- GtkFrame *frame = GTK_FRAME (widget);
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+ GtkFrame *frame = GTK_FRAME (widget);
+ GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
+ GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
widget->allocation = *allocation;
@@ -143,22 +148,23 @@
if (child && GTK_WIDGET_VISIBLE (child))
gtk_widget_size_allocate (child, &frame->child_allocation);
- if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
+ if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
{
GtkAllocation label_allocation;
GtkRequisition label_requisition;
- gint border = GTK_CONTAINER (widget)->border_width;
+ gint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- gtk_widget_get_child_requisition (frame->label_widget,
- &label_requisition);
+ gtk_widget_get_child_requisition (label_widget, &label_requisition);
- label_allocation.x = allocation->x + border;
- label_allocation.y = allocation->y + border;
+ label_allocation.x = allocation->x + border_width;
+ label_allocation.y = allocation->y + border_width;
label_allocation.width = MAX (label_requisition.width,
- allocation->width - 2 * border);
+ allocation->width - 2 * border_width);
label_allocation.height = label_requisition.height;
- gtk_widget_size_allocate (frame->label_widget, &label_allocation);
+ gtk_widget_size_allocate (label_widget, &label_allocation);
}
}
@@ -166,34 +172,36 @@
gimp_frame_child_allocate (GtkFrame *frame,
GtkAllocation *child_allocation)
{
- GtkWidget *widget = GTK_WIDGET (frame);
- GtkAllocation *allocation = &widget->allocation;
- gint border = GTK_CONTAINER (frame)->border_width;
- gint spacing = 0;
- gint indent = gimp_frame_get_indent (widget);
+ GtkWidget *widget = GTK_WIDGET (frame);
+ GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
+ GtkAllocation *allocation = &widget->allocation;
+ gint border_width;
+ gint spacing = 0;
+ gint indent = gimp_frame_get_indent (widget);
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (frame));
- if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
+ if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
{
GtkRequisition child_requisition;
- gtk_widget_get_child_requisition (frame->label_widget,
- &child_requisition);
+ gtk_widget_get_child_requisition (label_widget, &child_requisition);
spacing += child_requisition.height;
}
spacing += gimp_frame_get_label_spacing (frame);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- child_allocation->x = border + indent;
+ child_allocation->x = border_width + indent;
else
- child_allocation->x = border;
+ child_allocation->x = border_width;
- child_allocation->y = border + spacing;
+ child_allocation->y = border_width + spacing;
child_allocation->width = MAX (1,
- allocation->width - 2 * border - indent);
+ allocation->width - 2 * border_width - indent);
child_allocation->height = MAX (1,
allocation->height -
- child_allocation->y - border);
+ child_allocation->y - border_width);
child_allocation->x += allocation->x;
child_allocation->y += allocation->y;
@@ -227,20 +235,24 @@
static void
gimp_frame_label_widget_notify (GtkFrame *frame)
{
- if (frame->label_widget)
+ GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
+
+ if (label_widget)
{
GtkLabel *label = NULL;
- if (GTK_IS_LABEL (frame->label_widget))
+ if (GTK_IS_LABEL (label_widget))
{
- label = GTK_LABEL (frame->label_widget);
+ gfloat xalign, yalign;
+
+ label = GTK_LABEL (label_widget);
- gtk_misc_set_alignment (GTK_MISC (label),
- frame->label_xalign, frame->label_yalign);
+ gtk_frame_get_label_align (frame, &xalign, &yalign);
+ gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign);
}
- else if (GTK_IS_BIN (frame->label_widget))
+ else if (GTK_IS_BIN (label_widget))
{
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (frame->label_widget));
+ GtkWidget *child = gtk_bin_get_child (GTK_BIN (label_widget));
if (GTK_IS_LABEL (child))
label = GTK_LABEL (child);
@@ -293,9 +305,10 @@
static gint
gimp_frame_get_label_spacing (GtkFrame *frame)
{
- gint spacing = 0;
+ GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
+ gint spacing = 0;
- if ((frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget)) ||
+ if ((label_widget && GTK_WIDGET_VISIBLE (label_widget)) ||
(g_object_get_data (G_OBJECT (frame), GIMP_FRAME_IN_EXPANDER_KEY)))
{
gtk_widget_style_get (GTK_WIDGET (frame),
Modified: branches/soc-2008-tagging/libgimpwidgets/gimphelpui.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimphelpui.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimphelpui.c Sun Jul 13 12:11:51 2008
@@ -306,7 +306,7 @@
const gchar *help_id = NULL;
gpointer help_data = NULL;
- for (; widget; widget = widget->parent)
+ for (; widget; widget = gtk_widget_get_parent (widget))
{
help_id = g_object_get_qdata (G_OBJECT (widget), GIMP_HELP_ID);
help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpoffsetarea.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpoffsetarea.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpoffsetarea.c Sun Jul 13 12:11:51 2008
@@ -389,7 +389,8 @@
gimp_offset_area_expose_event (GtkWidget *widget,
GdkEventExpose *eevent)
{
- GimpOffsetArea *area = GIMP_OFFSET_AREA (widget);
+ GimpOffsetArea *area = GIMP_OFFSET_AREA (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkPixbuf *pixbuf;
gint w, h;
gint x, y;
@@ -414,14 +415,14 @@
if (pixbuf)
{
- gdk_draw_pixbuf (widget->window, widget->style->black_gc,
+ gdk_draw_pixbuf (widget->window, style->black_gc,
pixbuf, 0, 0, x, y, w, h, GDK_RGB_DITHER_NORMAL, 0, 0);
- gdk_draw_rectangle (widget->window, widget->style->black_gc, FALSE,
+ gdk_draw_rectangle (widget->window, style->black_gc, FALSE,
x, y, w - 1, h - 1);
}
else
{
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL, widget, NULL,
x, y, w, h);
@@ -474,7 +475,7 @@
}
else
{
- gdk_draw_rectangle (widget->window, widget->style->black_gc, FALSE,
+ gdk_draw_rectangle (widget->window, style->black_gc, FALSE,
x, y, w, h);
}
}
Modified: branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimppreviewarea.c Sun Jul 13 12:11:51 2008
@@ -238,12 +238,13 @@
if (gdk_rectangle_intersect (&rect, &event->area, &render))
{
- gint x = render.x - rect.x;
- gint y = render.y - rect.y;
- guchar *buf = area->buf + x * 3 + y * area->rowstride;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ gint x = render.x - rect.x;
+ gint y = render.y - rect.y;
+ guchar *buf = area->buf + x * 3 + y * area->rowstride;
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
render.x,
render.y,
render.width,
Modified: branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimppropwidgets.c Sun Jul 13 12:11:51 2008
@@ -137,7 +137,8 @@
return;
g_object_set (config,
- param_spec->name, GTK_TOGGLE_BUTTON (widget)->active,
+ param_spec->name,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)),
NULL);
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
@@ -154,7 +155,7 @@
param_spec->name, &value,
NULL);
- if (GTK_TOGGLE_BUTTON (button)->active != value)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) != value)
{
g_signal_handlers_block_by_func (button,
gimp_prop_check_button_callback,
@@ -260,7 +261,8 @@
g_object_set (config,
param_spec->name,
- GTK_TOGGLE_BUTTON (widget)->active ? true_value : false_value,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ?
+ true_value : false_value,
NULL);
gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (widget), FALSE);
@@ -296,7 +298,7 @@
gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (button),
inconsistent);
- if (GTK_TOGGLE_BUTTON (button)->active != active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) != active)
{
g_signal_handlers_block_by_func (button,
gimp_prop_enum_check_button_callback,
@@ -954,7 +956,7 @@
gimp_prop_radio_button_callback (GtkWidget *widget,
GObject *config)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GParamSpec *param_spec;
gint value;
Modified: branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c
==============================================================================
--- branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c (original)
+++ branches/soc-2008-tagging/libgimpwidgets/gimpscrolledpreview.c Sun Jul 13 12:11:51 2008
@@ -565,6 +565,7 @@
if (event->type == GDK_BUTTON_PRESS && event->button == 1)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkWidget *outer;
GtkWidget *inner;
GtkWidget *area;
@@ -625,8 +626,8 @@
y += event->y - v * (gdouble) GIMP_PREVIEW_AREA (area)->height;
gtk_window_move (GTK_WINDOW (preview->nav_popup),
- x - 2 * widget->style->xthickness,
- y - 2 * widget->style->ythickness);
+ x - 2 * style->xthickness,
+ y - 2 * style->ythickness);
gtk_widget_show (preview->nav_popup);
Modified: branches/soc-2008-tagging/modules/colorsel_water.c
==============================================================================
--- branches/soc-2008-tagging/modules/colorsel_water.c (original)
+++ branches/soc-2008-tagging/modules/colorsel_water.c Sun Jul 13 12:11:51 2008
@@ -204,14 +204,15 @@
select_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- gdouble width = widget->allocation.width;
- gdouble height = widget->allocation.height;
- gdouble dx = 1.0 / width;
- gdouble dy = 1.0 / height;
- guchar *buf = g_alloca (3 * event->area.width * event->area.height);
- guchar *dest = buf;
- gdouble y;
- gint i, j;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ gdouble width = widget->allocation.width;
+ gdouble height = widget->allocation.height;
+ gdouble dx = 1.0 / width;
+ gdouble dy = 1.0 / height;
+ guchar *buf = g_alloca (3 * event->area.width * event->area.height);
+ guchar *dest = buf;
+ gdouble y;
+ gint i, j;
for (j = 0, y = event->area.y / height; j < event->area.height; j++, y += dy)
{
@@ -246,7 +247,7 @@
}
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
event->area.x, event->area.y,
event->area.width, event->area.height,
GDK_RGB_DITHER_MAX,
Modified: branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c (original)
+++ branches/soc-2008-tagging/plug-ins/color-rotate/color-rotate-callbacks.c Sun Jul 13 12:11:51 2008
@@ -84,11 +84,13 @@
rcm_360_degrees (GtkWidget *button,
RcmCircle *circle)
{
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
+
circle->action_flag = DO_NOTHING;
gtk_widget_queue_draw (circle->preview);
circle->angle->beta = circle->angle->alpha-circle->angle->cw_ccw * 0.001;
color_rotate_draw_arrows (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->angle);
circle->action_flag = VIRGIN;
rcm_render_preview (Current.Bna->after);
@@ -115,13 +117,15 @@
rcm_a_to_b (GtkWidget *button,
RcmCircle *circle)
{
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
+
circle->action_flag = DO_NOTHING;
gtk_widget_queue_draw (circle->preview);
SWAP (circle->angle->alpha, circle->angle->beta);
color_rotate_draw_arrows (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->angle);
circle->action_flag = VIRGIN;
@@ -152,7 +156,7 @@
rcm_switch_to_degrees (GtkWidget *button,
gpointer *value)
{
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
Current.Units = DEGREES;
@@ -203,7 +207,7 @@
rcm_switch_to_radians (GtkWidget *button,
gpointer *value)
{
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
Current.Units = RADIANS;
@@ -254,7 +258,7 @@
rcm_switch_to_radians_over_PI (GtkWidget *button,
gpointer *value)
{
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
Current.Units = RADIANS_OVER_PI;
@@ -291,22 +295,24 @@
rcm_switch_to_gray_to (GtkWidget *button,
gpointer *value)
{
- if (! GTK_TOGGLE_BUTTON (button)->active)
- return;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+ {
+ Current.Gray_to_from = GRAY_TO;
- Current.Gray_to_from = GRAY_TO;
- rcm_render_preview (Current.Bna->after);
+ rcm_render_preview (Current.Bna->after);
+ }
}
void
rcm_switch_to_gray_from (GtkWidget *button,
gpointer *value)
{
- if (! GTK_TOGGLE_BUTTON (button)->active)
- return;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+ {
+ Current.Gray_to_from = GRAY_FROM;
- Current.Gray_to_from = GRAY_FROM;
- rcm_render_preview (Current.Bna->after);
+ rcm_render_preview (Current.Bna->after);
+ }
}
@@ -316,7 +322,7 @@
rcm_preview_as_you_drag (GtkWidget *button,
gpointer *value)
{
- Current.RealTime = GTK_TOGGLE_BUTTON (button)->active;
+ Current.RealTime = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
}
void
@@ -348,8 +354,10 @@
{
if (circle->action_flag == VIRGIN)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
+
color_rotate_draw_arrows (widget->window,
- widget->style->black_gc,
+ style->black_gc,
circle->angle);
}
@@ -383,10 +391,12 @@
if (*(circle->target) != clicked_angle)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
+
*(circle->target) = clicked_angle;
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_arrows (widget->window,
- widget->style->black_gc,
+ style->black_gc,
circle->angle);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (circle->alpha_entry),
@@ -414,9 +424,11 @@
{
if (circle->action_flag == DRAGING)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
+
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_arrows (widget->window,
- widget->style->black_gc,
+ style->black_gc,
circle->angle);
}
@@ -505,11 +517,15 @@
{
if (circle->action_flag == VIRGIN)
{
- color_rotate_draw_little_circle (widget->window, widget->style->black_gc,
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ color_rotate_draw_little_circle (widget->window,
+ style->black_gc,
circle->hue, circle->satur);
color_rotate_draw_large_circle (widget->window,
- widget->style->black_gc, circle->gray_sat);
+ style->black_gc,
+ circle->gray_sat);
}
return TRUE;
@@ -520,6 +536,7 @@
GdkEvent *event,
RcmGray *circle)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkEventButton *bevent;
int x, y;
@@ -535,11 +552,12 @@
circle->satur = 1;
gtk_widget_queue_draw (circle->preview);
- color_rotate_draw_little_circle (widget->window, widget->style->black_gc,
+ color_rotate_draw_little_circle (widget->window,
+ style->black_gc,
circle->hue, circle->satur);
color_rotate_draw_large_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ gtk_widget_get_style (circle->preview)->black_gc,
circle->gray_sat);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (circle->hue_entry),
@@ -560,10 +578,14 @@
RcmGray *circle)
{
if (circle->action_flag == DRAGING)
- color_rotate_draw_little_circle (widget->window,
- widget->style->black_gc,
- circle->hue,
- circle->satur);
+ {
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ color_rotate_draw_little_circle (widget->window,
+ style->black_gc,
+ circle->hue,
+ circle->satur);
+ }
circle->action_flag = VIRGIN;
@@ -587,9 +609,11 @@
if (circle->action_flag == DRAG_START)
{
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
+
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_large_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->gray_sat);
circle->action_flag = DRAGING;
@@ -634,6 +658,7 @@
gpointer data)
{
RcmCircle *circle = data;
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
if (circle->action_flag != VIRGIN)
return;
@@ -644,7 +669,7 @@
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_arrows (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->angle);
rcm_render_preview (Current.Bna->after);
@@ -655,6 +680,7 @@
gpointer data)
{
RcmCircle *circle = data;
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
if (circle->action_flag != VIRGIN)
return;
@@ -665,7 +691,7 @@
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_arrows (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->angle);
rcm_render_preview (Current.Bna->after);
@@ -675,10 +701,11 @@
rcm_set_hue (GtkWidget *entry,
gpointer data)
{
- RcmGray *circle = data;
+ RcmGray *circle = data;
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
- if (circle->action_flag != VIRGIN
- ) return;
+ if (circle->action_flag != VIRGIN)
+ return;
circle->hue = (gtk_spin_button_get_value (GTK_SPIN_BUTTON (entry)) /
rcm_units_factor(Current.Units));
@@ -686,11 +713,11 @@
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_little_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->hue, circle->satur);
color_rotate_draw_large_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->gray_sat);
rcm_render_preview (Current.Bna->after);
@@ -700,7 +727,8 @@
rcm_set_satur (GtkWidget *entry,
gpointer data)
{
- RcmGray *circle = data;
+ RcmGray *circle = data;
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
if (circle->action_flag != VIRGIN)
return;
@@ -710,11 +738,11 @@
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_little_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->hue, circle->satur);
color_rotate_draw_large_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->gray_sat);
rcm_render_preview (Current.Bna->after);
@@ -724,14 +752,15 @@
rcm_set_gray_sat (GtkWidget *entry,
gpointer data)
{
- RcmGray *circle = data;
+ RcmGray *circle = data;
+ GtkStyle *style = gtk_widget_get_style (circle->preview);
circle->gray_sat = gtk_spin_button_get_value (GTK_SPIN_BUTTON (entry));
gtk_widget_queue_draw (circle->preview);
color_rotate_draw_large_circle (circle->preview->window,
- circle->preview->style->black_gc,
+ style->black_gc,
circle->gray_sat);
rcm_render_preview (Current.Bna->after);
Modified: branches/soc-2008-tagging/plug-ins/common/animation-play.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/animation-play.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/animation-play.c Sun Jul 13 12:11:51 2008
@@ -343,8 +343,10 @@
GdkEventExpose *event,
gpointer data)
{
- gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ GtkStyle *style = gtk_widget_get_style (darea);
+
+ gdk_draw_rgb_image (darea->window,
+ style->white_gc,
0, 0, width, height,
(total_frames == 1) ? GDK_RGB_DITHER_MAX : DITHERTYPE,
drawing_area_data, width * 3);
@@ -357,8 +359,10 @@
GdkEventExpose *event,
gpointer data)
{
- gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ GtkStyle *style = gtk_widget_get_style (darea);
+
+ gdk_draw_rgb_image (darea->window,
+ style->white_gc,
0, 0, width, height,
(total_frames == 1) ? GDK_RGB_DITHER_MAX : DITHERTYPE,
shape_drawing_area_data, width * 3);
@@ -774,6 +778,8 @@
static void
render_frame (gint32 whichframe)
{
+ GtkStyle *shape_style = gtk_widget_get_style (shape_drawing_area);
+ GtkStyle *drawing_style = gtk_widget_get_style (drawing_area);
GimpPixelRgn pixel_rgn;
static guchar *rawframe = NULL;
static gint rawwidth = 0, rawheight = 0, rawbpp = 0;
@@ -918,7 +924,7 @@
{
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -928,7 +934,7 @@
{
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1019,7 +1025,7 @@
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, top, width, bottom - top,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1030,7 +1036,7 @@
{
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1045,7 +1051,7 @@
gint bottom = MIN (rawy + rawheight, height);
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, top, width, bottom - top,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1055,7 +1061,7 @@
else
{
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1147,7 +1153,7 @@
{
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1156,7 +1162,7 @@
else
{
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1252,7 +1258,7 @@
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, top, width, bottom - top,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1263,7 +1269,7 @@
{
reshape_from_bitmap (shape_preview_mask);
gdk_draw_rgb_image (shape_drawing_area->window,
- shape_drawing_area->style->white_gc,
+ shape_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1278,7 +1284,7 @@
gint bottom = MIN (rawy + rawheight, height);
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, top, width, bottom - top,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
@@ -1288,7 +1294,7 @@
else
{
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ drawing_style->white_gc,
0, 0, width, height,
(total_frames == 1 ?
GDK_RGB_DITHER_MAX : DITHERTYPE),
Modified: branches/soc-2008-tagging/plug-ins/common/cml-explorer.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/cml-explorer.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/cml-explorer.c Sun Jul 13 12:11:51 2008
@@ -1761,6 +1761,7 @@
GdkEventExpose *ev,
gpointer *data)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
gint x, y, last_y;
gint rgbi[3];
guchar *buffer;
@@ -1783,7 +1784,7 @@
}
}
- gdk_draw_rgb_image (widget->window, widget->style->black_gc,
+ gdk_draw_rgb_image (widget->window, style->black_gc,
0, 0, 256, 256,
GDK_RGB_DITHER_NORMAL,
buffer,
@@ -1791,7 +1792,7 @@
g_free (buffer);
- gdk_draw_line (widget->window, widget->style->white_gc, 0,255, 255, 0);
+ gdk_draw_line (widget->window, style->white_gc, 0,255, 255, 0);
y = 255 * CLAMP (logistic_function (param, 0, param->power),
0, 1.0);
@@ -1801,7 +1802,7 @@
/* curve */
y = 255 * CLAMP (logistic_function (param, x/(gdouble)255, param->power),
0, 1.0);
- gdk_draw_line (widget->window, widget->style->black_gc,
+ gdk_draw_line (widget->window, style->black_gc,
x, 255-last_y, x, 255-y);
}
return TRUE;
Modified: branches/soc-2008-tagging/plug-ins/common/convolution-matrix.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/convolution-matrix.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/convolution-matrix.c Sun Jul 13 12:11:51 2008
@@ -855,7 +855,7 @@
my_toggle_callback (GtkWidget *widget,
gboolean *data)
{
- gint val = GTK_TOGGLE_BUTTON (widget)->active;
+ gint val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
*data = val;
Modified: branches/soc-2008-tagging/plug-ins/common/curve-bend.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/curve-bend.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/curve-bend.c Sun Jul 13 12:11:51 2008
@@ -1488,8 +1488,9 @@
bender_update (BenderDialog *cd,
int update)
{
- gint i;
- gint other;
+ GtkStyle *graph_style = gtk_widget_get_style (cd->graph);
+ gint i;
+ gint other;
if (update & UP_PREVIEW)
{
@@ -1524,16 +1525,16 @@
GdkPoint points[256];
/* Clear the pixmap */
- gdk_draw_rectangle (cd->pixmap, cd->graph->style->bg_gc[GTK_STATE_NORMAL],
+ gdk_draw_rectangle (cd->pixmap, graph_style->bg_gc[GTK_STATE_NORMAL],
TRUE, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
/* Draw the grid lines */
for (i = 0; i < 5; i++)
{
- gdk_draw_line (cd->pixmap, cd->graph->style->dark_gc[GTK_STATE_NORMAL],
+ gdk_draw_line (cd->pixmap, graph_style->dark_gc[GTK_STATE_NORMAL],
RADIUS, i * (GRAPH_HEIGHT / 4) + RADIUS,
GRAPH_WIDTH + RADIUS, i * (GRAPH_HEIGHT / 4) + RADIUS);
- gdk_draw_line (cd->pixmap, cd->graph->style->dark_gc[GTK_STATE_NORMAL],
+ gdk_draw_line (cd->pixmap, graph_style->dark_gc[GTK_STATE_NORMAL],
i * (GRAPH_WIDTH / 4) + RADIUS, RADIUS,
i * (GRAPH_WIDTH / 4) + RADIUS, GRAPH_HEIGHT + RADIUS);
}
@@ -1546,7 +1547,7 @@
points[i].x = i + RADIUS;
points[i].y = 255 - cd->curve[other][i] + RADIUS;
}
- gdk_draw_points (cd->pixmap, cd->graph->style->dark_gc[GTK_STATE_NORMAL], points, 256);
+ gdk_draw_points (cd->pixmap, graph_style->dark_gc[GTK_STATE_NORMAL], points, 256);
/* Draw the active curve */
@@ -1555,7 +1556,7 @@
points[i].x = i + RADIUS;
points[i].y = 255 - cd->curve[cd->outline][i] + RADIUS;
}
- gdk_draw_points (cd->pixmap, cd->graph->style->black_gc, points, 256);
+ gdk_draw_points (cd->pixmap, graph_style->black_gc, points, 256);
/* Draw the points */
if (cd->curve_type == SMOOTH)
@@ -1563,13 +1564,13 @@
for (i = 0; i < 17; i++)
{
if (cd->points[cd->outline][i][0] != -1)
- gdk_draw_arc (cd->pixmap, cd->graph->style->black_gc, TRUE,
+ gdk_draw_arc (cd->pixmap, graph_style->black_gc, TRUE,
(cd->points[cd->outline][i][0] * 255.0),
255 - (cd->points[cd->outline][i][1] * 255.0),
RADIUS * 2, RADIUS * 2, 0, 23040);
}
}
- gdk_draw_drawable (cd->graph->window, cd->graph->style->black_gc, cd->pixmap,
+ gdk_draw_drawable (cd->graph->window, graph_style->black_gc, cd->pixmap,
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
}
}
Modified: branches/soc-2008-tagging/plug-ins/common/despeckle.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/despeckle.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/despeckle.c Sun Jul 13 12:11:51 2008
@@ -594,7 +594,7 @@
dialog_adaptive_callback (GtkWidget *widget,
gpointer data)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
filter_type |= FILTER_ADAPTIVE;
else
filter_type &= ~FILTER_ADAPTIVE;
@@ -606,7 +606,7 @@
dialog_recursive_callback (GtkWidget *widget,
gpointer data)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
filter_type |= FILTER_RECURSIVE;
else
filter_type &= ~FILTER_RECURSIVE;
Modified: branches/soc-2008-tagging/plug-ins/common/filter-pack.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/filter-pack.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/filter-pack.c Sun Jul 13 12:11:51 2008
@@ -658,7 +658,7 @@
{
gimp_radio_button_update (widget, data);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
fp_refresh_previews (fpvals.visible_frames);
if (AW.window && GTK_WIDGET_VISIBLE (AW.window))
@@ -814,7 +814,7 @@
{
gimp_radio_button_update (widget, data);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
fp_refresh_previews (fpvals.visible_frames);
if (AW.window && GTK_WIDGET_VISIBLE (AW.window) && AW.range_preview)
@@ -849,7 +849,7 @@
{
gimp_radio_button_update (widget, data);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
fp_redraw_all_windows ();
}
@@ -997,7 +997,7 @@
if (frame == NULL)
return;
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
if (!GTK_WIDGET_VISIBLE (frame))
{
@@ -1475,19 +1475,21 @@
static void
draw_it (GtkWidget *widget)
{
+ GtkStyle *style = gtk_widget_get_style (AW.aliasing_graph);
+
draw_slider (AW.aliasing_graph->window,
- AW.aliasing_graph->style->black_gc,
- AW.aliasing_graph->style->dark_gc[GTK_STATE_NORMAL],
+ style->black_gc,
+ style->dark_gc[GTK_STATE_NORMAL],
fpvals.cutoff[SHADOWS]);
draw_slider (AW.aliasing_graph->window,
- AW.aliasing_graph->style->black_gc,
- AW.aliasing_graph->style->dark_gc[GTK_STATE_NORMAL],
+ style->black_gc,
+ style->dark_gc[GTK_STATE_NORMAL],
fpvals.cutoff[MIDTONES]);
draw_slider (AW.aliasing_graph->window,
- AW.aliasing_graph->style->black_gc,
- AW.aliasing_graph->style->dark_gc[GTK_STATE_SELECTED],
+ style->black_gc,
+ style->dark_gc[GTK_STATE_SELECTED],
fpvals.offset);
}
Modified: branches/soc-2008-tagging/plug-ins/common/gee-zoom.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/gee-zoom.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/gee-zoom.c Sun Jul 13 12:11:51 2008
@@ -433,6 +433,7 @@
static void
render_frame (void)
{
+ GtkStyle *style;
int i;
static int frame = 0;
unsigned char* tmp;
@@ -444,6 +445,8 @@
if (! GTK_WIDGET_DRAWABLE (drawing_area))
return;
+ style = gtk_widget_get_style (drawing_area);
+
pixels = width*height*(rgb_mode?3:1);
tmp = preview_data2;
@@ -477,7 +480,7 @@
);
gdk_draw_rgb_image (drawing_area->window,
- drawing_area->style->white_gc,
+ style->white_gc,
0, 0, width, height,
GDK_RGB_DITHER_NORMAL,
preview_data1, width * 3);
@@ -533,7 +536,7 @@
);
gdk_draw_gray_image (drawing_area->window,
- drawing_area->style->white_gc,
+ style->white_gc,
0, 0, width, height,
GDK_RGB_DITHER_NORMAL,
preview_data1, width);
Modified: branches/soc-2008-tagging/plug-ins/common/gee.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/gee.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/gee.c Sun Jul 13 12:11:51 2008
@@ -253,11 +253,15 @@
show (void)
{
if (GTK_WIDGET_DRAWABLE (drawing_area))
- gdk_draw_rgb_32_image (drawing_area->window,
- drawing_area->style->white_gc,
- 0, 0, IWIDTH, IHEIGHT,
- GDK_RGB_DITHER_NORMAL,
- disp, IWIDTH * 4);
+ {
+ GtkStyle *style = gtk_widget_get_style (drawing_area);
+
+ gdk_draw_rgb_32_image (drawing_area->window,
+ style->white_gc,
+ 0, 0, IWIDTH, IHEIGHT,
+ GDK_RGB_DITHER_NORMAL,
+ disp, IWIDTH * 4);
+ }
}
Modified: branches/soc-2008-tagging/plug-ins/common/lens-flare.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/lens-flare.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/lens-flare.c Sun Jul 13 12:11:51 2008
@@ -827,36 +827,37 @@
static void
flare_center_cursor_draw (FlareCenter *center)
{
- GtkWidget *prvw = center->preview->area;
+ GtkWidget *prvw = center->preview->area;
+ GtkStyle *style = gtk_widget_get_style (prvw);
gint width, height;
gimp_preview_get_size (center->preview, &width, &height);
- gdk_gc_set_function (prvw->style->black_gc, GDK_INVERT);
+ gdk_gc_set_function (style->black_gc, GDK_INVERT);
if (show_cursor)
{
if (center->cursor_drawn)
{
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
center->oldx, 1,
center->oldx,
height - 1);
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
1, center->oldy,
width - 1,
center->oldy);
}
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
center->curx, 1,
center->curx,
height - 1);
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
1, center->cury,
width - 1,
center->cury);
@@ -867,7 +868,7 @@
center->oldy = center->cury;
center->cursor_drawn = TRUE;
- gdk_gc_set_function (prvw->style->black_gc, GDK_COPY);
+ gdk_gc_set_function (style->black_gc, GDK_COPY);
}
Modified: branches/soc-2008-tagging/plug-ins/common/newsprint.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/newsprint.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/newsprint.c Sun Jul 13 12:11:51 2008
@@ -1491,15 +1491,16 @@
if (st)
{
+ gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+
/* the CMYK widget looks after the black pullout widget */
if (new_cs == CS_CMYK)
{
- gtk_widget_set_sensitive (st->pull_table,
- GTK_TOGGLE_BUTTON (widget)->active);
+ gtk_widget_set_sensitive (st->pull_table, active);
}
/* if we're not activate, then there's nothing more to do */
- if (!GTK_TOGGLE_BUTTON (widget)->active)
+ if (! active)
return;
pvals.colourspace = new_cs;
Modified: branches/soc-2008-tagging/plug-ins/common/nova.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/nova.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/nova.c Sun Jul 13 12:11:51 2008
@@ -518,33 +518,34 @@
static void
nova_center_cursor_draw (NovaCenter *center)
{
- GtkWidget *prvw = center->preview->area;
+ GtkWidget *prvw = center->preview->area;
+ GtkStyle *style = gtk_widget_get_style (prvw);
gint width, height;
gimp_preview_get_size (center->preview, &width, &height);
- gdk_gc_set_function (prvw->style->black_gc, GDK_INVERT);
+ gdk_gc_set_function (style->black_gc, GDK_INVERT);
if (show_cursor)
{
if (center->cursor_drawn)
{
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
center->oldx, 1, center->oldx,
height - 1);
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
1, center->oldy,
width - 1, center->oldy);
}
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
center->curx, 1, center->curx,
height - 1);
gdk_draw_line (prvw->window,
- prvw->style->black_gc,
+ style->black_gc,
1, center->cury,
width - 1, center->cury);
}
@@ -554,7 +555,7 @@
center->oldy = center->cury;
center->cursor_drawn = TRUE;
- gdk_gc_set_function (prvw->style->black_gc, GDK_COPY);
+ gdk_gc_set_function (style->black_gc, GDK_COPY);
}
/*
Modified: branches/soc-2008-tagging/plug-ins/common/postscript.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/postscript.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/postscript.c Sun Jul 13 12:11:51 2008
@@ -3514,7 +3514,7 @@
save_unit_toggle_update (GtkWidget *widget,
gpointer data)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
SaveDialogVals *vals = (SaveDialogVals *) data;
gdouble factor;
@@ -3555,12 +3555,10 @@
ratio = 1.0;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (ps_width_spinbutton),
- GTK_SPIN_BUTTON (ps_width_spinbutton)->
- adjustment->value * ratio);
+ gtk_spin_button_get_value (GTK_SPIN_BUTTON (ps_width_spinbutton)) * ratio);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (ps_height_spinbutton),
- GTK_SPIN_BUTTON (ps_height_spinbutton)->
- adjustment->value * ratio);
+ gtk_spin_button_get_value (GTK_SPIN_BUTTON (ps_height_spinbutton)) * ratio);
return TRUE;
Modified: branches/soc-2008-tagging/plug-ins/common/sample-colorize.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/sample-colorize.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/sample-colorize.c Sun Jul 13 12:11:51 2008
@@ -460,7 +460,7 @@
{
gboolean *toggle_val = (gboolean *)data;
- *toggle_val = GTK_TOGGLE_BUTTON (widget)->active;
+ *toggle_val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
if ((data == &g_di.sample_show_selection) ||
(data == &g_di.sample_show_color))
@@ -1018,7 +1018,8 @@
if (update & INPUT_SLIDERS)
{
- gdouble width, mid, tmp;
+ GtkStyle *style = gtk_widget_get_style (g_di.in_lvl_drawarea);
+ gdouble width, mid, tmp;
levels_erase_slider (g_di.in_lvl_drawarea->window, g_di.slider_pos[0]);
levels_erase_slider (g_di.in_lvl_drawarea->window, g_di.slider_pos[1]);
@@ -1033,21 +1034,23 @@
g_di.slider_pos[1] = (int) (mid + width * tmp + 0.5);
levels_draw_slider (g_di.in_lvl_drawarea->window,
- g_di.in_lvl_drawarea->style->black_gc,
- g_di.in_lvl_drawarea->style->dark_gc[GTK_STATE_NORMAL],
+ style->black_gc,
+ style->dark_gc[GTK_STATE_NORMAL],
g_di.slider_pos[1]);
levels_draw_slider (g_di.in_lvl_drawarea->window,
- g_di.in_lvl_drawarea->style->black_gc,
- g_di.in_lvl_drawarea->style->black_gc,
+ style->black_gc,
+ style->black_gc,
g_di.slider_pos[0]);
levels_draw_slider (g_di.in_lvl_drawarea->window,
- g_di.in_lvl_drawarea->style->black_gc,
- g_di.in_lvl_drawarea->style->white_gc,
+ style->black_gc,
+ style->white_gc,
g_di.slider_pos[2]);
}
if (update & OUTPUT_SLIDERS)
{
+ GtkStyle *style = gtk_widget_get_style (g_di.sample_drawarea);
+
levels_erase_slider (g_di.sample_drawarea->window, g_di.slider_pos[3]);
levels_erase_slider (g_di.sample_drawarea->window, g_di.slider_pos[4]);
@@ -1055,12 +1058,12 @@
g_di.slider_pos[4] = DA_WIDTH * ((double) g_values.lvl_out_max / 255.0);
levels_draw_slider (g_di.sample_drawarea->window,
- g_di.sample_drawarea->style->black_gc,
- g_di.sample_drawarea->style->black_gc,
+ style->black_gc,
+ style->black_gc,
g_di.slider_pos[3]);
levels_draw_slider (g_di.sample_drawarea->window,
- g_di.sample_drawarea->style->black_gc,
- g_di.sample_drawarea->style->black_gc,
+ style->black_gc,
+ style->black_gc,
g_di.slider_pos[4]);
}
}
Modified: branches/soc-2008-tagging/plug-ins/common/sphere-designer.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/sphere-designer.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/sphere-designer.c Sun Jul 13 12:11:51 2008
@@ -2292,10 +2292,11 @@
expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
- guchar *data = img + event->area.y * 3 * PREVIEWSIZE + event->area.x * 3;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ guchar *data = img + event->area.y * 3 * PREVIEWSIZE + event->area.x * 3;
gdk_draw_rgb_image_dithalign (widget->window,
- widget->style->white_gc,
+ style->white_gc,
event->area.x, event->area.y,
event->area.width, event->area.height,
GDK_RGB_DITHER_MAX,
Modified: branches/soc-2008-tagging/plug-ins/common/tiff-load.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/tiff-load.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/tiff-load.c Sun Jul 13 12:11:51 2008
@@ -380,23 +380,42 @@
const gchar *fmt,
va_list ap)
{
- va_list ap_test;
+ int tag = 0;
- /* Workaround for: http://bugzilla.gnome.org/show_bug.cgi?id=131975 */
- /* Ignore the warnings about unregistered private tags (>= 32768) */
if (! strcmp (fmt, "%s: unknown field with tag %d (0x%x) encountered"))
{
+ const char *name;
+ va_list ap_test;
+
G_VA_COPY (ap_test, ap);
- if (va_arg (ap_test, char *)); /* ignore first argument */
- if (va_arg (ap_test, int) >= 32768)
- return;
+
+ name = va_arg (ap_test, const char *);
+ tag = va_arg (ap_test, int);
}
/* for older versions of libtiff? */
else if (! strcmp (fmt, "unknown field with tag %d (0x%x) ignored"))
{
+ va_list ap_test;
+
G_VA_COPY (ap_test, ap);
- if (va_arg (ap_test, int) >= 32768)
- return;
+
+ tag = va_arg (ap_test, int);
+ }
+
+ /* Workaround for: http://bugzilla.gnome.org/show_bug.cgi?id=131975 */
+ /* Ignore the warnings about unregistered private tags (>= 32768). */
+ if (tag >= 32768)
+ return;
+
+ /* Other unknown fields are only reported to stderr. */
+ if (tag > 0)
+ {
+ gchar *msg = g_strdup_vprintf (fmt, ap);
+
+ g_printerr ("%s\n", msg);
+ g_free (msg);
+
+ return;
}
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, ap);
Modified: branches/soc-2008-tagging/plug-ins/common/tile-small.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/common/tile-small.c (original)
+++ branches/soc-2008-tagging/plug-ins/common/tile-small.c Sun Jul 13 12:11:51 2008
@@ -640,38 +640,39 @@
{
if (exp_call.type == EXPLICT)
{
- gdouble x,y;
- gdouble width = (gdouble) preview_width / (gdouble) itvals.numtiles;
- gdouble height = (gdouble) preview_height / (gdouble) itvals.numtiles;
+ GtkStyle *style = gtk_widget_get_style (tint.preview);
+ gdouble x,y;
+ gdouble width = (gdouble) preview_width / (gdouble) itvals.numtiles;
+ gdouble height = (gdouble) preview_height / (gdouble) itvals.numtiles;
x = width * (exp_call.x - 1);
y = height * (exp_call.y - 1);
- gdk_gc_set_function (tint.preview->style->black_gc, GDK_INVERT);
+ gdk_gc_set_function (style->black_gc, GDK_INVERT);
gdk_draw_rectangle (tint.preview->window,
- tint.preview->style->black_gc,
+ style->black_gc,
0,
(gint) x,
(gint) y,
(gint) width,
(gint) height);
gdk_draw_rectangle (tint.preview->window,
- tint.preview->style->black_gc,
+ style->black_gc,
0,
(gint) x + 1,
(gint) y + 1,
(gint) width - 2,
(gint) height - 2);
gdk_draw_rectangle (tint.preview->window,
- tint.preview->style->black_gc,
+ style->black_gc,
0,
(gint) x + 2,
(gint) y + 2,
(gint) width - 4,
(gint) height - 4);
- gdk_gc_set_function (tint.preview->style->black_gc, GDK_COPY);
+ gdk_gc_set_function (style->black_gc, GDK_COPY);
}
}
@@ -812,7 +813,7 @@
{
gimp_radio_button_update (widget, data);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
switch (exp_call.type)
{
Modified: branches/soc-2008-tagging/plug-ins/gfig/gfig-grid.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gfig/gfig-grid.c (original)
+++ branches/soc-2008-tagging/plug-ins/gfig/gfig-grid.c Sun Jul 13 12:11:51 2008
@@ -534,27 +534,28 @@
static GdkGC *
gfig_get_grid_gc (GtkWidget *w, gint gctype)
{
+ GtkStyle *style = gtk_widget_get_style (w);
switch (gctype)
{
case GFIG_BLACK_GC:
- return (w->style->black_gc);
+ return style->black_gc;
case GFIG_WHITE_GC:
- return (w->style->white_gc);
+ return style->white_gc;
case GFIG_GREY_GC:
- return (grid_hightlight_drawgc);
+ return grid_hightlight_drawgc;
case GTK_STATE_NORMAL:
- return (w->style->bg_gc[GTK_STATE_NORMAL]);
+ return style->bg_gc[GTK_STATE_NORMAL];
case GTK_STATE_ACTIVE:
- return (w->style->bg_gc[GTK_STATE_ACTIVE]);
+ return style->bg_gc[GTK_STATE_ACTIVE];
case GTK_STATE_PRELIGHT:
- return (w->style->bg_gc[GTK_STATE_PRELIGHT]);
+ return style->bg_gc[GTK_STATE_PRELIGHT];
case GTK_STATE_SELECTED:
- return (w->style->bg_gc[GTK_STATE_SELECTED]);
+ return style->bg_gc[GTK_STATE_SELECTED];
case GTK_STATE_INSENSITIVE:
- return (w->style->bg_gc[GTK_STATE_INSENSITIVE]);
+ return style->bg_gc[GTK_STATE_INSENSITIVE];
default:
g_warning ("Unknown type for grid colouring\n");
- return (w->style->bg_gc[GTK_STATE_PRELIGHT]);
+ return style->bg_gc[GTK_STATE_PRELIGHT];
}
}
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/general.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/general.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/general.c Sun Jul 13 12:11:51 2008
@@ -62,10 +62,10 @@
void
general_store (void)
{
- pcvals.general_paint_edges = GTK_TOGGLE_BUTTON (general_paint_edges)->active;
+ pcvals.general_paint_edges = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_paint_edges));
pcvals.general_dark_edge = GTK_ADJUSTMENT (general_dark_edge_adjust)->value;
- pcvals.general_tileable = GTK_TOGGLE_BUTTON (general_tileable)->active;
- pcvals.general_drop_shadow = GTK_TOGGLE_BUTTON (general_drop_shadow)->active;
+ pcvals.general_tileable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_tileable));
+ pcvals.general_drop_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (general_drop_shadow));
pcvals.general_shadow_darkness = GTK_ADJUSTMENT (general_shadow_adjust)->value;
pcvals.general_shadow_depth = GTK_ADJUSTMENT (general_shadow_depth)->value;
pcvals.general_shadow_blur = GTK_ADJUSTMENT (general_shadow_blur)->value;
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/orientmap.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/orientmap.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/orientmap.c Sun Jul 13 12:11:51 2008
@@ -83,7 +83,7 @@
vec = vector;
angoff = GTK_ADJUSTMENT (angle_offset_adjust)->value;
strexp = GTK_ADJUSTMENT (orient_map_str_exp_adjust)->value;
- voronoi = GTK_TOGGLE_BUTTON (orient_voronoi)->active;
+ voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
else
{
@@ -458,7 +458,7 @@
pcvals.num_orient_vectors = num_vectors;
pcvals.orient_strength_exponent = GTK_ADJUSTMENT (orient_map_str_exp_adjust)->value;
pcvals.orient_angle_offset = GTK_ADJUSTMENT (angle_offset_adjust)->value;
- pcvals.orient_voronoi = GTK_TOGGLE_BUTTON (orient_voronoi)->active;
+ pcvals.orient_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (orient_voronoi));
}
};
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/paper.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/paper.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/paper.c Sun Jul 13 12:11:51 2008
@@ -61,7 +61,7 @@
{
for (j = 0; j < p.width; j++)
buf[j] = p.col[k + j * 3];
- if (GTK_TOGGLE_BUTTON (paper_invert)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (paper_invert)))
for (j = 0; j < p.width; j++)
buf[j] = 255 - buf[j];
}
@@ -119,9 +119,9 @@
void
paper_store (void)
{
- pcvals.paper_invert = GTK_TOGGLE_BUTTON (paper_invert)->active;
- pcvals.paper_invert = GTK_TOGGLE_BUTTON (paper_invert)->active;
- pcvals.paper_overlay = GTK_TOGGLE_BUTTON (paper_overlay)->active;
+ pcvals.paper_invert = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (paper_invert));
+ pcvals.paper_invert = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (paper_invert));
+ pcvals.paper_overlay = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (paper_overlay));
}
void
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/placement.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/placement.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/placement.c Sun Jul 13 12:11:51 2008
@@ -55,7 +55,7 @@
void
place_store (void)
{
- pcvals.placement_center = GTK_TOGGLE_BUTTON (placement_center)->active;
+ pcvals.placement_center = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (placement_center));
}
void
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/sizemap.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/sizemap.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/sizemap.c Sun Jul 13 12:11:51 2008
@@ -63,7 +63,7 @@
{
return getsiz_proto (x,y, numsmvect, smvector,
GTK_ADJUSTMENT (smstrexpadjust)->value,
- GTK_TOGGLE_BUTTON (size_voronoi)->active);
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi)));
}
static void
@@ -324,8 +324,8 @@
pcvals.size_vectors[i] = smvector[i];
pcvals.num_size_vectors = numsmvect;
- pcvals.size_strength_exponent = GTK_ADJUSTMENT (smstrexpadjust)->value;
- pcvals.size_voronoi = GTK_TOGGLE_BUTTON (size_voronoi)->active;
+ pcvals.size_strength_exponent = gtk_adjustment_get_value (GTK_ADJUSTMENT (smstrexpadjust));
+ pcvals.size_voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi));
}
break;
}
Modified: branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c (original)
+++ branches/soc-2008-tagging/plug-ins/gimpressionist/utils.c Sun Jul 13 12:11:51 2008
@@ -61,8 +61,8 @@
{
n = numsmvect;
vec = smvector;
- smstrexp = GTK_ADJUSTMENT(smstrexpadjust)->value;
- voronoi = GTK_TOGGLE_BUTTON(size_voronoi)->active;
+ smstrexp = gtk_adjustment_get_value (GTK_ADJUSTMENT (smstrexpadjust));
+ voronoi = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (size_voronoi));
}
else
{
Modified: branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/dialog.c (original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/dialog.c Sun Jul 13 12:11:51 2008
@@ -62,7 +62,10 @@
#endif
-#define GIMP_HELP_BROWSER_DIALOG_DATA "gimp-help-browser-dialog"
+#define GIMP_HELP_BROWSER_DIALOG_DATA "gimp-help-browser-dialog"
+
+#define GIMP_HELP_BROWSER_INDEX_MAX_DEPTH 4
+
typedef struct
{
@@ -343,7 +346,6 @@
GimpHelpItem *item,
GimpHelpLocale *locale)
{
-
#if 0
g_printerr ("%s: processing %s (parent %s)\n",
G_STRFUNC,
@@ -358,10 +360,21 @@
for (i = 0; i < 5; i++)
{
+ gunichar c;
+
if (! indices[i])
break;
- item->index += atoi (indices[i]) << (8 * (5 - i));
+ c = g_utf8_get_char (indices[i]);
+
+ if (g_unichar_isdigit (c))
+ {
+ item->index += atoi (indices[i]) << (8 * (5 - i));
+ }
+ else if (g_utf8_strlen (indices[i], -1) == 1)
+ {
+ item->index += (c & 0xFF) << (8 * (5 - i));
+ }
}
g_strfreev (indices);
@@ -374,7 +387,9 @@
parent = g_hash_table_lookup (locale->help_id_mapping, item->parent);
if (parent)
- parent->children = g_list_prepend (parent->children, item);
+ {
+ parent->children = g_list_prepend (parent->children, item);
+ }
}
else
{
@@ -386,8 +401,8 @@
help_item_compare (gconstpointer a,
gconstpointer b)
{
- GimpHelpItem *item_a = (GimpHelpItem *) a;
- GimpHelpItem *item_b = (GimpHelpItem *) b;
+ const GimpHelpItem *item_a = a;
+ const GimpHelpItem *item_b = b;
if (item_a->index > item_b->index)
return 1;
@@ -402,7 +417,8 @@
GimpHelpDomain *domain,
GimpHelpLocale *locale,
GtkTreeIter *parent,
- GimpHelpItem *item)
+ GimpHelpItem *item,
+ gint depth)
{
GtkTreeIter iter;
GList *list;
@@ -424,13 +440,16 @@
uri,
gtk_tree_iter_copy (&iter));
+ if (depth + 1 == GIMP_HELP_BROWSER_INDEX_MAX_DEPTH)
+ return;
+
item->children = g_list_sort (item->children, help_item_compare);
for (list = item->children; list; list = g_list_next (list))
{
GimpHelpItem *item = list->data;
- add_child (store, domain, locale, &iter, item);
+ add_child (store, domain, locale, &iter, item, depth + 1);
}
}
@@ -470,7 +489,7 @@
{
GimpHelpItem *item = list->data;
- add_child (store, domain, locale, NULL, item);
+ add_child (store, domain, locale, NULL, item, 0);
}
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (store));
@@ -481,11 +500,12 @@
select_index (const gchar *uri)
{
GtkTreeSelection *selection;
- GtkTreeIter *iter;
+ GtkTreeIter *iter = NULL;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
- iter = g_hash_table_lookup (uri_hash_table, uri);
+ if (uri)
+ iter = g_hash_table_lookup (uri_hash_table, uri);
if (iter)
{
@@ -789,21 +809,24 @@
/* this function unrefs the items and frees the list */
static GtkWidget *
-build_menu (GList *list)
+build_menu (GList *items)
{
GtkWidget *menu;
+ GList *list;
- if (! list)
+ if (! items)
return NULL;
menu = gtk_menu_new ();
- do
+ for (list = items; list; list = g_list_next (list))
{
WebKitWebHistoryItem *item = list->data;
GtkWidget *menu_item;
+ const gchar *title;
- menu_item = gtk_menu_item_new_with_label (webkit_web_history_item_get_title (item));
+ title = webkit_web_history_item_get_title (item);
+ menu_item = gtk_menu_item_new_with_label (title);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
@@ -814,9 +837,8 @@
g_object_unref (item);
}
- while ((list = g_list_next (list)));
- g_list_free (list);
+ g_list_free (items);
return menu;
}
@@ -1022,4 +1044,6 @@
gtk_action_set_sensitive (action, FALSE);
update_actions ();
+
+ select_index (webkit_web_frame_get_uri (frame));
}
Modified: branches/soc-2008-tagging/plug-ins/help/gimphelpdomain.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help/gimphelpdomain.c (original)
+++ branches/soc-2008-tagging/plug-ins/help/gimphelpdomain.c Sun Jul 13 12:11:51 2008
@@ -176,20 +176,33 @@
switch (error->code)
{
case G_IO_ERROR_NOT_FOUND:
+ if (domain->help_domain)
+ {
+ g_message (_("The help pages for '%s' are not available."),
+ domain->help_domain);
+ }
+ else
+ {
+ g_message ("%s\n\n%s",
+ _("The GIMP user manual is not available."),
+ _("Please install the additional help package "
+ "or use the online user manual at "
+ "http://docs.gimp.org/."));
+ }
+ break;
+
+ case G_IO_ERROR_NOT_SUPPORTED:
g_message ("%s\n\n%s",
- _("The GIMP user manual is not available."),
- _("Please install the additional help package or use "
- "the online user manual at http://docs.gimp.org/."));
+ error->message,
+ _("Perhaps you are missing GIO backends and need "
+ "to install GVFS?"));
break;
case G_IO_ERROR_CANCELLED:
break;
default:
- g_message ("%s\n\n%s\n\n%s",
- _("There is a problem with the GIMP user manual."),
- error->message,
- _("Please check your installation."));
+ g_message (error->message);
break;
}
Modified: branches/soc-2008-tagging/plug-ins/help/gimphelpitem.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help/gimphelpitem.h (original)
+++ branches/soc-2008-tagging/plug-ins/help/gimphelpitem.h Sun Jul 13 12:11:51 2008
@@ -31,7 +31,7 @@
gchar *title;
gchar *parent;
- /* eek */
+ /* extra fields used by the help-browser */
GList *children;
gint index;
};
Modified: branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c (original)
+++ branches/soc-2008-tagging/plug-ins/ifs-compose/ifs-compose.c Sun Jul 13 12:11:51 2008
@@ -1497,6 +1497,7 @@
design_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
PangoLayout *layout;
gint i;
gint cx, cy;
@@ -1510,21 +1511,21 @@
}
gdk_draw_rectangle (ifsDesign->pixmap,
- widget->style->bg_gc[widget->state],
- TRUE,
- event->area.x,
- event->area.y,
- event->area.width, event->area.height);
+ style->bg_gc[widget->state],
+ TRUE,
+ event->area.x,
+ event->area.y,
+ event->area.width, event->area.height);
/* draw an indicator for the center */
cx = ifsvals.center_x * widget->allocation.width;
cy = ifsvals.center_y * widget->allocation.width;
gdk_draw_line (ifsDesign->pixmap,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
cx - 10, cy, cx + 10, cy);
gdk_draw_line (ifsDesign->pixmap,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
cx, cy - 10, cx, cy + 10);
layout = gtk_widget_create_pango_layout (widget, NULL);
@@ -1535,7 +1536,7 @@
widget->allocation.width,
widget->allocation.height,
ifsDesign->pixmap,
- widget->style->fg_gc[widget->state],
+ style->fg_gc[widget->state],
ifsDesign->selected_gc,
layout);
}
@@ -1543,7 +1544,7 @@
g_object_unref (layout);
gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ style->fg_gc[GTK_WIDGET_STATE (widget)],
ifsDesign->pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
@@ -2085,8 +2086,10 @@
{
AffElement *cur = elements[ifsD->current_element];
- cur->v.simple_color = GTK_TOGGLE_BUTTON (widget)->active;
+ cur->v.simple_color = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+
ifsD->current_vals.simple_color = cur->v.simple_color;
+
if (cur->v.simple_color)
aff_element_compute_color_trans (cur);
Modified: branches/soc-2008-tagging/plug-ins/imagemap/imap_grid.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/imagemap/imap_grid.c (original)
+++ branches/soc-2008-tagging/plug-ins/imagemap/imap_grid.c Sun Jul 13 12:11:51 2008
@@ -352,22 +352,31 @@
void
draw_grid(GtkWidget *preview)
{
- if (grid_snap && grid_type != GRID_HIDDEN) {
+ if (grid_snap && grid_type != GRID_HIDDEN)
+ {
gint width = preview_get_width(preview);
gint height = preview_get_height(preview);
- if (!grid_gc) {
- grid_gc = gdk_gc_new(preview->window);
+ if (!grid_gc)
+ {
+ grid_gc = gdk_gc_new(preview->window);
+
+ gdk_gc_set_line_attributes(grid_gc, 1, GDK_LINE_ON_OFF_DASH,
+ GDK_CAP_BUTT, GDK_JOIN_BEVEL);
+ }
- gdk_gc_set_line_attributes(grid_gc, 1, GDK_LINE_ON_OFF_DASH,
- GDK_CAP_BUTT, GDK_JOIN_BEVEL);
- }
if (grid_type == GRID_LINES)
- draw_lines(preview->window, grid_gc, width, height);
+ {
+ draw_lines(preview->window, grid_gc, width, height);
+ }
else
- draw_crosses(preview->window, preview->style->black_gc, width,
- height);
- }
+ {
+ GtkStyle *style = gtk_widget_get_style (preview);
+
+ draw_crosses(preview->window, style->black_gc, width,
+ height);
+ }
+ }
}
void
Modified: branches/soc-2008-tagging/plug-ins/jpeg/jpeg-save.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/jpeg/jpeg-save.c (original)
+++ branches/soc-2008-tagging/plug-ins/jpeg/jpeg-save.c Sun Jul 13 12:11:51 2008
@@ -1353,7 +1353,10 @@
save_restart_update (GtkAdjustment *adjustment,
GtkWidget *toggle)
{
- jsvals.restart = GTK_TOGGLE_BUTTON (toggle)->active ? adjustment->value : 0;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)))
+ jsvals.restart = adjustment->value;
+ else
+ jsvals.restart = 0;
gtk_widget_set_sensitive (restart_markers_label, jsvals.restart);
gtk_widget_set_sensitive (restart_markers_scale, jsvals.restart);
Modified: branches/soc-2008-tagging/plug-ins/print/print-preview.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/print/print-preview.c (original)
+++ branches/soc-2008-tagging/plug-ins/print/print-preview.c Sun Jul 13 12:11:51 2008
@@ -407,6 +407,7 @@
GdkEventExpose *event)
{
PrintPreview *preview = PRINT_PREVIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gdouble paper_width;
gdouble paper_height;
@@ -442,10 +443,10 @@
/* draw page background */
cairo_rectangle (cr, 0, 0, scale * paper_width, scale * paper_height);
- gdk_cairo_set_source_color (cr, &widget->style->black);
+ gdk_cairo_set_source_color (cr, &style->black);
cairo_stroke_preserve (cr);
- gdk_cairo_set_source_color (cr, &widget->style->white);
+ gdk_cairo_set_source_color (cr, &style->white);
cairo_fill (cr);
/* draw page_margins */
@@ -455,7 +456,7 @@
scale * (paper_width - left_margin - right_margin),
scale * (paper_height - top_margin - bottom_margin));
- gdk_cairo_set_source_color (cr, &widget->style->mid[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->mid[widget->state]);
cairo_stroke (cr);
cairo_translate (cr,
@@ -469,7 +470,7 @@
scale * preview->image_width,
scale * preview->image_height);
- gdk_cairo_set_source_color (cr, &widget->style->black);
+ gdk_cairo_set_source_color (cr, &style->black);
cairo_stroke (cr);
}
Modified: branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/gimpmodule.c Sun Jul 13 12:11:51 2008
@@ -1710,7 +1710,6 @@
{"personal_rc_file", (PyCFunction)pygimp_personal_rc_file, METH_VARARGS | METH_KEYWORDS},
{"context_push", (PyCFunction)pygimp_context_push, METH_NOARGS},
{"context_pop", (PyCFunction)pygimp_context_pop, METH_NOARGS},
- {"get_foreground", (PyCFunction)pygimp_get_foreground, METH_NOARGS},
{"get_background", (PyCFunction)pygimp_get_background, METH_NOARGS},
{"get_foreground", (PyCFunction)pygimp_get_foreground, METH_NOARGS},
{"set_background", (PyCFunction)pygimp_set_background, METH_VARARGS},
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-colors.c Sun Jul 13 12:11:51 2008
@@ -20,6 +20,7 @@
#define NO_IMPORT_PYGOBJECT
+#include "pygimp.h"
#include "pygimpcolor.h"
#include <libgimpmath/gimpmath.h>
@@ -459,14 +460,14 @@
{ NULL, (getter)0, (setter)0 },
};
-static int
+static Py_ssize_t
rgb_length(PyObject *self)
{
return 4;
}
static PyObject *
-rgb_getitem(PyObject *self, int pos)
+rgb_getitem(PyObject *self, Py_ssize_t pos)
{
GimpRGB *rgb;
double val;
@@ -495,7 +496,7 @@
}
static int
-rgb_setitem(PyObject *self, int pos, PyObject *value)
+rgb_setitem(PyObject *self, Py_ssize_t pos, PyObject *value)
{
if (pos < 0)
pos += 4;
@@ -517,10 +518,10 @@
}
static PyObject *
-rgb_slice(PyObject *self, int start, int end)
+rgb_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end)
{
PyTupleObject *ret;
- int i;
+ Py_ssize_t i;
if (start < 0)
start = 0;
@@ -540,13 +541,13 @@
}
static PySequenceMethods rgb_as_sequence = {
- (inquiry)rgb_length,
+ rgb_length,
(binaryfunc)0,
- (intargfunc)0,
- (intargfunc)rgb_getitem,
- (intintargfunc)rgb_slice,
- (intobjargproc)rgb_setitem,
- (intintobjargproc)0,
+ 0,
+ rgb_getitem,
+ rgb_slice,
+ rgb_setitem,
+ 0,
(objobjproc)0,
};
@@ -562,7 +563,7 @@
return NULL;
return rgb_getitem(self, i);
} else if (PySlice_Check(item)) {
- int start, stop, step, slicelength, cur, i;
+ Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@@ -608,7 +609,7 @@
}
static PyMappingMethods rgb_as_mapping = {
- (inquiry)rgb_length,
+ rgb_length,
(binaryfunc)rgb_subscript,
(objobjargproc)0
};
@@ -982,14 +983,14 @@
{ NULL, (getter)0, (setter)0 },
};
-static int
+static Py_ssize_t
hsv_length(PyObject *self)
{
return 4;
}
static PyObject *
-hsv_getitem(PyObject *self, int pos)
+hsv_getitem(PyObject *self, Py_ssize_t pos)
{
GimpHSV *hsv;
double val, scale_factor;
@@ -1040,10 +1041,10 @@
}
static PyObject *
-hsv_slice(PyObject *self, int start, int end)
+hsv_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end)
{
PyTupleObject *ret;
- int i;
+ Py_ssize_t i;
if (start < 0)
start = 0;
@@ -1063,13 +1064,13 @@
}
static PySequenceMethods hsv_as_sequence = {
- (inquiry)hsv_length,
+ hsv_length,
(binaryfunc)0,
- (intargfunc)0,
- (intargfunc)hsv_getitem,
- (intintargfunc)hsv_slice,
- (intobjargproc)hsv_setitem,
- (intintobjargproc)0,
+ 0,
+ hsv_getitem,
+ hsv_slice,
+ hsv_setitem,
+ 0,
(objobjproc)0,
};
@@ -1085,7 +1086,7 @@
return NULL;
return hsv_getitem(self, i);
} else if (PySlice_Check(item)) {
- int start, stop, step, slicelength, cur, i;
+ Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@@ -1131,7 +1132,7 @@
}
static PyMappingMethods hsv_as_mapping = {
- (inquiry)hsv_length,
+ hsv_length,
(binaryfunc)hsv_subscript,
(objobjargproc)0
};
@@ -1495,14 +1496,14 @@
{ NULL, (getter)0, (setter)0 },
};
-static int
+static Py_ssize_t
hsl_length(PyObject *self)
{
return 4;
}
static PyObject *
-hsl_getitem(PyObject *self, int pos)
+hsl_getitem(PyObject *self, Py_ssize_t pos)
{
GimpHSL *hsl;
double val, scale_factor;
@@ -1553,10 +1554,10 @@
}
static PyObject *
-hsl_slice(PyObject *self, int start, int end)
+hsl_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end)
{
PyTupleObject *ret;
- int i;
+ Py_ssize_t i;
if (start < 0)
start = 0;
@@ -1576,13 +1577,13 @@
}
static PySequenceMethods hsl_as_sequence = {
- (inquiry)hsl_length,
+ hsl_length,
(binaryfunc)0,
- (intargfunc)0,
- (intargfunc)hsl_getitem,
- (intintargfunc)hsl_slice,
- (intobjargproc)hsl_setitem,
- (intintobjargproc)0,
+ 0,
+ hsl_getitem,
+ hsl_slice,
+ hsl_setitem,
+ 0,
(objobjproc)0,
};
@@ -1598,7 +1599,7 @@
return NULL;
return hsl_getitem(self, i);
} else if (PySlice_Check(item)) {
- int start, stop, step, slicelength, cur, i;
+ Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@@ -1644,7 +1645,7 @@
}
static PyMappingMethods hsl_as_mapping = {
- (inquiry)hsl_length,
+ hsl_length,
(binaryfunc)hsl_subscript,
(objobjargproc)0
};
@@ -1999,14 +2000,14 @@
{ NULL, (getter)0, (setter)0 },
};
-static int
+static Py_ssize_t
cmyk_length(PyObject *self)
{
return 5;
}
static PyObject *
-cmyk_getitem(PyObject *self, int pos)
+cmyk_getitem(PyObject *self, Py_ssize_t pos)
{
GimpCMYK *cmyk;
double val;
@@ -2059,10 +2060,10 @@
}
static PyObject *
-cmyk_slice(PyObject *self, int start, int end)
+cmyk_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end)
{
PyTupleObject *ret;
- int i;
+ Py_ssize_t i;
if (start < 0)
start = 0;
@@ -2082,13 +2083,13 @@
}
static PySequenceMethods cmyk_as_sequence = {
- (inquiry)cmyk_length,
+ cmyk_length,
(binaryfunc)0,
- (intargfunc)0,
- (intargfunc)cmyk_getitem,
- (intintargfunc)cmyk_slice,
- (intobjargproc)cmyk_setitem,
- (intintobjargproc)0,
+ 0,
+ cmyk_getitem,
+ cmyk_slice,
+ cmyk_setitem,
+ 0,
(objobjproc)0,
};
@@ -2104,7 +2105,7 @@
return NULL;
return cmyk_getitem(self, i);
} else if (PySlice_Check(item)) {
- int start, stop, step, slicelength, cur, i;
+ Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 5,
@@ -2153,7 +2154,7 @@
}
static PyMappingMethods cmyk_as_mapping = {
- (inquiry)cmyk_length,
+ cmyk_length,
(binaryfunc)cmyk_subscript,
(objobjargproc)0
};
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-display.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-display.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-display.c Sun Jul 13 12:11:51 2008
@@ -46,7 +46,7 @@
{
PyGimpDisplay *self;
- if (ID == -1) {
+ if (!gimp_display_is_valid(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-drawable.c Sun Jul 13 12:11:51 2008
@@ -1202,21 +1202,16 @@
{
PyObject *self;
- if (drawable == NULL && ID == -1) {
+ if (drawable != NULL)
+ ID = drawable->drawable_id;
+
+ if (!gimp_drawable_is_valid(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
- if (drawable != NULL)
- ID = drawable->drawable_id;
-
/* create the appropriate object type */
-
- /* avoids calling gimp_drawable_is_layer with an invalid id
- * pygimp_channel_new handles it cleanly
- */
- if (gimp_drawable_is_valid(ID) &&
- gimp_drawable_is_layer(ID))
+ if (gimp_drawable_is_layer(ID))
self = pygimp_layer_new(ID);
else
self = pygimp_channel_new(ID);
@@ -1224,6 +1219,7 @@
if (self == NULL)
return NULL;
+ if (PyObject_TypeCheck(self, &PyGimpDrawable_Type))
((PyGimpDrawable *)self)->drawable = drawable;
return self;
@@ -1692,7 +1688,7 @@
gchar *name;
name = gimp_drawable_get_name(self->ID);
- s = PyString_FromFormat("<gimp.Layer '%s'>", name);
+ s = PyString_FromFormat("<gimp.Layer '%s'>", name ? name : "(null)");
g_free(name);
return s;
@@ -1778,7 +1774,7 @@
{
PyGimpLayer *self;
- if (ID == -1) {
+ if (!gimp_drawable_is_valid(ID) || !gimp_drawable_is_layer(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
@@ -1971,7 +1967,7 @@
gchar *name;
name = gimp_drawable_get_name(self->ID);
- s = PyString_FromFormat("<gimp.Channel '%s'>", name);
+ s = PyString_FromFormat("<gimp.Channel '%s'>", name ? name : "(null)");
g_free(name);
return s;
@@ -2066,7 +2062,7 @@
{
PyGimpChannel *self;
- if (ID == -1) {
+ if (!gimp_drawable_is_valid(ID) || !gimp_drawable_is_channel(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-image.c Sun Jul 13 12:11:51 2008
@@ -1314,7 +1314,7 @@
{
PyGimpImage *self;
- if (ID == -1) {
+ if (!gimp_image_is_valid(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c Sun Jul 13 12:11:51 2008
@@ -481,6 +481,10 @@
ret[i].data.d_region.height = PyInt_AsLong(h);
break;
case GIMP_PDB_DISPLAY:
+ if (item == Py_None) {
+ ret[i].data.d_display = -1;
+ break;
+ }
check(!pygimp_display_check(item));
ret[i].data.d_display = ((PyGimpDisplay *)item)->ID;
break;
@@ -820,7 +824,7 @@
#endif
if (kwargs) {
- int len, pos;
+ Py_ssize_t len, pos;
PyObject *key, *val;
len = PyDict_Size(kwargs);
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-tile.c Sun Jul 13 12:11:51 2008
@@ -146,10 +146,10 @@
return s;
}
-static int
-tile_length(PyGimpTile *self)
+static Py_ssize_t
+tile_length(PyObject *self)
{
- return self->tile->ewidth * self->tile->eheight;
+ return ((PyGimpTile*)self)->tile->ewidth * ((PyGimpTile*)self)->tile->eheight;
}
static PyObject *
@@ -251,7 +251,7 @@
}
static PyMappingMethods tile_as_mapping = {
- (inquiry)tile_length, /*length*/
+ tile_length, /*length*/
(binaryfunc)tile_subscript, /*subscript*/
(objobjargproc)tile_ass_sub, /*ass_sub*/
};
@@ -358,8 +358,8 @@
/* Code to access pr objects as mappings */
-static int
-pr_length(PyGimpPixelRgn *self)
+static Py_ssize_t
+pr_length(PyObject *self)
{
PyErr_SetString(pygimp_error, "Can't get size of pixel region");
return -1;
@@ -371,7 +371,7 @@
GimpPixelRgn *pr = &(self->pr);
int bpp = pr->bpp;
PyObject *x, *y;
- int x1, y1, x2, y2, xs, ys;
+ Py_ssize_t x1, y1, x2, y2, xs, ys;
if (!PyTuple_Check(key) || PyTuple_Size(key) != 2) {
PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
@@ -480,7 +480,7 @@
int bpp = pr->bpp;
PyObject *x, *y;
guchar *buf;
- int len, x1, x2, xs, y1, y2, ys;
+ Py_ssize_t len, x1, x2, xs, y1, y2, ys;
if (w == NULL) {
PyErr_SetString(PyExc_TypeError, "can't delete subscripts");
@@ -592,7 +592,7 @@
}
static PyMappingMethods pr_as_mapping = {
- (inquiry)pr_length, /*mp_length*/
+ pr_length, /*mp_length*/
(binaryfunc)pr_subscript, /*mp_subscript*/
(objobjargproc)pr_ass_sub, /*mp_ass_subscript*/
};
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-vectors.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-vectors.c (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-vectors.c Sun Jul 13 12:11:51 2008
@@ -981,7 +981,7 @@
{
PyGimpVectors *self;
- if (ID == -1) {
+ if (!gimp_vectors_is_valid(ID)) {
Py_INCREF(Py_None);
return Py_None;
}
Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h (original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp.h Sun Jul 13 12:11:51 2008
@@ -27,6 +27,12 @@
#define _INSIDE_PYGIMP_
#include "pygimp-api.h"
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
G_BEGIN_DECLS
extern PyObject *pygimp_error;
Modified: branches/soc-2008-tagging/plug-ins/selection-to-path/pxl-outline.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/selection-to-path/pxl-outline.c (original)
+++ branches/soc-2008-tagging/plug-ins/selection-to-path/pxl-outline.c Sun Jul 13 12:11:51 2008
@@ -21,8 +21,6 @@
#include "config.h"
-#include <stdlib.h>
-
#include "global.h"
#include "selection-to-path.h"
#include "bitmap.h"
@@ -253,7 +251,7 @@
break;
default:
- printf ("append_coordinate: Bad edge (%d)", edge);
+ g_printerr ("append_coordinate: Bad edge (%d)", edge);
}
append_outline_pixel (o, c);
Modified: branches/soc-2008-tagging/plug-ins/uri/uri-backend-gvfs.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/uri/uri-backend-gvfs.c (original)
+++ branches/soc-2008-tagging/plug-ins/uri/uri-backend-gvfs.c Sun Jul 13 12:11:51 2008
@@ -207,7 +207,8 @@
}
gimp_progress_set_text_printf (format, done, total);
- gimp_progress_update (current_num_bytes / total_num_bytes);
+ gimp_progress_update ((gdouble) current_num_bytes /
+ (gdouble) total_num_bytes);
g_free (total);
g_free (done);
Modified: branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c (original)
+++ branches/soc-2008-tagging/plug-ins/win-snap/winsnap.c Sun Jul 13 12:11:51 2008
@@ -817,7 +817,7 @@
{
gint *toggle_val = (gint *) radio_button;
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
*toggle_val = TRUE;
else
*toggle_val = FALSE;
Modified: branches/soc-2008-tagging/po-libgimp/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po-libgimp/POTFILES.in (original)
+++ branches/soc-2008-tagging/po-libgimp/POTFILES.in Sun Jul 13 12:11:51 2008
@@ -19,6 +19,7 @@
libgimp/gimpunitcache.c
libgimpbase/gimpbaseenums.c
+libgimpbase/gimpcpuaccel.c
libgimpbase/gimpmemsize.c
libgimpbase/gimputils.c
Modified: branches/soc-2008-tagging/po/POTFILES.in
==============================================================================
--- branches/soc-2008-tagging/po/POTFILES.in (original)
+++ branches/soc-2008-tagging/po/POTFILES.in Sun Jul 13 12:11:51 2008
@@ -421,6 +421,7 @@
app/widgets/gimpselectiondata.c
app/widgets/gimpselectioneditor.c
app/widgets/gimpsettingsbox.c
+app/widgets/gimpsettingseditor.c
app/widgets/gimpsizebox.c
app/widgets/gimpstrokeeditor.c
app/widgets/gimptemplateeditor.c
Modified: branches/soc-2008-tagging/po/POTFILES.skip
==============================================================================
--- branches/soc-2008-tagging/po/POTFILES.skip (original)
+++ branches/soc-2008-tagging/po/POTFILES.skip Sun Jul 13 12:11:51 2008
@@ -1,3 +1,4 @@
+app/widgets/gtkscalebutton.c
data/tips/gimp-tips.xml.in
desktop/gimp.desktop.in
desktop/gimp.desktop.in
Modified: branches/soc-2008-tagging/themes/Default/images/stock-gegl-16.png
==============================================================================
Binary files. No diff available.
Modified: branches/soc-2008-tagging/themes/Default/images/stock-gegl-22.png
==============================================================================
Binary files. No diff available.
Modified: branches/soc-2008-tagging/themes/Default/images/stock-user-manual-64.png
==============================================================================
Binary files. No diff available.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]