[gtk+/native-layout: 329/335] Merge branch 'master' into native-layout
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout: 329/335] Merge branch 'master' into native-layout
- Date: Fri, 6 Aug 2010 17:22:09 +0000 (UTC)
commit f0b205f40ce5b8bf514b45bbc1359cfb73c41683
Merge: a564e69 e83a882
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Aug 5 14:24:42 2010 -0400
Merge branch 'master' into native-layout
Conflicts:
gtk/gtkbox.c
gtk/gtkcellrenderer.c
gtk/gtkcellrenderertext.c
gtk/gtkcellview.c
gtk/gtkcombobox.c
gtk/gtkexpander.c
gtk/gtkiconview.c
gtk/gtkplug.c
gtk/gtkscrolledwindow.c
gtk/gtksizerequest.c
gtk/gtksocket.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
tests/testheightforwidth.c
NEWS | 52 +
configure.ac | 30 +-
demos/gtk-demo/changedisplay.c | 16 +-
demos/gtk-demo/colorsel.c | 19 +-
demos/gtk-demo/combobox.c | 2 +-
demos/gtk-demo/dialog.c | 5 +-
demos/gtk-demo/drawingarea.c | 81 +-
demos/gtk-demo/entry_buffer.c | 5 +-
demos/gtk-demo/entry_completion.c | 5 +-
demos/gtk-demo/expander.c | 5 +-
demos/gtk-demo/offscreen_window.c | 14 +-
demos/gtk-demo/offscreen_window2.c | 15 +-
demos/gtk-demo/panes.c | 36 +-
demos/gtk-demo/pixbufs.c | 17 +-
demos/gtk-demo/search_entry.c | 5 +-
demos/gtk-demo/sizegroup.c | 5 +-
demos/gtk-demo/spinner.c | 5 +-
demos/pixbuf-demo.c | 22 +-
demos/testpixbuf-color.c | 2 -
demos/testpixbuf-scale.c | 13 +-
demos/testpixbuf.c | 13 +-
docs/faq/Makefile.am | 2 +
docs/reference/gdk/Makefile.am | 1 -
docs/reference/gdk/gdk3-sections.txt | 4 +-
docs/reference/gdk/tmpl/cursors.sgml | 9 +
docs/reference/gdk/tmpl/keys.sgml | 9 +
docs/reference/gtk/Makefile.am | 2 -
docs/reference/gtk/gtk-docs.sgml | 2 +-
docs/reference/gtk/gtk3-sections.txt | 5 +-
docs/reference/gtk/tmpl/.gitignore | 5 +
docs/reference/gtk/tmpl/gtkactiongroup.sgml | 401 --
docs/reference/gtk/tmpl/gtkbutton.sgml | 398 --
docs/reference/gtk/tmpl/gtkcalendar.sgml | 315 --
docs/reference/gtk/tmpl/gtkcelleditable.sgml | 83 -
docs/reference/gtk/tmpl/gtkfontsel.sgml | 5 -
docs/reference/gtk/tmpl/gtkicontheme.sgml | 4 +-
docs/reference/gtk/tmpl/gtknotebook.sgml | 6 -
docs/reference/gtk/tmpl/gtkpaned.sgml | 2 +-
docs/reference/gtk/tmpl/gtkrecentmanager.sgml | 482 --
docs/reference/gtk/tmpl/gtktable.sgml | 3 +-
docs/tools/widgets.c | 10 +-
docs/tutorial/Makefile.am | 6 +-
examples/colorsel/colorsel.c | 4 +-
gdk/Makefile.am | 83 +-
gdk/directfb/gdkcolor-directfb.c | 3 -
gdk/directfb/gdkcursor-directfb.c | 5 -
gdk/directfb/gdkdisplay-directfb.c | 6 -
gdk/directfb/gdkdnd-directfb.c | 4 -
gdk/directfb/gdkdrawable-directfb.c | 6 -
gdk/directfb/gdkevents-directfb.c | 9 -
gdk/directfb/gdkgc-directfb.c | 4 -
gdk/directfb/gdkgeometry-directfb.c | 4 -
gdk/directfb/gdkglobals-directfb.c | 4 -
gdk/directfb/gdkimage-directfb.c | 4 -
gdk/directfb/gdkinput-directfb.c | 5 -
gdk/directfb/gdkkeys-directfb.c | 24 +-
gdk/directfb/gdkmain-directfb.c | 4 -
gdk/directfb/gdkpixmap-directfb.c | 4 -
gdk/directfb/gdkproperty-directfb.c | 3 -
gdk/directfb/gdkscreen-directfb.c | 4 -
gdk/directfb/gdkselection-directfb.c | 4 -
gdk/directfb/gdkspawn-directfb.c | 4 -
gdk/directfb/gdktestutils-directfb.c | 4 -
gdk/directfb/gdkvisual-directfb.c | 4 -
gdk/directfb/gdkwindow-directfb.c | 5 -
gdk/gdk.c | 4 -
gdk/gdk.symbols | 4 +
gdk/gdkapplaunchcontext.c | 4 -
gdk/gdkcairo.c | 6 +-
gdk/gdkcolor.c | 4 -
gdk/gdkcursor.c | 20 +-
gdk/gdkcursor.h | 1 +
gdk/gdkdevice.c | 5 +-
gdk/gdkdevicemanager.c | 9 +-
gdk/gdkdisplay.c | 5 +-
gdk/gdkdisplaymanager.c | 9 +-
gdk/gdkdnd.c | 5 +-
gdk/gdkdraw.c | 9 +-
gdk/gdkenumtypes.c.template | 4 +-
gdk/gdkevents.c | 9 +-
gdk/gdkgc.c | 35 +-
gdk/gdkglobals.c | 2 +-
gdk/gdkimage.c | 4 -
gdk/gdkinternals.h | 5 +-
gdk/gdkkeynames.c | 4 -
gdk/gdkkeys.c | 5 +-
gdk/gdkkeys.h | 1 +
gdk/gdkkeyuni.c | 5 +-
gdk/gdkoffscreenwindow.c | 18 +-
gdk/gdkpango.c | 5 +-
gdk/gdkpixbuf-drawable.c | 5 +-
gdk/gdkpixbuf-render.c | 114 +-
gdk/gdkpixmap.c | 17 +-
gdk/gdkrectangle.c | 9 +-
gdk/gdkrgb.c | 4 -
gdk/gdkscreen.c | 5 +-
gdk/gdkselection.c | 5 +-
gdk/gdkvisual.c | 5 +-
gdk/gdkwindow.c | 232 +-
gdk/gdkwindow.h | 63 +-
gdk/gdkwindowimpl.c | 5 -
gdk/makefile.msc | 8 -
gdk/makegdkalias.pl | 136 -
gdk/pltcheck.sh | 17 -
gdk/quartz/gdkevents-quartz.c | 7 -
gdk/quartz/gdkkeys-quartz.c | 7 +
gdk/win32/gdkdrawable-win32.c | 42 +-
gdk/win32/gdkgc-win32.c | 31 +-
gdk/win32/gdkgeometry-win32.c | 2 +-
gdk/win32/gdkkeys-win32.c | 6 +
gdk/win32/gdkmain-win32.c | 10 +-
gdk/win32/gdkprivate-win32.h | 8 +-
gdk/win32/gdktestutils-win32.c | 2 +-
gdk/win32/gdkwindow-win32.c | 8 +-
gdk/x11/gdkapplaunchcontext-x11.c | 1 -
gdk/x11/gdkasync.c | 5 +-
gdk/x11/gdkcolor-x11.c | 5 +-
gdk/x11/gdkcursor-x11.c | 4 -
gdk/x11/gdkdevicemanager-core.c | 4 -
gdk/x11/gdkdevicemanager-xi.c | 5 -
gdk/x11/gdkdevicemanager-xi2.c | 4 -
gdk/x11/gdkdisplay-x11.c | 4 -
gdk/x11/gdkdnd-x11.c | 4 -
gdk/x11/gdkdrawable-x11.c | 6 +-
gdk/x11/gdkeventsource.c | 5 +-
gdk/x11/gdkeventtranslator.c | 5 +-
gdk/x11/gdkgc-x11.c | 4 -
gdk/x11/gdkgeometry-x11.c | 5 +-
gdk/x11/gdkglobals-x11.c | 2 +-
gdk/x11/gdkim-x11.c | 4 -
gdk/x11/gdkimage-x11.c | 6 +-
gdk/x11/gdkinput.c | 5 +-
gdk/x11/gdkkeys-x11.c | 42 +-
gdk/x11/gdkmain-x11.c | 4 -
gdk/x11/gdkpixmap-x11.c | 5 +-
gdk/x11/gdkproperty-x11.c | 5 +-
gdk/x11/gdkscreen-x11.c | 4 -
gdk/x11/gdkselection-x11.c | 5 +-
gdk/x11/gdkspawn-x11.c | 7 +-
gdk/x11/gdktestutils-x11.c | 4 -
gdk/x11/gdkvisual-x11.c | 5 +-
gdk/x11/gdkwindow-x11.c | 4 -
gdk/x11/gdkxid.c | 4 -
git.mk | 13 +-
gtk/Makefile.am | 27 +-
gtk/aliasfilescheck.sh | 11 -
gtk/gtk.symbols | 4 +-
gtk/gtkaboutdialog.c | 5 -
gtk/gtkaccelgroup.c | 5 +-
gtk/gtkaccellabel.c | 5 +-
gtk/gtkaccelmap.c | 14 +-
gtk/gtkaccessible.c | 32 +-
gtk/gtkaccessible.h | 8 +-
gtk/gtkaction.c | 10 +-
gtk/gtkaction.h | 3 +-
gtk/gtkactiongroup.c | 113 +-
gtk/gtkactiongroup.h | 54 +-
gtk/gtkactivatable.c | 4 -
gtk/gtkadjustment.c | 5 +-
gtk/gtkalignment.c | 201 +-
gtk/gtkalignment.h | 8 +-
gtk/gtkapplication.c | 89 +-
gtk/gtkapplication.h | 25 +-
gtk/gtkarrow.c | 94 +-
gtk/gtkarrow.h | 10 +-
gtk/gtkaspectframe.c | 122 +-
gtk/gtkaspectframe.h | 10 +-
gtk/gtkassistant.c | 244 +-
gtk/gtkassistant.h | 9 +-
gtk/gtkbbox.c | 225 +-
gtk/gtkbbox.h | 9 +-
gtk/gtkbin.c | 85 +-
gtk/gtkbin.h | 7 +-
gtk/gtkbindings.c | 4 -
gtk/gtkbox.c | 265 +-
gtk/gtkbox.h | 44 +-
gtk/gtkbuildable.c | 4 -
gtk/gtkbuilder.c | 5 +-
gtk/gtkbuilder.h | 2 +-
gtk/gtkbuilderparser.c | 2 +-
gtk/gtkbutton.c | 173 +-
gtk/gtkcalendar.c | 265 +-
gtk/gtkcelleditable.c | 19 +-
gtk/gtkcelllayout.c | 5 +-
gtk/gtkcellrenderer.c | 244 +-
gtk/gtkcellrenderer.h | 21 +-
gtk/gtkcellrendereraccel.c | 120 +-
gtk/gtkcellrendereraccel.h | 10 +-
gtk/gtkcellrenderercombo.c | 140 +-
gtk/gtkcellrenderercombo.h | 9 +-
gtk/gtkcellrendererpixbuf.c | 262 +-
gtk/gtkcellrendererpixbuf.h | 7 +-
gtk/gtkcellrendererprogress.c | 35 +-
gtk/gtkcellrendererprogress.h | 2 +-
gtk/gtkcellrendererspin.c | 30 +-
gtk/gtkcellrendererspin.h | 3 +
gtk/gtkcellrendererspinner.c | 16 +-
gtk/gtkcellrendererspinner.h | 2 +
gtk/gtkcellrenderertext.c | 503 ++-
gtk/gtkcellrenderertext.h | 32 +-
gtk/gtkcellrenderertoggle.c | 128 +-
gtk/gtkcellrenderertoggle.h | 7 +-
gtk/gtkcellsizerequest.c | 4 -
gtk/gtkcellview.c | 27 +-
gtk/gtkcellview.h | 2 +-
gtk/gtkcheckbutton.c | 51 +-
gtk/gtkcheckmenuitem.c | 104 +-
gtk/gtkcheckmenuitem.h | 12 +-
gtk/gtkclipboard-quartz.c | 5 +-
gtk/gtkclipboard.c | 4 -
gtk/gtkcolorbutton.c | 285 +-
gtk/gtkcolorbutton.h | 3 +-
gtk/gtkcolorsel.c | 6 -
gtk/gtkcolorsel.h | 4 +-
gtk/gtkcolorseldialog.c | 109 +-
gtk/gtkcolorseldialog.h | 7 +-
gtk/gtkcombobox.c | 167 +-
gtk/gtkcombobox.h | 2 +-
gtk/gtkcomboboxentry.c | 42 +-
gtk/gtkcomboboxentry.h | 2 +-
gtk/gtkcontainer.c | 158 +-
gtk/gtkcontainer.h | 21 +-
gtk/gtkcustompaperunixdialog.c | 30 +-
gtk/gtkcustompaperunixdialog.h | 4 +-
gtk/gtkdialog.c | 156 +-
gtk/gtkdialog.h | 7 +-
gtk/gtkdnd-quartz.c | 4 -
gtk/gtkdnd.c | 34 +-
gtk/gtkdrawingarea.c | 4 -
gtk/gtkeditable.c | 4 -
gtk/gtkentry.c | 19 +-
gtk/gtkentrybuffer.c | 4 -
gtk/gtkentrycompletion.c | 47 +-
gtk/gtkentrycompletion.h | 2 +-
gtk/gtkeventbox.c | 43 +-
gtk/gtkexpander.c | 58 +-
gtk/gtkexpander.h | 2 +-
gtk/gtkfilechooser.c | 4 -
gtk/gtkfilechooserbutton.c | 10 +-
gtk/gtkfilechooserbutton.h | 4 +-
gtk/gtkfilechooserdefault.c | 171 +-
gtk/gtkfilechooserdialog.c | 38 +-
gtk/gtkfilechooserdialog.h | 2 +-
gtk/gtkfilechooserembed.c | 1 -
gtk/gtkfilechooserentry.c | 1 -
gtk/gtkfilechoosersettings.c | 1 -
gtk/gtkfilechooserutils.c | 2 +-
gtk/gtkfilechooserwidget.c | 4 -
gtk/gtkfilechooserwidget.h | 2 +-
gtk/gtkfilefilter.c | 5 -
gtk/gtkfilesystem.c | 2 -
gtk/gtkfilesystemmodel.c | 1 -
gtk/gtkfixed.c | 73 +-
gtk/gtkfixed.h | 5 +-
gtk/gtkfontbutton.c | 13 +-
gtk/gtkfontbutton.h | 2 +-
gtk/gtkfontsel.c | 476 ++-
gtk/gtkfontsel.h | 40 +-
gtk/gtkframe.c | 254 +-
gtk/gtkframe.h | 10 +-
gtk/gtkgc.c | 4 -
gtk/gtkhandlebox.c | 527 ++-
gtk/gtkhandlebox.h | 22 +-
gtk/gtkhbbox.c | 4 -
gtk/gtkhbox.c | 4 -
gtk/gtkhpaned.c | 5 +-
gtk/gtkhruler.c | 5 +-
gtk/gtkhscale.c | 4 -
gtk/gtkhscrollbar.c | 5 +-
gtk/gtkhseparator.c | 5 +-
gtk/gtkhsv.c | 181 +-
gtk/gtkhsv.h | 9 +-
gtk/gtkiconcache.c | 1 -
gtk/gtkiconfactory.c | 42 +-
gtk/gtkiconfactory.h | 7 +-
gtk/gtkicontheme.c | 11 +-
gtk/gtkicontheme.h | 2 +-
gtk/gtkiconview.c | 75 +-
gtk/gtkiconview.h | 3 +-
gtk/gtkimage.c | 784 ++--
gtk/gtkimage.h | 25 +-
gtk/gtkimagemenuitem.c | 186 +-
gtk/gtkimagemenuitem.h | 4 +-
gtk/gtkimcontext.c | 4 -
gtk/gtkimcontextsimple.c | 242 +-
gtk/gtkimcontextsimple.h | 11 +-
gtk/gtkimmodule.c | 1 -
gtk/gtkimmulticontext.c | 155 +-
gtk/gtkimmulticontext.h | 7 +-
gtk/gtkinfobar.c | 34 +-
gtk/gtkinvisible.c | 53 +-
gtk/gtkinvisible.h | 5 +-
gtk/gtkitem.c | 4 -
gtk/gtkkeyhash.c | 1 -
gtk/gtklabel.c | 1216 +++---
gtk/gtklabel.h | 27 +-
gtk/gtklayout.c | 298 +-
gtk/gtklayout.h | 22 +-
gtk/gtklinkbutton.c | 12 +-
gtk/gtklinkbutton.h | 2 +-
gtk/gtkliststore.c | 446 ++-
gtk/gtkliststore.h | 15 +-
gtk/gtkmain.c | 4 -
gtk/gtkmenu.c | 69 +-
gtk/gtkmenubar.c | 54 +-
gtk/gtkmenubar.h | 8 +-
gtk/gtkmenuitem.c | 105 +-
gtk/gtkmenushell.c | 45 +-
gtk/gtkmenutoolbutton.c | 12 +-
gtk/gtkmenutoolbutton.h | 2 +-
gtk/gtkmessagedialog.c | 145 +-
gtk/gtkmessagedialog.h | 9 +-
gtk/gtkmisc.c | 118 +-
gtk/gtkmisc.h | 8 +-
gtk/gtkmnemonichash.c | 1 -
gtk/gtkmodules.c | 1 -
gtk/gtkmountoperation-x11.c | 3 -
gtk/gtkmountoperation.c | 16 +-
gtk/gtknotebook.c | 1509 ++++---
gtk/gtknotebook.h | 38 +-
gtk/gtkobject.c | 6 -
gtk/gtkoffscreenwindow.c | 30 +-
gtk/gtkorientable.c | 4 -
gtk/gtkpagesetup.c | 4 -
gtk/gtkpagesetupunixdialog.c | 26 +-
gtk/gtkpagesetupunixdialog.h | 4 +-
gtk/gtkpaned.c | 799 ++--
gtk/gtkpaned.h | 31 +-
gtk/gtkpapersize.c | 5 -
gtk/gtkpathbar.c | 17 +-
gtk/gtkplug-stub.c | 1 -
gtk/gtkplug-win32.c | 1 -
gtk/gtkplug-x11.c | 1 -
gtk/gtkplug.c | 42 +-
gtk/gtkprint-win32.c | 5 -
gtk/gtkprintbackend.c | 23 +-
gtk/gtkprintcontext.c | 5 -
gtk/gtkprinter.c | 13 +-
gtk/gtkprinter.h | 3 +-
gtk/gtkprinteroption.c | 5 -
gtk/gtkprinteroptionset.c | 5 -
gtk/gtkprinteroptionwidget.c | 4 -
gtk/gtkprintjob.c | 5 -
gtk/gtkprintoperation-unix.c | 5 +-
gtk/gtkprintoperation-win32.c | 6 +-
gtk/gtkprintoperation.c | 9 +-
gtk/gtkprintoperation.h | 3 +-
gtk/gtkprintoperationpreview.c | 5 -
gtk/gtkprintsettings.c | 5 -
gtk/gtkprintunixdialog.c | 48 +-
gtk/gtkprintunixdialog.h | 3 +-
gtk/gtkprintutils.c | 1 -
gtk/gtkprogressbar.c | 422 +-
gtk/gtkprogressbar.h | 25 +-
gtk/gtkquartz.c | 1 -
gtk/gtkradioaction.c | 29 +-
gtk/gtkradioaction.h | 3 +-
gtk/gtkradiobutton.c | 112 +-
gtk/gtkradiobutton.h | 4 +-
gtk/gtkradiomenuitem.c | 94 +-
gtk/gtkradiomenuitem.h | 4 +-
gtk/gtkradiotoolbutton.c | 5 +-
gtk/gtkrange.c | 7 +-
gtk/gtkrbtree.c | 1 -
gtk/gtkrc.c | 5 -
gtk/gtkrecentaction.c | 33 +-
gtk/gtkrecentaction.h | 2 +-
gtk/gtkrecentchooser.c | 5 -
gtk/gtkrecentchooserdefault.c | 2 +-
gtk/gtkrecentchooserdialog.c | 32 +-
gtk/gtkrecentchooserdialog.h | 4 +-
gtk/gtkrecentchoosermenu.c | 20 +-
gtk/gtkrecentchoosermenu.h | 4 +-
gtk/gtkrecentchooserutils.c | 1 -
gtk/gtkrecentchooserwidget.c | 5 -
gtk/gtkrecentchooserwidget.h | 4 +-
gtk/gtkrecentfilter.c | 5 -
gtk/gtkrecentmanager.c | 173 +-
gtk/gtkrecentmanager.h | 35 +-
gtk/gtkruler.c | 275 +-
gtk/gtkruler.h | 18 +-
gtk/gtkscale.c | 135 +-
gtk/gtkscale.h | 6 +-
gtk/gtkscalebutton.c | 43 +-
gtk/gtkscalebutton.h | 5 +-
gtk/gtkscrollbar.c | 5 -
gtk/gtkscrolledwindow.c | 94 +-
gtk/gtkselection.c | 5 -
gtk/gtkseparator.c | 6 -
gtk/gtkseparatormenuitem.c | 5 -
gtk/gtkseparatortoolitem.c | 217 +-
gtk/gtkseparatortoolitem.h | 2 +-
gtk/gtksettings.c | 5 -
gtk/gtkshow.c | 7 -
gtk/gtksizegroup.c | 133 +-
gtk/gtksizegroup.h | 11 +-
gtk/gtksizerequest.c | 15 +-
gtk/gtksizerequest.h | 25 +
gtk/gtksizerequestprivate.h | 45 -
gtk/gtksocket-stub.c | 1 -
gtk/gtksocket-win32.c | 1 -
gtk/gtksocket-x11.c | 1 -
gtk/gtksocket.c | 12 +-
gtk/gtkspinbutton.c | 581 ++-
gtk/gtkspinbutton.h | 26 +-
gtk/gtkspinner.c | 14 +-
gtk/gtkspinner.h | 2 +
gtk/gtkstatusbar.c | 318 +-
gtk/gtkstatusbar.h | 21 +-
gtk/gtkstatusicon.c | 19 +-
gtk/gtkstatusicon.h | 2 +-
gtk/gtkstock.c | 7 +-
gtk/gtkstock.h | 2 +-
gtk/gtkstyle.c | 165 +-
gtk/gtkstyle.h | 1 -
gtk/gtktable.c | 685 ++--
gtk/gtktable.h | 11 +-
gtk/gtktearoffmenuitem.c | 46 +-
gtk/gtktearoffmenuitem.h | 4 +-
gtk/gtktestutils.c | 25 +-
gtk/gtktextbtree.c | 4 -
gtk/gtktextbuffer.c | 203 +-
gtk/gtktextbuffer.h | 18 +-
gtk/gtktextbufferrichtext.c | 4 -
gtk/gtktextbufferserialize.c | 17 +-
gtk/gtktextchild.c | 4 -
gtk/gtktextdisplay.c | 185 +-
gtk/gtktextiter.c | 5 +-
gtk/gtktextlayout.c | 4 -
gtk/gtktextmark.c | 5 +-
gtk/gtktextsegment.c | 4 -
gtk/gtktexttag.c | 4 -
gtk/gtktexttagtable.c | 4 -
gtk/gtktexttypes.c | 4 -
gtk/gtktextutil.c | 56 +-
gtk/gtktextview.c | 1922 +++++----
gtk/gtktextview.h | 91 +-
gtk/gtkthemes.c | 5 +-
gtk/gtktoggleaction.c | 32 +-
gtk/gtktoggleaction.h | 7 +-
gtk/gtktoggleactionprivate.h | 43 -
gtk/gtktogglebutton.c | 7 +-
gtk/gtktoggletoolbutton.c | 11 +-
gtk/gtktoggletoolbutton.h | 2 +-
gtk/gtktoolbar.c | 89 +-
gtk/gtktoolbutton.c | 61 +-
gtk/gtktoolbutton.h | 2 +-
gtk/gtktoolitem.c | 34 +-
gtk/gtktoolitem.h | 2 +-
gtk/gtktoolitemgroup.c | 19 +-
gtk/gtktoolpalette.c | 18 +-
gtk/gtktoolshell.c | 5 +-
gtk/gtktooltip.c | 7 +-
gtk/gtktrayicon-x11.c | 10 +-
gtk/gtktreedatalist.c | 1 -
gtk/gtktreednd.c | 4 -
gtk/gtktreemodel.c | 22 +-
gtk/gtktreemodelfilter.c | 13 +-
gtk/gtktreemodelfilter.h | 2 +-
gtk/gtktreemodelsort.c | 9 +-
gtk/gtktreeprivate.h | 6 +-
gtk/gtktreeselection.c | 9 +-
gtk/gtktreesortable.c | 5 +-
gtk/gtktreestore.c | 19 +-
gtk/gtktreeview.c | 389 +-
gtk/gtktreeview.h | 3 +-
gtk/gtktreeviewcolumn.c | 202 +-
gtk/gtktypebuiltins.c.template | 4 +-
gtk/gtktypeutils.c | 5 +-
gtk/gtkuimanager.c | 9 +-
gtk/gtkuimanager.h | 3 +-
gtk/gtkvbbox.c | 6 +-
gtk/gtkvbox.c | 5 +-
gtk/gtkviewport.c | 205 +-
gtk/gtkviewport.h | 8 +-
gtk/gtkvolumebutton.c | 20 +-
gtk/gtkvpaned.c | 5 +-
gtk/gtkvruler.c | 5 +-
gtk/gtkvscale.c | 5 +-
gtk/gtkvscrollbar.c | 5 +-
gtk/gtkvseparator.c | 5 +-
gtk/gtkwidget.c | 49 +-
gtk/gtkwidget.h | 1 +
gtk/gtkwin32embed.c | 1 -
gtk/gtkwin32embedwidget.c | 4 -
gtk/gtkwindow-decorate.c | 80 +-
gtk/gtkwindow.c | 144 +-
gtk/gtkwindow.h | 2 +-
gtk/gtkxembed.c | 2 +-
gtk/makefile.msc.in | 8 +-
gtk/makegtkalias.pl | 143 -
gtk/pltcheck.sh | 17 -
gtk/tests/builder.c | 36 +-
gtk/tests/expander.c | 4 +-
gtk/tests/testing.c | 27 +-
modules/engines/pixbuf/pixbuf-render.c | 69 +-
modules/input/gtkimcontextxim.c | 27 +-
modules/other/gail/gail.c | 12 +-
modules/other/gail/gailbox.c | 2 +-
modules/other/gail/gailbutton.c | 88 +-
modules/other/gail/gailcheckmenuitem.c | 4 +-
modules/other/gail/gailchecksubmenuitem.c | 4 +-
modules/other/gail/gailcombobox.c | 37 +-
modules/other/gail/gailcontainer.c | 5 +-
modules/other/gail/gailentry.c | 65 +-
modules/other/gail/gailexpander.c | 36 +-
modules/other/gail/gailframe.c | 2 +-
modules/other/gail/gailimage.c | 12 +-
modules/other/gail/gailimagecell.c | 2 +-
modules/other/gail/gailitem.c | 24 +-
modules/other/gail/gaillabel.c | 42 +-
modules/other/gail/gailmenu.c | 4 +-
modules/other/gail/gailmenuitem.c | 27 +-
modules/other/gail/gailmenushell.c | 12 +-
modules/other/gail/gailnotebook.c | 41 +-
modules/other/gail/gailnotebookpage.c | 8 +-
modules/other/gail/gailnotebookpage.h | 4 +
modules/other/gail/gailpaned.c | 18 +-
modules/other/gail/gailradiobutton.c | 2 +-
modules/other/gail/gailradiomenuitem.c | 2 +-
modules/other/gail/gailradiosubmenuitem.c | 2 +-
modules/other/gail/gailrange.c | 13 +-
modules/other/gail/gailscale.c | 22 +-
modules/other/gail/gailscalebutton.c | 12 +-
modules/other/gail/gailscrollbar.c | 2 +-
modules/other/gail/gailscrolledwindow.c | 40 +-
modules/other/gail/gailseparator.c | 2 +-
modules/other/gail/gailspinbutton.c | 14 +-
modules/other/gail/gailstatusbar.c | 31 +-
modules/other/gail/gailsubmenuitem.c | 12 +-
modules/other/gail/gailtextcell.c | 158 +-
modules/other/gail/gailtextview.c | 96 +-
modules/other/gail/gailtogglebutton.c | 2 +-
modules/other/gail/gailtoplevel.c | 11 +-
modules/other/gail/gailtreeview.c | 79 +-
modules/other/gail/gailutil.c | 4 +-
modules/other/gail/gailwidget.c | 44 +-
modules/other/gail/gailwindow.c | 20 +-
modules/other/gail/libgail-util/gailmisc.c | 2 +-
modules/other/gail/libgail-util/gailmisc.h | 2 +-
modules/other/gail/tests/ferret.c | 28 +-
modules/other/gail/tests/testaction.c | 2 +-
modules/other/gail/tests/testbutton.c | 2 +-
modules/other/gail/tests/testcombo.c | 2 +-
modules/other/gail/tests/testimage.c | 23 +-
modules/other/gail/tests/testlib.c | 6 +-
modules/other/gail/tests/testmenuitem.c | 6 +-
modules/other/gail/tests/testnotebook.c | 9 +-
modules/other/gail/tests/testobject.c | 4 +-
modules/other/gail/tests/testpaned.c | 2 +-
modules/other/gail/tests/testselection.c | 2 +-
modules/other/gail/tests/testtext.c | 5 +-
modules/printbackends/cups/gtkprintbackendcups.c | 4 +-
po-properties/br.po | 4426 +++++++++---------
po-properties/de.po | 5374 ++++++++++------------
po-properties/es.po | 3228 +++++++-------
po-properties/gl.po | 3445 +++++++-------
po-properties/he.po | 3217 +++++++-------
po-properties/ro.po | 3759 ++++++++--------
po-properties/sl.po | 4923 ++++++++++----------
po-properties/zh_CN.po | 3803 ++++++++--------
po-properties/zh_HK.po | 3795 ++++++++--------
po-properties/zh_TW.po | 3686 ++++++++--------
po/POTFILES.in | 6 +
po/ast.po | 1753 ++++----
po/cs.po | 1730 ++++----
po/de.po | 1794 ++++----
po/eo.po | 1883 ++++----
po/es.po | 1743 ++++----
po/et.po | 1257 +-----
po/gl.po | 1728 ++++----
po/he.po | 785 ++--
po/id.po | 2226 ++++------
po/kk.po | 2724 ++++++-----
po/nb.po | 1799 ++++----
po/ro.po | 1738 ++++----
po/sl.po | 1903 ++++----
po/zh_CN.po | 1774 ++++----
po/zh_HK.po | 1756 ++++----
po/zh_TW.po | 1721 ++++----
tests/gtkoffscreenbox.c | 14 +-
tests/prop-editor.c | 6 +-
tests/testassistant.c | 4 +-
tests/testcombochange.c | 7 +-
tests/testfilechooserbutton.c | 15 +-
tests/testframe.c | 23 +-
tests/testgtk.c | 571 ++-
tests/testinput.c | 71 +-
tests/testmenubars.c | 10 +-
tests/testmultidisplay.c | 14 +-
tests/testoffscreen.c | 47 +-
tests/testrgb.c | 12 +-
tests/testselection.c | 13 +-
tests/teststatusicon.c | 9 +-
tests/testtooltips.c | 5 +-
tests/testtreeflow.c | 2 +-
tests/testwindows.c | 19 +-
597 files changed, 46768 insertions(+), 49204 deletions(-)
---
diff --cc gtk/gtkcellrenderer.c
index 793cd02,17744e8..f57715e
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@@ -24,10 -23,8 +24,10 @@@
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#include "gtktreeprivate.h"
- #include "gtkalias.h"
+
+static void gtk_cell_renderer_init (GtkCellRenderer *cell);
+static void gtk_cell_renderer_class_init (GtkCellRendererClass *class);
static void gtk_cell_renderer_get_property (GObject *object,
guint param_id,
GValue *value,
@@@ -39,34 -36,26 +39,48 @@@ static void gtk_cell_renderer_set_prope
static void set_cell_bg_color (GtkCellRenderer *cell,
GdkColor *color);
+/* Fallback GtkCellSizeRequest implementation to use remaining ->get_size() implementations */
+static void gtk_cell_renderer_cell_size_request_init (GtkCellSizeRequestIface *iface);
+static void gtk_cell_renderer_get_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_cell_renderer_get_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_cell_renderer_get_height_for_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
+static void gtk_cell_renderer_get_width_for_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+
+
- #define GTK_CELL_RENDERER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRendererPrivate))
-
- typedef struct _GtkCellRendererPrivate GtkCellRendererPrivate;
- struct _GtkCellRendererPrivate
+ struct _GtkCellRendererPriv
{
+ gfloat xalign;
+ gfloat yalign;
+
+ gint width;
+ gint height;
+
+ guint16 xpad;
+ guint16 ypad;
+
+ guint mode : 2;
+ guint visible : 1;
+ guint is_expander : 1;
+ guint is_expanded : 1;
+ guint cell_background_set : 1;
+ guint sensitive : 1;
+ guint editing : 1;
+
GdkColor cell_background;
};
@@@ -1028,130 -1035,3 +1093,131 @@@ gtk_cell_renderer_stop_editing (GtkCell
g_signal_emit (cell, cell_renderer_signals[EDITING_CANCELED], 0);
}
}
+
+static void
+gtk_cell_renderer_cell_size_request_init (GtkCellSizeRequestIface *iface)
+{
+ iface->get_width = gtk_cell_renderer_get_width;
+ iface->get_height = gtk_cell_renderer_get_height;
+
+ iface->get_width_for_height = gtk_cell_renderer_get_width_for_height;
+ iface->get_height_for_width = gtk_cell_renderer_get_height_for_width;
+}
+
+static void
+gtk_cell_renderer_get_desired_size (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkRequisition min_req;
+
+ /* Fallback on the old API to get the size. */
+ if (GTK_CELL_RENDERER_GET_CLASS (cell)->get_size)
+ GTK_CELL_RENDERER_GET_CLASS (cell)->get_size (GTK_CELL_RENDERER (cell), widget, NULL, NULL, NULL,
+ &min_req.width, &min_req.height);
+ else
+ {
+ min_req.width = 0;
+ min_req.height = 0;
+ }
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ if (minimum_size)
+ *minimum_size = min_req.width;
+
+ if (natural_size)
+ *natural_size = min_req.width;
+ }
+ else
+ {
+ if (minimum_size)
+ *minimum_size = min_req.height;
+
+ if (natural_size)
+ *natural_size = min_req.height;
+ }
+}
+
+static void
+gtk_cell_renderer_get_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_cell_renderer_get_desired_size (cell, widget, GTK_ORIENTATION_HORIZONTAL,
+ minimum_size, natural_size);
+}
+
+static void
+gtk_cell_renderer_get_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_cell_renderer_get_desired_size (cell, widget, GTK_ORIENTATION_VERTICAL,
+ minimum_size, natural_size);
+}
+
+
+static void
+gtk_cell_renderer_get_height_for_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ /* Fall back on the height reported from ->get_size() */
+ gtk_cell_size_request_get_height (cell, widget, minimum_height, natural_height);
+}
+
+static void
+gtk_cell_renderer_get_width_for_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
+{
+ /* Fall back on the width reported from ->get_size() */
+ gtk_cell_size_request_get_width (cell, widget, minimum_width, natural_width);
+}
+
+/* An internal convenience function for some containers to peek at the
+ * cell alignment in a target allocation (used to draw focus and align
+ * cells in the icon view).
+ *
+ * Note this is only a trivial 'align * (allocation - request)' operation.
+ */
+void
+_gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
+ const GdkRectangle *cell_area,
+ GtkTextDirection direction,
+ gint width,
+ gint height,
+ gint *x_offset,
+ gint *y_offset)
+{
++ GtkCellRendererPriv *priv;
++
+ g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
+ g_return_if_fail (cell_area != NULL);
+ g_return_if_fail (x_offset || y_offset);
+
++ priv = cell->priv;
++
+ if (x_offset)
+ {
+ *x_offset = (((direction == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) *
++ (1.0 - priv->xalign) : priv->xalign) *
+ (cell_area->width - width));
+ *x_offset = MAX (*x_offset, 0);
+ }
+ if (y_offset)
+ {
- *y_offset = (cell->yalign *
++ *y_offset = (priv->yalign *
+ (cell_area->height - height));
+ *y_offset = MAX (*y_offset, 0);
+ }
+}
-
- #define __GTK_CELL_RENDERER_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtkcellrenderertext.c
index c2df04b,46c5211..11dbb6c
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@@ -132,36 -123,53 +132,55 @@@ static guint text_cell_renderer_signal
#define GTK_CELL_RENDERER_TEXT_PATH "gtk-cell-renderer-text-path"
- #define GTK_CELL_RENDERER_TEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererTextPrivate))
-
- typedef struct _GtkCellRendererTextPrivate GtkCellRendererTextPrivate;
- struct _GtkCellRendererTextPrivate
+ struct _GtkCellRendererTextPriv
{
- guint single_paragraph : 1;
- guint language_set : 1;
- guint markup_set : 1;
- guint ellipsize_set : 1;
- guint align_set : 1;
-
- gulong focus_out_id;
- PangoLanguage *language;
- PangoEllipsizeMode ellipsize;
- PangoWrapMode wrap_mode;
- PangoAlignment align;
-
- gulong populate_popup_id;
- gulong entry_menu_popdown_timeout;
+ GtkWidget *entry;
+
+ PangoAlignment align;
+ PangoAttrList *extra_attrs;
+ PangoColor foreground;
+ PangoColor background;
+ PangoEllipsizeMode ellipsize;
+ PangoFontDescription *font;
+ PangoLanguage *language;
+ PangoUnderline underline_style;
+ PangoWrapMode wrap_mode;
+
gboolean in_entry_menu;
-
+
+ gchar *text;
+
+ gdouble font_scale;
+
+ gint rise;
+ gint fixed_height_rows;
gint width_chars;
gint wrap_width;
-
- GtkWidget *entry;
+
+ guint strikethrough : 1;
+ guint editable : 1;
+ guint scale_set : 1;
+ guint foreground_set : 1;
+ guint background_set : 1;
+ guint underline_set : 1;
+ guint rise_set : 1;
+ guint strikethrough_set : 1;
+ guint editable_set : 1;
+ guint calc_fixed_height : 1;
+ guint single_paragraph : 1;
+ guint language_set : 1;
+ guint markup_set : 1;
+ guint ellipsize_set : 1;
+ guint align_set : 1;
+
+ gulong focus_out_id;
+ gulong populate_popup_id;
+ gulong entry_menu_popdown_timeout;
};
-G_DEFINE_TYPE (GtkCellRendererText, gtk_cell_renderer_text, GTK_TYPE_CELL_RENDERER)
+G_DEFINE_TYPE_WITH_CODE (GtkCellRendererText, gtk_cell_renderer_text, GTK_TYPE_CELL_RENDERER,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_SIZE_REQUEST,
+ gtk_cell_renderer_text_cell_size_request_init))
static void
gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
@@@ -1372,26 -1382,24 +1392,27 @@@ add_attr (PangoAttrList *attr_list
static PangoLayout*
get_layout (GtkCellRendererText *celltext,
GtkWidget *widget,
- gboolean will_render,
+ GdkRectangle *cell_area,
GtkCellRendererState flags)
{
+ GtkCellRendererTextPriv *priv = celltext->priv;
PangoAttrList *attr_list;
PangoLayout *layout;
PangoUnderline uline;
- GtkCellRendererTextPrivate *priv;
++ gint xpad;
- priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
-
- layout = gtk_widget_create_pango_layout (widget, celltext->text);
+ layout = gtk_widget_create_pango_layout (widget, priv->text);
- if (celltext->extra_attrs)
- attr_list = pango_attr_list_copy (celltext->extra_attrs);
+ if (priv->extra_attrs)
+ attr_list = pango_attr_list_copy (priv->extra_attrs);
else
attr_list = pango_attr_list_new ();
pango_layout_set_single_paragraph_mode (layout, priv->single_paragraph);
- if (will_render)
++ gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (celltext), &xpad, NULL);
++
+ if (cell_area)
{
/* Add options that affect appearance but not size */
@@@ -1459,12 -1467,7 +1480,12 @@@
if (priv->wrap_width != -1)
{
- pango_layout_set_width (layout, priv->wrap_width * PANGO_SCALE);
+ if (cell_area)
+ pango_layout_set_width (layout,
- (cell_area->width - GTK_CELL_RENDERER (celltext)->xpad * 2) * PANGO_SCALE);
++ (cell_area->width - xpad * 2) * PANGO_SCALE);
+ else
+ pango_layout_set_width (layout, priv->wrap_width * PANGO_SCALE);
+
pango_layout_set_wrap (layout, priv->wrap_mode);
}
else
@@@ -1620,19 -1644,18 +1649,18 @@@ gtk_cell_renderer_text_render (GtkCellR
GtkCellRendererState flags)
{
- GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
+ GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
+ GtkCellRendererTextPriv *priv = celltext->priv;
PangoLayout *layout;
GtkStateType state;
-- gint x_offset;
-- gint y_offset;
- GtkCellRendererTextPrivate *priv;
-
- priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
++ gint x_offset = 0;
++ gint y_offset = 0;
+ gint xpad, ypad;
- layout = get_layout (celltext, widget, TRUE, flags);
+ layout = get_layout (celltext, widget, cell_area, flags);
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
- if (!cell->sensitive)
+ if (!gtk_cell_renderer_get_sensitive (cell))
{
state = GTK_STATE_INSENSITIVE;
}
@@@ -1927,152 -1961,7 +1966,148 @@@ gtk_cell_renderer_text_set_fixed_height
}
else
{
- renderer->fixed_height_rows = number_of_rows;
- renderer->calc_fixed_height = TRUE;
+ priv->fixed_height_rows = number_of_rows;
+ priv->calc_fixed_height = TRUE;
}
}
+
+static void
+gtk_cell_renderer_text_cell_size_request_init (GtkCellSizeRequestIface *iface)
+{
+ iface->get_width = gtk_cell_renderer_text_get_width;
+ iface->get_height = gtk_cell_renderer_text_get_height;
+ iface->get_height_for_width = gtk_cell_renderer_text_get_height_for_width;
+}
+
+static void
+gtk_cell_renderer_text_get_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
- GtkCellRendererTextPrivate *priv;
++ GtkCellRendererTextPriv *priv;
+ GtkCellRendererText *celltext;
+ PangoLayout *layout;
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+ PangoRectangle rect;
+ gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, guess_width, xpad;
+
+ /* "width-chars" Hard-coded minimum width:
+ * - minimum size should be MAX (width-chars, strlen ("..."));
+ * - natural size should be MAX (width-chars, strlen (label->text));
+ *
+ * "wrap-width" User specified natural wrap width
+ * - minimum size should be MAX (width-chars, 0)
+ * - natural size should be MIN (wrap-width, strlen (label->text))
+ */
+
+ celltext = GTK_CELL_RENDERER_TEXT (cell);
- priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
- xpad = GTK_CELL_RENDERER (cell)->xpad;
++ priv = celltext->priv;
++
++ gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (cell), &xpad, NULL);
+
+ layout = get_layout (celltext, widget, NULL, 0);
+
+ /* Get the layout with the text possibly wrapping at wrap_width */
+ pango_layout_get_pixel_extents (layout, NULL, &rect);
+ guess_width = rect.width;
+
+ /* Fetch the length of the complete unwrapped text */
+ pango_layout_set_width (layout, -1);
+ pango_layout_get_extents (layout, NULL, &rect);
+ text_width = rect.width;
+
+ /* Fetch the average size of a charachter */
+ context = pango_layout_get_context (layout);
+ metrics = pango_context_get_metrics (context, widget->style->font_desc,
+ pango_context_get_language (context));
+
+ char_width = pango_font_metrics_get_approximate_char_width (metrics);
+ digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
+ char_pixels = MAX (char_width, digit_width);
+
+ pango_font_metrics_unref (metrics);
+ g_object_unref (layout);
+
+ /* enforce minimum width for ellipsized labels at ~3 chars */
+ if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
+ ellipsize_chars = 3;
+ else
+ ellipsize_chars = 0;
+
+ if (minimum_size)
+ {
+ if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->width_chars > 0)
+ *minimum_size =
+ xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, ellipsize_chars));
+ /* If no width-chars set, minimum for wrapping text will be the wrap-width */
+ else if (priv->wrap_width > -1)
+ *minimum_size = xpad * 2 + rect.x + priv->wrap_width;
+ else
+ *minimum_size = xpad * 2 + rect.x + guess_width;
+ }
+
+ if (natural_size)
+ {
+ if (priv->wrap_width > -1)
+ *natural_size = xpad * 2 +
+ MIN (priv->wrap_width, PANGO_PIXELS (text_width));
+ else /* Natural size is full text here regardless of ellipsize */
+ *natural_size = xpad * 2 +
+ MAX ((PANGO_PIXELS (char_width) * priv->width_chars), PANGO_PIXELS (text_width));
+ }
+}
+
+static void
+gtk_cell_renderer_text_get_height_for_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
+{
- GtkCellRendererTextPrivate *priv;
++ GtkCellRendererTextPriv *priv;
+ GtkCellRendererText *celltext;
+ PangoLayout *layout;
+ gint text_height, xpad, ypad;
+
+
+ celltext = GTK_CELL_RENDERER_TEXT (cell);
- priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
++ priv = celltext->priv;
+
- xpad = GTK_CELL_RENDERER (cell)->xpad;
- ypad = GTK_CELL_RENDERER (cell)->ypad;
++ gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (cell), &xpad, &ypad);
+
+ layout = get_layout (celltext, widget, FALSE, 0);
+
+ pango_layout_set_width (layout, (width - xpad * 2) * PANGO_SCALE);
+ pango_layout_get_pixel_size (layout, NULL, &text_height);
+
+ if (minimum_height)
+ *minimum_height = text_height + ypad * 2;
+
+ if (natural_height)
+ *natural_height = text_height + ypad * 2;
+
+ g_object_unref (layout);
+}
+
+static void
+gtk_cell_renderer_text_get_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gint min_width;
+
+ /* Thankfully cell renderers dont rotate, so they only have to do
+ * height-for-width and not the opposite. Here we have only to return
+ * the height for the base minimum width of the renderer.
+ *
+ * Note this code path wont be followed by GtkTreeView which is
+ * height-for-width specifically.
+ */
+ gtk_cell_size_request_get_width (cell, widget, &min_width, NULL);
+ gtk_cell_renderer_text_get_height_for_width (cell, widget, min_width,
+ minimum_size, natural_size);
+}
+
-
-
- #define __GTK_CELL_RENDERER_TEXT_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtkcellsizerequest.c
index 9274bb3,0000000..42c0613
mode 100644,000000..100644
--- a/gtk/gtkcellsizerequest.c
+++ b/gtk/gtkcellsizerequest.c
@@@ -1,340 -1,0 +1,336 @@@
+/* gtkcellsizerequest.c
+ * Copyright (C) 2010 Openismus GmbH
+ *
+ * Author:
+ * Tristan Van Berkom <tristan van berkom gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#include <config.h>
+#include "gtkcellrenderer.h"
+#include "gtkcellsizerequest.h"
+#include "gtkintl.h"
- #include "gtkalias.h"
+
+
+#define DEBUG_CELL_SIZE_REQUEST 0
+
+GType
+gtk_cell_size_request_get_type (void)
+{
+ static GType cell_size_request_type = 0;
+
+ if (G_UNLIKELY(!cell_size_request_type))
+ {
+ cell_size_request_type =
+ g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkCellSizeRequest"),
+ sizeof (GtkCellSizeRequestIface),
+ NULL, 0, NULL, 0);
+
+ g_type_interface_add_prerequisite (cell_size_request_type, GTK_TYPE_CELL_RENDERER);
+ }
+ return cell_size_request_type;
+}
+
+/**
+ * gtk_cell_size_request_get_request_mode:
+ * @cell: a #GtkCellSizeRequest instance
+ *
+ * Gets whether the cell renderer prefers a height-for-width layout
+ * or a width-for-height layout.
+ *
+ * Returns: The #GtkSizeRequestMode preferred by this renderer.
+ *
+ * Since: 3.0
+ */
+GtkSizeRequestMode
+gtk_cell_size_request_get_request_mode (GtkCellSizeRequest *cell)
+{
+ GtkCellSizeRequestIface *iface;
+
+ g_return_val_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell), FALSE);
+
+ iface = GTK_CELL_SIZE_REQUEST_GET_IFACE (cell);
+ if (iface->get_request_mode)
+ return iface->get_request_mode (cell);
+
+ /* By default cell renderers are height-for-width. */
+ return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
+}
+
+/**
+ * gtk_cell_size_request_get_width:
+ * @cell: a #GtkCellSizeRequest instance
+ * @widget: the #GtkWidget this cell will be rendering to
+ * @minimum_size: location to store the minimum size, or %NULL
+ * @natural_size: location to store the natural size, or %NULL
+ *
+ * Retreives a renderer's natural size when rendered to @widget.
+ *
+ * Since: 3.0
+ */
+void
+gtk_cell_size_request_get_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkCellSizeRequestIface *iface;
+ gint width;
+
+ g_return_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell));
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (NULL != minimum_size || NULL != natural_size);
+
+ gtk_cell_renderer_get_fixed_size (GTK_CELL_RENDERER (cell), &width, NULL);
+
+ if (width < 0)
+ {
+ iface = GTK_CELL_SIZE_REQUEST_GET_IFACE (cell);
+ iface->get_width (cell, widget, minimum_size, natural_size);
+ }
+ else
+ {
+ if (minimum_size)
+ *minimum_size = width;
+ if (natural_size)
+ *natural_size = width;
+ }
+
+#if DEBUG_CELL_SIZE_REQUEST
+ g_message ("%s returning minimum width: %d and natural width: %d",
+ G_OBJECT_TYPE_NAME (cell),
+ minimum_size ? *minimum_size : 20000,
+ natural_size ? *natural_size : 20000);
+#endif
+}
+
+
+/**
+ * gtk_cell_size_request_get_height:
+ * @cell: a #GtkCellSizeRequest instance
+ * @widget: the #GtkWidget this cell will be rendering to
+ * @minimum_size: location to store the minimum size, or %NULL
+ * @natural_size: location to store the natural size, or %NULL
+ *
+ * Retreives a renderer's natural size when rendered to @widget.
+ *
+ * Since: 3.0
+ */
+void
+gtk_cell_size_request_get_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkCellSizeRequestIface *iface;
+ gint height;
+
+ g_return_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell));
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (NULL != minimum_size || NULL != natural_size);
+
+ gtk_cell_renderer_get_fixed_size (GTK_CELL_RENDERER (cell), NULL, &height);
+
+ if (height < 0)
+ {
+ iface = GTK_CELL_SIZE_REQUEST_GET_IFACE (cell);
+ iface->get_height (cell, widget, minimum_size, natural_size);
+ }
+ else
+ {
+ if (minimum_size)
+ *minimum_size = height;
+ if (natural_size)
+ *natural_size = height;
+ }
+
+#if DEBUG_CELL_SIZE_REQUEST
+ g_message ("%s returning minimum height: %d and natural height: %d",
+ G_OBJECT_TYPE_NAME (cell),
+ minimum_size ? *minimum_size : 20000,
+ natural_size ? *natural_size : 20000);
+#endif
+}
+
+
+/**
+ * gtk_cell_size_request_get_width_for_height:
+ * @cell: a #GtkCellSizeRequest instance
+ * @widget: the #GtkWidget this cell will be rendering to
+ * @height: the size which is available for allocation
+ * @minimum_width: location for storing the minimum size, or %NULL
+ * @natural_width: location for storing the preferred size, or %NULL
+ *
+ * Retreives a cell renderers's minimum and natural width if it were rendered to
+ * @widget with the specified @height.
+ *
+ * Since: 3.0
+ */
+void
+gtk_cell_size_request_get_width_for_height (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
+{
+ GtkCellSizeRequestIface *iface;
+ gint width;
+
+ g_return_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell));
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (NULL != minimum_width || NULL != natural_width);
+
+ gtk_cell_renderer_get_fixed_size (GTK_CELL_RENDERER (cell), &width, NULL);
+
+ if (width < 0)
+ {
+ iface = GTK_CELL_SIZE_REQUEST_GET_IFACE (cell);
+ iface->get_width_for_height (cell, widget, height, minimum_width, natural_width);
+ }
+ else
+ {
+ if (minimum_width)
+ *minimum_width = width;
+ if (natural_width)
+ *natural_width = width;
+ }
+
+#if DEBUG_CELL_SIZE_REQUEST
+ g_message ("%s width for height: %d is minimum %d and natural: %d",
+ G_OBJECT_TYPE_NAME (cell), height,
+ minimum_width ? *minimum_width : 20000,
+ natural_width ? *natural_width : 20000);
+#endif
+}
+
+/**
+ * gtk_cell_size_request_get_height_for_width:
+ * @cell: a #GtkCellSizeRequest instance
+ * @widget: the #GtkWidget this cell will be rendering to
+ * @width: the size which is available for allocation
+ * @minimum_height: location for storing the minimum size, or %NULL
+ * @natural_height: location for storing the preferred size, or %NULL
+ *
+ * Retreives a cell renderers's minimum and natural height if it were rendered to
+ * @widget with the specified @width.
+ *
+ * Since: 3.0
+ */
+void
+gtk_cell_size_request_get_height_for_width (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ GtkCellSizeRequestIface *iface;
+ gint height;
+
+ g_return_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell));
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (NULL != minimum_height || NULL != natural_height);
+
+ gtk_cell_renderer_get_fixed_size (GTK_CELL_RENDERER (cell), NULL, &height);
+
+ if (height < 0)
+ {
+ iface = GTK_CELL_SIZE_REQUEST_GET_IFACE (cell);
+ iface->get_height_for_width (cell, widget, width, minimum_height, natural_height);
+ }
+ else
+ {
+ if (minimum_height)
+ *minimum_height = height;
+ if (natural_height)
+ *natural_height = height;
+ }
+
+#if DEBUG_CELL_SIZE_REQUEST
+ g_message ("%s height for width: %d is minimum %d and natural: %d",
+ G_OBJECT_TYPE_NAME (cell), width,
+ minimum_height ? *minimum_height : 20000,
+ natural_height ? *natural_height : 20000);
+#endif
+}
+
+/**
+ * gtk_cell_size_request_get_size:
+ * @cell: a #GtkCellSizeRequest instance
+ * @widget: the #GtkWidget this cell will be rendering to
+ * @request_natural: Whether to base the contextual request off of the
+ * base natural or the base minimum
+ * @minimum_size: (out) (allow-none): location for storing the minimum size, or %NULL
+ * @natural_size: (out) (allow-none): location for storing the natural size, or %NULL
+ *
+ * Retrieves the minimum and natural size of a cell taking
+ * into account the widget's preference for height-for-width management.
+ *
+ * If request_natural is specified, the non-contextual natural value will
+ * be used to make the contextual request; otherwise the minimum will be used.
+ *
+ * Since: 3.0
+ */
+void
+gtk_cell_size_request_get_size (GtkCellSizeRequest *cell,
+ GtkWidget *widget,
+ GtkRequisition *minimum_size,
+ GtkRequisition *natural_size)
+{
+ gint min_width, nat_width;
+ gint min_height, nat_height;
+
+ g_return_if_fail (GTK_IS_CELL_SIZE_REQUEST (cell));
+
+ if (gtk_cell_size_request_get_request_mode (cell) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
+ {
+ gtk_cell_size_request_get_width (cell, widget, &min_width, &nat_width);
+
+ if (minimum_size)
+ {
+ minimum_size->width = min_width;
+ gtk_cell_size_request_get_height_for_width (cell, widget, min_width,
+ &minimum_size->height, NULL);
+ }
+
+ if (natural_size)
+ {
+ natural_size->width = nat_width;
+ gtk_cell_size_request_get_height_for_width (cell, widget, nat_width,
+ NULL, &natural_size->height);
+ }
+ }
+ else /* GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT */
+ {
+ gtk_cell_size_request_get_height (cell, widget, &min_height, &nat_height);
+
+ if (minimum_size)
+ {
+ minimum_size->height = min_height;
+ gtk_cell_size_request_get_width_for_height (cell, widget, min_height,
+ &minimum_size->width, NULL);
+ }
+
+ if (natural_size)
+ {
+ natural_size->height = nat_height;
+ gtk_cell_size_request_get_width_for_height (cell, widget, nat_height,
+ NULL, &natural_size->width);
+ }
+ }
+}
+
-
- #define __GTK_CELL_SIZE_REQUEST_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtkcellview.c
index 1ac2169,a02fc72..0bc91b5
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@@ -121,17 -120,8 +121,16 @@@ static void gtk_cell_view_buildab
const gchar *tagname,
gpointer *data);
+static void gtk_cell_view_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_cell_view_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_cell_view_get_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+
static GtkBuildableIface *parent_buildable_iface;
- #define GTK_CELL_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW, GtkCellViewPrivate))
enum
{
@@@ -363,24 -389,11 +367,24 @@@ gtk_cell_view_size_allocate (GtkWidge
{
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
- info->real_width = info->requested_width +
- (info->expand ? extra_space : 0);
+ info->real_width = info->requested_width;
+
+ if (natural_width > 0)
+ info->real_width += natural * (info->natural_width - info->requested_width) / natural_width;
+
+ if (info->expand)
+ {
+ if (nexpand_cells == 1)
+ info->real_width += available;
+ else
+ info->real_width += extra;
+
+ nexpand_cells -= 1;
+ available -= extra;
+ }
}
}
@@@ -1166,90 -1099,3 +1170,85 @@@ gtk_cell_view_buildable_custom_tag_end
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
data);
}
+
-
+static void
+gtk_cell_view_size_request_init (GtkSizeRequestIface *iface)
+{
+ iface->get_width = gtk_cell_view_get_width;
+ iface->get_height = gtk_cell_view_get_height;
+}
+
+static void
+gtk_cell_view_get_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GList *i;
+ gint cell_min, cell_nat;
+ gboolean first_cell = TRUE;
+ GtkCellView *cellview = GTK_CELL_VIEW (widget);
+ gint minimum, natural;
+
+ minimum = natural = 0;
+
+ if (cellview->priv->displayed_row)
+ gtk_cell_view_set_cell_data (cellview);
+
+ for (i = cellview->priv->cell_list; i; i = i->next)
+ {
+ GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
+
- if (info->cell->visible)
++ if (gtk_cell_renderer_get_visible (info->cell))
+ {
+
+ if (!first_cell && orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ minimum += cellview->priv->spacing;
+ natural += cellview->priv->spacing;
+ }
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ gtk_cell_size_request_get_width (GTK_CELL_SIZE_REQUEST (info->cell),
+ GTK_WIDGET (cellview), &cell_min, &cell_nat);
+
+ info->requested_width = cell_min;
+ info->natural_width = cell_nat;
+
+ minimum += info->requested_width;
+ natural += info->natural_width;
+ }
+ else
+ {
+ gtk_cell_size_request_get_height (GTK_CELL_SIZE_REQUEST (info->cell),
+ GTK_WIDGET (cellview), &cell_min, &cell_nat);
+ minimum = MAX (minimum, cell_min);
+ natural = MAX (natural, cell_nat);
+ }
+ first_cell = FALSE;
+ }
+ }
+
+ if (minimum_size)
+ *minimum_size = minimum;
+
+ if (natural_size)
+ *natural_size = natural;
+}
+
+static void
+gtk_cell_view_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_cell_view_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+}
+
+static void
+gtk_cell_view_get_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_cell_view_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+}
-
-
- #define __GTK_CELL_VIEW_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtkcombobox.c
index 06f052f,d91561a..36de6c8
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@@ -941,12 -935,11 +944,12 @@@ gtk_combo_box_init (GtkComboBox *combo_
priv->cell_view = gtk_cell_view_new ();
gtk_widget_set_parent (priv->cell_view, GTK_WIDGET (combo_box));
- GTK_BIN (combo_box)->child = priv->cell_view;
+ _gtk_bin_set_child (GTK_BIN (combo_box), priv->cell_view);
gtk_widget_show (priv->cell_view);
- priv->width = 0;
- priv->height = 0;
+ memset (&priv->minimum_size, 0x0, sizeof (GtkRequisition));
+ memset (&priv->natural_size, 0x0, sizeof (GtkRequisition));
+
priv->wrap_width = 0;
priv->active = -1;
@@@ -5888,240 -6056,3 +5912,235 @@@ gtk_combo_box_buildable_custom_tag_end
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
data);
}
+
+
+static void
+gtk_combo_box_size_request_init (GtkSizeRequestIface *iface)
+{
+ iface->get_width = gtk_combo_box_get_width;
+ iface->get_height = gtk_combo_box_get_height;
+}
+
+static void
+gtk_combo_box_remeasure (GtkComboBox *combo_box)
+{
+ GtkComboBoxPrivate *priv = combo_box->priv;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+
+ if (!priv->model ||
+ !gtk_tree_model_get_iter_first (priv->model, &iter))
+ return;
+
+ memset (&priv->minimum_size, 0x0, sizeof (GtkRequisition));
+ memset (&priv->natural_size, 0x0, sizeof (GtkRequisition));
+
+ path = gtk_tree_path_new_from_indices (0, -1);
+
+ do
+ {
+ GtkRequisition req, nat_req;
+
+ if (priv->cell_view)
+ {
+ /* XXX FIXME: Currently still not doing height-for-width in cell renderers here */
+ gtk_cell_view_get_desired_width_of_row (GTK_CELL_VIEW (priv->cell_view),
+ path, &req.width, &nat_req.width);
+ gtk_cell_view_get_desired_height_of_row (GTK_CELL_VIEW (priv->cell_view),
+ path, &req.height, &nat_req.height);
+ }
+ else
+ {
+ memset (&req, 0x0, sizeof (GtkRequisition));
+ memset (&nat_req, 0x0, sizeof (GtkRequisition));
+ }
+
+ priv->minimum_size.width = MAX (priv->minimum_size.width, req.width);
+ priv->minimum_size.height = MAX (priv->minimum_size.height, req.height);
+
+ priv->natural_size.width = MAX (priv->natural_size.width, nat_req.width);
+ priv->natural_size.height = MAX (priv->natural_size.height, nat_req.height);
+
+ gtk_tree_path_next (path);
+ }
+ while (gtk_tree_model_iter_next (priv->model, &iter));
+
+ gtk_tree_path_free (path);
+}
+
+
+/* XXX TODO: Split this up into 2 orientations so as
+ * to properly support height-for-width/width-for-height here
+ *
+ */
+static void
+gtk_combo_box_get_size (GtkSizeRequest *widget,
+ GtkRequisition *minimum_size,
+ GtkRequisition *natural_size)
+{
+ GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
+ GtkComboBoxPrivate *priv = combo_box->priv;
+ gint focus_width, focus_pad;
+ gint font_size, arrow_size;
+ GtkRequisition bin_req, bin_nat_req;
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+ PangoFontDescription *font_desc;
+ GtkWidget *child;
+
+ child = gtk_bin_get_child (GTK_BIN (widget));
+
+ /* common */
+ gtk_size_request_get_size (GTK_SIZE_REQUEST (child), &bin_req, &bin_nat_req);
+ gtk_combo_box_remeasure (combo_box);
+
+ bin_req.width = MAX (bin_req.width, priv->minimum_size.width);
+ bin_req.height = MAX (bin_req.height, priv->minimum_size.height);
+ bin_nat_req.width = MAX (bin_nat_req.width, priv->natural_size.width);
+ bin_nat_req.height = MAX (bin_nat_req.height, priv->natural_size.height);
+
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_pad,
+ "arrow-size", &arrow_size,
+ NULL);
+
+ font_desc = child->style->font_desc;
+ context = gtk_widget_get_pango_context (GTK_WIDGET (widget));
+ metrics = pango_context_get_metrics (context, font_desc,
+ pango_context_get_language (context));
+ font_size = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
+ pango_font_metrics_get_descent (metrics));
+ pango_font_metrics_unref (metrics);
+
+ arrow_size = MAX (arrow_size, font_size);
+
+ gtk_widget_set_size_request (priv->arrow, arrow_size, arrow_size);
+
+ if (!priv->tree_view)
+ {
+ /* menu mode */
+
+ if (priv->cell_view)
+ {
+ GtkRequisition button_req, sep_req, arrow_req;
+ gint border_width, xthickness, ythickness, xpad, ypad;
+
+ gtk_widget_size_request (priv->button, &button_req);
- border_width = GTK_CONTAINER (combo_box)->border_width;
++ border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
+ xthickness = priv->button->style->xthickness;
+ ythickness = priv->button->style->ythickness;
+
+ xpad = 2*(border_width + xthickness + focus_width + focus_pad);
+ ypad = 2*(border_width + ythickness + focus_width + focus_pad);
+
+ gtk_widget_size_request (priv->separator, &sep_req);
+ gtk_widget_size_request (priv->arrow, &arrow_req);
+
+ minimum_size->width = bin_req.width + sep_req.width + arrow_req.width;
+ minimum_size->height = MAX (sep_req.height, arrow_req.height);
+ minimum_size->height = MAX (minimum_size->height, bin_req.height);
+
+ natural_size->width = bin_nat_req.width + sep_req.width + arrow_req.width;
+ natural_size->height = MAX (minimum_size->height, bin_nat_req.height);
+
+ minimum_size->width += xpad;
+ minimum_size->height += ypad;
+ natural_size->width += xpad;
+ natural_size->height += ypad;
+ }
+ else
+ {
+ GtkRequisition but_req, but_nat_req;
+
+ gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->button),
+ &but_req, &but_nat_req);
+
+ minimum_size->width = bin_req.width + but_req.width;
+ minimum_size->height = MAX (bin_req.height, but_req.height);
+
+ natural_size->width = bin_nat_req.width + but_nat_req.width;
+ natural_size->height = MAX (bin_nat_req.height, but_nat_req.height);
+ }
+ }
+ else
+ {
+ /* list mode */
+ GtkRequisition button_req, button_nat_req, frame_req;
+
+ /* sample + frame */
+ *minimum_size = bin_req;
+ *natural_size = bin_nat_req;
+
+ minimum_size->width += 2 * focus_width;
+ natural_size->width += 2 * focus_width;
+
+ if (priv->cell_view_frame)
+ {
+ gtk_widget_size_request (priv->cell_view_frame, &frame_req);
+ if (priv->has_frame)
+ {
- gint xpad = 2 * (GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
-
- gint ypad = 2 * (GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
++ gint border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
++ gint xpad = 2 * (border_width + GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
++ gint ypad = 2 * (border_width + GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
+
+ minimum_size->width += xpad;
+ minimum_size->height += ypad;
+ natural_size->width += xpad;
+ natural_size->height += ypad;
+ }
+ }
+
+ /* the button */
+ gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->button),
+ &button_req, &button_nat_req);
+
+ minimum_size->width += button_req.width;
+ minimum_size->height = MAX (minimum_size->height, button_req.height);
+
+ natural_size->width += button_nat_req.width;
+ natural_size->height = MAX (natural_size->height, button_nat_req.height);
+ }
+
+ if (GTK_SHADOW_NONE != priv->shadow_type)
+ {
+ minimum_size->width += 2 * GTK_WIDGET (widget)->style->xthickness;
+ minimum_size->height += 2 * GTK_WIDGET (widget)->style->ythickness;
+
+ natural_size->width += 2 * GTK_WIDGET (widget)->style->xthickness;
+ natural_size->height += 2 * GTK_WIDGET (widget)->style->ythickness;
+ }
+}
+
+static void
+gtk_combo_box_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkRequisition minimum, natural;
+
+ gtk_combo_box_get_size (widget, &minimum, &natural);
+
+ if (minimum_size)
+ *minimum_size = minimum.width;
+
+ if (natural_size)
+ *natural_size = natural.width;
+}
+
+static void
+gtk_combo_box_get_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkRequisition minimum, natural;
+
+ gtk_combo_box_get_size (widget, &minimum, &natural);
+
+ if (minimum_size)
+ *minimum_size = minimum.height;
+
+ if (natural_size)
+ *natural_size = natural.height;
+}
+
-
- #define __GTK_COMBO_BOX_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtkexpander.c
index 04fd2ff,ce49601..023fe27
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@@ -564,10 -564,10 +564,12 @@@ gtk_expander_size_allocate (GtkWidge
child = gtk_bin_get_child (GTK_BIN (widget));
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+ widget->allocation = *allocation;
+ widget->allocation = *allocation;
+
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
"focus-line-width", &focus_width,
diff --cc gtk/gtkiconview.c
index 8f3ffea,c62df31..f823f6f
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@@ -40,9 -40,7 +40,8 @@@
#include "gtkcombobox.h"
#include "gtktextbuffer.h"
#include "gtktreednd.h"
+#include "gtkcellsizerequest.h"
#include "gtkprivate.h"
- #include "gtkalias.h"
/**
* SECTION:gtkiconview
@@@ -3009,16 -3008,14 +3008,16 @@@ gtk_icon_view_calculate_item_size (GtkI
for (l = icon_view->priv->cell_list; l; l = l->next)
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-
+ GtkRequisition min_size;
+
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
- gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),
- NULL, NULL, NULL,
- &item->box[info->position].width,
- &item->box[info->position].height);
+ gtk_cell_size_request_get_size (GTK_CELL_SIZE_REQUEST (info->cell),
+ GTK_WIDGET (icon_view),
+ &min_size, NULL);
+ item->box[info->position].width = min_size.width;
+ item->box[info->position].height = min_size.height;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
diff --cc gtk/gtkplug-x11.c
index 40a635b,f753493..a028765
--- a/gtk/gtkplug-x11.c
+++ b/gtk/gtkplug-x11.c
@@@ -47,10 -47,8 +47,9 @@@
#include "gtkplugprivate.h"
#include "x11/gdkx.h"
+#include <X11/Xatom.h>
#include "gtkxembed.h"
- #include "gtkalias.h"
static void xembed_set_info (GdkWindow *window,
unsigned long flags);
diff --cc gtk/gtkplug.c
index fa14948,f1e2a19..bc991c4
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@@ -751,14 -750,14 +751,16 @@@ static voi
gtk_plug_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- GtkBin *bin = GTK_BIN (widget);
+ GtkRequisition natural_size;
++ GtkBin *bin = GTK_BIN (widget);
+ GtkWidget *child;
+
++ child = gtk_bin_get_child (bin);
++
if (gtk_widget_is_toplevel (widget))
GTK_WIDGET_CLASS (gtk_plug_parent_class)->size_allocate (widget, allocation);
else
{
-- GtkBin *bin = GTK_BIN (widget);
--
widget->allocation = *allocation;
if (gtk_widget_get_realized (widget))
@@@ -766,7 -765,9 +768,7 @@@
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (bin->child && gtk_widget_get_visible (bin->child))
- child = gtk_bin_get_child (bin);
-
+ if (child != NULL && gtk_widget_get_visible (child))
{
GtkAllocation child_allocation;
@@@ -780,10 -781,6 +782,10 @@@
}
}
+
- gtk_size_request_get_size (GTK_SIZE_REQUEST (bin->child),
++ gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
+ NULL, &natural_size);
+ _gtk_plug_windowing_publish_natural_size (GTK_PLUG (widget), &natural_size);
}
static gboolean
diff --cc gtk/gtkscrolledwindow.c
index 8928312,6bbe37b..e769fdf
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@@ -1728,55 -1745,82 +1747,56 @@@ gtk_scrolled_window_size_request_init (
iface->get_width_for_height = gtk_scrolled_window_get_width_for_height;
}
-static void
-gtk_scrolled_window_get_size (GtkSizeRequest *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+static void
+gtk_scrolled_window_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
+
GtkScrolledWindow *scrolled_window;
- GtkBin *bin;
- gint extra_width;
- gint extra_height;
- gint scrollbar_spacing;
GtkRequisition hscrollbar_requisition;
GtkRequisition vscrollbar_requisition;
- GtkRequisition minimum_req, natural_req;
GtkWidget *child;
+ gint min_width, nat_width;
gint min_child_size, nat_child_size;
- gint extra_width;
- guint border_width;
++ gint extra_width, border_width;
+ gint scrollbar_spacing;
scrolled_window = GTK_SCROLLED_WINDOW (widget);
- bin = GTK_BIN (scrolled_window);
+ child = gtk_bin_get_child (GTK_BIN (scrolled_window));
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
++ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
extra_width = 0;
- extra_height = 0;
- minimum_req.width = 0;
- minimum_req.height = 0;
- natural_req.width = 0;
- natural_req.height = 0;
+ min_width = 0;
+ nat_width = 0;
gtk_widget_size_request (scrolled_window->hscrollbar,
&hscrollbar_requisition);
gtk_widget_size_request (scrolled_window->vscrollbar,
&vscrollbar_requisition);
-
+
- child = gtk_bin_get_child (bin);
if (child && gtk_widget_get_visible (child))
{
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
+ &min_child_size,
+ &nat_child_size);
+
+ if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
{
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &min_child_size,
- &nat_child_size);
-
- if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
- {
- minimum_req.width += min_child_size;
- natural_req.width += nat_child_size;
- }
- else
- {
- GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (child, FALSE);
-
- if (aux_info && aux_info->width > 0)
- {
- minimum_req.width += aux_info->width;
- natural_req.width += aux_info->width;
- extra_width = -1;
- }
- else
- {
- minimum_req.width += vscrollbar_requisition.width;
- natural_req.width += vscrollbar_requisition.width;
- }
- }
+ min_width += min_child_size;
+ nat_width += nat_child_size;
}
- else /* GTK_ORIENTATION_VERTICAL */
+ else
{
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &min_child_size,
- &nat_child_size);
-
- if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
+ GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (child, FALSE);
+
+ if (aux_info && aux_info->width > 0)
{
- minimum_req.height += min_child_size;
- natural_req.height += nat_child_size;
+ min_width += aux_info->width;
+ nat_width += aux_info->width;
+ extra_width = -1;
}
else
{
@@@ -1800,8 -1859,11 +1820,8 @@@
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
}
- min_width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
- nat_width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- minimum_req.width += border_width * 2 + MAX (0, extra_width);
- minimum_req.height += border_width * 2 + MAX (0, extra_height);
- natural_req.width += border_width * 2 + MAX (0, extra_width);
- natural_req.height += border_width * 2 + MAX (0, extra_height);
++ min_width += border_width * 2 + MAX (0, extra_width);
++ nat_width += border_width * 2 + MAX (0, extra_width);
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
{
@@@ -1820,85 -1902,7 +1840,86 @@@ gtk_scrolled_window_get_height (GtkSize
gint *minimum_size,
gint *natural_size)
{
- gtk_scrolled_window_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ GtkScrolledWindow *scrolled_window;
+ GtkRequisition hscrollbar_requisition;
+ GtkRequisition vscrollbar_requisition;
+ GtkWidget *child;
+ gint min_height, nat_height;
+ gint min_child_size, nat_child_size;
- gint extra_height;
++ gint extra_height, border_width;
+ gint scrollbar_spacing;
+
+ scrolled_window = GTK_SCROLLED_WINDOW (widget);
+ child = gtk_bin_get_child (GTK_BIN (scrolled_window));
+
+ scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
++ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+ extra_height = 0;
+ min_height = 0;
+ nat_height = 0;
+
+ gtk_widget_size_request (scrolled_window->hscrollbar,
+ &hscrollbar_requisition);
+ gtk_widget_size_request (scrolled_window->vscrollbar,
+ &vscrollbar_requisition);
+
+ if (child && gtk_widget_get_visible (child))
+ {
+ gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
+ &min_child_size,
+ &nat_child_size);
+
+ if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
+ {
+ min_height += min_child_size;
+ nat_height += nat_child_size;
+ }
+ else
+ {
+ GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (child, FALSE);
+
+ if (aux_info && aux_info->height > 0)
+ {
+ min_height += aux_info->height;
+ nat_height += aux_info->height;
+ extra_height = -1;
+ }
+ else
+ {
+ min_height += hscrollbar_requisition.height;
+ nat_height += hscrollbar_requisition.height;
+ }
+ }
+ }
+
+ if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC ||
+ scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
+ {
+ if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
+ extra_height = scrollbar_spacing + hscrollbar_requisition.height;
+ }
+
+ if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC ||
+ scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
+ {
+ min_height = MAX (min_height, vscrollbar_requisition.height);
+ nat_height = MAX (nat_height, vscrollbar_requisition.height);
+ }
+
- min_height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
- nat_height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
++ min_height += border_width * 2 + MAX (0, extra_height);
++ nat_height += border_width * 2 + MAX (0, extra_height);
+
+ if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
+ {
+ min_height += 2 * GTK_WIDGET (widget)->style->ythickness;
+ nat_height += 2 * GTK_WIDGET (widget)->style->ythickness;
+ }
+
+ if (minimum_size)
+ *minimum_size = min_height;
+ if (natural_size)
+ *natural_size = nat_height;
}
static void
@@@ -1923,17 -1921,8 +1944,14 @@@ gtk_scrolled_window_get_width_for_heigh
gint height,
gint *minimum_width,
gint *natural_width)
-{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+{
+ GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ /* In the unlikely case that both scrollbars are disabled; forward the child's
+ * width-for-height request via the GtkBin generic method */
+ if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER &&
+ scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
+ parent_size_request_iface->get_width_for_height (widget, height, minimum_width, natural_width);
+ else
+ gtk_size_request_get_width (widget, minimum_width, natural_width);
}
-
- #define __GTK_SCROLLED_WINDOW_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtksocket.c
index ebbb63b,08f0cd1..68a6001
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@@ -37,10 -37,8 +37,9 @@@
#include "gtksocket.h"
#include "gtksocketprivate.h"
#include "gtkdnd.h"
+#include "gtksizerequest.h"
#include "gtkintl.h"
- #include "gtkalias.h"
/**
* SECTION:gtksocket
@@@ -1062,84 -1047,3 +1063,81 @@@ _gtk_socket_advance_toplevel_focus (Gtk
return;
}
}
+
+static void
+gtk_socket_size_request_init (GtkSizeRequestIface *iface)
+{
+ iface->get_width = gtk_socket_get_width;
+ iface->get_height = gtk_socket_get_height;
+}
+
+static void
+gtk_socket_get_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkSocket *socket = GTK_SOCKET (widget);
+ GtkSocketPrivate *priv;
+
+ if (socket->plug_widget)
+ {
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ gtk_size_request_get_width (GTK_SIZE_REQUEST (socket->plug_widget),
+ minimum_size, natural_size);
+ else
+ gtk_size_request_get_height (GTK_SIZE_REQUEST (socket->plug_widget),
+ minimum_size, natural_size);
+ }
+ else
+ {
+ priv = _gtk_socket_get_private (socket);
+
+ if (socket->is_mapped && !priv->have_natural_size && socket->plug_window)
+ {
+ _gtk_socket_windowing_size_request (socket);
+ _gtk_socket_windowing_get_natural_size (socket);
+ }
+
+ if (socket->is_mapped && priv->have_natural_size)
+ {
+ if (minimum_size)
+ {
+ *minimum_size =
+ (orientation == GTK_ORIENTATION_HORIZONTAL) ?
+ MAX (socket->request_width, 1) : MAX (socket->request_height, 1);
+ }
+ if (natural_size)
+ {
+ *natural_size =
+ (orientation == GTK_ORIENTATION_HORIZONTAL) ?
+ MAX (priv->natural_width, 1) : MAX (priv->natural_height, 1);
+ }
+ }
+ else
+ {
+ if (minimum_size)
+ *minimum_size = 1;
+
+ if (natural_size)
+ *natural_size = 1;
+ }
+ }
+}
+
+static void
+gtk_socket_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_socket_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+}
+
+static void
+gtk_socket_get_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_socket_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+}
+
-
- #define __GTK_SOCKET_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtktreeview.c
index 3351832,444a81a..eb6b62d
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@@ -27,8 -27,6 +27,7 @@@
#include "gtktreednd.h"
#include "gtktreeprivate.h"
#include "gtkcellrenderer.h"
+#include "gtksizerequest.h"
- #include "gtksizerequestprivate.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkbuildable.h"
@@@ -45,9 -43,7 +44,8 @@@
#include "gtkframe.h"
#include "gtktreemodelsort.h"
#include "gtktooltip.h"
+#include "gtkscrolledwindow.h"
#include "gtkprivate.h"
- #include "gtkalias.h"
#define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5)
#define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2)
@@@ -2274,10 -2222,6 +2260,10 @@@ gtk_tree_view_size_allocate_columns (Gt
number_of_expand_columns++;
}
+ /* Distribute as much of remaining 'size' as possible before sharing expand space */
+ sizes = (GtkRequestedSize *)array->data;
- extra = _gtk_distribute_allocation (MAX (extra, 0), array->len, sizes);
++ extra = gtk_distribute_natural_allocation (MAX (extra, 0), array->len, sizes);
+
/* Only update the expand value if the width of the widget has changed,
* or the number of expand columns has changed, or if there are no expand
* columns, or if we didn't have an size-allocation yet after the
@@@ -4767,44 -4684,78 +4773,61 @@@ gtk_tree_view_bin_expose (GtkWidge
*/
highlight_x = cell_area.x;
expander_cell_width = cell_area.width;
-
- if (is_separator)
- gtk_paint_hline (widget->style,
- event->window,
- state,
- &cell_area,
- widget,
- NULL,
- cell_area.x,
- cell_area.x + cell_area.width,
- cell_area.y + cell_area.height / 2);
- else
- _gtk_tree_view_column_cell_render (column,
- event->window,
- &background_area,
- &cell_area,
- &event->area,
- flags);
- if (TREE_VIEW_DRAW_EXPANDERS(tree_view)
- && (node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT)
- {
- if (!got_pointer)
- {
- gdk_window_get_pointer (tree_view->priv->bin_window,
- &pointer_x, &pointer_y, NULL);
- got_pointer = TRUE;
- }
-
- gtk_tree_view_draw_arrow (GTK_TREE_VIEW (widget),
- tree,
- node,
- pointer_x, pointer_y);
- }
}
+
+ /* Do the actual rendering */
+ if (is_separator)
+ gtk_paint_hline (widget->style,
+ event->window,
+ state,
+ &cell_area,
+ widget,
+ NULL,
+ cell_area.x,
+ cell_area.x + cell_area.width,
+ cell_area.y + cell_area.height / 2);
else
+ _gtk_tree_view_column_cell_render (column,
+ event->window,
+ &background_area,
+ &cell_area,
+ &event->area,
+ flags);
+
+ if (gtk_tree_view_is_expander_column (tree_view, column) &&
+ TREE_VIEW_DRAW_EXPANDERS(tree_view) &&
+ (node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT)
{
- if (is_separator)
- gtk_paint_hline (widget->style,
- event->window,
- state,
- &cell_area,
- widget,
- NULL,
- cell_area.x,
- cell_area.x + cell_area.width,
- cell_area.y + cell_area.height / 2);
- else
- _gtk_tree_view_column_cell_render (column,
- event->window,
- &background_area,
- &cell_area,
- &event->area,
- flags);
+ if (!got_pointer)
+ {
+ gdk_window_get_pointer (tree_view->priv->bin_window,
+ &pointer_x, &pointer_y, NULL);
+ got_pointer = TRUE;
+ }
+
+ gtk_tree_view_draw_arrow (GTK_TREE_VIEW (widget),
+ tree,
+ node,
+ pointer_x, pointer_y);
}
+ if (draw_hgrid_lines)
+ {
+ if (background_area.y > 0)
+ gtk_tree_view_draw_line (tree_view, event->window,
+ GTK_TREE_VIEW_GRID_LINE,
+ background_area.x, background_area.y,
+ background_area.x + background_area.width,
+ background_area.y);
+
+ if (y_offset + max_height >= event->area.height)
+ gtk_tree_view_draw_line (tree_view, event->window,
+ GTK_TREE_VIEW_GRID_LINE,
+ background_area.x, background_area.y + max_height,
+ background_area.x + background_area.width,
+ background_area.y + max_height);
+ }
+
if (gtk_tree_view_is_expander_column (tree_view, column) &&
tree_view->priv->tree_lines_enabled)
{
@@@ -15798,104 -15699,3 +15826,101 @@@ gtk_tree_view_get_tooltip_column (GtkTr
return tree_view->priv->tooltip_column;
}
+
-
+static void
+gtk_tree_view_get_minimum_size (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
+ GList *tmp_list;
+
+ /* we validate some rows initially just to make sure we have some size.
+ * In practice, with a lot of static lists, this should get a good width.
+ */
+ do_validate_rows (tree_view, FALSE);
+ gtk_tree_view_size_request_columns (tree_view);
+ gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
+
+ requisition->width = tree_view->priv->width;
+ requisition->height = tree_view->priv->height + TREE_VIEW_HEADER_HEIGHT (tree_view);
+
+ tmp_list = tree_view->priv->children;
+
+ while (tmp_list)
+ {
+ GtkTreeViewChild *child = tmp_list->data;
+ GtkRequisition child_requisition;
+
+ tmp_list = tmp_list->next;
+
+ if (gtk_widget_get_visible (child->widget))
+ gtk_widget_size_request (child->widget, &child_requisition);
+ }
+}
+
+static void
+gtk_tree_view_size_request_init (GtkSizeRequestIface *iface)
+{
+ iface->get_width = gtk_tree_view_get_width;
+ iface->get_height = gtk_tree_view_get_height;
+}
+
+static void
+gtk_tree_view_get_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ GtkTreeView *tree_view;
+ gint natural_width = 0;
+ GList *column_iter;
+ GtkRequisition requisition;
+
+ tree_view = GTK_TREE_VIEW (widget);
+
+ gtk_tree_view_get_minimum_size (GTK_WIDGET (widget), &requisition);
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ for (column_iter = tree_view->priv->columns; column_iter; column_iter = column_iter->next)
+ {
+ GtkTreeViewColumn *column = column_iter->data;
+
+ if (!column->visible)
+ continue;
+
+ natural_width += gtk_tree_view_get_real_natural_width_from_column (tree_view, column);
+ }
+
+ if (minimum_size)
+ *minimum_size = requisition.width;
+
+ if (natural_size)
+ *natural_size = MAX (requisition.width, natural_width);
+ }
+ else
+ {
+ if (minimum_size)
+ *minimum_size = requisition.height;
+
+ if (natural_size)
+ *natural_size = requisition.height;
+ }
+}
+
+static void
+gtk_tree_view_get_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_tree_view_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+}
+
+static void
+gtk_tree_view_get_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
+{
+ gtk_tree_view_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+}
+
- #define __GTK_TREE_VIEW_C__
- #include "gtkaliasdef.c"
diff --cc gtk/gtktreeviewcolumn.c
index e4d57c6,7f75f2c..0021331
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@@ -26,15 -26,12 +26,15 @@@
#include "gtkbutton.h"
#include "gtkalignment.h"
#include "gtklabel.h"
+#include "gtkcellsizerequest.h"
- #include "gtksizerequestprivate.h"
++#include "gtksizerequest.h"
#include "gtkhbox.h"
#include "gtkmarshalers.h"
#include "gtkarrow.h"
+#include "gtkdebug.h"
#include "gtkprivate.h"
#include "gtkintl.h"
- #include "gtkalias.h"
+
enum
{
@@@ -2674,25 -2600,57 +2612,60 @@@ gtk_tree_view_column_cell_set_cell_dat
*
* Obtains the width and height needed to render the column. This is used
* primarily by the #GtkTreeView.
++ *
++ * Deprecated: 3.0: Use gtk_tree_view_column_get_natural_width() and
++ * gtk_tree_view_column_get_height_for_width() instead.
**/
void
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
- gint *width,
- gint *height)
+ gint *width,
+ gint *height)
{
- GtkRequisition min_req;
+ GList *list;
+ gboolean first_cell = TRUE;
+ gint focus_line_width;
- gtk_tree_view_column_cell_get_real_size (tree_column, cell_area,
- x_offset, y_offset, &min_req, NULL);
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
+ if (height)
+ * height = 0;
if (width)
- *width = min_req.width;
+ * width = 0;
- if (height)
- *height = min_req.height;
+ gtk_widget_style_get (tree_column->tree_view, "focus-line-width", &focus_line_width, NULL);
+
+ for (list = tree_column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gboolean visible;
+ gint new_height = 0;
+ gint new_width = 0;
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ if (first_cell == FALSE && width)
+ *width += tree_column->spacing;
+
+ gtk_cell_renderer_get_size (info->cell,
+ tree_column->tree_view,
+ cell_area,
+ x_offset,
+ y_offset,
+ &new_width,
+ &new_height);
+
+ if (height)
+ * height = MAX (*height, new_height + focus_line_width * 2);
+ info->requested_width = MAX (info->requested_width, new_width + focus_line_width * 2);
+ if (width)
+ * width += info->requested_width;
+ first_cell = FALSE;
+ }
}
/* rendering, event handling and rendering focus are somewhat complicated, and
@@@ -2817,42 -2774,86 +2790,44 @@@ gtk_tree_view_column_cell_process_actio
else if (extra_space > 0 && expand_cell_count > 0)
extra_space /= expand_cell_count;
-
- /* iterate list for GTK_PACK_START cells */
- for (list = tree_column->cell_list; list; list = list->next)
+ for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
{
- GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
-
- if (info->pack == GTK_PACK_END)
- continue;
-
- if (!gtk_cell_renderer_get_visible (info->cell))
- continue;
-
- if ((info->has_focus || special_cells == 1) && cursor_row)
- flags |= GTK_CELL_RENDERER_FOCUSED;
- else
- flags &= ~GTK_CELL_RENDERER_FOCUSED;
-
- info->real_width = info->requested_width + (info->expand?extra_space:0);
- /* We constrain ourselves to only the width available */
- if (real_cell_area.x - focus_line_width + info->real_width > cell_area->x + cell_area->width)
+ for (list = tree_column->cell_list; list; list = list->next)
{
- info->real_width = cell_area->x + cell_area->width - real_cell_area.x;
- }
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
++ gboolean visible;
+
- if (real_cell_area.x > cell_area->x + cell_area->width)
- break;
++ g_object_get (info->cell, "visible", &visible, NULL);
- real_cell_area.width = info->real_width;
- real_cell_area.width -= 2 * focus_line_width;
+ if (info->pack != packing)
+ continue;
- if (! info->cell->visible)
- if (list->next)
- {
- real_background_area.width = info->real_width + depth;
- }
- else
- {
- /* fill the rest of background for the last cell */
- real_background_area.width = background_area->x + background_area->width - real_background_area.x;
- }
++ if (! visible)
+ continue;
- rtl_cell_area = real_cell_area;
- rtl_background_area = real_background_area;
-
- if (rtl)
- {
- rtl_cell_area.x = cell_area->x + cell_area->width - (real_cell_area.x - cell_area->x) - real_cell_area.width;
- rtl_background_area.x = background_area->x + background_area->width - (real_background_area.x - background_area->x) - real_background_area.width;
- }
+ if ((info->has_focus || special_cells == 1) && cursor_row)
+ flags |= GTK_CELL_RENDERER_FOCUSED;
+ else
+ flags &= ~GTK_CELL_RENDERER_FOCUSED;
- /* RENDER */
- if (action == CELL_ACTION_RENDER)
- {
- gtk_cell_renderer_render (info->cell,
- window,
- tree_column->tree_view,
- &rtl_background_area,
- &rtl_cell_area,
- &real_expose_area,
- flags);
- }
- /* FOCUS */
- else if (action == CELL_ACTION_FOCUS)
- {
- gint x_offset, y_offset, width, height;
+ /* We constrain ourselves to only the width available */
+ if (real_cell_area.x - focus_line_width + info->real_width > cell_area->x + cell_area->width)
+ {
+ info->real_width = cell_area->x + cell_area->width - real_cell_area.x;
+ }
+
+ /* Break out of the inner loop once we itterate out of our allocation
+ * (and possibly start the other packing direction) */
+ if (real_cell_area.x > cell_area->x + cell_area->width)
+ break;
- gtk_cell_renderer_get_size (info->cell,
- tree_column->tree_view,
- &rtl_cell_area,
- &x_offset, &y_offset,
- &width, &height);
+ real_cell_area.width = info->real_width;
+ real_cell_area.width -= 2 * focus_line_width;
- if (special_cells > 1)
+ if (list->next)
{
- if (info->has_focus)
- {
- min_x = rtl_cell_area.x + x_offset;
- max_x = min_x + width;
- min_y = rtl_cell_area.y + y_offset;
- max_y = min_y + height;
- }
+ real_background_area.width = info->real_width + depth;
}
else
{
@@@ -3673,313 -3777,3 +3648,284 @@@ gtk_tree_view_column_get_tree_view (Gtk
return tree_column->tree_view;
}
+
-
- /**
- * gtk_tree_view_column_get_desired_size:
- * @tree_column: A #GtkTreeViewColumn
- * @minimum_size: location for storing the minimum size, or %NULL
- * @natural_size: location for storing the preferred size, or %NULL
- *
- *
- * Retreives @tree_column's minimum and natural size.
- *
- * Since: 3.0
- */
- void
- gtk_tree_view_column_get_desired_size (GtkTreeViewColumn *column,
- GtkRequisition *minimal_size,
- GtkRequisition *desired_size)
- {
- g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
-
- gtk_tree_view_column_cell_get_real_size (column,
- NULL, NULL, NULL,
- minimal_size, desired_size);
- }
-
+/**
+ * gtk_tree_view_column_get_natural_width:
+ * @tree_column: A #GtkTreeViewColumn
+ * @minimum_width: location for storing the minimum width, or %NULL
+ * @natural_width: location for storing the natural width, or %NULL
+ *
+ * Retreives @tree_column's minimum and natural width.
+ *
+ * Since: 3.0
+ */
+void
+gtk_tree_view_column_get_natural_width (GtkTreeViewColumn *column,
+ gint *minimum_width,
+ gint *natural_width)
+{
+ GList *list;
+ gboolean first_cell = TRUE;
+ gint focus_line_width;
+ gint min = 0, nat = 0;
+
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
+
+ gtk_widget_style_get (column->tree_view, "focus-line-width", &focus_line_width, NULL);
+
+ for (list = column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gint cell_min, cell_nat;
+ gboolean visible;
+
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ if (first_cell == FALSE)
+ {
+ min += column->spacing;
+ nat += column->spacing;
+ }
+
+ gtk_cell_size_request_get_width (GTK_CELL_SIZE_REQUEST (info->cell),
+ column->tree_view, &cell_min, &cell_nat);
+
+ cell_min += focus_line_width * 2;
+ cell_nat += focus_line_width * 2;
+
+ /* Store 'requested_width' and 'natural_width' to cache all the requests
+ * for every row in the column; natural space distribution is only calculated
+ * once for the whole column for now. */
+ info->requested_width = MAX (info->requested_width, cell_min);
+ info->natural_width = MAX (info->natural_width, cell_nat);
+
+ /* Return the collective minimum/natural width of all
+ * cached sizes */
+ min += info->requested_width;
+ nat += info->natural_width;
+
+ first_cell = FALSE;
+ }
+
+ if (minimum_width)
+ *minimum_width = min;
+
+ if (natural_width)
+ *natural_width = nat;
+}
+
+/**
+ * gtk_tree_view_column_get_height_for_width:
+ * @tree_column: A #GtkTreeViewColumn
+ * @width: the width available for allocation
+ * @minimum_height: location for storing the minimum height, or %NULL
+ * @natural_height: location for storing the natural height, or %NULL
+ *
+ * Retreives @tree_column's minimum and natural height if it were rendered to
+ * @widget with the specified @height.
+ *
+ * Since: 3.0
+ */
+void
+gtk_tree_view_column_get_height_for_width (GtkTreeViewColumn *column,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ GList *list;
+ GArray *array;
+ gint size = width;
+ gint focus_line_width;
+ gint expand_cell_count = 0, i;
+ gboolean first_cell = TRUE;
+ gint min_height = 0, nat_height = 0;
+ GtkRequestedSize *sizes;
+
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
+
+ gtk_widget_style_get (column->tree_view, "focus-line-width", &focus_line_width, NULL);
+
+ array = g_array_new (0, TRUE, sizeof (GtkRequestedSize));
+
+
+ /* First get the overall expand space and collect the cell requests */
+ for (list = column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gboolean visible;
+ GtkRequestedSize requested;
+
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ if (info->expand == TRUE)
+ expand_cell_count++;
+
+ if (first_cell == FALSE)
+ size -= column->spacing;
+
+ size -= focus_line_width * 2;
+ size -= info->requested_width;
+
+ /* Here the collective minimum/natural width for all rows
+ * has necessarily been cached by gtk_tree_view_column_get_natural_width().
+ *
+ * As the allocated width is based on the collective widths of all rows,
+ * the allocated width for a cell will be the same in each row.
+ *
+ * However the height-for-width must also be calculated for each
+ * row based on the aligned width in order to determine the row height.
+ *
+ * OPTIMIZE ME: It would be better to calculate the allocations of the cells once
+ * and caching an extra info->allocated_width in order to avoid this
+ * calculation for every row.
+ *
+ * Note we would use the real minimums/naturals as reported
+ * by the cells for each row here if we were to display
+ * the cells unaligned (which is more expensive to calculate
+ * but would allow cells to flow more naturally inside columns).
+ */
+ requested.data = info;
+ requested.minimum_size = info->requested_width;
+ requested.natural_size = info->natural_width;
+ g_array_append_val (array, requested);
+
+ first_cell = FALSE;
+ }
+
+
+ /* Distribute as much of remaining 'size' as possible before sharing expand space */
+ sizes = (GtkRequestedSize *)array->data;
- size = _gtk_distribute_allocation (size, array->len, sizes);
++ size = gtk_distribute_natural_allocation (size, array->len, sizes);
+
+ /* The rest gets split up evenly among expanding cells */
+ if (expand_cell_count)
+ size /= expand_cell_count;
+
+ /* Collect the minimum and natural height for the allocations of cells */
+ for (i = 0, list = column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gint cell_min, cell_nat;
+ gboolean visible;
+
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ gtk_cell_size_request_get_height_for_width (GTK_CELL_SIZE_REQUEST (info->cell),
+ column->tree_view,
+ sizes[i].minimum_size + (info->expand ? size : 0),
+ &cell_min, &cell_nat);
+
+ min_height = MAX (min_height, cell_min);
+ nat_height = MAX (nat_height, cell_nat);
+
+ i++;
+ }
+ g_array_free (array, TRUE);
+
+ if (minimum_height)
+ *minimum_height = min_height;
+
+ if (natural_height)
+ *natural_height = nat_height;
+}
+
+/**
+ * gtk_tree_view_column_allocate_width:
+ * @tree_column: A #GtkTreeViewColumn
+ * @width: the overall width of the column
+ *
+ * This allocates a good size for each cell in the column
+ * based on the overall minimum and natural widths of the
+ * cells after having been tested for each column.
+ *
+ * A width must be allocated after the request phase
+ * and before handling events
+ *
+ * Since: 3.0
+ */
+void
+gtk_tree_view_column_allocate_width (GtkTreeViewColumn *column,
+ gint width)
+{
+ GList *list;
+ GArray *array;
+ gint size = width;
+ gint focus_line_width;
+ gint expand_cell_count = 0, i;
+ gboolean first_cell = TRUE;
+ GtkRequestedSize *sizes;
+
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
+
+ column->width = width;
+
+ gtk_widget_style_get (column->tree_view, "focus-line-width", &focus_line_width, NULL);
+
+ array = g_array_new (0, TRUE, sizeof (GtkRequestedSize));
+
+ /* First get the overall expand space and collect the cell requests */
+ for (list = column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gboolean visible;
+ GtkRequestedSize requested;
+
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ if (info->expand == TRUE)
+ expand_cell_count++;
+
+ if (first_cell == FALSE)
+ size -= column->spacing;
+
+ size -= focus_line_width * 2;
+ size -= info->requested_width;
+
+ requested.data = info;
+ requested.minimum_size = info->requested_width;
+ requested.natural_size = info->natural_width;
+ g_array_append_val (array, requested);
+
+ first_cell = FALSE;
+ }
+
+ /* Distribute as much of remaining 'size' as possible before sharing expand space */
+ sizes = (GtkRequestedSize *)array->data;
- size = _gtk_distribute_allocation (size, array->len, sizes);
++ size = gtk_distribute_natural_allocation (size, array->len, sizes);
+
+ /* The rest gets split up evenly among expanding cells */
+ if (expand_cell_count > 0)
+ size /= expand_cell_count;
+
+ /* Allocate/assign info->real_width based in minimum/natural size + expand space */
+ for (i = 0, list = column->cell_list; list; list = list->next)
+ {
+ GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
+ gboolean visible;
+
+ g_object_get (info->cell, "visible", &visible, NULL);
+
+ if (visible == FALSE)
+ continue;
+
+ info->real_width = sizes[i].minimum_size + (info->expand ? size : 0);
+
+ i++;
+ }
+ g_array_free (array, TRUE);
+
+ g_object_notify (G_OBJECT (column), "width");
+}
+
-
-
-
- #define __GTK_TREE_VIEW_COLUMN_C__
- #include "gtkaliasdef.c"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]