[goffice] Ported to gtk+-3.0



commit 914bcabd48534e812f12464a939442ed5457dadf
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Aug 1 16:42:43 2011 +0200

    Ported to gtk+-3.0

 ChangeLog                                     |    4 +
 NEWS                                          |    4 +
 configure.in                                  |  101 +--
 goffice/Makefile.am                           |    7 +-
 goffice/app/go-cmd-context.c                  |    2 +-
 goffice/app/go-doc.c                          |   31 -
 goffice/app/go-plugin.c                       |    4 +-
 goffice/app/io-context.c                      |    8 +-
 goffice/canvas/goc-arc.c                      |   26 +-
 goffice/canvas/goc-canvas.c                   |   60 +-
 goffice/canvas/goc-ellipse.c                  |    4 +-
 goffice/canvas/goc-graph.c                    |    2 +-
 goffice/canvas/goc-group.c                    |    4 +-
 goffice/canvas/goc-item.c                     |    3 +-
 goffice/canvas/goc-path.c                     |    4 +-
 goffice/canvas/goc-polygon.c                  |    6 +-
 goffice/canvas/goc-polyline.c                 |    2 +-
 goffice/canvas/goc-rectangle.c                |    2 +-
 goffice/canvas/goc-styled-item.c              |    6 +-
 goffice/canvas/goc-text.c                     |  116 ++-
 goffice/canvas/goc-text.h                     |    3 +-
 goffice/canvas/goc-widget.c                   |    8 +-
 goffice/goffice-priv.h                        |    2 +-
 goffice/goffice.c                             |    7 +
 goffice/graph/Makefile.am                     |    1 +
 goffice/graph/gog-3d-box-prefs.ui             |  240 +++---
 goffice/graph/gog-3d-box.c                    |    6 +-
 goffice/graph/gog-axis-line.c                 |   36 +-
 goffice/graph/gog-axis-prefs.ui               | 1022 ++++++++++++-------------
 goffice/graph/gog-axis.c                      |   49 +-
 goffice/graph/gog-chart.c                     |    6 +-
 goffice/graph/gog-child-button.c              |    8 +-
 goffice/graph/gog-equation-prefs.ui           |    6 +-
 goffice/graph/gog-equation.c                  |  129 ++--
 goffice/graph/gog-error-bar-prefs.ui          |   12 +-
 goffice/graph/gog-error-bar.c                 |    3 +-
 goffice/graph/gog-graph-prefs.ui              |    4 +-
 goffice/graph/gog-graph.c                     |    8 +-
 goffice/graph/gog-guru-type-selector.ui       |  268 ++++----
 goffice/graph/gog-guru.c                      |   45 +-
 goffice/graph/gog-guru.ui                     |  191 +++--
 goffice/graph/gog-label.c                     |    4 +-
 goffice/graph/gog-legend.c                    |    2 +-
 goffice/graph/gog-object-prefs.ui             |   14 +-
 goffice/graph/gog-object.c                    |    6 +-
 goffice/graph/gog-plot-prefs.ui               |    8 +-
 goffice/graph/gog-plot.c                      |    2 +-
 goffice/graph/gog-reg-curve-prefs.ui          |    2 +-
 goffice/graph/gog-reg-eqn-prefs.ui            |    4 +-
 goffice/graph/gog-renderer.c                  |   53 +-
 goffice/graph/gog-renderer.h                  |   37 +-
 goffice/graph/gog-series-prefs.ui             |    8 +-
 goffice/graph/gog-series.c                    |   22 +-
 goffice/graph/gog-theme.c                     |   10 +-
 goffice/graph/gog-trend-line.c                |    2 +-
 goffice/graph/gog-view.h                      |    2 +-
 goffice/gtk/Makefile.am                       |    3 -
 goffice/gtk/go-3d-rotation-sel.c              |   30 +-
 goffice/gtk/go-3d-rotation-sel.ui             |   16 +-
 goffice/gtk/go-action-combo-color.c           |   28 +-
 goffice/gtk/go-action-combo-pixmaps.c         |   32 +-
 goffice/gtk/go-action-combo-stack.c           |   30 +-
 goffice/gtk/go-action-combo-text.c            |   38 +-
 goffice/gtk/go-charmap-sel.c                  |    6 +-
 goffice/gtk/go-color-palette.c                |   62 +-
 goffice/gtk/go-color-selector.c               |   24 +-
 goffice/gtk/go-combo-box.c                    |  104 ++--
 goffice/gtk/go-combo-box.h                    |    4 +-
 goffice/gtk/go-combo-color.c                  |    4 +-
 goffice/gtk/go-combo-color.h                  |    2 +-
 goffice/gtk/go-combo-pixmaps.c                |   10 +-
 goffice/gtk/go-combo-text.c                   |  142 ++--
 goffice/gtk/go-font-sel.c                     |   21 +-
 goffice/gtk/go-format-sel.c                   |   15 +-
 goffice/gtk/go-format-sel.ui                  |   22 +-
 goffice/gtk/go-graph-widget.c                 |   16 +-
 goffice/gtk/go-gtk-compat.h                   |  151 ----
 goffice/gtk/go-image-save-dialog-extra.ui     |    4 +-
 goffice/gtk/go-image-sel.ui                   |  131 ++--
 goffice/gtk/go-locale-sel.c                   |    6 +-
 goffice/gtk/go-optionmenu.c                   |   51 +-
 goffice/gtk/go-optionmenu.h                   |    1 +
 goffice/gtk/go-palette.c                      |   11 +-
 goffice/gtk/go-rotation-sel.c                 |   29 +-
 goffice/gtk/go-rotation-sel.ui                |   10 +-
 goffice/gtk/go-selector.c                     |   40 +-
 goffice/gtk/go-selector.h                     |    4 +-
 goffice/gtk/goffice-gtk.c                     |  115 +--
 goffice/gtk/goffice-gtk.h                     |    6 +-
 goffice/math/go-regression.c                  |    4 +-
 goffice/utils/go-color.c                      |   20 +-
 goffice/utils/go-color.h                      |    4 +-
 goffice/utils/go-file.c                       |   14 +-
 goffice/utils/go-format.c                     |    2 +-
 goffice/utils/go-image.c                      |   14 +-
 goffice/utils/go-path.c                       |    2 +-
 goffice/utils/go-style-prefs.ui               |  588 ++++++++-------
 goffice/utils/go-style.c                      |    8 +-
 goffice/utils/goffice-utils.h                 |   20 +
 goffice/utils/regutf8.c                       |  106 ---
 libgoffice.pc.in                              |    4 +-
 plugins/plot_barcol/gog-barcol-prefs.c        |    1 -
 plugins/plot_barcol/gog-barcol.c              |    2 +-
 plugins/plot_barcol/gog-minmax.c              |    1 -
 plugins/plot_distrib/gog-boxplot.c            |    1 -
 plugins/plot_distrib/gog-histogram.c          |   30 +-
 plugins/plot_distrib/gog-probability-plot.c   |    2 +-
 plugins/plot_pie/gog-pie-prefs.c              |    1 -
 plugins/plot_pie/gog-pie-series.ui            |    2 +-
 plugins/plot_pie/gog-pie.c                    |    2 +-
 plugins/plot_radar/gog-radar.c                |   14 +-
 plugins/plot_surface/gog-xyz-surface-prefs.c  |    3 +-
 plugins/plot_surface/gog-xyz-surface-prefs.ui |    4 +-
 plugins/plot_xy/gog-bubble-prefs.c            |    1 -
 plugins/plot_xy/gog-bubble-prefs.ui           |    2 +-
 plugins/plot_xy/gog-xy-dropbar.c              |    4 +-
 plugins/plot_xy/gog-xy-series-prefs.ui        |    2 +-
 plugins/plot_xy/gog-xy.c                      |    2 +-
 plugins/reg_linear/gog-lin-reg.c              |    2 +-
 plugins/smoothing/gog-exp-smooth.c            |    4 +-
 plugins/smoothing/gog-moving-avg.c            |    4 +-
 plugins/smoothing/gog-moving-avg.ui           |    4 +-
 tests/go-demo.c                               |    2 +-
 tests/mf-demo.c                               |  238 +++---
 tests/pie-demo.c                              |    2 +-
 tests/shapes-demo.c                           |   33 +-
 126 files changed, 2215 insertions(+), 2728 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2ebda93..c6016f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,10 @@
 	* goffice/utils/go-string.c (go_string_new_rich): ensure we have determined
 	the byte_len (if it was negative or zero)
 
+2011-08-01  Jean Brefort  <jean brefort normalesup org>
+
+	* all files: port to gtk+-3.0.
+
 2011-08-01  Morten Welinder <terra gnome org>
 
 	* configure.in: Branch to 0.9.0.
diff --git a/NEWS b/NEWS
index b293a0e..c9dd19a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ goffice 0.9.0:
 Andreas:
 	* Use pango attributes for formatting. [#584380][#651561]
 
+Jean:
+	* Port to gtk+-3.0.
+	* Add a plugin directory for extern plugins, independent from micro version.
+
 --------------------------------------------------------------------------
 goffice 0.8.17:
 
diff --git a/configure.in b/configure.in
index d71b962..0f18cf9 100644
--- a/configure.in
+++ b/configure.in
@@ -93,24 +93,25 @@ PKG_PROG_PKG_CONFIG
 
 dnl *****************************
 goffice_reqs="
-	glib-2.0		>= 2.8.0
-	gobject-2.0		>= 2.16.0
-	gmodule-2.0		>= 2.16.0
-	gio-2.0			>= 2.16.0
+	glib-2.0		>= 2.28.0
+	gobject-2.0		>= 2.28.0
+	gmodule-2.0		>= 2.28.0
+	gio-2.0			>= 2.28.0
 	libgsf-1		>= 1.14.9
 	libxml-2.0		>= 2.4.12
-	pango			>= 1.8.1
-	pangocairo		>= 1.8.1
-	cairo			>= 1.2.0
+	pango			>= 1.24.0
+	pangocairo		>= 1.24.0
+	cairo			>= 1.10.0
 "
+
 goffice_gtk_reqs="
-	gtk+-2.0		>= 2.12.0
+	gtk+-3.0		>= 3.0.0
 "
 
 surfaces_reqs="
-	cairo-ps		>= 1.2.0
-	cairo-pdf		>= 1.2.0
-	cairo-svg		>= 1.2.0
+	cairo-ps		>= 1.10.0
+	cairo-pdf		>= 1.10.0
+	cairo-svg		>= 1.10.0
 "
 
 PKG_CHECK_MODULES(surfaces, $surfaces_reqs)
@@ -124,17 +125,18 @@ dnl ***********************
 goffice_with_lasem=false
 AC_ARG_WITH(lasem, [  --with-lasem          Build with lasem use])
 if test "x$with_lasem" = xyes; then
-	PKG_CHECK_MODULES(Lasem, lasem-0.2 >= 0.2.0)
+	PKG_CHECK_MODULES(Lasem, lasem-0.4 >= 0.3.1)
 	goffice_with_lasem=true
 fi
 if test "x$goffice_with_lasem" = "xtrue" ; then
 	AC_DEFINE(GOFFICE_WITH_LASEM, 1, [Define if Lasem is used])
-	goffice_reqs="$goffice_reqs lasem-0.2 >= 0.2.0 "
-	EXTRA_DEPS="$EXTRA_DEPS lasem-0.2"
+	goffice_reqs="$goffice_reqs lasem-0.4 >= 0.3.1 "
+	EXTRA_DEPS="$EXTRA_DEPS lasem-0.4"
 fi
 
 AM_CONDITIONAL(GOFFICE_WITH_LASEM, $goffice_with_lasem)
 
+
 dnl *****************************
 AC_MSG_CHECKING([for Win32 platform])
 with_win32=no
@@ -237,21 +239,6 @@ fi
 if test "x$goffice_with_gtk" = "xtrue" ; then
 	AC_DEFINE(GOFFICE_WITH_GTK, 1, [Define if UI is built])
 	goffice_reqs="$goffice_reqs $goffice_gtk_reqs"
-
-	dnl ***************************
-	dnl Is gtk_show_uri available ?
-	dnl ***************************
-
-	SAVE_CFLAGS=$CFLAGS
-	SAVE_LIBS=$LIBS
-	CFLAGS="$CFLAGS $TK_CFLAGS"
-	LIBS="$GTK_LIBS $LIBS"
-	AC_CHECK_FUNC([gtk_show_uri],[have_gtk_show_uri=yes],[have_gtk_show_uri=false])
-	CFLAGS=$SAVE_CFLAGS
-	LIBS=$SAVE_LIBS
-	if test "x$have_gtk_show_uri" = xyes; then
-		AC_DEFINE(HAVE_GTK_SHOW_URI, 1, [Define to 1 if you have the `have_gtk_show_uri' function.])
-	fi
 fi
 
 AM_CONDITIONAL(WITH_GTK,   $goffice_with_gtk)
@@ -306,7 +293,7 @@ fi
 
 dnl disable for in stable release, re-enable for development series
 gtk_disable_deprecated=no
-if test XXX$goffice_devel = yes; then
+if test $goffice_devel = yes; then
 	CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
 	CFLAGS="$CFLAGS -DPANGO_DISABLE_DEPRECATED"
 	if test "x$goffice_with_gtk" = "xtrue"; then
@@ -465,67 +452,16 @@ dnl Handle systems that have stuff in -lm.
 AC_CHECK_FUNCS(log)
 if test $ac_cv_func_log = no; then
   AC_CHECK_LIB(m, log,
-        [AC_DEFINE(HAVE_LOG, 1,
+        [AC_DEFINE(H,AVE_LOG, 1,
 		[Define if the log function is available]
 	 )
          LIBS="$LIBS -lm"])
 fi
 
-SAVE_LIBS=$LIBS
-LIBS="$GOFFICE_LIBS $LIBS"
-AC_CHECK_FUNCS(cairo_surface_set_fallback_resolution cairo_ps_surface_set_eps)
-AC_CHECK_FUNCS(g_file_new_for_commandline_arg g_file_new_for_uri g_hash_table_iter_init)
-AC_CHECK_FUNCS(g_content_type_from_mime_type)
-AC_CHECK_FUNCS(get_gsf_odf_version)
-AC_CHECK_FUNCS(gtk_adjustment_get_page_size gtk_adjustment_get_upper \
-	gtk_color_selection_dialog_get_color_selection gtk_dialog_get_action_area \
-	gtk_layout_get_bin_window gtk_menu_shell_get_active gtk_selection_data_get_data \
-	gtk_selection_data_get_length gtk_selection_data_get_target gtk_tearoff_menu_item_get_torn_off \
-	gtk_tearoff_menu_item_set_torn_off gtk_widget_get_allocation gtk_widget_get_has_window \
-	gtk_widget_get_state gtk_widget_get_style gtk_widget_get_visible gtk_widget_get_window \
-	gtk_widget_has_focus gtk_widget_get_mapped gtk_widget_get_realized gtk_widget_set_can_default \
-	gtk_widget_is_sensitive gtk_widget_send_focus_change gtk_widget_set_can_focus \
-	gtk_widget_set_receives_default gtk_window_get_default_widget)
-LIBS=$SAVE_LIBS
-
-SAVE_CFLAGS=$CFLAGS
-SAVE_LIBS=$LIBS
-CFLAGS="$CFLAGS $GOFFICE_CFLAGS"
-LIBS="$GOFFICE_LIBS $LIBS"
-AC_MSG_CHECKING([for G_REGEX_ERROR_STRAY_BACKSLASH])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <glib/gregex.h>]], [[GRegexError error=G_REGEX_ERROR_STRAY_BACKSLASH;]])],
-               [AC_DEFINE(HAVE_G_REGEX_ERROR_STRAY_BACKSLASH, 1, [Define if G_REGEX_ERROR_STRAY_BACKSLASH is defined])
-	        glib_has_G_REGEX_ERROR_STRAY_BACKSLASH=yes
-                AC_MSG_RESULT(yes)],
-               [AC_MSG_RESULT(no)
-	        glib_has_G_REGEX_ERROR_STRAY_BACKSLASH=no])
-if test "x$goffice_with_gtk" = "xtrue" ; then
-  AC_CHECK_FUNCS(gtk_dialog_get_response_for_widget)
-  AC_CHECK_FUNCS(gtk_widget_set_tooltip_text gtk_tool_item_set_tooltip_text,
-		 [test $gtk_disable_deprecated = no || gtk_disable_deprecated=yes])
-  AC_CHECK_FUNCS(gdk_cairo_set_source_pixbuf gdk_x11_drawable_get_xdisplay)
-fi
-CFLAGS=$SAVE_CFLAGS
-LIBS=$SAVE_LIBS
 if test $gtk_disable_deprecated = yes; then
   CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
 fi
 
-if test "x$glib_has_G_REGEX_ERROR_STRAY_BACKSLASH" = "xno"; then
-  dnl Check for working pcre
-  AC_CHECK_HEADER(pcre.h,[], AC_MSG_ERROR([Header files for PCRE were not found]))
-  AC_CHECK_LIB(pcre,pcre_compile2,[], AC_MSG_ERROR([The PCRE library is missing or too old]))
-  AC_MSG_CHECKING([for UTF-8 support in pcre])
-  if (pcretest -C 2>&1) | grep -i "^ *UTF-8 support" >/dev/null; then
-      AC_MSG_RESULT(yes)
-      LIBS="$LIBS -lpcre"
-      EXTRA_LIBS="$EXTRA_LIBS -lpcre"
-  else
-      AC_MSG_ERROR([The installed PCRE library is not configured for UTF-8 support.])
-  fi
-fi
-
-
 AC_DEFUN([GOFFICE_CHECK_FUNC],
 [AC_CHECK_FUNC([$1],
 	[],
@@ -644,6 +580,7 @@ AC_SUBST(goffice_icondir, '${datadir}/pixmaps/goffice/${VERSION}')
 AC_SUBST(goffice_localedir, '${prefix}/${DATADIRNAME}/locale')
 dnl
 AC_SUBST(goffice_plugindir, '${goffice_libdir}/plugins')
+AC_SUBST(goffice_externplugindir, '${libdir}/goffice/${GOFFICE_API_VER}/plugins')
 
 dnl Export to goffice-config.h and goffice-features.h
 AC_DEFINE(GOFFICE_VERSION, "goffice_full_version",
diff --git a/goffice/Makefile.am b/goffice/Makefile.am
index 4a89b56..ab340d3 100644
--- a/goffice/Makefile.am
+++ b/goffice/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = utils data app graph math ms-compat
+SUBDIRS = utils data app graph math
 
 lib_LTLIBRARIES = libgoffice- GOFFICE_API_VER@.la
 
@@ -8,14 +8,12 @@ libgoffice_ GOFFICE_API_VER@_la_LIBADD = 			\
 	data/libgoffice-data.la			\
 	graph/libgoffice-graph.la		\
 	math/libgoffice-math.la		\
-	ms-compat/libgoffice-ms-compat.la	\
 	$(GOFFICE_LIBS)
 
 if WITH_GTK
-SUBDIRS += gtk drawing component canvas
+SUBDIRS += gtk component canvas
 libgoffice_ GOFFICE_API_VER@_la_LIBADD += 			\
 	gtk/libgoffice-gtk.la			\
-	drawing/libgoffice-drawing.la		\
 	component/libgoffice-component.la	\
 	canvas/libgoffice-canvas.la
 endif
@@ -51,6 +49,7 @@ goffice-paths.h: Makefile
 	echo '#define GOFFICE_LIBDIR "$(goffice_libdir)"'; \
 	echo '#define GOFFICE_ICONDIR "$(goffice_icondir)"'; \
 	echo '#define GOFFICE_LOCALEDIR "$(goffice_localedir)"'; \
+	echo '#define GOFFICE_EXTERNPLUGINDIR "$(goffice_externplugindir)"'; \
 	echo ''; \
 	echo '#endif /* GOFFICE_PATHS_H */'; \
 	) >$@
diff --git a/goffice/app/go-cmd-context.c b/goffice/app/go-cmd-context.c
index 408b954..54e937f 100644
--- a/goffice/app/go-cmd-context.c
+++ b/goffice/app/go-cmd-context.c
@@ -149,7 +149,7 @@ go_cmd_context_set_sensitive (GOCmdContext *cc, gboolean sensitive)
 }
 
 
-static void    
+static void
 go_cmd_context_error_info_list_default 	(GOCmdContext *gcc, GSList *errs)
 {
 	if (errs == NULL)
diff --git a/goffice/app/go-doc.c b/goffice/app/go-doc.c
index f79218b..a2b9111 100644
--- a/goffice/app/go-doc.c
+++ b/goffice/app/go-doc.c
@@ -333,25 +333,6 @@ go_doc_get_image (GODoc *doc, char const *id)
 		NULL;
 }
 
-#ifndef HAVE_G_HASH_TABLE_ITER_INIT
-struct check_for_pixbuf {
-	GOImage *src_image;
-	GOImage *dst_image;
-};
-
-static void
-check_for_pixbuf (gpointer key, gpointer img_, gpointer user)
-{
-	GOImage *img = img_;
-	struct check_for_pixbuf *cl = user;
-
-	if (cl->dst_image == NULL) {
-		if (go_image_same_pixbuf (cl->src_image, img))
-			cl->dst_image = img;
-	}
-}
-#endif
-
 /** go_doc_add_image:
  * @doc: a #GODoc
  * @id: the image name or NULL
@@ -368,30 +349,18 @@ go_doc_add_image (GODoc *doc, char const *id, GOImage *image)
 	GOImage *img;
 	int i = 0;
 	char *new_id;
-#ifdef HAVE_G_HASH_TABLE_ITER_INIT
 	GHashTableIter iter;
 	char const *key;
-#else
-	struct check_for_pixbuf cl;
-#endif
 
 	if (doc->images == NULL)
 		doc->images = g_hash_table_new_full (g_str_hash, g_str_equal,
 						     g_free, g_object_unref);
 
 	/* check if the image is already there */
-#ifdef HAVE_G_HASH_TABLE_ITER_INIT
 	g_hash_table_iter_init (&iter, doc->images);
 	while (g_hash_table_iter_next (&iter, (void**) &key, (void**) &img))
 		if (go_image_same_pixbuf (image, img))
 			return img;
-#else
-	cl.src_image = image;
-	cl.dst_image = NULL;
-	g_hash_table_foreach (doc->images, check_for_pixbuf, &img);
-	if (cl.dst_image)
-		return cl.dst_image;
-#endif
 
 	if (!id || !*id)
 		id = _("Image");
diff --git a/goffice/app/go-plugin.c b/goffice/app/go-plugin.c
index 4d96db1..fc155e3 100644
--- a/goffice/app/go-plugin.c
+++ b/goffice/app/go-plugin.c
@@ -1724,8 +1724,10 @@ append_dir (gpointer data, G_GNUC_UNUSED gpointer user_data)
 static void
 go_plugins_set_dirs (GSList *plugin_dirs)
 {
-	if (!go_plugin_dirs)
+	if (!go_plugin_dirs) {
 		go_plugin_dirs = g_slist_prepend (NULL, go_plugins_get_plugin_dir ());
+		go_plugin_dirs = g_slist_append (go_plugin_dirs, g_strdup (go_sys_extern_plugin_dir ()));
+	}
 	g_slist_foreach (plugin_dirs, append_dir, NULL);
 	g_slist_free (plugin_dirs);
 }
diff --git a/goffice/app/io-context.c b/goffice/app/io-context.c
index 36fd8d0..d94a8b7 100644
--- a/goffice/app/io-context.c
+++ b/goffice/app/io-context.c
@@ -204,7 +204,7 @@ go_io_error_push (GOIOContext *context, GOErrorInfo *error)
 {
 	g_return_if_fail (context != NULL);
 	g_return_if_fail (error != NULL);
-	
+
 	if (context->info == NULL)
 		go_io_error_info_set (context, error);
 	else {
@@ -226,7 +226,7 @@ go_io_error_display (GOIOContext *context)
 			cc = context->impl;
 		else
 			cc = GO_CMD_CONTEXT (context);
-		go_cmd_context_error_info_list 
+		go_cmd_context_error_info_list
 			(cc, context->info);
 	}
 }
@@ -478,8 +478,8 @@ go_io_warning (G_GNUC_UNUSED GOIOContext *context,
 void
 go_io_warning_varargs (GOIOContext *context, char const *fmt, va_list args)
 {
-	context->info = g_slist_prepend 
-		(context->info, go_error_info_new_vprintf 
+	context->info = g_slist_prepend
+		(context->info, go_error_info_new_vprintf
 		 (GO_WARNING, fmt, args));
 	context->warning_occurred = TRUE;
 }
diff --git a/goffice/canvas/goc-arc.c b/goffice/canvas/goc-arc.c
index 1ef15dd..300270e 100644
--- a/goffice/canvas/goc-arc.c
+++ b/goffice/canvas/goc-arc.c
@@ -53,7 +53,7 @@ enum {
 	ARC_TYPE_CHORD,
 	ARC_TYPE_PIE
 };
-	
+
 static void
 goc_arc_set_property (GObject *gobject, guint param_id,
 				    GValue const *value, GParamSpec *pspec)
@@ -145,7 +145,7 @@ goc_arc_get_property (GObject *gobject, guint param_id,
 	case ARC_PROP_TYPE:
 		g_value_set_int (value, arc->type);
 		break;
-		
+
 	case ARC_PROP_START_ARROW:
 		g_value_set_boxed (value, &arc->start_arrow);
 		break;
@@ -165,11 +165,11 @@ goc_arc_start (GocItem const *item, double *x, double *y, double *phi)
 	GocArc *arc = GOC_ARC (item);
 	double x1, y1, s;
 	double sign = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? -1.: 1.;
-	
+
 	x1 = arc->xr * cos (atan2 (arc->xr / arc->yr * sin (arc->ang1), cos (arc->ang1)));
 	y1 = arc->yr * sin (atan2 (arc->xr / arc->yr * sin (arc->ang1), cos (arc->ang1)));
 	s = sqrt (x1 * x1 + y1 * y1);
-	
+
 	(*x) = arc->xc + s * cos (arc->ang1 - arc->rotation) * sign;
 	(*y) = arc->yc - s * sin (arc->ang1 - arc->rotation);
 	(*phi) = atan2 (arc->yr * arc->yr * x1, arc->xr * arc->xr * y1) + arc->rotation;
@@ -184,7 +184,7 @@ goc_arc_end (GocItem const *item, double *x, double *y, double *phi)
 	GocArc *arc = GOC_ARC (item);
 	double x1, y1, s;
 	double sign = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? -1.: 1.;
-	
+
 	x1 = arc->xr * cos (atan2 (arc->xr / arc->yr * sin (arc->ang2), cos (arc->ang2)));
 	y1 = arc->yr * sin (atan2 (arc->xr / arc->yr * sin (arc->ang2), cos (arc->ang2)));
 	s = sqrt (x1 * x1 + y1 * y1);
@@ -208,7 +208,7 @@ prepare_draw_arrow (GocItem const *item, cairo_t *cr, gboolean end, gboolean fla
 	double rsign = sign;
 
 	w = style->line.width? style->line.width / 2.0: 0.5;
-	
+
 	if (0 == end) {
 		arrow = arc->start_arrow;
 		goc_arc_start (item, &x, &y, &phi);
@@ -216,7 +216,7 @@ prepare_draw_arrow (GocItem const *item, cairo_t *cr, gboolean end, gboolean fla
 		arrow = arc->end_arrow;
 		goc_arc_end (item, &x, &y, &phi);
 	}
-	
+
 	cairo_save (cr);
 	if (1 == flag) {
 		goc_group_cairo_transform (item->parent, cr, arc->xc, arc->yc);
@@ -225,7 +225,7 @@ prepare_draw_arrow (GocItem const *item, cairo_t *cr, gboolean end, gboolean fla
 		cairo_translate (cr, arc->xc, arc->yc);
 		rsign = 1;
 	}
-	
+
 	switch (arrow.typ) {
 	case GO_ARROW_KITE:
 		cairo_save (cr);
@@ -244,7 +244,7 @@ prepare_draw_arrow (GocItem const *item, cairo_t *cr, gboolean end, gboolean fla
 		cairo_close_path (cr);
 		cairo_restore (cr);
 		break;
-		
+
 	case GO_ARROW_OVAL:
 		cairo_save (cr);
 		cairo_translate (cr, (x - arc->xc) * sign, y - arc->yc);
@@ -259,9 +259,9 @@ prepare_draw_arrow (GocItem const *item, cairo_t *cr, gboolean end, gboolean fla
 	default:
 		g_assert_not_reached ();
 	}
-	
+
 	cairo_restore (cr);
-	
+
 }
 
 static gboolean
@@ -374,7 +374,7 @@ static void
 goc_arc_draw (GocItem const *item, cairo_t *cr)
 {
 	GocArc *arc = GOC_ARC (item);
-	
+
 
 	cairo_save(cr);
 
@@ -480,7 +480,7 @@ goc_arc_class_init (GocItemClass *item_klass)
 			_("The type of arc: arc, chord or pie"),
 			0, 2, 0,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE));
-			
+
 	g_object_class_install_property (obj_klass, ARC_PROP_START_ARROW,
 		g_param_spec_boxed ("start-arrow",
 			_("Start Arrow"),
diff --git a/goffice/canvas/goc-canvas.c b/goffice/canvas/goc-canvas.c
index 5d6c2fd..f8b1a6c 100644
--- a/goffice/canvas/goc-canvas.c
+++ b/goffice/canvas/goc-canvas.c
@@ -22,7 +22,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include <gsf/gsf-impl-utils.h>
 #include <math.h>
 
@@ -44,29 +43,43 @@
 static GObjectClass *parent_klass;
 
 static gboolean
-expose_cb (GocCanvas *canvas, GdkEventExpose *event, G_GNUC_UNUSED gpointer data)
+goc_canvas_draw (GtkWidget *widget, cairo_t *cr)
 {
 	double x0, y0, x1, y1;
 	double ax0, ay0, ax1, ay1;
-
-       if (event->count)
-		return TRUE;
-	goc_item_get_bounds (GOC_ITEM (canvas->root),&x0, &y0, &x1, &y1);
-	if (canvas->direction == GOC_DIRECTION_RTL) {
-		ax1 = (double)  (canvas->width - event->area.x) / canvas->pixels_per_unit + canvas->scroll_x1;
-		ax0 = (double) (canvas->width - event->area.x - event->area.width) / canvas->pixels_per_unit + canvas->scroll_x1;
+	GocCanvas *canvas = GOC_CANVAS (widget);
+	GdkEventExpose *event = (GdkEventExpose *) gtk_get_current_event ();
+
+	if (event && event->type == GDK_EXPOSE) {
+		if (event->count)
+			return TRUE;
+		goc_item_get_bounds (GOC_ITEM (canvas->root),&x0, &y0, &x1, &y1);
+		if (canvas->direction == GOC_DIRECTION_RTL) {
+			ax1 = (double) (canvas->width - event->area.x) / canvas->pixels_per_unit + canvas->scroll_x1;
+			ax0 = (double) (canvas->width - event->area.x - event->area.width) / canvas->pixels_per_unit + canvas->scroll_x1;
+		} else {
+			ax0 = (double) event->area.x / canvas->pixels_per_unit + canvas->scroll_x1;
+			ax1 = ((double) event->area.x + event->area.width) / canvas->pixels_per_unit + canvas->scroll_x1;
+		}
+		ay0 = (double) event->area.y / canvas->pixels_per_unit + canvas->scroll_y1;
+		ay1 = ((double) event->area.y + event->area.height) / canvas->pixels_per_unit + canvas->scroll_y1;
+		if (x0 <= ax1 && x1 >= ax0 && y0 <= ay1 && y1 >= ay0) {
+			canvas->cur_event = (GdkEvent *) event;
+			goc_item_draw_region (GOC_ITEM (canvas->root), cr, ax0, ay0, ax1, ay1);
+		}
 	} else {
-		ax0 = (double) event->area.x / canvas->pixels_per_unit + canvas->scroll_x1;
-		ax1 = ((double) event->area.x + event->area.width) / canvas->pixels_per_unit + canvas->scroll_x1;
-	}
-	ay0 = (double) event->area.y / canvas->pixels_per_unit + canvas->scroll_y1;
-	ay1 = ((double) event->area.y + event->area.height) / canvas->pixels_per_unit + canvas->scroll_y1;
-	if (x0 <= ax1 && x1 >= ax0 && y0 <= ay1 && y1 >= ay0) {
-		cairo_t *cr = gdk_cairo_create (event->window);
-		canvas->cur_event = (GdkEvent *) event;
-		goc_item_draw_region (GOC_ITEM (canvas->root), cr, ax0, ay0, ax1, ay1);
-		cairo_destroy (cr);
-		canvas->cur_event = NULL;
+		goc_item_get_bounds (GOC_ITEM (canvas->root),&x0, &y0, &x1, &y1);
+		if (canvas->direction == GOC_DIRECTION_RTL) {
+			ax1 = (double)  canvas->width / canvas->pixels_per_unit + canvas->scroll_x1;
+			ax0 = canvas->scroll_x1;
+		} else {
+			ax0 = canvas->scroll_x1;
+			ax1 = (double)  canvas->width / canvas->pixels_per_unit + canvas->scroll_x1;
+		}
+		ay0 = canvas->scroll_y1;
+		ay1 = (double) canvas->height / canvas->pixels_per_unit + canvas->scroll_y1;
+		if (x0 <= ax1 && x1 >= ax0 && y0 <= ay1 && y1 >= ay0)
+			goc_item_draw_region (GOC_ITEM (canvas->root), cr, ax0, ay0, ax1, ay1);
 	}
 	return TRUE;
 }
@@ -255,9 +268,13 @@ goc_canvas_dispose (GObject *obj)
 static void
 goc_canvas_class_init (GObjectClass *klass)
 {
+	GtkWidgetClass *widget_klass = (GtkWidgetClass *) klass;
+
 	parent_klass = g_type_class_peek_parent (klass);
 	klass->finalize = goc_canvas_finalize;
 	klass->dispose = goc_canvas_dispose;
+
+	widget_klass->draw = goc_canvas_draw;
 }
 
 static void
@@ -281,7 +298,6 @@ goc_canvas_init (GocCanvas *canvas)
 	g_signal_connect (G_OBJECT (w), "button-press-event", G_CALLBACK (button_press_cb), NULL);
 	g_signal_connect (G_OBJECT (w), "button-release-event", G_CALLBACK (button_release_cb), NULL);
 	g_signal_connect (G_OBJECT (w), "motion-notify-event", G_CALLBACK (motion_cb), NULL);
-	g_signal_connect (G_OBJECT (w), "expose-event", G_CALLBACK (expose_cb), NULL);
 	g_signal_connect (G_OBJECT (w), "key_press_event", (GCallback) key_press_cb, NULL);
 	g_signal_connect (G_OBJECT (w), "key_release_event", (GCallback) key_release_cb, NULL);
 	g_signal_connect (G_OBJECT (w), "size-allocate", (GCallback) size_changed_cb, NULL);
@@ -585,7 +601,7 @@ goc_canvas_get_direction (GocCanvas *canvas)
  * @y: the vertical position as a widget coordinate.
  * @x_: where to store the horizontal position as a canvas coordinate.
  * @y_: where to store the vertical position as a canvas coordinate.
- * 
+ *
  * Retrieves the canvas coordinates given the position in the widget.
  **/
 void
diff --git a/goffice/canvas/goc-ellipse.c b/goffice/canvas/goc-ellipse.c
index b887e40..ec3b5d4 100644
--- a/goffice/canvas/goc-ellipse.c
+++ b/goffice/canvas/goc-ellipse.c
@@ -112,10 +112,10 @@ goc_ellipse_prepare_draw (GocItem const *item, cairo_t *cr, gboolean flag)
 {
 	GocEllipse *ellipse = GOC_ELLIPSE (item);
 	double sign = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? -1.: 1.;
-	
+
 	if (0 == ellipse->width && 0 == ellipse->height)
 		return FALSE;
-		
+
 	cairo_save(cr);
 	if (1 == flag) {
 		goc_group_cairo_transform (item->parent, cr, ellipse->x + ellipse->width/2., ellipse->y + ellipse->height/2.);
diff --git a/goffice/canvas/goc-graph.c b/goffice/canvas/goc-graph.c
index 163b87d..16a71cd 100644
--- a/goffice/canvas/goc-graph.c
+++ b/goffice/canvas/goc-graph.c
@@ -219,7 +219,7 @@ goc_graph_update_bounds (GocItem *item)
 	item->y0 = graph->y;
 	item->x1 = graph->x + graph->w;
 	item->y1 = graph->y + graph->h;
-	gog_renderer_update (graph->renderer, 
+	gog_renderer_update (graph->renderer,
 				      (int) (graph->w * item->canvas->pixels_per_unit),
 				      (int) (graph->h * item->canvas->pixels_per_unit));
 }
diff --git a/goffice/canvas/goc-group.c b/goffice/canvas/goc-group.c
index 3c38739..83540d6 100644
--- a/goffice/canvas/goc-group.c
+++ b/goffice/canvas/goc-group.c
@@ -371,7 +371,7 @@ goc_group_remove_child (GocGroup *parent, GocItem *item)
  *
  * Adds @group horizontal offset to @x0 and @x1, and vertical offset to @y0
  * and @y1. This function is called recursively so that when returning @x0,
- * @y0, @x1, and @y1 are absolute coordinates in canvas space, 
+ * @y0, @x1, and @y1 are absolute coordinates in canvas space,
  **/
 void
 goc_group_adjust_bounds (GocGroup const *group, double *x0, double *y0, double *x1, double *y1)
@@ -395,7 +395,7 @@ goc_group_adjust_bounds (GocGroup const *group, double *x0, double *y0, double *
  *
  * Adds @group horizontal offset to @x0, and vertical offset to @y0.
  * This function is called recursively so that when returning @x0 and
- * @y0 are absolute coordinates in canvas space, 
+ * @y0 are absolute coordinates in canvas space,
  **/
 void
 goc_group_adjust_coords (GocGroup const *group, double *x, double *y)
diff --git a/goffice/canvas/goc-item.c b/goffice/canvas/goc-item.c
index 3957016..6cb6dcf 100644
--- a/goffice/canvas/goc-item.c
+++ b/goffice/canvas/goc-item.c
@@ -22,7 +22,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include <gtk/gtk.h>
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -414,7 +413,7 @@ goc_item_draw (GocItem const *item, cairo_t *cr)
  * @y0: the lowest vertical bound of the region to draw
  * @x1: the highest horizontal bound of the region to draw
  * @y1: the highest vertical bound of the region to draw
- * 
+ *
  * Renders @item using @cr, limiting all drawings to the region limited by
  * @x0, @y0, @x1, and @y1. If this function returns %FALSE, #goc_item_draw
  * should be called. There is no need to call this function directly.
diff --git a/goffice/canvas/goc-path.c b/goffice/canvas/goc-path.c
index ed9dde6..e7d310d 100644
--- a/goffice/canvas/goc-path.c
+++ b/goffice/canvas/goc-path.c
@@ -60,11 +60,11 @@ goc_path_set_property (GObject *gobject, guint param_id,
 	case PATH_PROP_ROTATION:
 		path->rotation = g_value_get_double (value);
 		break;
-		
+
 	case PATH_PROP_CLOSED:
 		path->closed = g_value_get_boolean (value);
 		break;
-		
+
 	case PATH_PROP_PATH:
 		path->path = g_value_peek_pointer (value);
 		break;
diff --git a/goffice/canvas/goc-polygon.c b/goffice/canvas/goc-polygon.c
index 5f82c16..b6f6909 100644
--- a/goffice/canvas/goc-polygon.c
+++ b/goffice/canvas/goc-polygon.c
@@ -178,7 +178,7 @@ goc_polygon_prepare_path (GocItem const *item, cairo_t *cr, gboolean flag)
 
 	if (polygon->nb_points == 0)
 		return FALSE;
-		
+
 	cairo_set_fill_rule (cr, priv->fill_rule);
 	if (1 == flag) {
 		goc_group_cairo_transform (item->parent, cr, polygon->points[0].x, polygon->points[0].y);
@@ -212,7 +212,7 @@ goc_polygon_prepare_path (GocItem const *item, cairo_t *cr, gboolean flag)
 				cairo_line_to (cr, (polygon->points[i].x - polygon->points[0].x * flag) * sign,
 						polygon->points[i].y - polygon->points[0].y * flag);
 			cairo_close_path (cr);
-			
+
 		} else {
 		    for (i = 1; i < (int) polygon->nb_points; i++)
 			cairo_line_to (cr, (polygon->points[i].x - polygon->points[0].x * flag) * sign,
@@ -220,7 +220,7 @@ goc_polygon_prepare_path (GocItem const *item, cairo_t *cr, gboolean flag)
 		    cairo_close_path (cr);
 		}
 	}
-	
+
 	return TRUE;
 }
 
diff --git a/goffice/canvas/goc-polyline.c b/goffice/canvas/goc-polyline.c
index 44a04d2..3ecbd3d 100644
--- a/goffice/canvas/goc-polyline.c
+++ b/goffice/canvas/goc-polyline.c
@@ -133,7 +133,7 @@ goc_polyline_prepare_draw (GocItem const *item, cairo_t *cr, gboolean flag)
 				cairo_line_to (cr, (polyline->points[i].x - polyline->points[0].x * flag) * sign,
 					polyline->points[i].y - polyline->points[0].y * flag);
 		}
-		
+
 		return TRUE;
 	}
 
diff --git a/goffice/canvas/goc-rectangle.c b/goffice/canvas/goc-rectangle.c
index 607f0ec..3ba6ca9 100644
--- a/goffice/canvas/goc-rectangle.c
+++ b/goffice/canvas/goc-rectangle.c
@@ -159,7 +159,7 @@ goc_rectangle_prepare_draw (GocItem const *item, cairo_t *cr, gboolean flag)
 
 	if (0 == rect->width && 0 == rect->height)
 		return FALSE;
-		
+
 	cairo_save(cr);
 	if (1 == flag) {
 		goc_group_cairo_transform (item->parent, cr, rect->x, rect->y);
diff --git a/goffice/canvas/goc-styled-item.c b/goffice/canvas/goc-styled-item.c
index 9b155ae..c539cbf 100644
--- a/goffice/canvas/goc-styled-item.c
+++ b/goffice/canvas/goc-styled-item.c
@@ -137,8 +137,8 @@ goc_styled_item_class_init (GocItemClass *goc_klass)
  * @gsi: the object on which the signal is emitted
  * @style: the new #GOStyle.
  *
- * The ::style-changed signal is emitted when a new style 
- * has been set on a styled item. 
+ * The ::style-changed signal is emitted when a new style
+ * has been set on a styled item.
  **/
 	goc_styled_item_signals [STYLE_CHANGED] = g_signal_new ("style-changed",
 		G_TYPE_FROM_CLASS (goc_klass),
@@ -268,7 +268,7 @@ GSF_CLASS_FULL (GocStyledItem, goc_styled_item, NULL, NULL,
  * go_styled_object_set_cairo_line().
  *
  * If the item drawing used goc_group_cairo_transform(),
- * scale-line-width should be %FALSE to avoid scaling twice, or 
+ * scale-line-width should be %FALSE to avoid scaling twice, or
  * go_styled_object_set_cairo_line() should be called directly instead.
  * Returns: %TRUE if the line is not invisible
  **/
diff --git a/goffice/canvas/goc-text.c b/goffice/canvas/goc-text.c
index 753c8cb..cf439cc 100644
--- a/goffice/canvas/goc-text.c
+++ b/goffice/canvas/goc-text.c
@@ -48,6 +48,38 @@ enum {
 
 static GocItemClass *parent_class;
 
+#define GO_TYPE_ANCHOR_TYPE go_anchor_type_get_type ()
+GType go_anchor_type_get_type (void);
+
+GType
+go_anchor_type_get_type (void)
+{
+	static GType etype = 0;
+	if (etype == 0) {
+		static GEnumValue const values[] = {
+			{ GO_ANCHOR_CENTER,	"GO_ANCHOR_CENTER",	"center" },
+			{ GO_ANCHOR_NORTH_WEST,	"GO_ANCHOR_NORTH_WEST",	"north-west" },
+			{ GO_ANCHOR_NORTH_EAST,	"GO_ANCHOR_NORTH_EAST",	"north-east" },
+			{ GO_ANCHOR_SOUTH,	"GO_ANCHOR_SOUTH",	"south" },
+			{ GO_ANCHOR_SOUTH_WEST,	"GO_ANCHOR_SOUTH_WEST",	"south-west" },
+			{ GO_ANCHOR_SOUTH_EAST,	"GO_ANCHOR_SOUTH_EAST",	"south-east" },
+			{ GO_ANCHOR_WEST,	"GO_ANCHOR_WEST",	"west" },
+			{ GO_ANCHOR_EAST,	"GO_ANCHOR_EAST",	"east" },
+			{ GO_ANCHOR_N,	"GO_ANCHOR_Ngo_anchor_type_get_type",	"n" },
+			{ GO_ANCHOR_NW,	"GO_ANCHOR_NW",	"nw" },
+			{ GO_ANCHOR_NE,	"GO_ANCHOR_NE",	"ne" },
+			{ GO_ANCHOR_S,	"GO_ANCHOR_S",	"s" },
+			{ GO_ANCHOR_SW,	"GO_ANCHOR_SW",	"sw" },
+			{ GO_ANCHOR_SE,	"GO_ANCHOR_SE",	"se" },
+			{ GO_ANCHOR_W,	"GO_ANCHOR_W",	"w" },
+			{ GO_ANCHOR_E,	"GO_ANCHOR_E",	"e" },
+			{ 0, NULL, NULL }
+		};
+		etype = g_enum_register_static (g_intern_static_string ("GOAnchorType"), values);
+	}
+	return etype;
+}
+
 static void
 goc_text_set_property (GObject *gobject, guint param_id,
 		       GValue const *value, GParamSpec *pspec)
@@ -68,7 +100,7 @@ goc_text_set_property (GObject *gobject, guint param_id,
 		break;
 
 	case TEXT_PROP_ANCHOR:
-		text->anchor =  (GtkAnchorType) g_value_get_enum (value);
+		text->anchor =  (GOAnchorType) g_value_get_enum (value);
 		break;
 
 	case TEXT_PROP_TEXT:
@@ -225,7 +257,7 @@ goc_text_prepare_draw (GocItem *item, cairo_t *cr)
 	GocText *text = GOC_TEXT (item);
 	PangoRectangle rect;
 	double sign = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? -1.: 1.;
-	
+
 	pango_layout_get_extents (text->layout, NULL, &rect);
 	text->w = (double) rect.width / PANGO_SCALE;
 	text->h = (double) rect.height / PANGO_SCALE;
@@ -233,18 +265,18 @@ goc_text_prepare_draw (GocItem *item, cairo_t *cr)
 	item->y0 = text->y;
 	/* adjust horizontally */
 	switch (text->anchor) {
-	case GTK_ANCHOR_CENTER:
-	case GTK_ANCHOR_NORTH:
-	case GTK_ANCHOR_SOUTH:
+	case GO_ANCHOR_CENTER:
+	case GO_ANCHOR_NORTH:
+	case GO_ANCHOR_SOUTH:
 		item->x0 -= text->w / 2.;
 		break;
-	case GTK_ANCHOR_NORTH_WEST:
-	case GTK_ANCHOR_SOUTH_WEST:
-	case GTK_ANCHOR_WEST:
+	case GO_ANCHOR_NORTH_WEST:
+	case GO_ANCHOR_SOUTH_WEST:
+	case GO_ANCHOR_WEST:
 		break;
-	case GTK_ANCHOR_NORTH_EAST:
-	case GTK_ANCHOR_SOUTH_EAST:
-	case GTK_ANCHOR_EAST:
+	case GO_ANCHOR_NORTH_EAST:
+	case GO_ANCHOR_SOUTH_EAST:
+	case GO_ANCHOR_EAST:
 		item->x0 -= text->w;
 		break;
 	default: /* should not occur */
@@ -252,18 +284,18 @@ goc_text_prepare_draw (GocItem *item, cairo_t *cr)
 	}
 	/* adjust vertically */
 	switch (text->anchor) {
-	case GTK_ANCHOR_NORTH:
-	case GTK_ANCHOR_NORTH_WEST:
-	case GTK_ANCHOR_NORTH_EAST:
+	case GO_ANCHOR_NORTH:
+	case GO_ANCHOR_NORTH_WEST:
+	case GO_ANCHOR_NORTH_EAST:
 		break;
-	case GTK_ANCHOR_CENTER:
-	case GTK_ANCHOR_WEST:
-	case GTK_ANCHOR_EAST:
+	case GO_ANCHOR_CENTER:
+	case GO_ANCHOR_WEST:
+	case GO_ANCHOR_EAST:
 		item->y0 -= text->h / 2.;
 		break;
-	case GTK_ANCHOR_SOUTH:
-	case GTK_ANCHOR_SOUTH_WEST:
-	case GTK_ANCHOR_SOUTH_EAST:
+	case GO_ANCHOR_SOUTH:
+	case GO_ANCHOR_SOUTH_WEST:
+	case GO_ANCHOR_SOUTH_EAST:
 		item->y0 -= text->h;
 		break;
 	default: /* should not occur */
@@ -305,9 +337,9 @@ goc_text_distance (GocItem *item, double x, double y, GocItem **near_item)
 	cairo_surface_t *surface;
 	cairo_t *cr;
 	double res = 20;
-	
+
 	*near_item = item;
-	
+
 	if (!text->layout)
 		return res;
 
@@ -328,7 +360,7 @@ goc_text_draw (GocItem const *item, cairo_t *cr)
 	GocText *text = GOC_TEXT (item);
 	double x = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? text->x + text->w: text->x, y = text->y;
 	double sign = (goc_canvas_get_direction (item->canvas) == GOC_DIRECTION_RTL)? -1.: 1.;
-	
+
 	PangoLayout *pl;
 	GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
 	if (!text->text)
@@ -344,18 +376,18 @@ goc_text_draw (GocItem const *item, cairo_t *cr)
 		pango_layout_set_attributes (pl, text->attributes);
 	/* adjust horizontally */
 	switch (text->anchor) {
-	case GTK_ANCHOR_CENTER:
-	case GTK_ANCHOR_NORTH:
-	case GTK_ANCHOR_SOUTH:
+	case GO_ANCHOR_CENTER:
+	case GO_ANCHOR_NORTH:
+	case GO_ANCHOR_SOUTH:
 		x -= text->w / 2.;
 		break;
-	case GTK_ANCHOR_NORTH_WEST:
-	case GTK_ANCHOR_SOUTH_WEST:
-	case GTK_ANCHOR_WEST:
+	case GO_ANCHOR_NORTH_WEST:
+	case GO_ANCHOR_SOUTH_WEST:
+	case GO_ANCHOR_WEST:
 		break;
-	case GTK_ANCHOR_NORTH_EAST:
-	case GTK_ANCHOR_SOUTH_EAST:
-	case GTK_ANCHOR_EAST:
+	case GO_ANCHOR_NORTH_EAST:
+	case GO_ANCHOR_SOUTH_EAST:
+	case GO_ANCHOR_EAST:
 		x -= text->w;
 		break;
 	default: /* should not occur */
@@ -363,18 +395,18 @@ goc_text_draw (GocItem const *item, cairo_t *cr)
 	}
 	/* adjust vertically */
 	switch (text->anchor) {
-	case GTK_ANCHOR_NORTH:
-	case GTK_ANCHOR_NORTH_WEST:
-	case GTK_ANCHOR_NORTH_EAST:
+	case GO_ANCHOR_NORTH:
+	case GO_ANCHOR_NORTH_WEST:
+	case GO_ANCHOR_NORTH_EAST:
 		break;
-	case GTK_ANCHOR_CENTER:
-	case GTK_ANCHOR_WEST:
-	case GTK_ANCHOR_EAST:
+	case GO_ANCHOR_CENTER:
+	case GO_ANCHOR_WEST:
+	case GO_ANCHOR_EAST:
 		y -= text->h / 2.;
 		break;
-	case GTK_ANCHOR_SOUTH:
-	case GTK_ANCHOR_SOUTH_WEST:
-	case GTK_ANCHOR_SOUTH_EAST:
+	case GO_ANCHOR_SOUTH:
+	case GO_ANCHOR_SOUTH_WEST:
+	case GO_ANCHOR_SOUTH_EAST:
 		y -= text->h;
 		break;
 	default: /* should not occur */
@@ -445,7 +477,7 @@ goc_text_class_init (GocItemClass *item_klass)
 		g_param_spec_enum ("anchor",
 			_("Anchor"),
 			_("The anchor point for the text"),
-			GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_CENTER,
+			GO_TYPE_ANCHOR_TYPE, GO_ANCHOR_CENTER,
 		        GSF_PARAM_STATIC | G_PARAM_READWRITE));
 	g_object_class_install_property (obj_klass, TEXT_PROP_TEXT,
 		g_param_spec_string ("text",
diff --git a/goffice/canvas/goc-text.h b/goffice/canvas/goc-text.h
index 8936afd..4110842 100644
--- a/goffice/canvas/goc-text.h
+++ b/goffice/canvas/goc-text.h
@@ -27,6 +27,7 @@
 
 G_BEGIN_DECLS
 
+
 struct _GocText {
 	GocStyledItem base;
 
@@ -35,7 +36,7 @@ struct _GocText {
 	gboolean clipped;
 	double clip_width, clip_height, wrap_width;
 	char *text;
-	GtkAnchorType anchor;
+	GOAnchorType anchor;
 	PangoAttrList *attributes;
 	PangoLayout *layout;
 };
diff --git a/goffice/canvas/goc-widget.c b/goffice/canvas/goc-widget.c
index 177fc1a..fdab779 100644
--- a/goffice/canvas/goc-widget.c
+++ b/goffice/canvas/goc-widget.c
@@ -272,11 +272,9 @@ static void
 goc_widget_draw (GocItem const *item, cairo_t *cr)
 {
 	GocWidget *widget = GOC_WIDGET (item);
-	if (item->canvas->cur_event == NULL)
-		return; /* we do not draw for off-screen rendering, at least until this is implemented in gtk+ */
-	 gtk_container_propagate_expose (GTK_CONTAINER (item->canvas),
-					widget->widget,
-					(GdkEventExpose *) goc_canvas_get_cur_event (item->canvas));
+	gtk_container_propagate_draw (GTK_CONTAINER (item->canvas),
+				      widget->widget,
+				      cr);
 }
 
 static void
diff --git a/goffice/goffice-priv.h b/goffice/goffice-priv.h
index 50c9fea..2a5c106 100644
--- a/goffice/goffice-priv.h
+++ b/goffice/goffice-priv.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
 gchar const *go_sys_data_dir (void);
 gchar const *go_sys_icon_dir (void);
 gchar const *go_sys_lib_dir (void);
-
+gchar const *go_sys_extern_plugin_dir (void);
 G_END_DECLS
 
 #endif /* GOFFICE_PRIV_H */
diff --git a/goffice/goffice.c b/goffice/goffice.c
index 67bfecb..163c446 100644
--- a/goffice/goffice.c
+++ b/goffice/goffice.c
@@ -67,6 +67,7 @@ static char const *libgoffice_data_dir   = GOFFICE_DATADIR;
 static char const *libgoffice_icon_dir   = GOFFICE_ICONDIR;
 static char const *libgoffice_locale_dir = GOFFICE_LOCALEDIR;
 static char const *libgoffice_lib_dir    = GOFFICE_LIBDIR;
+static char const *libgoffice_extern_plugin_dir = GOFFICE_EXTERNPLUGINDIR;
 
 /**
  * SECTION: goffice
@@ -125,6 +126,12 @@ go_sys_lib_dir (void)
 	return libgoffice_lib_dir;
 }
 
+gchar const *
+go_sys_extern_plugin_dir (void)
+{
+	return libgoffice_extern_plugin_dir;
+}
+
 
 /**
  * libgoffice_init:
diff --git a/goffice/graph/Makefile.am b/goffice/graph/Makefile.am
index 7ef2c07..c7af691 100644
--- a/goffice/graph/Makefile.am
+++ b/goffice/graph/Makefile.am
@@ -98,6 +98,7 @@ if GOFFICE_WITH_LASEM
   libgoffice_graph_la_SOURCES += gog-equation.c
   libgoffice_graph_la_HEADERS += gog-equation.h
 endif
+
 # Always distribute the ui file.
 dist_ui_DATA += gog-equation-prefs.ui
 
diff --git a/goffice/graph/gog-3d-box-prefs.ui b/goffice/graph/gog-3d-box-prefs.ui
index 5f193a1..125a6b0 100644
--- a/goffice/graph/gog-3d-box-prefs.ui
+++ b/goffice/graph/gog-3d-box-prefs.ui
@@ -1,7 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">180</property>
     <property name="step_increment">1</property>
@@ -17,137 +16,122 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkHBox" id="gog_3d_box_prefs">
+  <object class="GtkGrid" id="gog-3d-box-prefs">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <property name="spacing">24</property>
+    <property name="row_spacing">12</property>
+    <property name="column_spacing">6</property>
+    <property name="n_rows">4</property>
+    <property name="n_columns">2</property>
     <child>
-      <object class="GtkVBox" id="vbox7">
+      <object class="GtkLabel" id="label4">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">12</property>
-        <child>
-          <object class="GtkLabel" id="label4">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;Euler angles&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkTable" id="table1">
-            <property name="visible">True</property>
-            <property name="n_rows">3</property>
-            <property name="n_columns">2</property>
-            <property name="column_spacing">12</property>
-            <property name="row_spacing">6</property>
-            <child>
-              <object class="GtkHScale" id="theta_scale">
-                <property name="width_request">180</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="adjustment">adjustment1</property>
-                <property name="digits">0</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkHScale" id="psi_scale">
-                <property name="width_request">180</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="adjustment">adjustment2</property>
-                <property name="digits">0</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Psi:</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label2">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Theta:</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label3">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Phi:</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkHScale" id="phi_scale">
-                <property name="width_request">180</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="adjustment">adjustment3</property>
-                <property name="digits">0</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
+        <property name="can_focus">False</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="margin_bottom">6</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">&lt;b&gt;Euler angles&lt;/b&gt;</property>
+        <property name="use_markup">True</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">2</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="label1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">Psi:</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="label2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">Theta:</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="label3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">Phi:</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScale" id="psi-scale">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="hexpand">True</property>
+        <property name="adjustment">adjustment1</property>
+        <property name="lower_stepper_sensitivity">on</property>
+        <property name="round_digits">1</property>
+        <property name="digits">0</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScale" id="theta-scale">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="hexpand">True</property>
+        <property name="adjustment">adjustment2</property>
+        <property name="round_digits">0</property>
+        <property name="digits">0</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">2</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScale" id="phi-scale">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="hexpand">True</property>
+        <property name="adjustment">adjustment3</property>
+        <property name="round_digits">1</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">3</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
       </packing>
     </child>
   </object>
diff --git a/goffice/graph/gog-3d-box.c b/goffice/graph/gog-3d-box.c
index babf101..da5fc1d 100644
--- a/goffice/graph/gog-3d-box.c
+++ b/goffice/graph/gog-3d-box.c
@@ -78,7 +78,7 @@ cb_fov_changed (GO3DRotationSel *g3d, int angle, GObject *gobj)
 }
 
 static gboolean
-cb_box_psi_changed (GtkHScale *scale_widget, GdkEventButton *event,
+cb_box_psi_changed (GtkScale *scale_widget, GdkEventButton *event,
                     GObject *gobj)
 {
 	Gog3DBox *box = GOG_3D_BOX (gobj);
@@ -92,7 +92,7 @@ cb_box_psi_changed (GtkHScale *scale_widget, GdkEventButton *event,
 }
 
 static gboolean
-cb_box_theta_changed (GtkHScale *scale_widget, GdkEventButton *event,
+cb_box_theta_changed (GtkScale *scale_widget, GdkEventButton *event,
                       GObject *gobj)
 {
 	Gog3DBox *box = GOG_3D_BOX (gobj);
@@ -106,7 +106,7 @@ cb_box_theta_changed (GtkHScale *scale_widget, GdkEventButton *event,
 }
 
 static gboolean
-cb_box_phi_changed (GtkHScale *scale_widget, GdkEventButton *event,
+cb_box_phi_changed (GtkScale *scale_widget, GdkEventButton *event,
                     GObject *gobj)
 {
 	Gog3DBox *box = GOG_3D_BOX (gobj);
diff --git a/goffice/graph/gog-axis-line.c b/goffice/graph/gog-axis-line.c
index 26ffcfa..44e924c 100644
--- a/goffice/graph/gog-axis-line.c
+++ b/goffice/graph/gog-axis-line.c
@@ -390,7 +390,7 @@ static void
 cb_cross_location_changed (GtkWidget *editor, AxisBasePrefs *state)
 {
 	gtk_toggle_button_set_active
-		(GTK_TOGGLE_BUTTON (gtk_builder_get_object (state->gui, "axis_cross")),
+		(GTK_TOGGLE_BUTTON (gtk_builder_get_object (state->gui, "axis-cross")),
 		 TRUE);
 }
 
@@ -407,7 +407,7 @@ cb_cross_axis_changed (GtkComboBox *combo, AxisBasePrefs *state)
 	state->axis_base->crossed_axis_id = g_value_get_uint (&value);
 
 	gtk_toggle_button_set_active
-		(GTK_TOGGLE_BUTTON (gtk_builder_get_object (state->gui, "axis_cross")),
+		(GTK_TOGGLE_BUTTON (gtk_builder_get_object (state->gui, "axis-cross")),
 		 TRUE);
 
 	g_value_unset (&value);
@@ -424,15 +424,15 @@ cb_position_toggled (GtkWidget *button, AxisBasePrefs *state)
 	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
 		return;
 
-	if (g_ascii_strcasecmp ("axis_high", widget_name) == 0)
+	if (g_ascii_strcasecmp ("axis-high", widget_name) == 0)
 		position = GOG_AXIS_AT_HIGH;
-	else if (g_ascii_strcasecmp ("axis_cross", widget_name) == 0)
+	else if (g_ascii_strcasecmp ("axis-cross", widget_name) == 0)
 		position = GOG_AXIS_CROSS;
 	else
 		position = GOG_AXIS_AT_LOW;
 
 	if (position != axis_base->position)
-		gtk_widget_set_sensitive (go_gtk_builder_get_widget (state->gui, "padding_spinbutton"),
+		gtk_widget_set_sensitive (go_gtk_builder_get_widget (state->gui, "padding-spinbutton"),
 					  position != GOG_AXIS_CROSS);
 
 	if (position != GOG_AXIS_CROSS) {
@@ -525,7 +525,7 @@ gog_axis_base_populate_editor (GogObject *gobj,
 		AxisBasePrefs *state;
 
 		store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT);
-		combo = go_gtk_builder_get_widget (gui, "cross_axis_combo");
+		combo = go_gtk_builder_get_widget (gui, "cross-axis-combo");
 		gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (store));
 		g_object_unref (store);
 
@@ -560,7 +560,7 @@ gog_axis_base_populate_editor (GogObject *gobj,
 		deditor = gog_data_allocator_editor
 			(dalloc, GOG_DATASET (axis_base),
 			 GOG_AXIS_ELEM_CROSS_POINT, GOG_DATA_SCALAR);
-		container = go_gtk_builder_get_widget (gui, "cross_location_alignment");
+		container = go_gtk_builder_get_widget (gui, "cross-at-grid");
 		gtk_container_add (GTK_CONTAINER (container), GTK_WIDGET (deditor));
 		gtk_widget_show_all (container);
 
@@ -573,17 +573,17 @@ gog_axis_base_populate_editor (GogObject *gobj,
 				  G_CALLBACK (cb_cross_location_changed), state);
 		g_signal_connect_swapped (G_OBJECT (combo), "destroy", G_CALLBACK (axis_base_pref_free), state);
 
-		w = go_gtk_builder_get_widget (gui, "axis_low");
+		w = go_gtk_builder_get_widget (gui, "axis-low");
 		if (axis_base->position == GOG_AXIS_AT_LOW)
 			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
 		g_signal_connect (G_OBJECT (w), "toggled",
 				  G_CALLBACK (cb_position_toggled), state);
-		w = go_gtk_builder_get_widget (gui, "axis_cross");
+		w = go_gtk_builder_get_widget (gui, "axis-cross");
 		if (axis_base->position == GOG_AXIS_CROSS)
 			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
 		g_signal_connect (G_OBJECT (w), "toggled",
 				  G_CALLBACK (cb_position_toggled), state);
-		w = go_gtk_builder_get_widget (gui, "axis_high");
+		w = go_gtk_builder_get_widget (gui, "axis-high");
 		if (axis_base->position == GOG_AXIS_AT_HIGH)
 			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
 		g_signal_connect (G_OBJECT (w), "toggled",
@@ -591,7 +591,7 @@ gog_axis_base_populate_editor (GogObject *gobj,
 
 		hide_position_box = FALSE;
 	} else {
-		w = go_gtk_builder_get_widget (gui, "cross_box");
+		w = go_gtk_builder_get_widget (gui, "cross-at-grid");
 		gtk_widget_hide (w);
 	}
 
@@ -599,19 +599,19 @@ gog_axis_base_populate_editor (GogObject *gobj,
 	    axis_type == GOG_AXIS_Y ||
 	    axis_type == GOG_AXIS_Z ||
 	    axis_type == GOG_AXIS_RADIAL) {
-		w = go_gtk_builder_get_widget (gui, "padding_spinbutton");
+		w = go_gtk_builder_get_widget (gui, "padding-spinbutton");
 		gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), axis_base->padding);
 		g_signal_connect (G_CALLBACK (w), "value-changed",
 				  G_CALLBACK (cb_padding_changed), axis_base);
 		gtk_widget_set_sensitive (w, axis_base->position != GOG_AXIS_CROSS);
 		hide_position_box = FALSE;
 	} else {
-		w = go_gtk_builder_get_widget (gui, "padding_box");
+		w = go_gtk_builder_get_widget (gui, "padding-grid");
 		gtk_widget_hide (w);
 	}
 
 	if (hide_position_box) {
-		w = go_gtk_builder_get_widget (gui, "position_box");
+		w = go_gtk_builder_get_widget (gui, "position-grid");
 		gtk_widget_hide (w);
 	}
 
@@ -628,12 +628,12 @@ gog_axis_base_populate_editor (GogObject *gobj,
 
 	if (gog_axis_is_discrete (axis_base->axis)) {
 		/* Hide minor tick properties */
-		GtkWidget *w = go_gtk_builder_get_widget (gui, "minor_tick_box");
+		GtkWidget *w = go_gtk_builder_get_widget (gui, "minor-tick-grid");
 		gtk_widget_hide (w);
 	}
 
 	go_editor_add_page (editor,
-			     go_gtk_builder_get_widget (gui, "axis_base_pref_box"),
+			     go_gtk_builder_get_widget (gui, "axis-base-pref-grid"),
 			     _("Layout"));
 	g_object_unref (gui);
 
@@ -1268,7 +1268,7 @@ axis_line_render (GogAxisBase *axis_base,
 			label_pos.x = obrs[j].x;
 			label_pos.y = obrs[j].y;
 			gog_renderer_draw_gostring (renderer, ticks[j].str,
-						    &label_pos, GTK_ANCHOR_CENTER);
+						    &label_pos, GO_ANCHOR_CENTER);
 		}
 	}
 	g_free (obrs);
@@ -1475,7 +1475,7 @@ axis_circle_render (GogAxisBase *axis_base, GogRenderer *renderer,
 			     !go_geometry_test_OBR_overlap (&txt_obr, &txt_obr_first))) {
 				gog_renderer_draw_gostring 
 					(renderer, ticks[i].str,
-					 &label_pos, GTK_ANCHOR_CENTER);
+					 &label_pos, GO_ANCHOR_CENTER);
 				txt_obr_old = txt_obr;
 			}
 			if (!first_label_done) {
diff --git a/goffice/graph/gog-axis-prefs.ui b/goffice/graph/gog-axis-prefs.ui
index 1e60431..ff49ff3 100644
--- a/goffice/graph/gog-axis-prefs.ui
+++ b/goffice/graph/gog-axis-prefs.ui
@@ -1,7 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">-180</property>
     <property name="upper">180</property>
@@ -14,636 +13,565 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkHBox" id="axis_pref_box">
+  <object class="GtkGrid" id="axis-base-pref-grid">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <property name="spacing">24</property>
+    <property name="row_spacing">12</property>
+    <property name="column_spacing">6</property>
     <child>
-      <object class="GtkVBox" id="vbox7">
+      <object class="GtkLabel" id="label3">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">12</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">&lt;b&gt;Major ticks&lt;/b&gt;</property>
+        <property name="use_markup">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkCheckButton" id="major-tick-out">
+        <property name="label" translatable="yes">_Outside</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
+        <property name="margin_left">12</property>
+        <property name="use_action_appearance">False</property>
+        <property name="use_underline">True</property>
+        <property name="xalign">0</property>
+        <property name="draw_indicator">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkCheckButton" id="major-tick-in">
+        <property name="label" translatable="yes">_Inside</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
+        <property name="margin_left">12</property>
+        <property name="use_action_appearance">False</property>
+        <property name="use_underline">True</property>
+        <property name="xalign">0</property>
+        <property name="draw_indicator">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkCheckButton" id="major-tick-labeled">
+        <property name="label" translatable="yes">_Show Labels</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
+        <property name="margin_left">12</property>
+        <property name="use_action_appearance">False</property>
+        <property name="use_underline">True</property>
+        <property name="xalign">0</property>
+        <property name="draw_indicator">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkGrid" id="position-grid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_top">6</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="label5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">&lt;b&gt;Position&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="axis-low">
+            <property name="label" translatable="yes">_Low</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="margin_left">12</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="axis-high">
+            <property name="label" translatable="yes">_High</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="valign">center</property>
+            <property name="margin_left">12</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+            <property name="group">axis-low</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
         <child>
-          <object class="GtkVBox" id="bound_box">
+          <object class="GtkGrid" id="cross-at-grid">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">False</property>
+            <property name="margin_left">12</property>
+            <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label1">
+              <object class="GtkRadioButton" id="axis-cross">
+                <property name="label" translatable="yes">_Cross</property>
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Bounds&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">axis-low</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">at</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkAlignment" id="alignment16">
+              <object class="GtkComboBox" id="cross-axis-combo">
                 <property name="visible">True</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkTable" id="bound_table">
-                    <property name="visible">True</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">12</property>
-                    <property name="row_spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="label7">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Automatic</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                </child>
+                <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="position">1</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">3</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="mapping_box">
+          <object class="GtkGrid" id="padding-grid">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">False</property>
+            <property name="margin_left">12</property>
+            <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label2">
+              <object class="GtkLabel" id="label11">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Mapping&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Padding:</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkAlignment" id="alignment9">
+              <object class="GtkSpinButton" id="padding-spinbutton">
                 <property name="visible">True</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkVBox" id="vbox18">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkCheckButton" id="invert-axis">
-                        <property name="label" translatable="yes">_Invert axis</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="map_type_box">
-                        <property name="visible">True</property>
-                        <property name="spacing">12</property>
-                        <child>
-                          <object class="GtkLabel" id="map_label">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">_Type:</property>
-                            <property name="use_underline">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkComboBox" id="map_type_combo">
-                            <property name="visible">True</property>
-                            <property name="model">model1</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkTable" id="circular_table">
-                        <property name="visible">True</property>
-                        <property name="n_rows">2</property>
-                        <property name="n_columns">3</property>
-                        <property name="column_spacing">12</property>
-                        <property name="row_spacing">6</property>
-                        <child>
-                          <object class="GtkLabel" id="label9">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">_Rotation:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">circular_rotation_spinbutton</property>
-                          </object>
-                          <packing>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label10">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">degrees</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="right_attach">3</property>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkSpinButton" id="circular_rotation_spinbutton">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">&#x2022;</property>
-                            <property name="adjustment">adjustment1</property>
-                            <property name="climb_rate">1</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label8">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">_Unit:</property>
-                            <property name="use_underline">True</property>
-                          </object>
-                          <packing>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkComboBox" id="polar_unit_combo">
-                            <property name="visible">True</property>
-                            <property name="model">polar-unit-model</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â</property>
+                <property name="invisible_char_set">True</property>
+                <property name="adjustment">adjustment2</property>
+                <property name="climb_rate">1</property>
+                <property name="numeric">True</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label12">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">pts</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">4</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
           </packing>
         </child>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
+        <property name="width">2</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
+      <object class="GtkGrid" id="minor-tick-grid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="label4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">&lt;b&gt;Minor ticks&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="minor-tick-out">
+            <property name="label" translatable="yes">O_utside</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="margin_left">12</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="minor-tick-in">
+            <property name="label" translatable="yes">I_nside</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="margin_left">12</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">3</property>
       </packing>
     </child>
   </object>
-  <object class="GtkVBox" id="axis_base_pref_box">
+  <object class="GtkGrid" id="axis-pref-grid">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <property name="orientation">vertical</property>
-    <property name="spacing">12</property>
+    <property name="row_spacing">12</property>
+    <property name="column_spacing">6</property>
     <child>
-      <object class="GtkHBox" id="hbox3">
+      <object class="GtkLabel" id="label1">
         <property name="visible">True</property>
-        <property name="spacing">24</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">&lt;b&gt;Bounds&lt;/b&gt;</property>
+        <property name="use_markup">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkGrid" id="bound-grid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_left">12</property>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">12</property>
         <child>
-          <object class="GtkVBox" id="major_tick_box">
+          <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Automatic</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_left">12</property>
+        <property name="row_spacing">12</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkComboBoxText" id="map-type-combo">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">start</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="map-label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">start</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">_Type:</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="invert-axis">
+            <property name="label" translatable="yes">_Invert axis</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">2</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="circular-grid">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">12</property>
+            <property name="column_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label3">
+              <object class="GtkLabel" id="label8">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Major ticks&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">_Unit:</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkAlignment" id="alignment12">
+              <object class="GtkLabel" id="label9">
                 <property name="visible">True</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkVBox" id="vbox13">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkCheckButton" id="major-tick-out">
-                        <property name="label" translatable="yes">_Outside</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="major-tick-in">
-                        <property name="label" translatable="yes">_Inside</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="major-tick-labeled">
-                        <property name="label" translatable="yes">_Show Labels</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">_Rotation:</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="minor_tick_box">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
             <child>
-              <object class="GtkLabel" id="label4">
+              <object class="GtkSpinButton" id="circular-rotation-spinbutton">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Minor ticks&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â</property>
+                <property name="adjustment">adjustment1</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBoxText" id="polar-unit-combo">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkAlignment" id="alignment13">
+              <object class="GtkLabel" id="label10">
                 <property name="visible">True</property>
-                <property name="top_padding">6</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkVBox" id="vbox15">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkCheckButton" id="minor-tick-out">
-                        <property name="label" translatable="yes">O_utside</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="minor-tick-in">
-                        <property name="label" translatable="yes">I_nside</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">degrees</property>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">2</property>
+            <property name="height">1</property>
           </packing>
         </child>
+        <child>
+          <placeholder/>
+        </child>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
       </packing>
     </child>
     <child>
-      <object class="GtkVBox" id="position_box">
+      <object class="GtkLabel" id="label7">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkLabel" id="label5">
-            <property name="visible">True</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;Position&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkAlignment" id="alignment14">
-            <property name="visible">True</property>
-            <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
-            <child>
-              <object class="GtkVBox" id="vbox19">
-                <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkVBox" id="cross_box">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkRadioButton" id="axis_low">
-                        <property name="label" translatable="yes">_Low</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="axis_high">
-                        <property name="label" translatable="yes">_High</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">axis_low</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="hbox4">
-                        <property name="visible">True</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkAlignment" id="alignment15">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="yalign">0</property>
-                            <child>
-                              <object class="GtkRadioButton" id="axis_cross">
-                                <property name="label" translatable="yes">_Cross</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_underline">True</property>
-                                <property name="draw_indicator">True</property>
-                                <property name="group">axis_low</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkComboBox" id="cross_axis_combo">
-                            <property name="visible">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label6">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">at</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkAlignment" id="cross_location_alignment">
-                            <property name="visible">True</property>
-                            <child>
-                              <placeholder/>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">3</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="padding_box">
-                    <property name="visible">True</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="label11">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">Padding:</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="padding_spinbutton">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="invisible_char">&#x2022;</property>
-                        <property name="adjustment">adjustment2</property>
-                        <property name="climb_rate">1</property>
-                        <property name="numeric">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label12">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">pts</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
+        <property name="can_focus">False</property>
+        <property name="margin_top">6</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">&lt;b&gt;Mapping&lt;/b&gt;</property>
+        <property name="use_markup">True</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
       </packing>
     </child>
   </object>
@@ -653,10 +581,4 @@
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="polar-unit-model">
-    <columns>
-      <!-- column-name gchararray1 -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
 </interface>
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 79bbe17..61bbbdd 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -1470,7 +1470,7 @@ gog_axis_map_set_by_num (GogAxis *axis, gint num)
 }
 
 static void
-gog_axis_map_populate_combo (GogAxis *axis, GtkComboBox *combo)
+gog_axis_map_populate_combo (GogAxis *axis, GtkComboBoxText *combo)
 {
 	unsigned i;
 
@@ -1478,9 +1478,9 @@ gog_axis_map_populate_combo (GogAxis *axis, GtkComboBox *combo)
 
 	for (i = 0; i < G_N_ELEMENTS (map_descs); i++) {
 		const char *thisname = map_descs[i]->name;
-		gtk_combo_box_append_text (combo, _(thisname));
+		gtk_combo_box_text_append_text (combo, _(thisname));
 		if (!g_ascii_strcasecmp (thisname, axis->map_desc->name))
-			gtk_combo_box_set_active (combo, i);
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i);
 	}
 }
 #endif
@@ -2335,7 +2335,7 @@ cb_update_dim_editor (GogObject *gobj, ElemToggleData *closure)
 }
 
 static void
-make_dim_editor (GogDataset *set, GtkTable *table, unsigned dim,
+make_dim_editor (GogDataset *set, GtkGrid *grid, unsigned dim,
 		 GogDataAllocator *dalloc, char const *dim_name)
 {
 	ElemToggleData *info;
@@ -2373,10 +2373,11 @@ make_dim_editor (GogDataset *set, GtkTable *table, unsigned dim,
 
 	g_object_weak_ref (G_OBJECT (toggle), (GWeakNotify) elem_toggle_data_free, info);
 
-	gtk_table_attach (table, toggle,
-		0, 1, dim + 1, dim + 2, GTK_FILL, 0, 0, 0);
-	gtk_table_attach (table, editor,
-		1, 2, dim + 1, dim + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+	gtk_grid_attach (grid, toggle,
+		0, dim + 1, 1, 1);
+	g_object_set (G_OBJECT (editor), "hexpand", TRUE, NULL);
+	gtk_grid_attach (grid, editor,
+		1, dim + 1, 1, 1);
 
 }
 
@@ -2396,18 +2397,18 @@ cb_map_combo_changed (GtkComboBox *combo,
 }
 
 static void
-gog_axis_populate_polar_unit_combo (GogAxis *axis, GtkComboBox *combo)
+gog_axis_populate_polar_unit_combo (GogAxis *axis, GtkComboBoxText *combo)
 {
 	unsigned i, id = 0;
 
 	g_return_if_fail (GOG_IS_AXIS (axis));
 
 	for (i = 0; i < G_N_ELEMENTS (polar_units); i++) {
-		gtk_combo_box_append_text (combo, _(polar_units[i].name));
+		gtk_combo_box_text_append_text (combo, _(polar_units[i].name));
 		if (polar_units[i].unit == axis->polar_unit)
 			id = i;
 	}
-	gtk_combo_box_set_active (combo, id);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), id);
 }
 
 static void
@@ -2445,7 +2446,7 @@ gog_axis_populate_editor (GogObject *gobj,
 		"invert-axis"
 	};
 	GtkWidget *w;
-	GtkTable  *table;
+	GtkGrid *grid;
 	unsigned i = 0;
 	GogAxis *axis = GOG_AXIS (gobj);
 	GogAxisPrefState *state;
@@ -2461,7 +2462,7 @@ gog_axis_populate_editor (GogObject *gobj,
 	g_object_ref (G_OBJECT (axis));
 
 	/* Bounds Page */
-	table = GTK_TABLE (gtk_builder_get_object (gui, "bound_table"));
+	grid = GTK_GRID (gtk_builder_get_object (gui, "bound-grid"));
 	if (axis->is_discrete) {
 		static char const * const dim_names[] = {
 			N_("M_inimum"),
@@ -2470,7 +2471,7 @@ gog_axis_populate_editor (GogObject *gobj,
 			N_("Categories between _labels")
 		};
 		for (i = GOG_AXIS_ELEM_MIN; i < GOG_AXIS_ELEM_CROSS_POINT ; i++)
-			make_dim_editor (set, table, i, dalloc,
+			make_dim_editor (set, grid, i, dalloc,
 					 _(dim_names[i]));
 	} else {
 		static char const * const dim_names[] = {
@@ -2481,40 +2482,42 @@ gog_axis_populate_editor (GogObject *gobj,
 		};
 
 		for (i = GOG_AXIS_ELEM_MIN; i < GOG_AXIS_ELEM_CROSS_POINT ; i++)
-			make_dim_editor (set, table, i, dalloc,
+			make_dim_editor (set, grid, i, dalloc,
 					 _(dim_names[i]));
 	}
-	gtk_widget_show_all (GTK_WIDGET (table));
+	gtk_widget_show_all (GTK_WIDGET (grid));
 
 	/* Details page */
 	if (!axis->is_discrete && gog_axis_get_atype (axis) != GOG_AXIS_CIRCULAR) {
-		GtkComboBox *box = go_gtk_builder_combo_box_init_text (gui, "map_type_combo");
+		GtkComboBoxText *box = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (gui, "map-type-combo"));
 		gog_axis_map_populate_combo (axis, box);
 		g_signal_connect_object (G_OBJECT (box),
 					 "changed",
 					 G_CALLBACK (cb_map_combo_changed),
 					 axis, 0);
 	} else {
-		GtkWidget *w = go_gtk_builder_get_widget (gui, "map_type_box");
+		GtkWidget *w = go_gtk_builder_get_widget (gui, "map-label");
+		gtk_widget_hide (w);
+		w = go_gtk_builder_get_widget (gui, "map-type-combo");
 		gtk_widget_hide (w);
 	}
 
 	if (!axis->is_discrete && gog_axis_get_atype (axis) == GOG_AXIS_CIRCULAR) {
 		GtkWidget *w;
-		GtkComboBox *box = go_gtk_builder_combo_box_init_text (gui, "polar_unit_combo");
+		GtkComboBoxText *box = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (gui, "polar-unit-combo"));
 		gog_axis_populate_polar_unit_combo (axis, box);
 		g_signal_connect (G_OBJECT (box),
 				  "changed",
 				  G_CALLBACK (cb_polar_unit_changed),
 				  state);
 
-		w = go_gtk_builder_get_widget (gui, "circular_rotation_spinbutton");
+		w = go_gtk_builder_get_widget (gui, "circular-rotation-spinbutton");
 		gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), axis->circular_rotation);
 		g_signal_connect_object (G_OBJECT (w), "value-changed",
 					 G_CALLBACK (cb_rotation_changed),
 					 axis, 0);
 	} else {
-		GtkWidget *w = go_gtk_builder_get_widget (gui, "circular_table");
+		GtkWidget *w = go_gtk_builder_get_widget (gui, "circular-grid");
 		gtk_widget_hide (w);
 	}
 
@@ -2530,7 +2533,7 @@ gog_axis_populate_editor (GogObject *gobj,
 	}
 
 	go_editor_add_page (editor,
-			     go_gtk_builder_get_widget (gui, "axis_pref_box"),
+			     go_gtk_builder_get_widget (gui, "axis-pref-grid"),
 			     _("Scale"));
 
 	if (gog_object_is_visible (axis) && gog_axis_get_atype (axis) < GOG_AXIS_VIRTUAL) {
@@ -2554,7 +2557,7 @@ gog_axis_populate_editor (GogObject *gobj,
 	    }
 	}
 
-	g_object_set_data_full (gtk_builder_get_object (gui, "axis_pref_box"),
+	g_object_set_data_full (gtk_builder_get_object (gui, "axis-pref-grid"),
 				"state", state, (GDestroyNotify) gog_axis_pref_state_free);
 	g_object_unref (gui);
 
diff --git a/goffice/graph/gog-chart.c b/goffice/graph/gog-chart.c
index e717db9..e1c0a7b 100644
--- a/goffice/graph/gog-chart.c
+++ b/goffice/graph/gog-chart.c
@@ -717,10 +717,10 @@ static void
 gog_chart_init (GogChart *chart)
 {
 	chart->x_pos =
-	chart->y_pos = 
-	chart->cols  = 		
+	chart->y_pos =
+	chart->cols  =
 	chart->rows  =
-	chart->x_pos_actual = 
+	chart->x_pos_actual =
 	chart->y_pos_actual = 0;
 
 	/* start as true so that we can queue an update when it changes */
diff --git a/goffice/graph/gog-child-button.c b/goffice/graph/gog-child-button.c
index 8b4b1c5..f32cda0 100644
--- a/goffice/graph/gog-child-button.c
+++ b/goffice/graph/gog-child-button.c
@@ -22,9 +22,7 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
-#include <gdk/gdkpixbuf.h>
 #include <gdk/gdkkeysyms.h>
 
 #include <glib/gi18n-lib.h>
@@ -46,7 +44,7 @@ static void 	gog_child_button_free_additions 	(GogChildButton *child_button);
 
 struct _GogChildButton
 {
-	GtkHBox parent;
+	GtkBox parent;
 
 	GtkWidget	*toggle_button;
 	GtkMenu 	*menu;
@@ -59,10 +57,10 @@ struct _GogChildButton
 
 struct _GogChildButtonClass
 {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 };
 
-G_DEFINE_TYPE (GogChildButton, gog_child_button, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GogChildButton, gog_child_button, GTK_TYPE_BOX)
 
 static void
 gog_child_button_init (GogChildButton *child_button)
diff --git a/goffice/graph/gog-equation-prefs.ui b/goffice/graph/gog-equation-prefs.ui
index 3f5310d..bff845d 100644
--- a/goffice/graph/gog-equation-prefs.ui
+++ b/goffice/graph/gog-equation-prefs.ui
@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkVBox" id="gog_equation_prefs">
+  <object class="GtkBox" id="gog_equation_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <child>
-      <object class="GtkVBox" id="plot_area_box">
+      <object class="GtkBox" id="plot_area_box">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
diff --git a/goffice/graph/gog-equation.c b/goffice/graph/gog-equation.c
index f656eac..5abb617 100644
--- a/goffice/graph/gog-equation.c
+++ b/goffice/graph/gog-equation.c
@@ -19,12 +19,10 @@
  * USA
  */
 
-#include <lsmmathmldocument.h>
-#include <lsmdomparser.h>
-#include <lsmmathmlmathelement.h>
+#include <lsmdom.h>
 
 #include <goffice/goffice-config.h>
-#include <goffice/graph/gog-equation.h>
+#include <goffice/goffice.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -40,7 +38,12 @@ struct _GogEquation {
 
 	char *itex;
 	gboolean inline_mode;
-	LsmMathmlDocument *mathml;
+
+	LsmDomDocument *mathml;
+	LsmDomNode *math_element;
+	LsmDomNode *style_element;
+	LsmDomNode *itex_element;
+	LsmDomNode *itex_string;
 };
 
 typedef struct {
@@ -108,57 +111,47 @@ gog_equation_populate_editor (GogObject *obj,
 static void
 _update_equation_style (GogEquation *equation, const GOStyle *style)
 {
-	LsmMathmlStyle *math_style;
-	LsmMathmlMathElement *math_element;
+	LsmDomElement *style_element;
 	PangoFontDescription *font_description;
+	char *value;
 
-	if (equation->mathml == NULL)
-		return;
-
-	math_element = lsm_mathml_document_get_root_element (equation->mathml);
-	if (math_element == NULL)
-		return;
-
-	math_style = lsm_mathml_math_element_get_default_style (math_element);
-	if (math_style == NULL)
-		return;
+	style_element = LSM_DOM_ELEMENT (equation->style_element);
 
-	lsm_mathml_style_set_math_color (math_style,
-				      GO_COLOR_DOUBLE_R (style->font.color),
-				      GO_COLOR_DOUBLE_G (style->font.color),
-				      GO_COLOR_DOUBLE_B (style->font.color),
-				      GO_COLOR_DOUBLE_A (style->font.color));
+	value = g_strdup_printf ("#%02x%02x%02x",
+				 GO_COLOR_UINT_R (style->font.color),
+				 GO_COLOR_UINT_G (style->font.color),
+				 GO_COLOR_UINT_B (style->font.color));
+	lsm_dom_element_set_attribute (style_element, "mathcolor", value);
+	g_free (value);
 
 	font_description = style->font.font->desc;
 	if (font_description != NULL) {
-		LsmMathmlVariant math_variant;
-
 		if (pango_font_description_get_weight (font_description) >= PANGO_WEIGHT_BOLD) {
 			if (pango_font_description_get_style (font_description) == PANGO_STYLE_NORMAL)
-				math_variant = LSM_MATHML_VARIANT_BOLD;
+				lsm_dom_element_set_attribute (style_element, "mathvariant", "bold");
 			else
-				math_variant = LSM_MATHML_VARIANT_BOLD_ITALIC;
+				lsm_dom_element_set_attribute (style_element, "mathvariant", "bold-italic");
 		} else {
 			if (pango_font_description_get_style (font_description) == PANGO_STYLE_NORMAL)
-				math_variant = LSM_MATHML_VARIANT_NORMAL;
+				lsm_dom_element_set_attribute (style_element, "mathvariant", "normal");
 			else
-				math_variant = LSM_MATHML_VARIANT_ITALIC;
+				lsm_dom_element_set_attribute (style_element, "mathvariant", "italic");
 		}
 
-		lsm_mathml_style_set_math_family (math_style, pango_font_description_get_family (font_description));
-		lsm_mathml_style_set_math_size_pt
-			(math_style, pango_units_to_double (pango_font_description_get_size (font_description)));
-		lsm_mathml_style_set_math_variant (math_style, math_variant);
-	}
+		lsm_dom_element_set_attribute (style_element, "mathfamily",
+					       pango_font_description_get_family (font_description));
 
-	lsm_mathml_math_element_set_default_style (math_element, math_style);
+		value = g_strdup_printf ("%gpt", pango_units_to_double (
+				pango_font_description_get_size (font_description)));
+		lsm_dom_element_set_attribute (style_element, "mathsize", value);
+		g_free (value);
+	}
 }
 
 static void
 gog_equation_update (GogObject *obj)
 {
 	GogEquation *equation = GOG_EQUATION (obj);
-	LsmMathmlDocument *mathml;
 	GString *itex;
 	char *itex_iter;
 	char *prev_char = '\0';
@@ -198,40 +191,19 @@ gog_equation_update (GogObject *obj)
 		}
 	}
 
-	if (equation->inline_mode)
-		itex = g_string_new ("$");
-	else
-		itex = g_string_new ("$$");
-	g_string_append (itex, equation->itex);
+	itex = g_string_new (equation->itex);
 	if (add_dash)
 		g_string_append_c (itex, '-');
 	for (j = 0; j < n_unclosed_braces; j++)
 		g_string_append_c (itex, '}');
-	if (equation->inline_mode)
-		itex = g_string_append (itex, "$");
-	else
-		itex = g_string_append (itex, "$$");
-
-	mathml = lsm_mathml_document_new_from_itex (itex->str, itex->len, NULL);
-
-	/* Keep the last valid mathml document if the itex -> mathml conversion fails.
-	 * It keep the equation from disappearing when the current equation entry is not a
-	 * well formed itex expression. */
-
-	if (mathml != NULL) {
-		if (lsm_mathml_document_get_root_element (mathml) != NULL || is_blank) {
-			if (equation->mathml != NULL)
-				g_object_unref (equation->mathml);
 
-			equation->mathml = mathml;
-
-			_update_equation_style (equation,
-						go_styled_object_get_style (GO_STYLED_OBJECT (equation)));
-		} else
-			g_object_unref (mathml);
-	}
+	lsm_dom_element_set_attribute (LSM_DOM_ELEMENT (equation->style_element), "displaystyle",
+				       equation->inline_mode ? "false" : "true");
+	lsm_dom_node_set_node_value (equation->itex_string, itex->str);
 
 	g_string_free (itex, TRUE);
+
+	lsm_dom_document_save_to_path (equation->mathml, "goffice.mml", NULL);
 }
 
 static void
@@ -349,7 +321,17 @@ gog_equation_init (GogEquation *equation)
 {
 	equation->itex = NULL;
 	equation->inline_mode = FALSE;
-	equation->mathml = NULL;
+
+	equation->mathml = lsm_dom_implementation_create_document (NULL, "math");
+	equation->math_element = LSM_DOM_NODE (lsm_dom_document_create_element (equation->mathml, "math"));
+	equation->style_element = LSM_DOM_NODE (lsm_dom_document_create_element (equation->mathml, "mstyle"));
+	equation->itex_element = LSM_DOM_NODE (lsm_dom_document_create_element (equation->mathml, "lasem:itex"));
+	equation->itex_string = LSM_DOM_NODE (lsm_dom_document_create_text_node (equation->mathml, ""));
+
+	lsm_dom_node_append_child (LSM_DOM_NODE (equation->mathml), equation->math_element);
+	lsm_dom_node_append_child (equation->math_element, equation->style_element);
+	lsm_dom_node_append_child (equation->style_element, equation->itex_element);
+	lsm_dom_node_append_child (equation->itex_element, equation->itex_string);
 }
 
 GSF_CLASS (GogEquation, gog_equation,
@@ -359,7 +341,7 @@ GSF_CLASS (GogEquation, gog_equation,
 typedef struct {
 	GogOutlinedView		 base;
 
-	LsmMathmlView 		*mathml_view;
+	LsmDomView 		*mathml_view;
 } GogEquationView;
 
 typedef GogOutlinedViewClass	GogEquationViewClass;
@@ -390,9 +372,7 @@ gog_equation_view_size_request (GogView *view,
 		return;
 	}
 
-	lsm_dom_view_set_document (LSM_DOM_VIEW (equation_view->mathml_view),
-				   LSM_DOM_DOCUMENT (equation->mathml));
-	lsm_dom_view_get_size (LSM_DOM_VIEW (equation_view->mathml_view), &width, &height);
+	lsm_dom_view_get_size (equation_view->mathml_view, &width, &height, NULL);
 
 	obr.w = gog_renderer_pt2r_x (view->renderer, width);
 	obr.h = gog_renderer_pt2r_y (view->renderer, height);
@@ -420,8 +400,6 @@ gog_equation_view_render (GogView *view,
 	if (equation->mathml == NULL)
 		return;
 
-	lsm_dom_view_set_document (LSM_DOM_VIEW (equation_view->mathml_view),
-				   LSM_DOM_DOCUMENT (equation->mathml));
 	gog_renderer_push_style (view->renderer, go_styled_object_get_style (GO_STYLED_OBJECT(equation)));
 	gog_renderer_draw_equation (view->renderer, equation_view->mathml_view,
 				    view->residual.x + view->residual.w / 2., view->residual.y + view->residual.h / 2.);
@@ -429,6 +407,15 @@ gog_equation_view_render (GogView *view,
 }
 
 static void
+gog_equation_view_state_init (GogView *view)
+{
+	GogEquationView *equation_view = GOG_EQUATION_VIEW (view);
+	GogEquation *equation = GOG_EQUATION (view->model);
+
+	equation_view->mathml_view = lsm_dom_document_create_view (equation->mathml);
+}
+
+static void
 gog_equation_view_finalize (GObject *object)
 {
 	GogEquationView *view = GOG_EQUATION_VIEW (object);
@@ -447,6 +434,7 @@ gog_equation_view_class_init (GogEquationViewClass *gview_klass)
 	equation_view_parent_klass = g_type_class_peek_parent (gview_klass);
 
 	gobject_klass->finalize	   = gog_equation_view_finalize;
+	view_klass->state_init     = gog_equation_view_state_init;
 	view_klass->size_request   = gog_equation_view_size_request;
 	view_klass->render	   = gog_equation_view_render;
 }
@@ -454,9 +442,6 @@ gog_equation_view_class_init (GogEquationViewClass *gview_klass)
 static void
 gog_equation_view_init (GObject *object)
 {
-	GogEquationView *view = GOG_EQUATION_VIEW (object);
-
-	view->mathml_view = lsm_mathml_view_new (NULL);
 }
 
 GSF_CLASS (GogEquationView, gog_equation_view,
diff --git a/goffice/graph/gog-error-bar-prefs.ui b/goffice/graph/gog-error-bar-prefs.ui
index f26039b..fa68566 100644
--- a/goffice/graph/gog-error-bar-prefs.ui
+++ b/goffice/graph/gog-error-bar-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="value">1</property>
@@ -34,17 +34,17 @@
       </row>
     </data>
   </object>
-  <object class="GtkVBox" id="gog_error_bar_prefs">
+  <object class="GtkBox" id="gog_error_bar_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <property name="spacing">12</property>
     <child>
-      <object class="GtkHBox" id="hbox1">
+      <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="spacing">24</property>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkBox" id="vbox1">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
@@ -96,7 +96,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="style_box">
+          <object class="GtkBox" id="style_box">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
@@ -311,7 +311,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkVBox" id="values_box">
+      <object class="GtkBox" id="values_box">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <child>
diff --git a/goffice/graph/gog-error-bar.c b/goffice/graph/gog-error-bar.c
index b2ae3ec..c5c29cf 100644
--- a/goffice/graph/gog-error-bar.c
+++ b/goffice/graph/gog-error-bar.c
@@ -20,7 +20,6 @@
  */
 
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include "gog-error-bar.h"
 #include "gog-series-impl.h"
 #include "gog-plot-impl.h"
@@ -713,7 +712,7 @@ void gog_error_bar_render (const GogErrorBar *bar,
 			cap_min = FALSE;
 		} else
 			cap_min = TRUE;
-			
+
 		gog_chart_map_2D_to_view (map, x, (start ? y + plus : y),
 							  &xx, &yy);
 		path = go_path_new ();
diff --git a/goffice/graph/gog-graph-prefs.ui b/goffice/graph/gog-graph-prefs.ui
index bdfddbb..d4ef3bc 100644
--- a/goffice/graph/gog-graph-prefs.ui
+++ b/goffice/graph/gog-graph-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkTable" id="gog_graph_prefs">
     <property name="visible">True</property>
@@ -49,7 +49,7 @@
             <property name="xscale">0</property>
             <property name="yscale">0</property>
             <child>
-              <object class="GtkHBox" id="hbox1">
+              <object class="GtkBox" id="hbox1">
                 <property name="visible">True</property>
                 <property name="spacing">2</property>
                 <child>
diff --git a/goffice/graph/gog-graph.c b/goffice/graph/gog-graph.c
index b707db3..707e7fd 100644
--- a/goffice/graph/gog-graph.c
+++ b/goffice/graph/gog-graph.c
@@ -982,7 +982,7 @@ update_cursor (GogGraphView *view, GogTool *tool, GdkWindow *window)
 		/* FIXME: gdk_display_get_default is probably not a good idea */
 		cursor = gdk_cursor_new_for_display (gdk_display_get_default (), cursor_type);
 		gdk_window_set_cursor (window, cursor);
-		gdk_cursor_unref (cursor);
+		g_object_unref (cursor);
 	}
 }
 #endif
@@ -1134,15 +1134,9 @@ GSList *
 gog_graph_get_supported_image_formats (void)
 {
 	static GOImageFormat supported_formats[] = {
-#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
 		GO_IMAGE_FORMAT_EPS,
-#endif
-#ifdef GOG_RENDERER_CAIRO_WITH_PS
 		GO_IMAGE_FORMAT_PS,
-#endif
-#ifdef GOG_RENDERER_CAIRO_WITH_PDF
 		GO_IMAGE_FORMAT_PDF,
-#endif
 		GO_IMAGE_FORMAT_JPG,
 		GO_IMAGE_FORMAT_PNG,
 		GO_IMAGE_FORMAT_SVG
diff --git a/goffice/graph/gog-guru-type-selector.ui b/goffice/graph/gog-guru-type-selector.ui
index 2ca5a37..3a48555 100644
--- a/goffice/graph/gog-guru-type-selector.ui
+++ b/goffice/graph/gog-guru-type-selector.ui
@@ -1,165 +1,173 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkAlignment" id="type_selector">
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkGrid" id="type-selector">
     <property name="visible">True</property>
-    <property name="top_padding">6</property>
-    <property name="left_padding">6</property>
-    <property name="right_padding">6</property>
+    <property name="can_focus">False</property>
+    <property name="margin_left">6</property>
+    <property name="margin_right">6</property>
+    <property name="margin_top">6</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="row_spacing">24</property>
     <child>
-      <object class="GtkVBox" id="vbox2">
+      <object class="GtkGrid" id="grid1">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="vexpand">True</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="type_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">&lt;b&gt;_Plot type&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="hscrollbar_policy">never</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="type-treeview">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection1"/>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkPaned" id="paned1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">12</property>
+        <property name="position">250</property>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkGrid" id="grid2">
             <property name="visible">True</property>
-            <property name="spacing">24</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="sample-label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;Sample&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
             <child>
-              <object class="GtkVBox" id="vbox4">
+              <object class="GtkFrame" id="sample-container">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">6</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkLabel" id="type_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;_Plot type&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">type_treeview</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
+                  <placeholder/>
                 </child>
-                <child>
-                  <object class="GtkScrolledWindow" id="scrolledwindow1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hscrollbar_policy">never</property>
-                    <property name="vscrollbar_policy">never</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <object class="GtkTreeView" id="type_treeview">
-                        <property name="width_request">150</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="headers_visible">False</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
+                <child type="label_item">
+                  <placeholder/>
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="position">0</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
+          </object>
+          <packing>
+            <property name="resize">False</property>
+            <property name="shrink">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
-              <placeholder/>
+              <object class="GtkLabel" id="subtype_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;_Subtype&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
             </child>
             <child>
-              <object class="GtkVPaned" id="vpaned1">
+              <object class="GtkScrolledWindow" id="canvas-container">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="position">250</property>
-                <child>
-                  <object class="GtkVBox" id="sample-box">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <object class="GtkLabel" id="sample-label">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Sample&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFrame" id="sample-container">
-                        <property name="visible">True</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">in</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child type="label_item">
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="resize">True</property>
-                    <property name="shrink">True</property>
-                  </packing>
-                </child>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
                 <child>
-                  <object class="GtkVBox" id="rbox">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="subtype_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;_Subtype&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">type_treeview</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkScrolledWindow" id="canvas-container">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">automatic</property>
-                        <property name="vscrollbar_policy">automatic</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="resize">True</property>
-                    <property name="shrink">True</property>
-                  </packing>
+                  <placeholder/>
                 </child>
               </object>
               <packing>
-                <property name="position">2</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="position">0</property>
+            <property name="resize">True</property>
+            <property name="shrink">True</property>
           </packing>
         </child>
       </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
     </child>
   </object>
 </interface>
diff --git a/goffice/graph/gog-guru.c b/goffice/graph/gog-guru.c
index f27d9d1..938f73b 100644
--- a/goffice/graph/gog-guru.c
+++ b/goffice/graph/gog-guru.c
@@ -24,7 +24,6 @@
 #include <goffice/goffice-priv.h>
 
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -257,22 +256,22 @@ cb_key_press_event (G_GNUC_UNUSED GtkWidget *wrapper,
 	row = type->row;
 
 	switch (event->keyval){
-	case GDK_KP_Left:	case GDK_Left:
+	case GDK_KEY_KP_Left:	case GDK_KEY_Left:
 		corner = GTK_CORNER_BOTTOM_RIGHT;
 		--col;
 		break;
 
-	case GDK_KP_Up:	case GDK_Up:
+	case GDK_KEY_KP_Up:	case GDK_KEY_Up:
 		corner = GTK_CORNER_BOTTOM_RIGHT;
 		--row;
 		break;
 
-	case GDK_KP_Right:	case GDK_Right:
+	case GDK_KEY_KP_Right:	case GDK_KEY_Right:
 		corner = GTK_CORNER_TOP_LEFT;
 		++col;
 		break;
 
-	case GDK_KP_Down:	case GDK_Down:
+	case GDK_KEY_KP_Down:	case GDK_KEY_Down:
 		corner = GTK_CORNER_TOP_LEFT;
 		++row;
 		break;
@@ -468,12 +467,6 @@ cb_plot_families_init (char const *id, GogPlotFamily *family,
 }
 
 static void
-cb_canvas_realized (GtkLayout *widget)
-{
-	gdk_window_set_back_pixmap (gtk_layout_get_bin_window (widget), NULL, FALSE);
-}
-
-static void
 graph_guru_state_destroy (GraphGuruState *state)
 {
 	g_return_if_fail (state != NULL);
@@ -1124,16 +1117,18 @@ static void
 typesel_set_selection_color (GraphGuruTypeSelector *typesel)
 {
 	GtkWidget *w = gtk_entry_new ();
-	GtkStyle *gstyle = gtk_widget_get_style (w);
-	GdkColor  *color = &gstyle->base [gtk_widget_has_focus (typesel->canvas)
-		? GTK_STATE_SELECTED : GTK_STATE_ACTIVE];
+	GtkStyleContext *style_context = gtk_widget_get_style_context (w);
+	GdkRGBA  rgba;
 	GOColor    select_color;
 	GOStyle   *style;
 
-	select_color = ((color->red >> 8) & 0xff)   << 24;
-	select_color |= ((color->green >> 8) & 0xff) << 16;
-	select_color |= ((color->blue >> 8) & 0xff)  << 8;
-	select_color |= 0x40; /* alpha of 25% */
+	gtk_style_context_get_background_color (style_context,
+	                                        gtk_widget_has_focus (typesel->canvas)
+											? GTK_STATE_SELECTED : GTK_STATE_ACTIVE,
+                                            &rgba);
+	if (rgba.alpha > 0.40)
+				rgba.alpha = 0.40;
+	select_color = GO_COLOR_FROM_GDK_RGBA (rgba);
 
 	style = go_styled_object_get_style (GO_STYLED_OBJECT (typesel->selector));
 	style->fill.pattern.back = select_color;
@@ -1161,7 +1156,7 @@ graph_guru_type_selector_new (GraphGuruState *s)
 	typesel->max_priority_so_far = -1;
 	s->type_selector = typesel;
 
-	selector = GTK_WIDGET (g_object_ref (gtk_builder_get_object (gui, "type_selector")));
+	selector = GTK_WIDGET (g_object_ref (gtk_builder_get_object (gui, "type-selector")));
 
 	/* List of family types */
 	typesel->model = gtk_list_store_new (PLOT_FAMILY_NUM_COLUMNS,
@@ -1171,7 +1166,7 @@ graph_guru_type_selector_new (GraphGuruState *s)
 	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (typesel->model),
 		PLOT_FAMILY_TYPE_NAME, GTK_SORT_ASCENDING);
 
-	typesel->list_view = GTK_TREE_VIEW (gtk_builder_get_object (gui, "type_treeview"));
+	typesel->list_view = GTK_TREE_VIEW (gtk_builder_get_object (gui, "type-treeview"));
 	gtk_tree_view_set_model (typesel->list_view, GTK_TREE_MODEL (typesel->model));
 	g_object_unref (typesel->model);
 	gtk_tree_view_append_column (typesel->list_view,
@@ -1189,8 +1184,7 @@ graph_guru_type_selector_new (GraphGuruState *s)
 	/* Setup an canvas to display the sample image & the sample plot. */
 	typesel->canvas = GTK_WIDGET (g_object_new (GOC_TYPE_CANVAS, NULL));
 	g_object_connect (typesel->canvas,
-		"signal::realize", G_CALLBACK (cb_canvas_realized), typesel,
-		"signal_after::key_press_event", G_CALLBACK (cb_key_press_event), typesel,
+	    "signal_after::key_press_event", G_CALLBACK (cb_key_press_event), typesel,
 		"signal::button_press_event", G_CALLBACK (cb_button_press_event), typesel,
 		"swapped_signal::focus_in_event", G_CALLBACK (typesel_set_selection_color), typesel,
 		"swapped_signal::focus_out_event", G_CALLBACK (typesel_set_selection_color), typesel,
@@ -1357,11 +1351,10 @@ void
 gog_guru_add_custom_widget (GtkWidget *guru, GtkWidget *custom)
 {
 	GraphGuruState *state = g_object_get_data (G_OBJECT (guru), "state");
-	GtkBox *box = GTK_BOX (gtk_widget_get_parent (
-	    					gtk_widget_get_parent (
-							 gtk_widget_get_parent (state->type_selector->canvas))));
+	GtkWidget *w = gtk_widget_get_parent (gtk_widget_get_parent (state->type_selector->canvas));
+	GtkGrid *box = GTK_GRID (gtk_widget_get_parent (w));
 	if (custom) {
-		gtk_box_pack_start (GTK_BOX (box), custom, FALSE, TRUE, 0);
+		gtk_grid_attach_next_to (GTK_GRID (box), custom, w, GTK_POS_BOTTOM, 1, 1);
 		g_object_set_data (G_OBJECT (custom), "graph", state->graph);
 		gtk_widget_show_all (custom);
 	}
diff --git a/goffice/graph/gog-guru.ui b/goffice/graph/gog-guru.ui
index eb249b8..0b1d565 100644
--- a/goffice/graph/gog-guru.ui
+++ b/goffice/graph/gog-guru.ui
@@ -1,37 +1,117 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="GraphGuru">
+    <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title">GNOME Office Graph</property>
     <property name="window_position">mouse</property>
     <property name="default_width">530</property>
     <property name="default_height">625</property>
     <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox4">
+      <object class="GtkBox" id="dialog-vbox4">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="help_button">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button_cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button_navigate">
+                <property name="label">gtk-go-forward</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button_ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkNotebook" id="notebook">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="show_tabs">False</property>
             <property name="show_border">False</property>
             <child>
-              <object class="GtkVPaned" id="v_fmt_pane">
+              <object class="GtkPaned" id="v_fmt_pane">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="orientation">vertical</property>
                 <property name="position">1</property>
                 <child>
-                  <object class="GtkHPaned" id="h_fmt_pane">
+                  <object class="GtkPaned" id="h_fmt_pane">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="position">1</property>
                     <child>
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="yalign">0</property>
                         <property name="top_padding">6</property>
@@ -39,8 +119,9 @@
                         <property name="left_padding">6</property>
                         <property name="right_padding">6</property>
                         <child>
-                          <object class="GtkVBox" id="vbox1">
+                          <object class="GtkBox" id="vbox1">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
@@ -48,25 +129,28 @@
                                 <property name="height_request">150</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="hscrollbar_policy">automatic</property>
-                                <property name="vscrollbar_policy">automatic</property>
                                 <property name="shadow_type">in</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkHBox" id="menu_hbox">
+                              <object class="GtkBox" id="menu_hbox">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkButton" id="first_precedence">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image79">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-goto-top</property>
                                       </object>
                                     </child>
@@ -82,9 +166,11 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image78">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-go-up</property>
                                       </object>
                                     </child>
@@ -100,9 +186,11 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image77">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-go-down</property>
                                       </object>
                                     </child>
@@ -118,9 +206,11 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image76">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-goto-bottom</property>
                                       </object>
                                     </child>
@@ -136,10 +226,12 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="focus_on_click">False</property>
                                     <child>
                                       <object class="GtkImage" id="image80">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-remove</property>
                                       </object>
                                     </child>
@@ -169,6 +261,7 @@
                       <object class="GtkAlignment" id="sample-alignment">
                         <property name="width_request">200</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="yalign">0</property>
                         <property name="top_padding">6</property>
@@ -193,6 +286,7 @@
                 <child>
                   <object class="GtkAlignment" id="prop_alignment">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="yalign">0</property>
                     <property name="top_padding">6</property>
@@ -212,6 +306,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
                 <property name="yalign">0</property>
               </object>
@@ -225,6 +320,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
                 <property name="yalign">0</property>
               </object>
@@ -235,78 +331,9 @@
             </child>
           </object>
           <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area4">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="help_button">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button_cancel">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button_navigate">
-                <property name="label">gtk-go-forward</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button_ok">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
             <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
           </packing>
         </child>
       </object>
diff --git a/goffice/graph/gog-label.c b/goffice/graph/gog-label.c
index 7c58595..805e874 100644
--- a/goffice/graph/gog-label.c
+++ b/goffice/graph/gog-label.c
@@ -167,7 +167,7 @@ gog_label_populate_editor (GogObject *gobj,
 			   GOCmdContext *cc)
 {
 	static guint label_pref_page = 0;
-	GtkWidget *hbox = gtk_hbox_new (FALSE, 12);
+	GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 	GtkWidget *alignment = gtk_alignment_new (0, 0, 1, 0);
 	GtkWidget *editor_widget =
 		GTK_WIDGET
@@ -475,7 +475,7 @@ gog_text_view_render (GogView *view, GogViewAllocation const *bbox)
 			gog_renderer_draw_rectangle (view->renderer, &rect);
 		}
 		gog_renderer_draw_text (view->renderer, str,
-					&view->residual, GTK_ANCHOR_NW, FALSE);
+					&view->residual, GO_ANCHOR_NW, FALSE);
 		g_free (str);
 	}
 	gog_renderer_pop_style (view->renderer);
diff --git a/goffice/graph/gog-legend.c b/goffice/graph/gog-legend.c
index 4a69ece..5050882 100644
--- a/goffice/graph/gog-legend.c
+++ b/goffice/graph/gog-legend.c
@@ -511,7 +511,7 @@ cb_render_elements (unsigned index, GOStyle const *base_style, char const *name,
 	pos.x = data->x + glv->label_offset;
 	pos.y = data->y + glv->element_height / 2.0;
 	pos.w = pos.h = -1;
-	gog_renderer_draw_text (renderer, name, &pos, GTK_ANCHOR_W, FALSE);
+	gog_renderer_draw_text (renderer, name, &pos, GO_ANCHOR_W, FALSE);
 
 	if (style != base_style && style != NULL)
 		g_object_unref (style);
diff --git a/goffice/graph/gog-object-prefs.ui b/goffice/graph/gog-object-prefs.ui
index 5ae2b33..c359eb0 100644
--- a/goffice/graph/gog-object-prefs.ui
+++ b/goffice/graph/gog-object-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">-10000</property>
@@ -38,13 +38,13 @@
       </row>
     </data>
   </object>
-  <object class="GtkVBox" id="gog_object_prefs">
+  <object class="GtkBox" id="gog_object_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <property name="spacing">6</property>
     <child>
-      <object class="GtkHBox" id="position_select_box">
+      <object class="GtkBox" id="position_select_box">
         <property name="visible">True</property>
         <property name="spacing">12</property>
         <child>
@@ -88,12 +88,12 @@
         <property name="show_tabs">False</property>
         <property name="show_border">False</property>
         <child>
-          <object class="GtkVBox" id="vbox12">
+          <object class="GtkBox" id="vbox12">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkHBox" id="compass_position">
+              <object class="GtkBox" id="compass_position">
                 <property name="visible">True</property>
                 <property name="spacing">12</property>
                 <child>
@@ -127,7 +127,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="compass_alignment">
+              <object class="GtkBox" id="compass_alignment">
                 <property name="visible">True</property>
                 <property name="spacing">12</property>
                 <child>
@@ -172,7 +172,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox9">
+          <object class="GtkBox" id="vbox9">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
diff --git a/goffice/graph/gog-object.c b/goffice/graph/gog-object.c
index 016397d..ef16d1d 100644
--- a/goffice/graph/gog-object.c
+++ b/goffice/graph/gog-object.c
@@ -438,7 +438,7 @@ gog_object_populate_editor (GogObject *gobj,
 		gtk_size_group_add_widget (widget_size_group, w);
 		flags = gog_object_get_position_flags (gobj, GOG_POSITION_COMPASS);
 		for (i = 0; i < G_N_ELEMENTS (position_compass); i++) {
-			gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_compass[i].label));
+			go_gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_compass[i].label));
 			if (position_compass[i].flags == flags)
 				gtk_combo_box_set_active (GTK_COMBO_BOX (w), i);
 		}
@@ -455,7 +455,7 @@ gog_object_populate_editor (GogObject *gobj,
 		gtk_size_group_add_widget (widget_size_group, w);
 		flags = gog_object_get_position_flags (gobj, GOG_POSITION_ALIGNMENT);
 		for (i = 0; i < G_N_ELEMENTS (position_alignment); i++) {
-			gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_alignment[i].label));
+			go_gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_alignment[i].label));
 			if (position_alignment[i].flags == flags)
 				gtk_combo_box_set_active (GTK_COMBO_BOX (w), i);
 		}
@@ -498,7 +498,7 @@ gog_object_populate_editor (GogObject *gobj,
 		w =  GTK_WIDGET (go_gtk_builder_combo_box_init_text (gui, "anchor_combo"));
 		flags = gog_object_get_position_flags (gobj, GOG_POSITION_ANCHOR);
 		for (i = 0; i < G_N_ELEMENTS (position_anchor); i++) {
-			gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_anchor[i].label));
+			go_gtk_combo_box_append_text (GTK_COMBO_BOX (w), _(position_anchor[i].label));
 			if (i == 0 || position_anchor[i].flags == flags)
 				gtk_combo_box_set_active (GTK_COMBO_BOX (w), i);
 		}
diff --git a/goffice/graph/gog-plot-prefs.ui b/goffice/graph/gog-plot-prefs.ui
index 605bcf0..d7181f2 100644
--- a/goffice/graph/gog-plot-prefs.ui
+++ b/goffice/graph/gog-plot-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">100</property>
@@ -36,17 +36,17 @@
       </row>
     </data>
   </object>
-  <object class="GtkVBox" id="gog_plot_prefs">
+  <object class="GtkBox" id="gog_plot_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <child>
-      <object class="GtkVBox" id="plot_area_box">
+      <object class="GtkBox" id="plot_area_box">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkBox" id="hbox1">
             <property name="visible">True</property>
             <property name="spacing">12</property>
             <child>
diff --git a/goffice/graph/gog-plot.c b/goffice/graph/gog-plot.c
index 01bd213..3b05d75 100644
--- a/goffice/graph/gog-plot.c
+++ b/goffice/graph/gog-plot.c
@@ -194,7 +194,7 @@ gog_plot_populate_editor (GogObject *obj,
 	GtkCellRenderer *cell;
 
 	g_return_if_fail (chart != NULL);
-	
+
 	if (gog_chart_get_axis_set (chart) == GOG_AXIS_SET_XY) {
 		GtkWidget *combo;
 		GtkWidget *table = gtk_table_new (0, 1, FALSE);
diff --git a/goffice/graph/gog-reg-curve-prefs.ui b/goffice/graph/gog-reg-curve-prefs.ui
index c8c26b5..1e2e497 100644
--- a/goffice/graph/gog-reg-curve-prefs.ui
+++ b/goffice/graph/gog-reg-curve-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkTable" id="reg-curve-prefs">
     <property name="visible">True</property>
diff --git a/goffice/graph/gog-reg-eqn-prefs.ui b/goffice/graph/gog-reg-eqn-prefs.ui
index 5fda88b..5ad567b 100644
--- a/goffice/graph/gog-reg-eqn-prefs.ui
+++ b/goffice/graph/gog-reg-eqn-prefs.ui
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkVBox" id="reg-eqn-prefs">
+  <object class="GtkBox" id="reg-eqn-prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
diff --git a/goffice/graph/gog-renderer.c b/goffice/graph/gog-renderer.c
index b77a681..9637ede 100644
--- a/goffice/graph/gog-renderer.c
+++ b/goffice/graph/gog-renderer.c
@@ -777,11 +777,11 @@ gog_renderer_draw_marker (GogRenderer *rend, double x, double y)
 }
 
 /**
- * gog_renderer_draw_layout :
+ * gog_renderer_draw_gostring :
  * @rend   : #GogRenderer
  * @gostring : the #GOString to draw
  * @pos    : #GogViewAllocation
- * @anchor : #GtkAnchorType how to draw relative to @pos
+ * @anchor : #GOAnchorType how to draw relative to @pos
  *
  * Have @rend draw @layout in the at @pos.{x,y} anchored by the @anchor corner.
  * If @pos.w or @pos.h are >= 0 then clip the results to less than that size.
@@ -789,7 +789,7 @@ gog_renderer_draw_marker (GogRenderer *rend, double x, double y)
 
 void
 gog_renderer_draw_gostring (GogRenderer *rend, GOString *str,
-			GogViewAllocation const *pos, GtkAnchorType anchor)
+			GogViewAllocation const *pos, GOAnchorType anchor)
 {
 	PangoLayout *layout;
 	PangoContext *context;
@@ -828,20 +828,20 @@ gog_renderer_draw_gostring (GogRenderer *rend, GOString *str,
 	go_geometry_OBR_to_AABR (&obr, &aabr);
 
 	switch (anchor) {
-		case GTK_ANCHOR_NW: case GTK_ANCHOR_W: case GTK_ANCHOR_SW:
+		case GO_ANCHOR_NW: case GO_ANCHOR_W: case GO_ANCHOR_SW:
 			obr.x += aabr.w / 2.0;
 			break;
-		case GTK_ANCHOR_NE : case GTK_ANCHOR_SE : case GTK_ANCHOR_E :
+		case GO_ANCHOR_NE : case GO_ANCHOR_SE : case GO_ANCHOR_E :
 			obr.x -= aabr.w / 2.0;
 			break;
 		default : break;
 	}
 
 	switch (anchor) {
-		case GTK_ANCHOR_NW: case GTK_ANCHOR_N: case GTK_ANCHOR_NE:
+		case GO_ANCHOR_NW: case GO_ANCHOR_N: case GO_ANCHOR_NE:
 			obr.y += aabr.h / 2.0;
 			break;
-		case GTK_ANCHOR_SE : case GTK_ANCHOR_S : case GTK_ANCHOR_SW :
+		case GO_ANCHOR_SE : case GO_ANCHOR_S : case GO_ANCHOR_SW :
 			obr.y -= aabr.h / 2.0;
 			break;
 		default : break;
@@ -875,7 +875,7 @@ gog_renderer_draw_gostring (GogRenderer *rend, GOString *str,
 
 void
 gog_renderer_draw_text (GogRenderer *rend, char const *text,
-			GogViewAllocation const *pos, GtkAnchorType anchor,
+			GogViewAllocation const *pos, GOAnchorType anchor,
 			gboolean use_markup)
 {
 	cairo_t *cairo;
@@ -1310,60 +1310,32 @@ gog_renderer_export_image (GogRenderer *rend, GOImageFormat format,
 	switch (format) {
 		case GO_IMAGE_FORMAT_EPS:
 			rend->marker_as_surface = FALSE;
-#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
 			surface = cairo_ps_surface_create_for_stream
 				(_cairo_write_func,
 				 output, width_in_pts, height_in_pts);
 			cairo_ps_surface_set_eps (surface, TRUE);
-#ifdef HAVE_CAIRO_SURFACE_SET_FALLBACK_RESOLUTION
 			cairo_surface_set_fallback_resolution (surface, x_dpi, y_dpi);
-#endif
 			goto do_export_vectorial;
-#else
-			g_warning ("[GogRendererCairo::export_image] cairo EPS backend missing");
-			return FALSE;
-#endif
 		case GO_IMAGE_FORMAT_PDF:
 			rend->marker_as_surface = FALSE;
-#ifdef CAIRO_HAS_PDF_SURFACE
 			surface = cairo_pdf_surface_create_for_stream
 				(_cairo_write_func,
 				 output, width_in_pts, height_in_pts);
-#ifdef HAVE_CAIRO_SURFACE_SET_FALLBACK_RESOLUTION
 			cairo_surface_set_fallback_resolution (surface, x_dpi, y_dpi);
-#endif
 			goto do_export_vectorial;
-#else
-			g_warning ("[GogRendererCairo::export_image] cairo PDF backend missing");
-			return FALSE;
-#endif
 		case GO_IMAGE_FORMAT_PS:
 			rend->marker_as_surface = FALSE;
-#ifdef CAIRO_HAS_PS_SURFACE
 			surface = cairo_ps_surface_create_for_stream
 				(_cairo_write_func,
 				 output, width_in_pts, height_in_pts);
-#ifdef HAVE_CAIRO_SURFACE_SET_FALLBACK_RESOLUTION
 			cairo_surface_set_fallback_resolution (surface, x_dpi, y_dpi);
-#endif
 			goto do_export_vectorial;
-#else
-			g_warning ("[GogRendererCairo::export_image] cairo PS backend missing");
-			return FALSE;
-#endif
 		case GO_IMAGE_FORMAT_SVG:
 			rend->marker_as_surface = TRUE;
-#ifdef CAIRO_HAS_SVG_SURFACE
 			surface = cairo_svg_surface_create_for_stream
 				(_cairo_write_func,
 				 output, width_in_pts, height_in_pts);
-#ifdef HAVE_CAIRO_SURFACE_SET_FALLBACK_RESOLUTION
 			cairo_surface_set_fallback_resolution (surface, x_dpi, y_dpi);
-#endif
-#else
-			g_warning ("[GogRendererCairo::export_image] cairo SVG backend missing");
-			return FALSE;
-#endif
 do_export_vectorial:
 			rend->scale = 1.0;
 			cairo = cairo_create (surface);
@@ -1434,19 +1406,19 @@ gog_renderer_get_hairline_width_pts (GogRenderer const *rend)
 #ifdef GOFFICE_WITH_LASEM
 
 void
-gog_renderer_draw_equation (GogRenderer *renderer, LsmMathmlView *mathml_view, double x, double y)
+gog_renderer_draw_equation (GogRenderer *renderer, LsmDomView *mathml_view, double x, double y)
 {
 	cairo_t *cairo;
 	double w, h, alpha;
 
 	g_return_if_fail (GOG_IS_RENDERER (renderer));
-	g_return_if_fail (LSM_IS_MATHML_VIEW (mathml_view));
+	g_return_if_fail (LSM_IS_DOM_VIEW (mathml_view));
 	g_return_if_fail (renderer->cur_style != NULL);
 
 	cairo = renderer->cairo;
 
 	alpha = -renderer->cur_style->text_layout.angle * M_PI / 180.0;
-	lsm_dom_view_get_size (LSM_DOM_VIEW (mathml_view), &w, &h);
+	lsm_dom_view_get_size (LSM_DOM_VIEW (mathml_view), &w, &h, NULL);
 	w *= renderer->scale;
 	h *= renderer->scale;
 	x = x - (w / 2.0) * cos (alpha) + (h / 2.0) * sin (alpha);
@@ -1458,8 +1430,7 @@ gog_renderer_draw_equation (GogRenderer *renderer, LsmMathmlView *mathml_view, d
 	cairo_rotate (cairo, alpha);
 	cairo_scale (cairo, renderer->scale_x, renderer->scale_y);
 
-	lsm_dom_view_set_cairo (LSM_DOM_VIEW (mathml_view), cairo);
-	lsm_dom_view_render (LSM_DOM_VIEW (mathml_view), 0., 0.);
+	lsm_dom_view_render (LSM_DOM_VIEW (mathml_view), cairo, 0., 0.);
 
 	cairo_restore (cairo);
 }
diff --git a/goffice/graph/gog-renderer.h b/goffice/graph/gog-renderer.h
index 7db1410..203be4b 100644
--- a/goffice/graph/gog-renderer.h
+++ b/goffice/graph/gog-renderer.h
@@ -29,42 +29,13 @@
 #include <gdk/gdk.h>
 #else
 typedef struct _GdkPixbuf GdkPixbuf;
-typedef enum
-{
-  GTK_ANCHOR_CENTER,
-  GTK_ANCHOR_NORTH,
-  GTK_ANCHOR_NORTH_WEST,
-  GTK_ANCHOR_NORTH_EAST,
-  GTK_ANCHOR_SOUTH,
-  GTK_ANCHOR_SOUTH_WEST,
-  GTK_ANCHOR_SOUTH_EAST,
-  GTK_ANCHOR_WEST,
-  GTK_ANCHOR_EAST,
-  GTK_ANCHOR_N		= GTK_ANCHOR_NORTH,
-  GTK_ANCHOR_NW		= GTK_ANCHOR_NORTH_WEST,
-  GTK_ANCHOR_NE		= GTK_ANCHOR_NORTH_EAST,
-  GTK_ANCHOR_S		= GTK_ANCHOR_SOUTH,
-  GTK_ANCHOR_SW		= GTK_ANCHOR_SOUTH_WEST,
-  GTK_ANCHOR_SE		= GTK_ANCHOR_SOUTH_EAST,
-  GTK_ANCHOR_W		= GTK_ANCHOR_WEST,
-  GTK_ANCHOR_E		= GTK_ANCHOR_EAST
-} GtkAnchorType;
 #endif
 
 #ifdef GOFFICE_WITH_LASEM
-#include <lsmmathmlview.h>
+#include <lsmdomview.h>
 #endif
 
 #include <cairo.h>
-#ifdef CAIRO_HAS_SVG_SURFACE
-#define GOG_RENDERER_CAIRO_WITH_SVG
-#endif
-#ifdef CAIRO_HAS_PDF_SURFACE
-#define GOG_RENDERER_CAIRO_WITH_PDF
-#endif
-#ifdef CAIRO_HAS_PS_SURFACE
-#define GOG_RENDERER_CAIRO_WITH_PS
-#endif
 
 G_BEGIN_DECLS
 /* We need to define an hair line width for the svg and gnome_print renderer.
@@ -116,13 +87,13 @@ void  gog_renderer_draw_marker	  (GogRenderer *rend, double x, double y);
 
 void  gog_renderer_draw_text	  (GogRenderer *rend, char const *text,
 				   GogViewAllocation const *pos, 
-				   GtkAnchorType anchor,
+				   GOAnchorType anchor,
 				   gboolean use_markup);
 
 void  gog_renderer_draw_gostring  (GogRenderer *rend,
 				   GOString *str,
 				   GogViewAllocation const *pos, 
-				   GtkAnchorType anchor);
+				   GOAnchorType anchor);
 
 void  gog_renderer_get_gostring_OBR   (GogRenderer *rend, GOString *str,
 				       GOGeometryOBR *obr);
@@ -154,7 +125,7 @@ gboolean 	 gog_renderer_export_image 	(GogRenderer *renderer, GOImageFormat form
 GogRenderer 	*gog_renderer_new 		(GogGraph *graph);
 
 #ifdef GOFFICE_WITH_LASEM
-void		 gog_renderer_draw_equation	(GogRenderer *renderer, LsmMathmlView *mathml_view,
+void		 gog_renderer_draw_equation	(GogRenderer *renderer, LsmDomView *mathml_view,
 						 double x, double y);
 #endif
 
diff --git a/goffice/graph/gog-series-prefs.ui b/goffice/graph/gog-series-prefs.ui
index 706587c..368995c 100644
--- a/goffice/graph/gog-series-prefs.ui
+++ b/goffice/graph/gog-series-prefs.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkListStore" id="model1">
     <columns>
@@ -13,7 +13,7 @@
       </row>
     </data>
   </object>
-  <object class="GtkVBox" id="interpolation_prefs">
+  <object class="GtkBox" id="interpolation_prefs">
     <property name="visible">True</property>
     <property name="orientation">vertical</property>
     <child>
@@ -123,11 +123,11 @@
       </packing>
     </child>
   </object>
-  <object class="GtkVBox" id="fill_type_prefs">
+  <object class="GtkBox" id="fill_type_prefs">
     <property name="visible">True</property>
     <property name="orientation">vertical</property>
     <child>
-      <object class="GtkHBox" id="hbox1">
+      <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="spacing">12</property>
         <child>
diff --git a/goffice/graph/gog-series.c b/goffice/graph/gog-series.c
index 1fa8d64..0b961e4 100644
--- a/goffice/graph/gog-series.c
+++ b/goffice/graph/gog-series.c
@@ -154,7 +154,7 @@ gog_series_element_populate_editor (GogObject *gobj,
 
 	(GOG_OBJECT_CLASS(gse_parent_klass)->populate_editor) (gobj, editor, dalloc, cc);
 
-	w = gtk_hbox_new (FALSE, 12);
+	w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 	gtk_box_pack_start (GTK_BOX (w), gtk_label_new (_("Index:")),
 			    FALSE, FALSE, 0);
 	spin_button = gtk_spin_button_new_with_range (0, G_MAXINT, 1);
@@ -165,7 +165,7 @@ gog_series_element_populate_editor (GogObject *gobj,
 			  G_CALLBACK (cb_index_changed), gobj);
 	gtk_box_pack_start(GTK_BOX (w), spin_button, FALSE, FALSE, 0);
 	if (gse_vbox == NULL) {
-		vbox = gtk_vbox_new (FALSE, 6);
+		vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 		gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
 	} else
 		vbox = gse_vbox;
@@ -458,7 +458,7 @@ gog_series_populate_editor (GogObject *gobj,
 	GogDataset *set = GOG_DATASET (gobj);
 	GogSeriesDesc const *desc;
 	GogDataType data_type;
-	GtkComboBox *combo = NULL;
+	GtkComboBoxText *combo = NULL;
 
 	g_return_if_fail (series->plot != NULL);
 
@@ -491,7 +491,7 @@ gog_series_populate_editor (GogObject *gobj,
 	}
 
 	if (has_shared) {
-		gtk_table_attach (table, gtk_hseparator_new (),
+		gtk_table_attach (table, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL),
 			0, 2, row, row+1, GTK_FILL, 0, 0, 0);
 		row++;
 	}
@@ -506,7 +506,7 @@ gog_series_populate_editor (GogObject *gobj,
 				desc->dim[i].name, desc->dim[i].priority, TRUE);
 	}
 
-	gtk_table_attach (table, gtk_hseparator_new (),
+	gtk_table_attach (table, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL),
 		0, 2, row, row+1, GTK_FILL, 0, 0, 0);
 	row++;
 	w = gtk_check_button_new_with_mnemonic (_("_Show in Legend"));
@@ -537,16 +537,16 @@ gog_series_populate_editor (GogObject *gobj,
 			gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
 			widget = go_gtk_builder_get_widget (gui, "interpolation-table");
 			/* create an interpolation type combo and populate it */
-			combo = GTK_COMBO_BOX (gtk_combo_box_new_text ());
+			combo = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new ());
 			if (set & 1 << GOG_AXIS_RADIAL)
 				for (i = 0; i < GO_LINE_INTERPOLATION_MAX; i++) {
 					if (go_line_interpolation_supports_radial (i))
-						gtk_combo_box_append_text (combo, _(go_line_interpolation_as_label (i)));
+						gtk_combo_box_text_append_text (combo, _(go_line_interpolation_as_label (i)));
 				}
 			else
 				for (i = 0; i < GO_LINE_INTERPOLATION_MAX; i++)
-					gtk_combo_box_append_text (combo, _(go_line_interpolation_as_label (i)));
-			gtk_combo_box_set_active (combo, series->interpolation);
+					gtk_combo_box_text_append_text (combo, _(go_line_interpolation_as_label (i)));
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo), series->interpolation);
 			g_signal_connect (combo, "changed",
 					  G_CALLBACK (cb_line_interpolation_changed), series);
 			gtk_table_attach (GTK_TABLE (widget), GTK_WIDGET (combo), 1, 2,
@@ -587,7 +587,7 @@ gog_series_populate_editor (GogObject *gobj,
 		gui = go_gtk_builder_new ("gog-series-prefs.ui", GETTEXT_PACKAGE, cc);
 		if (gui != NULL) {
 			widget = go_gtk_builder_get_widget (gui, "fill_type_combo");
-			gog_series_populate_fill_type_combo (GOG_SERIES (series), GTK_COMBO_BOX (widget));
+				gog_series_populate_fill_type_combo (GOG_SERIES (series), GTK_COMBO_BOX (widget));
 			g_signal_connect (G_OBJECT (widget), "changed",
 					  G_CALLBACK (cb_fill_type_changed), series);
 			if (combo)
@@ -1175,7 +1175,7 @@ gog_series_populate_fill_type_combo (GogSeries const *series, GtkComboBox *combo
 	for (i = 0; series_klass->valid_fill_type_list[i] != GOG_SERIES_FILL_TYPE_INVALID; i++) {
 		fill_type = series_klass->valid_fill_type_list[i];
 		if (fill_type >= 0 && fill_type < GOG_SERIES_FILL_TYPE_INVALID) {
-			gtk_combo_box_append_text (combo, _(_fill_type_infos[fill_type].label));
+			go_gtk_combo_box_append_text (combo, _(_fill_type_infos[fill_type].label));
 			if (fill_type == series->fill_type)
 				gtk_combo_box_set_active (combo, i);
 		}
diff --git a/goffice/graph/gog-theme.c b/goffice/graph/gog-theme.c
index 94627b0..774f001 100644
--- a/goffice/graph/gog-theme.c
+++ b/goffice/graph/gog-theme.c
@@ -37,20 +37,20 @@
 /**
  * SECTION:gog-theme
  * @short_description: a list of default styles to apply to appropriate graph elements.
- * 
+ *
  * The library provides two hard coded themes, "Default", and "Guppi". Other themes
  * are described in files, some of which might be distributed with the library.
- * 
+ *
  * A file defining a theme is an xml file with a &lt;GogTheme&gt; root node. The contents
  * must be: _name|name+, _description?|description*, GOStyle+.
- * 
+ *
  * _name and name nodes:
  *
  * The _name node should be used for themes distributed with goffice, localized
  * names will be in *.po files and only the default name for "C" locale needs to
  * be there. Other files need at least one name node for the default name, and
  * might have some translated names with an appropriate "xml:lang" attribute.
- * 
+ *
  * _description and description nodes:
  *
  * These work just like name nodes. The difference is that no description node is
@@ -1026,7 +1026,7 @@ desc_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 static void
 elem_start (GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
 {
-	struct theme_load_state	*state = (struct theme_load_state *) xin->user_state; 
+	struct theme_load_state	*state = (struct theme_load_state *) xin->user_state;
 	char const *role = NULL, *class_name = NULL;
 	GOStyle *style;
 	unsigned i;
diff --git a/goffice/graph/gog-trend-line.c b/goffice/graph/gog-trend-line.c
index bd9c8a8..5d6927b 100644
--- a/goffice/graph/gog-trend-line.c
+++ b/goffice/graph/gog-trend-line.c
@@ -91,7 +91,7 @@ gog_trend_line_populate_editor (GogObject *gobj,
 	if (!box)
 		box = go_editor_get_page (editor, _("Details"));
 	if (!box) {
-		box = gtk_vbox_new (FALSE, 6);
+		box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 		gtk_container_set_border_width (GTK_CONTAINER (box), 12);
 		gtk_widget_show_all (box);
 		go_editor_add_page (editor, box, _("Legend"));
diff --git a/goffice/graph/gog-view.h b/goffice/graph/gog-view.h
index ab347cc..0ab1a69 100644
--- a/goffice/graph/gog-view.h
+++ b/goffice/graph/gog-view.h
@@ -122,7 +122,7 @@ GogTool		*gog_view_get_tool_at_point 	(GogView *view, double x, double y,
 GogView 	*gog_view_get_view_at_point	(GogView *view, double x, double y,
 						 GogObject **obj, GogTool **tool);
 char		*gog_view_get_tip_at_point      (GogView *view, double x, double y);
-    
+
     /* protected */
 void gog_view_size_child_request (GogView *view,
 				  GogViewRequisition const *available,
diff --git a/goffice/gtk/Makefile.am b/goffice/gtk/Makefile.am
index cec44b7..3f7169d 100644
--- a/goffice/gtk/Makefile.am
+++ b/goffice/gtk/Makefile.am
@@ -75,9 +75,6 @@ libgoffice_gtk_la_HEADERS = 		\
 	go-graph-widget.h	\
 	go-image-sel.h
 
-noinst_HEADERS = \
-	go-gtk-compat.h
-
 uidir = $(goffice_datadir)/ui
 dist_ui_DATA = \
 	go-rotation-sel.ui			\
diff --git a/goffice/gtk/go-3d-rotation-sel.c b/goffice/gtk/go-3d-rotation-sel.c
index be84573..d7493ac 100644
--- a/goffice/gtk/go-3d-rotation-sel.c
+++ b/goffice/gtk/go-3d-rotation-sel.c
@@ -20,7 +20,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -31,7 +30,7 @@ typedef struct {
 } g3d_point;
 
 struct _GO3DRotationSel {
-	GtkHBox		 box;
+	GtkBox		 box;
 	GtkBuilder	*gui;
 	GtkRange	*fovscale;
 	double		 psi;
@@ -57,7 +56,7 @@ struct _GO3DRotationSel {
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 	void (* psi_changed) (GO3DRotationSel *g3d, int angle);
 	void (* theta_changed) (GO3DRotationSel *g3d, int angle);
 	void (* phi_changed) (GO3DRotationSel *g3d, int angle);
@@ -191,13 +190,13 @@ static void
 cb_rotate_canvas_realize (GocCanvas *canvas, GO3DRotationSel *g3d)
 {
 	GocGroup  *group = GOC_GROUP (goc_canvas_get_root (canvas));
-	GtkStyle *style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (canvas)));
 	int i;
 	GOStyle *go_style;
 	double mgn = g3d->margin - 2 + g3d->radius;
-	style->bg[GTK_STATE_NORMAL] = style->white;
-	gtk_widget_set_style (GTK_WIDGET (canvas), style);
-	g_object_unref (style);
+	GdkRGBA color = {1., 1., 1., 1.};
+
+	gtk_widget_override_background_color (GTK_WIDGET (canvas),
+	                                      GTK_STATE_NORMAL, &color);
 
 	for (i = 0; i < 6; ++i) {
 		g3d->cube_polygons[i] = goc_item_new (group,
@@ -296,10 +295,11 @@ cb_rotate_canvas_button (GocCanvas *canvas, GdkEventButton *event,
 		x -= g3d->bank_dial_x;
 		y -= g3d->bank_dial_y;
 		r = g3d->bank_dial_r;
-		gdk_pointer_grab (gtk_layout_get_bin_window (&canvas->base), FALSE,
-			GDK_POINTER_MOTION_MASK
-			| GDK_BUTTON_RELEASE_MASK, NULL, NULL,
-			event->time);
+		gdk_device_grab (gdk_event_get_device ((GdkEvent *) event),
+		                 gtk_layout_get_bin_window (&canvas->base),
+		                 GDK_OWNERSHIP_APPLICATION, FALSE,
+				 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+				 NULL, event->time);
 
 		if (x * x + y * y <= r * r) {
 			g3d->motion_handle = g_signal_connect (G_OBJECT (canvas),
@@ -314,8 +314,8 @@ cb_rotate_canvas_button (GocCanvas *canvas, GdkEventButton *event,
 	} else if (event->type == GDK_BUTTON_RELEASE) {
 		if (g3d->motion_handle == 0)
 			return TRUE;
-		gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (canvas)),
-			event->time);
+		gdk_device_ungrab (gdk_event_get_device ((GdkEvent *) event),
+		                   event->time);
 		g_signal_handler_disconnect (canvas, g3d->motion_handle);
 		g3d->motion_handle = 0;
 		g_signal_emit (G_OBJECT (g3d),
@@ -389,7 +389,7 @@ g3d_class_init (GObjectClass *klass)
 	GObjectClass *gobj_class = (GObjectClass *) klass;
 	gobj_class->finalize = g3d_finalize;
 
-	g3d_parent_class = g_type_class_peek (gtk_hbox_get_type ());
+	g3d_parent_class = g_type_class_peek (gtk_box_get_type ());
 	g3d_signals [MATRIX_CHANGED] = g_signal_new ("matrix-changed",
 		G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (GO3DRotationSelClass, psi_changed),
@@ -423,7 +423,7 @@ g3d_class_init (GObjectClass *klass)
 }
 
 GSF_CLASS (GO3DRotationSel, go_3d_rotation_sel,
-	   g3d_class_init, g3d_init, GTK_TYPE_HBOX)
+	   g3d_class_init, g3d_init, GTK_TYPE_BOX)
 
 GtkWidget *
 go_3d_rotation_sel_new (void)
diff --git a/goffice/gtk/go-3d-rotation-sel.ui b/goffice/gtk/go-3d-rotation-sel.ui
index 4c17540..605b68f 100644
--- a/goffice/gtk/go-3d-rotation-sel.ui
+++ b/goffice/gtk/go-3d-rotation-sel.ui
@@ -1,24 +1,26 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">90</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkHBox" id="toplevel">
+  <object class="GtkBox" id="toplevel">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
     <property name="spacing">24</property>
     <child>
-      <object class="GtkVBox" id="vbox7">
+      <object class="GtkBox" id="vbox7">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
           <object class="GtkLabel" id="label1">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">&lt;b&gt;Rotation&lt;/b&gt;</property>
@@ -31,8 +33,9 @@
           </packing>
         </child>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkBox" id="hbox1">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <child>
               <object class="GtkScrolledWindow" id="rotate_canvas">
@@ -55,10 +58,11 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVScale" id="fovscale">
+              <object class="GtkScale" id="fovscale">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="orientation">vertical</property>
                 <property name="adjustment">adjustment1</property>
                 <property name="digits">0</property>
                 <property name="draw_value">False</property>
diff --git a/goffice/gtk/go-action-combo-color.c b/goffice/gtk/go-action-combo-color.c
index 7deab49..2412da5 100644
--- a/goffice/gtk/go-action-combo-color.c
+++ b/goffice/gtk/go-action-combo-color.c
@@ -19,12 +19,7 @@
  * USA
  */
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include "go-action-combo-color.h"
-#include "go-combo-color.h"
-#include "go-combo-box.h"
-#include "go-color-palette.h"
-#include "goffice-gtk.h"
 
 #include <gsf/gsf-impl-utils.h>
 
@@ -42,27 +37,6 @@ typedef GtkToolItemClass GOToolComboColorClass;
 
 static GType go_tool_combo_color_get_type (void);
 
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-static gboolean
-go_tool_combo_color_set_tooltip (GtkToolItem *tool_item, GtkTooltips *tooltips,
-				 char const *tip_text,
-				 char const *tip_private)
-{
-	GOToolComboColor *self = (GOToolComboColor *)tool_item;
-	go_combo_box_set_tooltip (GO_COMBO_BOX (self->combo), tooltips,
-				  tip_text, tip_private);
-	return TRUE;
-}
-#endif
-
-static void
-go_tool_combo_color_class_init (GtkToolItemClass *tool_item_class)
-{
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-	tool_item_class->set_tooltip = go_tool_combo_color_set_tooltip;
-#endif
-}
-
 static GdkPixbuf *
 make_icon (GtkAction *a, GtkWidget *tool)
 {
@@ -98,7 +72,7 @@ make_icon (GtkAction *a, GtkWidget *tool)
 
 
 static GSF_CLASS (GOToolComboColor, go_tool_combo_color,
-	   go_tool_combo_color_class_init, NULL,
+	   NULL, NULL,
 	   GTK_TYPE_TOOL_ITEM)
 
 /*****************************************************************************/
diff --git a/goffice/gtk/go-action-combo-pixmaps.c b/goffice/gtk/go-action-combo-pixmaps.c
index 801802b..4f00062 100644
--- a/goffice/gtk/go-action-combo-pixmaps.c
+++ b/goffice/gtk/go-action-combo-pixmaps.c
@@ -19,7 +19,6 @@
  * USA
  */
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include "go-action-combo-pixmaps.h"
 #include "go-combo-pixmaps.h"
 #include "go-combo-box.h"
@@ -40,29 +39,8 @@ typedef GtkToolItemClass GOToolComboPixmapsClass;
 
 static GType go_tool_combo_pixmaps_get_type (void);
 
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-static gboolean
-go_tool_combo_pixmaps_set_tooltip (GtkToolItem *tool_item, GtkTooltips *tooltips,
-				   char const *tip_text,
-				   char const *tip_private)
-{
-	GOToolComboPixmaps *self = (GOToolComboPixmaps *)tool_item;
-	go_combo_box_set_tooltip (GO_COMBO_BOX (self->combo), tooltips,
-				  tip_text, tip_private);
-	return TRUE;
-}
-#endif
-
-static void
-go_tool_combo_pixmaps_class_init (GtkToolItemClass *tool_item_klass)
-{
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-	tool_item_klass->set_tooltip = go_tool_combo_pixmaps_set_tooltip;
-#endif
-}
-
 static GSF_CLASS (GOToolComboPixmaps, go_tool_combo_pixmaps,
-	   go_tool_combo_pixmaps_class_init, NULL,
+	   NULL, NULL,
 	   GTK_TYPE_TOOL_ITEM)
 
 /*****************************************************************************/
@@ -105,8 +83,7 @@ make_icon (GtkAction *a, const char *stock_id, GtkWidget *tool)
 	} else
 		size = GTK_ICON_SIZE_MENU;
 
-	return gtk_widget_render_icon (tool, stock_id, size,
-				       "GOActionComboPixmaps");
+	return gtk_widget_render_icon_pixbuf (tool, stock_id, size);
 }
 
 
@@ -191,10 +168,9 @@ go_action_combo_pixmaps_create_menu_item (GtkAction *a)
 
 	for ( ; el->stock_id != NULL ; el++)
 		go_menu_pixmaps_add_element (submenu,
-			gtk_widget_render_icon (GTK_WIDGET (item),
+			gtk_widget_render_icon_pixbuf (GTK_WIDGET (item),
 				el->stock_id,
-				GTK_ICON_SIZE_MENU,
-				"GOActionComboPixmaps"),
+				GTK_ICON_SIZE_MENU),
 			el->id);
 
 	gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), GTK_WIDGET (submenu));
diff --git a/goffice/gtk/go-action-combo-stack.c b/goffice/gtk/go-action-combo-stack.c
index d3230a5..8e0bfea 100644
--- a/goffice/gtk/go-action-combo-stack.c
+++ b/goffice/gtk/go-action-combo-stack.c
@@ -19,7 +19,6 @@
  * USA
  */
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include "go-action-combo-stack.h"
 #include "go-combo-box.h"
 #include "goffice-gtk.h"
@@ -109,7 +108,7 @@ cb_button_release_event (GtkWidget *list, GdkEventButton *e, gpointer data)
 
 	if (stack->last_key != NULL) {
 		gint dummy, w, h;
-		gdk_window_get_geometry (e->window, &dummy, &dummy, &w, &h, &dummy);
+		gdk_window_get_geometry (e->window, &dummy, &dummy, &w, &h);
 		if (0 <= e->x && e->x < w && 0 <= e->y && e->y < h)
 			g_signal_emit (stack, go_combo_stack_signals [POP], 0,
 				       stack->last_key);
@@ -170,8 +169,8 @@ go_combo_stack_init (GOComboStack *stack)
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
 
 	stack->scrolled = gtk_scrolled_window_new (
-		gtk_tree_view_get_hadjustment (stack->list),
-		gtk_tree_view_get_vadjustment (stack->list));
+		gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (stack->list)),
+		gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (stack->list)));
 	scrolled = GTK_SCROLLED_WINDOW (stack->scrolled);
 	gtk_scrolled_window_set_policy (scrolled,
 		GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
@@ -231,29 +230,8 @@ typedef GtkToolItemClass GOToolComboStackClass;
 
 static GType go_tool_combo_stack_get_type (void);
 
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-static gboolean
-go_tool_combo_stack_set_tooltip (GtkToolItem *tool_item, GtkTooltips *tooltips,
-				 char const *tip_text,
-				 char const *tip_private)
-{
-	GOToolComboStack *self = (GOToolComboStack *)tool_item;
-	go_combo_box_set_tooltip (GO_COMBO_BOX (self->combo), tooltips,
-				  tip_text, tip_private);
-	return TRUE;
-}
-#endif
-
-static void
-go_tool_combo_stack_class_init (GtkToolItemClass *tool_item_klass)
-{
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-	tool_item_klass->set_tooltip = go_tool_combo_stack_set_tooltip;
-#endif
-}
-
 static GSF_CLASS (GOToolComboStack, go_tool_combo_stack,
-	   go_tool_combo_stack_class_init, NULL,
+	   NULL, NULL,
 	   GTK_TYPE_TOOL_ITEM)
 
 /*****************************************************************************/
diff --git a/goffice/gtk/go-action-combo-text.c b/goffice/gtk/go-action-combo-text.c
index 4e6773a..2b014c6 100644
--- a/goffice/gtk/go-action-combo-text.c
+++ b/goffice/gtk/go-action-combo-text.c
@@ -39,45 +39,9 @@ typedef GtkToolItemClass GOToolComboTextClass;
 #define GO_IS_TOOL_COMBO_TEXT(o)	(G_TYPE_CHECK_INSTANCE_TYPE (o, GO_TYPE_TOOL_COMBO_TEXT))
 
 static GType go_tool_combo_text_get_type (void);
-#if 0
-static void
-go_tool_combo_text_finalize (GObject *obj)
-{
-	/* Call parent->finalize (obj).  */
-}
-static gboolean
-go_tool_combo_text_create_menu_proxy (GtkToolItem *tool_item)
-{
-}
-#endif
-
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-static gboolean
-go_tool_combo_text_set_tooltip (GtkToolItem *tool_item, GtkTooltips *tooltips,
-				char const *tip_text,
-				char const *tip_private)
-{
-	GOToolComboText *self = (GOToolComboText *)tool_item;
-	go_combo_box_set_tooltip (GO_COMBO_BOX (self->combo), tooltips,
-				  tip_text, tip_private);
-	return TRUE;
-}
-#endif
-
-static void
-go_tool_combo_text_class_init (GtkToolItemClass *tool_item_klass)
-{
-#if 0
-	gobject_klass->finalize		   = go_tool_combo_text_finalize;
-	tool_item_klass->create_menu_proxy = go_tool_combo_text_create_menu_proxy;
-#endif
-#ifndef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-	tool_item_klass->set_tooltip	   = go_tool_combo_text_set_tooltip;
-#endif
-}
 
 static GSF_CLASS (GOToolComboText, go_tool_combo_text,
-	   go_tool_combo_text_class_init, NULL,
+	   NULL, NULL,
 	   GTK_TYPE_TOOL_ITEM)
 
 /*****************************************************************************/
diff --git a/goffice/gtk/go-charmap-sel.c b/goffice/gtk/go-charmap-sel.c
index 287133b..9be63ef 100644
--- a/goffice/gtk/go-charmap-sel.c
+++ b/goffice/gtk/go-charmap-sel.c
@@ -221,14 +221,14 @@ charset_order (const void *_a, const void *_b)
 static GHashTable *encoding_hash;
 
 struct _GOCharmapSel {
-	GtkHBox box;
+	GtkBox box;
 	GOOptionMenu *encodings;
 	GtkMenu *encodings_menu;
 	GOCharmapSelTestDirection test;
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 
 	gboolean (* charmap_changed) (GOCharmapSel *cs, char const *new_charmap);
 } GOCharmapSelClass;
@@ -553,7 +553,7 @@ cs_class_init (GtkWidgetClass *widget_klass)
 }
 
 GSF_CLASS (GOCharmapSel, go_charmap_sel,
-	   cs_class_init, cs_init, GTK_TYPE_HBOX)
+	   cs_class_init, cs_init, GTK_TYPE_BOX)
 
 GtkWidget *
 go_charmap_sel_new (GOCharmapSelTestDirection test)
diff --git a/goffice/gtk/go-color-palette.c b/goffice/gtk/go-color-palette.c
index 0f1acb8..5f27e2b 100644
--- a/goffice/gtk/go-color-palette.c
+++ b/goffice/gtk/go-color-palette.c
@@ -29,7 +29,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include <goffice/utils/go-marshalers.h>
 
 #include <gdk/gdkkeysyms.h>
@@ -40,7 +39,7 @@
 #include <string.h>
 
 struct _GOColorPalette {
-	GtkVBox	base;
+	GtkBox	base;
 
 	GOColorGroup *group;
 	GOColor	      selection, default_color;
@@ -56,7 +55,7 @@ struct _GOColorPalette {
 };
 
 typedef struct {
-	GtkVBoxClass base;
+	GtkBoxClass base;
 
 	/* Signals emited by this widget */
 	void (*color_changed) (GOColorPalette *pal, GOColor color,
@@ -154,15 +153,13 @@ create_color_sel (GObject *action_proxy, GOColor c, GCallback handler, gboolean
 	GtkWidget *w = gtk_color_selection_dialog_new (title), *hb;
 	GtkColorSelectionDialog *dialog = GTK_COLOR_SELECTION_DIALOG (w);
 	GtkColorSelection *colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (dialog));
-	GdkColor gdk;
+	GdkRGBA gdk;
 
 	g_object_get (G_OBJECT (w), "help-button", &hb, NULL);
 	gtk_widget_hide (hb);
-	gtk_color_selection_set_current_color (colorsel,
-		go_color_to_gdk (c, &gdk));
 	gtk_color_selection_set_has_opacity_control (colorsel, allow_alpha);
-	if (allow_alpha)
-		gtk_color_selection_set_current_alpha (colorsel, GO_COLOR_UINT_A(c) * 257);
+	gtk_color_selection_set_current_rgba (colorsel,
+		go_color_to_gdk_rgba (c, &gdk));
 
 	g_signal_connect_object (dialog,
 		"response", handler, action_proxy, 0);
@@ -176,14 +173,11 @@ handle_color_sel (GtkColorSelectionDialog *dialog,
 		  gint response_id, GOColor *res)
 {
 	if (response_id == GTK_RESPONSE_OK) {
-		GdkColor gdk;
+		GdkRGBA gdk;
 		GtkColorSelection *colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (dialog));
-		guint16 alpha = gtk_color_selection_get_current_alpha (colorsel);
 
-		gtk_color_selection_get_current_color (colorsel, &gdk);
-		*res = GO_COLOR_FROM_GDK (gdk);
-		alpha >>= 8;
-		*res = GO_COLOR_CHANGE_A (*res, alpha);
+		gtk_color_selection_get_current_rgba (colorsel, &gdk);
+		*res = GO_COLOR_FROM_GDK_RGBA (gdk);
 	}
 	/* destroy _before_ we emit */
 	gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -226,9 +220,15 @@ go_color_palette_class_init (GObjectClass *gobject_class)
 			      G_TYPE_NONE, 1, G_TYPE_OBJECT);
 }
 
+static void
+go_color_palette_init (GObject *obj)
+{
+	g_object_set (obj, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
+}
+
 GSF_CLASS (GOColorPalette, go_color_palette,
-	   go_color_palette_class_init, NULL,
-	   GTK_TYPE_VBOX)
+	   go_color_palette_class_init, go_color_palette_init,
+	   GTK_TYPE_BOX)
 
 /*
  * Find out if a color is in the default palette (not in the custom colors!)
@@ -265,12 +265,12 @@ static void
 cb_history_changed (GOColorPalette *pal)
 {
 	int i;
-	GdkColor gdk;
+	GdkRGBA gdk;
 	GOColorGroup *group = pal->group;
 
 	for (i = 0 ; i < GO_COLOR_GROUP_HISTORY_SIZE ; i++)
-		gtk_widget_modify_bg (pal->swatches [i], GTK_STATE_NORMAL,
-			go_color_to_gdk (group->history[i], &gdk));
+		gtk_widget_override_background_color (pal->swatches [i], GTK_STATE_NORMAL,
+			go_color_to_gdk_rgba (group->history[i], &gdk));
 #if 0
 	if (next_swatch != NULL) {
 		next_swatch->style->bg[GTK_STATE_NORMAL] = *new_color;
@@ -292,14 +292,16 @@ swatch_activated (GOColorPalette *pal, GtkBin *button)
 {
 	GList *tmp = gtk_container_get_children (GTK_CONTAINER (gtk_bin_get_child (button)));
 	GtkWidget *swatch = (tmp != NULL) ? tmp->data : NULL;
-	GtkStyle *style;
+	GtkStyleContext *style_ctx;
+	GdkRGBA rgba;
 
 	g_list_free (tmp);
 
 	g_return_if_fail (swatch != NULL);
 
-	style = gtk_widget_get_style (swatch);
-	set_color (pal, GO_COLOR_FROM_GDK (style->bg[GTK_STATE_NORMAL]),
+	style_ctx = gtk_widget_get_style_context (swatch);
+	gtk_style_context_get_background_color (style_ctx, GTK_STATE_NORMAL, &rgba);
+	set_color (pal, GO_COLOR_FROM_GDK_RGBA (rgba),
 		   FALSE, TRUE, FALSE);
 }
 
@@ -314,9 +316,9 @@ cb_swatch_release_event (GtkBin *button, GdkEventButton *event, GOColorPalette *
 static gboolean
 cb_swatch_key_press (GtkBin *button, GdkEventKey *event, GOColorPalette *pal)
 {
-	if (event->keyval == GDK_Return ||
-	    event->keyval == GDK_KP_Enter ||
-	    event->keyval == GDK_space) {
+	if (event->keyval == GDK_KEY_Return ||
+	    event->keyval == GDK_KEY_KP_Enter ||
+	    event->keyval == GDK_KEY_space) {
 		swatch_activated (pal, button);
 		return TRUE;
 	} else
@@ -334,22 +336,22 @@ go_color_palette_button_new (GOColorPalette *pal, GtkTable* table,
 			     gint col, gint row)
 {
         GtkWidget *button, *swatch, *box;
-	GdkColor   gdk;
+	GdkRGBA   gdk;
 
 	swatch = gtk_drawing_area_new ();
-	gtk_widget_modify_bg (swatch, GTK_STATE_NORMAL,
-		go_color_to_gdk (color_name->color, &gdk));
+	gtk_widget_override_background_color (swatch, GTK_STATE_NORMAL,
+		go_color_to_gdk_rgba (color_name->color, &gdk));
 	gtk_widget_set_size_request (swatch, COLOR_PREVIEW_WIDTH, COLOR_PREVIEW_HEIGHT);
 
 	/* Wrap inside a vbox with a border so that we can see the focus indicator */
-	box = gtk_vbox_new (FALSE, 0);
+	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width (GTK_CONTAINER (box), 2);
 	gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (swatch), TRUE, TRUE, 0);
 
 	button = gtk_button_new ();
 	gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
 	gtk_container_add (GTK_CONTAINER (button), box);
-	go_widget_set_tooltip_text (button, _(color_name->name));
+	gtk_widget_set_tooltip_text (button, _(color_name->name));
 
 	gtk_table_attach (table, button, col, col+1, row, row+1,
 		GTK_FILL, GTK_FILL, 0, 0);
diff --git a/goffice/gtk/go-color-selector.c b/goffice/gtk/go-color-selector.c
index daa0b38..f124341 100644
--- a/goffice/gtk/go-color-selector.c
+++ b/goffice/gtk/go-color-selector.c
@@ -20,7 +20,6 @@
  */
 
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include "go-color-selector.h"
 
@@ -161,18 +160,14 @@ cb_color_dialog_response (GtkColorSelectionDialog *color_dialog,
 
 	if (response == GTK_RESPONSE_OK) {
 		GOColorSelectorState *state;
-		GdkColor gdk_color;
+		GdkRGBA gdk_color;
 		GOColor color;
-		guint16 alpha;
 
-		gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (color_selection),
+		gtk_color_selection_get_current_rgba (GTK_COLOR_SELECTION (color_selection),
 						       &gdk_color);
-		alpha = gtk_color_selection_get_current_alpha (GTK_COLOR_SELECTION (color_selection));
 		state = go_selector_get_user_data (selector);
 
-		color = GO_COLOR_FROM_GDK (gdk_color);
-		alpha >>= 8;
-		color = GO_COLOR_CHANGE_A (color, alpha);
+		color = GO_COLOR_FROM_GDK_RGBA (gdk_color);
 		if (!go_color_selector_set_color (selector, color))
 			/* Index is not necessarly changed, but swatch may change */
 			go_selector_activate (selector);
@@ -186,7 +181,7 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 {
 	GtkWidget *color_dialog;
 	GtkWidget *color_selection;
-	GdkColor gdk_color;
+	GdkRGBA gdk_color;
 	GOColor color;
 	GOColorSelectorState *state = go_selector_get_user_data (selector);
 
@@ -194,11 +189,8 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 	if (color_dialog != NULL) {
 		color_selection = gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (color_dialog));
 		color = go_color_selector_get_color (selector, NULL);
-		gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (color_selection),
-						       go_color_to_gdk (color, &gdk_color));
-		if (state->allow_alpha)
-			gtk_color_selection_set_current_alpha (GTK_COLOR_SELECTION (color_selection),
-						       GO_COLOR_UINT_A (color) * 257);
+		gtk_color_selection_set_current_rgba (GTK_COLOR_SELECTION (color_selection),
+						       go_color_to_gdk_rgba (color, &gdk_color));
 		gtk_window_present (GTK_WINDOW (color_dialog));
 		return;
 	}
@@ -209,8 +201,8 @@ cb_combo_custom_activate (GOPalette *palette, GOSelector *selector)
 	g_object_set_data_full (G_OBJECT (selector), "color-dialog", color_dialog,
 				(GDestroyNotify) gtk_widget_destroy);
 	color = go_color_selector_get_color (selector, NULL);
-	gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (color_selection),
-					       go_color_to_gdk (color, &gdk_color));
+	gtk_color_selection_set_current_rgba (GTK_COLOR_SELECTION (color_selection),
+					       go_color_to_gdk_rgba (color, &gdk_color));
 	if (state->allow_alpha)
 		gtk_color_selection_set_current_alpha (GTK_COLOR_SELECTION (color_selection),
 					       GO_COLOR_UINT_A (color) * 257);
diff --git a/goffice/gtk/go-combo-box.c b/goffice/gtk/go-combo-box.c
index df8c6e8..0e03b52 100644
--- a/goffice/gtk/go-combo-box.c
+++ b/goffice/gtk/go-combo-box.c
@@ -25,7 +25,6 @@
  */
 
 #include <goffice/goffice-config.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include "go-combo-box.h"
 #include <goffice/utils/go-marshalers.h>
 #include <goffice/gtk/goffice-gtk.h>
@@ -52,6 +51,7 @@ struct _GOComboBoxPrivate {
 	GtkWidget *toplevel;		/* Popup's toplevel when not torn off */
 	GtkWidget *tearoff_window;	/* Popup's toplevel when torn off */
 	gboolean torn_off;
+	gulong  tearoff_signal;
 
 	GtkWidget *tearable;	/* The tearoff "button" */
 	GtkWidget *popup;	/* Popup */
@@ -78,14 +78,8 @@ go_combo_popup_reparent (GtkWidget *popup,
 			 GtkWidget *new_parent,
 			 gboolean unrealize)
 {
-#if GLIB_CHECK_VERSION(2,10,0) && GTK_CHECK_VERSION(2,8,14)
 	gboolean was_floating = g_object_is_floating (popup);
 	g_object_ref_sink (popup);
-#else
-	gboolean was_floating = GTK_OBJECT_FLOATING (popup);
-	g_object_ref (popup);
-	gtk_object_sink (GTK_OBJECT (popup));
-#endif
 
 	if (unrealize) {
 		g_object_ref (popup);
@@ -98,11 +92,7 @@ go_combo_popup_reparent (GtkWidget *popup,
 	gtk_widget_set_size_request (new_parent, -1, -1);
 
 	if (was_floating) {
-#if GLIB_CHECK_VERSION(2,10,0) && GTK_CHECK_VERSION(2,8,14)
 		g_object_force_floating (G_OBJECT (popup));
-#else
-		GTK_OBJECT_SET_FLAGS (GTK_OBJECT (popup), GTK_FLOATING);
-#endif
 	} else
 		g_object_unref (popup);
 }
@@ -118,10 +108,10 @@ go_combo_box_finalize (GObject *object)
 }
 
 static void
-go_combo_box_destroy (GtkObject *object)
+go_combo_box_destroy (GtkWidget *widget)
 {
-	GtkObjectClass *klass = (GtkObjectClass *)go_combo_box_parent_class;
-	GOComboBox *combo_box = GO_COMBO_BOX (object);
+	GtkWidgetClass *klass = (GtkWidgetClass *)go_combo_box_parent_class;
+	GOComboBox *combo_box = GO_COMBO_BOX (widget);
 
 	if (combo_box->priv->toplevel) {
 		gtk_widget_destroy (combo_box->priv->toplevel);
@@ -136,7 +126,7 @@ go_combo_box_destroy (GtkObject *object)
 	}
 
 	if (klass->destroy)
-                klass->destroy (object);
+                klass->destroy (widget);
 }
 
 /* Cut and paste from gtkwindow.c */
@@ -175,15 +165,13 @@ go_combo_box_popup_hide_unconditional (GOComboBox *combo_box)
 
 	gtk_widget_hide (combo_box->priv->toplevel);
 	gtk_widget_hide (combo_box->priv->popup);
-	if (combo_box->priv->torn_off) {
-		gtk_tearoff_menu_item_set_torn_off (GTK_TEAROFF_MENU_ITEM (combo_box->priv->tearable), FALSE);
+	if (combo_box->priv->torn_off)
 		go_combo_set_tearoff_state (combo_box, FALSE);
-	}
 
 	do_focus_change (combo_box->priv->toplevel, FALSE);
 	gtk_grab_remove (combo_box->priv->toplevel);
-	gdk_display_pointer_ungrab (gtk_widget_get_display (combo_box->priv->toplevel),
-				    GDK_CURRENT_TIME);
+	gdk_device_ungrab (gtk_get_current_event_device (),
+	                   GDK_CURRENT_TIME);
 
 	pdc = g_object_ref (combo_box->priv->popdown_container);
 	g_signal_emit (combo_box,
@@ -243,7 +231,7 @@ go_combo_box_realize (GtkWidget *widget)
 					     GDK_TOP_LEFT_ARROW);
 	gtk_widget_realize (combo->priv->popup);
 	gdk_window_set_cursor (gtk_widget_get_window (combo->priv->popup), cursor);
-	gdk_cursor_unref (cursor);
+	g_object_unref (cursor);
 
 	((GtkWidgetClass *)go_combo_box_parent_class)->realize (widget);
 }
@@ -257,7 +245,7 @@ go_combo_box_class_init (GObjectClass *object_class)
 	object_class->finalize = go_combo_box_finalize;
 	widget_class->mnemonic_activate = go_combo_box_mnemonic_activate;
 	widget_class->realize = go_combo_box_realize;
-	((GtkObjectClass *)object_class)->destroy = go_combo_box_destroy;
+	((GtkWidgetClass *)object_class)->destroy = go_combo_box_destroy;
 
 	gtk_widget_class_install_style_property
 		(widget_class,
@@ -289,11 +277,11 @@ static  gint
 cb_combo_keypress (GtkWidget *widget, GdkEventKey *event,
 		   GOComboBox *combo_box)
 {
-	if (event->keyval == GDK_Escape) {
+	if (event->keyval == GDK_KEY_Escape) {
 		go_combo_box_popup_hide_unconditional (combo_box);
 		return TRUE;
-	} else
-		return FALSE;
+	}
+	return FALSE;
 }
 
 /**
@@ -320,12 +308,7 @@ go_combo_popup_tear_off (GOComboBox *combo, gboolean set_position)
 
 		/* FIXME: made this a toplevel, not a dialog ! */
 		tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-#if GLIB_CHECK_VERSION(2,10,0) && GTK_CHECK_VERSION(2,8,14)
 		g_object_ref_sink (tearoff);
-#else
-		g_object_ref (tearoff);
-		gtk_object_sink (GTK_OBJECT (tearoff));
-#endif
 		combo->priv->tearoff_window = tearoff;
 		gtk_widget_set_app_paintable (tearoff, TRUE);
 		g_signal_connect (tearoff, "key_press_event",
@@ -335,10 +318,6 @@ go_combo_popup_tear_off (GOComboBox *combo, gboolean set_position)
 		title = go_combo_box_get_title (combo);
 		if (title)
 			gdk_window_set_title (gtk_widget_get_window (tearoff), title);
-		g_object_set (G_OBJECT (tearoff),
-			"allow-shrink",	FALSE,
-			"allow-grow",	TRUE,
-			NULL);
 		gtk_window_set_transient_for
 			(GTK_WINDOW (tearoff),
 			 GTK_WINDOW (gtk_widget_get_toplevel
@@ -349,8 +328,8 @@ go_combo_popup_tear_off (GOComboBox *combo, gboolean set_position)
 		gtk_widget_hide (combo->priv->toplevel);
 
 		gtk_grab_remove (combo->priv->toplevel);
-		gdk_display_pointer_ungrab (gtk_widget_get_display (combo->priv->toplevel),
-					    GDK_CURRENT_TIME);
+			gdk_device_ungrab (gtk_get_current_event_device (),
+					   GDK_CURRENT_TIME);
 	}
 
 	go_combo_popup_reparent (combo->priv->popup,
@@ -425,6 +404,8 @@ go_combo_box_get_pos (GOComboBox *combo_box, int *x, int *y)
 static void
 go_combo_tearoff_bg_copy (GOComboBox *combo)
 {
+#if 0
+	/* FIXME: is this function really needed? seems things work without it */
 	GdkPixmap *pixmap;
 	GdkGC *gc;
 	GdkGCValues gc_values;
@@ -456,6 +437,7 @@ go_combo_tearoff_bg_copy (GOComboBox *combo)
 			(gtk_widget_get_window (combo->priv->tearoff_window), pixmap, FALSE);
 		g_object_unref (pixmap);
 	}
+#endif
 }
 
 /* protected */ void
@@ -492,11 +474,13 @@ go_combo_box_popup_display (GOComboBox *combo_box)
 	do_focus_change (combo_box->priv->toplevel, TRUE);
 
 	gtk_grab_add (combo_box->priv->toplevel);
-	gdk_pointer_grab (gtk_widget_get_window (combo_box->priv->toplevel), TRUE,
-			  GDK_BUTTON_PRESS_MASK |
-			  GDK_BUTTON_RELEASE_MASK |
-			  GDK_POINTER_MOTION_MASK,
-			  NULL, NULL, GDK_CURRENT_TIME);
+	gdk_device_grab (gtk_get_current_event_device (),
+	                 gtk_widget_get_window (combo_box->priv->toplevel),
+	                 GDK_OWNERSHIP_APPLICATION, TRUE,
+			 GDK_BUTTON_PRESS_MASK |
+			 GDK_BUTTON_RELEASE_MASK |
+			 GDK_POINTER_MOTION_MASK,
+			 NULL, GDK_CURRENT_TIME);
 	set_arrow_state (combo_box, TRUE);
 }
 
@@ -558,8 +542,6 @@ go_combo_box_init (GOComboBox *combo_box)
 	combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP);
 	g_object_ref (combo_box->priv->toplevel);
 	g_object_set (G_OBJECT (combo_box->priv->toplevel),
-		      "allow-shrink", FALSE,
-		      "allow-grow", TRUE,
 		      "type-hint", GDK_WINDOW_TYPE_HINT_COMBO,
 		      NULL);
 
@@ -584,7 +566,7 @@ go_combo_box_init (GOComboBox *combo_box)
 
 GSF_CLASS (GOComboBox, go_combo_box,
 	   go_combo_box_class_init, go_combo_box_init,
-	   GTK_TYPE_HBOX)
+	   GTK_TYPE_BOX)
 
 /**
  * go_combo_box_set_display:
@@ -668,7 +650,7 @@ cb_tearable_button_release (GtkWidget *w, GdkEventButton *event,
 	g_return_val_if_fail (GTK_IS_TEAROFF_MENU_ITEM (w), FALSE);
 
 	tearable = GTK_TEAROFF_MENU_ITEM (w);
-	gtk_tearoff_menu_item_set_torn_off (tearable, !gtk_tearoff_menu_item_get_torn_off (tearable));
+	/* FIXME: should we notify the parent menu? */
 
 	if (!combo->priv->torn_off) {
 		gboolean need_connect;
@@ -685,6 +667,29 @@ cb_tearable_button_release (GtkWidget *w, GdkEventButton *event,
 	return TRUE;
 }
 
+static void
+cb_tearoff_state_changed (GtkMenu *menu, GParamSpec *pspec, GOComboBox *combo)
+{
+	combo->priv->torn_off = gtk_menu_get_tearoff_state (menu);
+}
+
+static void
+cb_tearable_parent_changed (GtkWidget *tearable_menu, GtkWidget *old_parent, GOComboBox *combo)
+{
+	GtkWidget *new_parent = gtk_widget_get_parent (tearable_menu);
+
+	if (old_parent && combo->priv->tearoff_signal) {
+		g_signal_handler_disconnect (old_parent, combo->priv->tearoff_signal);
+		combo->priv->tearoff_signal = 0;
+	}
+	if (GTK_IS_MENU (new_parent)) {
+		combo->priv->torn_off = gtk_menu_get_tearoff_state (GTK_MENU (new_parent));
+		combo->priv->tearoff_signal = g_signal_connect (new_parent, "notify::tearoff-state",
+								 G_CALLBACK (cb_tearoff_state_changed),
+								 combo);
+	}
+}
+
 void
 go_combo_box_construct (GOComboBox *combo,
 			GtkWidget *display_widget,
@@ -702,7 +707,7 @@ go_combo_box_construct (GOComboBox *combo,
 	combo->priv->popdown_container = popdown_container;
 	combo->priv->display_widget = NULL;
 
-	vbox = gtk_vbox_new (FALSE, 5);
+	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
 	tearable = gtk_tearoff_menu_item_new ();
 	g_signal_connect (tearable, "enter-notify-event",
 			  G_CALLBACK (cb_tearable_enter_leave),
@@ -713,6 +718,9 @@ go_combo_box_construct (GOComboBox *combo,
 	g_signal_connect (tearable, "button-release-event",
 			  G_CALLBACK (cb_tearable_button_release),
 			  (gpointer) combo);
+	g_signal_connect (tearable, "parent-set",
+			  G_CALLBACK (cb_tearable_parent_changed),
+			  (gpointer) combo);
 	gtk_box_pack_start (GTK_BOX (vbox), tearable, FALSE, FALSE, 0);
 	gtk_box_pack_start (GTK_BOX (vbox), popdown_container, TRUE, TRUE, 0);
 	combo->priv->tearable = tearable;
@@ -800,6 +808,6 @@ go_combo_box_set_tooltip (GOComboBox *c, G_GNUC_UNUSED void *tips,
 			  G_GNUC_UNUSED char const *priv_text)
 {
 /* FIXME FIXME FIXME this is ugly the tip moves as we jump from preview to arrow */
-	go_widget_set_tooltip_text (c->priv->display_widget, text);
-	go_widget_set_tooltip_text (c->priv->arrow_button, text);
+	gtk_widget_set_tooltip_text (c->priv->display_widget, text);
+	gtk_widget_set_tooltip_text (c->priv->arrow_button, text);
 }
diff --git a/goffice/gtk/go-combo-box.h b/goffice/gtk/go-combo-box.h
index 7eb8113..6e869a6 100644
--- a/goffice/gtk/go-combo-box.h
+++ b/goffice/gtk/go-combo-box.h
@@ -38,12 +38,12 @@ typedef struct _GOComboBoxPrivate GOComboBoxPrivate;
 typedef struct _GOComboBoxClass   GOComboBoxClass;
 
 struct _GOComboBox {
-	GtkHBox hbox;
+	GtkBox hbox;
 	GOComboBoxPrivate *priv;
 };
 
 struct _GOComboBoxClass {
-	GtkHBoxClass	base;
+	GtkBoxClass	base;
 
 	/* virtual */
 	void  (*set_title) (GOComboBox *cbox, char const *title);
diff --git a/goffice/gtk/go-combo-color.c b/goffice/gtk/go-combo-color.c
index 1657ded..0d43a84 100644
--- a/goffice/gtk/go-combo-color.c
+++ b/goffice/gtk/go-combo-color.c
@@ -257,13 +257,13 @@ go_combo_color_get_color (GOComboColor *cc, gboolean *is_default)
  * signal to be emitted.
  */
 void
-go_combo_color_set_color_gdk (GOComboColor *cc, GdkColor *color)
+go_combo_color_set_color_gdk (GOComboColor *cc, GdkRGBA *color)
 {
 /* FIXME FIXME FIXME convert to GOColor */
 	g_return_if_fail (GO_IS_COMBO_COLOR (cc));
 
 	if (color != NULL)
-		go_color_palette_set_current_color (cc->palette, GO_COLOR_FROM_GDK (*color));
+		go_color_palette_set_current_color (cc->palette, GO_COLOR_FROM_GDK_RGBA (*color));
 	else
 		go_color_palette_set_color_to_default (cc->palette);
 }
diff --git a/goffice/gtk/go-combo-color.h b/goffice/gtk/go-combo-color.h
index a9972b4..2aebc09 100644
--- a/goffice/gtk/go-combo-color.h
+++ b/goffice/gtk/go-combo-color.h
@@ -49,7 +49,7 @@ GtkWidget *go_combo_color_new        (GdkPixbuf   *icon,
 GOColor go_combo_color_get_color (GOComboColor  *cc, gboolean *is_default);
 void    go_combo_color_set_color (GOComboColor  *cc, GOColor   color);
 void    go_combo_color_set_color_to_default (GOComboColor *cc);
-void    go_combo_color_set_color_gdk (GOComboColor *cc, GdkColor *color);
+void    go_combo_color_set_color_gdk (GOComboColor *cc, GdkRGBA *color);
 
 void go_combo_color_set_allow_alpha    (GOComboColor *cc, gboolean allow_alpha);
 void go_combo_color_set_instant_apply  (GOComboColor *cc, gboolean active);
diff --git a/goffice/gtk/go-combo-pixmaps.c b/goffice/gtk/go-combo-pixmaps.c
index 649a2fd..9edcdb9 100644
--- a/goffice/gtk/go-combo-pixmaps.c
+++ b/goffice/gtk/go-combo-pixmaps.c
@@ -175,9 +175,9 @@ cb_swatch_release_event (GtkWidget *button, GdkEventButton *event, GOComboPixmap
 static gboolean
 cb_swatch_key_press (GtkWidget *button, GdkEventKey *event, GOComboPixmaps *combo)
 {
-	if (event->keyval == GDK_Return ||
-	    event->keyval == GDK_KP_Enter ||
-	    event->keyval == GDK_space)
+	if (event->keyval == GDK_KEY_Return ||
+	    event->keyval == GDK_KEY_KP_Enter ||
+	    event->keyval == GDK_KEY_space)
 		return swatch_activated (combo, button);
 	else
 		return FALSE;
@@ -204,7 +204,7 @@ go_combo_pixmaps_add_element (GOComboPixmaps *combo,
 	g_return_if_fail (GO_IS_COMBO_PIXMAPS (combo));
 
 	/* Wrap inside a vbox with a border so that we can see the focus indicator */
-	box = gtk_vbox_new (FALSE, 0);
+	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_pack_start (GTK_BOX (box),
 			    gtk_image_new_from_pixbuf (pixbuf),
 			    TRUE, TRUE, 0);
@@ -216,7 +216,7 @@ go_combo_pixmaps_add_element (GOComboPixmaps *combo,
 	gtk_container_add (GTK_CONTAINER (button), box);
 
 	if (tooltip != NULL)
-		go_widget_set_tooltip_text (button, tooltip);
+		gtk_widget_set_tooltip_text (button, tooltip);
 
 	col = combo->elements->len;
 	row = col / combo->cols;
diff --git a/goffice/gtk/go-combo-text.c b/goffice/gtk/go-combo-text.c
index 07f0c6b..325eb5a 100644
--- a/goffice/gtk/go-combo-text.c
+++ b/goffice/gtk/go-combo-text.c
@@ -7,7 +7,6 @@
 #include "go-combo-text.h"
 #include "go-combo-box.h"
 #include <goffice/utils/go-marshalers.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 
@@ -22,6 +21,76 @@ struct _GOComboText {
 	int rows;
 };
 
+/*****************************************************************************
+ * A private simple scrolled window just needed for size request             *
+ *****************************************************************************/
+static GType go_scrolled_window_get_type (void);
+static GtkWidgetClass *go_scrolled_window_parent_class;
+
+typedef GtkScrolledWindow GOScrolledWindow;
+typedef GtkScrolledWindowClass GOScrolledWindowClass;
+
+static void
+go_scrolled_window_get_preferred_height (GtkWidget *widget, gint *minimum_height, gint *natural_height)
+{
+	GtkRequisition list_req;
+	int mon_width, mon_height, border_width;
+	GdkRectangle rect;
+	GdkScreen    *screen;
+	GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+	GOComboText *ct;
+
+	go_scrolled_window_parent_class->get_preferred_height (widget, minimum_height, natural_height);
+
+	if (GTK_IS_VIEWPORT (child))
+		child = gtk_bin_get_child (GTK_BIN (child));
+	ct = GO_COMBO_TEXT (g_object_get_data (G_OBJECT (child), "go-combo"));
+	/* In a Xinerama setup, use geometry of the actual display unit.  */
+	screen = gtk_widget_get_screen (widget);
+	if (screen == NULL)
+		/* Looks like this will happen when
+		 * embedded as a bonobo component */
+		screen = gdk_screen_get_default ();
+
+	gdk_screen_get_monitor_geometry (screen, 0, &rect);
+	mon_width  = rect.width;
+	mon_height = rect.height;
+	border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+	gtk_widget_get_preferred_size (child, &list_req, NULL);
+	if (*minimum_height < list_req.height) {
+		int height       = list_req.height;
+
+		if (child != NULL) {
+			/* Make room for a whole number of items which don't
+			 * overflow the screen, but no more than 20. */
+			int avail_height, nitems;
+
+			avail_height = mon_height - 20
+				- border_width * 2 + 4;
+			nitems = MIN (20, avail_height * ct->rows / list_req.height);
+			height = nitems *  list_req.height / ct->rows;
+			if (height > list_req.height)
+				height = list_req.height;
+		}
+
+		*minimum_height = height +
+			border_width * 2;
+	}
+
+	*minimum_height = *natural_height = MIN (*minimum_height, mon_height - 20);
+}
+
+static void
+go_scrolled_window_class_init (GtkWidgetClass *klass)
+{
+	go_scrolled_window_parent_class = g_type_class_peek_parent (klass);
+	klass->get_preferred_height = go_scrolled_window_get_preferred_height;
+}
+
+GSF_CLASS (GOScrolledWindow, go_scrolled_window,
+	   go_scrolled_window_class_init, NULL,
+	   GTK_TYPE_SCROLLED_WINDOW)
+
 typedef struct {
 	GOComboBoxClass	base;
 
@@ -108,61 +177,6 @@ cb_list_changed (GtkTreeView *list, gpointer data)
 }
 
 static void
-cb_scroll_size_request (GtkWidget *widget, GtkRequisition *requisition,
-			GOComboText *ct)
-{
-	GtkRequisition list_req, w_req;
-	GtkAllocation allocation;
-	int mon_width, mon_height, border_width;
-	GdkRectangle rect;
-	GdkScreen    *screen;
-
-	/* In a Xinerama setup, use geometry of the actual display unit.  */
-	screen = gtk_widget_get_screen (widget);
-	if (screen == NULL)
-		/* Looks like this will happen when
-		 * embedded as a bonobo component */
-		screen = gdk_screen_get_default ();
-
-	gdk_screen_get_monitor_geometry (screen, 0, &rect);
-	mon_width  = rect.width;
-	mon_height = rect.height;
-	border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
-	gtk_widget_size_request	(ct->list, &list_req);
-	if (requisition->height < list_req.height) {
-		int height       = list_req.height;
-		GtkWidget const *w = ct->list;
-
-		if (w != NULL) {
-			/* Make room for a whole number of items which don't
-			 * overflow the screen, but no more than 20. */
-			int avail_height, nitems;
-
-			gtk_widget_get_child_requisition (GTK_WIDGET (w), &w_req);
-			avail_height = mon_height - 20
-				- border_width * 2 + 4;
-			nitems = MIN (20, avail_height * ct->rows / w_req.height);
-			height = nitems *  w_req.height / ct->rows;
-			if (height > list_req.height)
-				height = list_req.height;
-		}
-
-		/* FIXME : Why do we need 4 ??
-		 * without it things end up scrolling.
-		 */
-		requisition->height = height +
-			border_width * 2 + 4;
-	}
-
-	gtk_widget_get_allocation (ct->entry, &allocation);
-	requisition->width  = MAX (requisition->width,
-				   allocation.width + border_width * 2);
-	requisition->width  = MIN (requisition->width, mon_width - 20);
-	requisition->height = MIN (requisition->height, mon_height - 20);
-}
-
-static void
 cb_screen_changed (GOComboText *ct, GdkScreen *previous_screen)
 {
 	GtkWidget *w = GTK_WIDGET (ct);
@@ -186,6 +200,7 @@ go_combo_text_init (GOComboText *ct)
 	ct->rows = 0;
 	ct->entry = gtk_entry_new ();
 	ct->list = gtk_tree_view_new ();
+	g_object_set_data (G_OBJECT (ct->list), "go-combo", ct);
 	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ct->list), FALSE);
 	store = gtk_list_store_new (1, G_TYPE_STRING);
 	gtk_tree_view_set_model (GTK_TREE_VIEW (ct->list), GTK_TREE_MODEL (store));
@@ -199,7 +214,7 @@ go_combo_text_init (GOComboText *ct)
 	g_signal_connect (G_OBJECT (ct->list), "cursor_changed",
 			  G_CALLBACK (cb_list_changed), ct);
 
-	ct->scroll = gtk_scrolled_window_new (NULL, NULL);
+	ct->scroll = g_object_new (go_scrolled_window_get_type (), NULL);
 
 	gtk_scrolled_window_set_policy (
 		GTK_SCROLLED_WINDOW (ct->scroll),
@@ -218,9 +233,6 @@ go_combo_text_init (GOComboText *ct)
 	g_signal_connect (G_OBJECT (ct->entry),
 		"activate",
 		G_CALLBACK (cb_entry_activate), (gpointer) ct);
-	g_signal_connect (G_OBJECT (ct->scroll),
-		"size_request",
-		G_CALLBACK (cb_scroll_size_request), (gpointer) ct);
 
 	gtk_widget_show (ct->entry);
 	go_combo_box_construct (GO_COMBO_BOX (ct),
@@ -232,10 +244,10 @@ go_combo_text_init (GOComboText *ct)
 }
 
 static void
-go_combo_text_destroy (GtkObject *object)
+go_combo_text_destroy (GtkWidget *widget)
 {
-	GtkObjectClass *parent;
-	GOComboText *ct = GO_COMBO_TEXT (object);
+	GtkWidgetClass *parent;
+	GOComboText *ct = GO_COMBO_TEXT (widget);
 
 	if (ct->list != NULL) {
 		g_signal_handlers_disconnect_by_func (G_OBJECT (ct),
@@ -245,11 +257,11 @@ go_combo_text_destroy (GtkObject *object)
 
 	parent = g_type_class_peek (GO_TYPE_COMBO_BOX);
 	if (parent && parent->destroy)
-		(*parent->destroy) (object);
+		(*parent->destroy) (widget);
 }
 
 static void
-go_combo_text_class_init (GtkObjectClass *klass)
+go_combo_text_class_init (GtkWidgetClass *klass)
 {
 	klass->destroy = &go_combo_text_destroy;
 
diff --git a/goffice/gtk/go-font-sel.c b/goffice/gtk/go-font-sel.c
index 6595b46..6a3ba67 100644
--- a/goffice/gtk/go-font-sel.c
+++ b/goffice/gtk/go-font-sel.c
@@ -10,7 +10,6 @@
  */
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -20,7 +19,7 @@
 #include <string.h>
 
 struct _GOFontSel {
-	GtkHBox		box;
+	GtkBox		box;
 	GtkBuilder	*gui;
 
 	GtkWidget	*font_name_entry;
@@ -41,7 +40,7 @@ struct _GOFontSel {
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 
 	void (* font_changed) (GOFontSel *gfs, PangoAttrList *modfications);
 } GOFontSelClass;
@@ -52,7 +51,7 @@ enum {
 };
 
 static guint gfs_signals[LAST_SIGNAL] = { 0 };
-static GtkObjectClass *gfs_parent_class;
+static GtkWidgetClass *gfs_parent_class;
 
 static void
 go_font_sel_add_attr (GOFontSel *gfs, PangoAttribute *attr0, PangoAttribute *attr1)
@@ -92,7 +91,7 @@ cb_list_adjust (GtkTreeView* view)
 		GtkAllocation allocation;
 		GtkRequisition requisition;
 		gtk_widget_get_allocation (GTK_WIDGET (view), &allocation);
-		gtk_widget_get_child_requisition (GTK_WIDGET (view), &requisition);
+		gtk_widget_get_preferred_size (GTK_WIDGET (view), &requisition, NULL);
 		path = gtk_tree_model_get_path (model, &iter);
 		scroll = GTK_SCROLLED_WINDOW (gtk_widget_get_parent (GTK_WIDGET (view)));
 		height = allocation.height;
@@ -378,9 +377,9 @@ gfs_init (GOFontSel *gfs)
 }
 
 static void
-gfs_destroy (GtkObject *object)
+gfs_destroy (GtkWidget *widget)
 {
-	GOFontSel *gfs = GO_FONT_SEL (object);
+	GOFontSel *gfs = GO_FONT_SEL (widget);
 
 	if (gfs->gui) {
 		g_object_unref (G_OBJECT (gfs->gui));
@@ -407,17 +406,17 @@ gfs_destroy (GtkObject *object)
 	g_slist_free (gfs->font_sizes);
 	gfs->font_sizes = NULL;
 
-	gfs_parent_class->destroy (object);
+	gfs_parent_class->destroy (widget);
 }
 
 static void
 gfs_class_init (GObjectClass *klass)
 {
-	GtkObjectClass *gto_class = (GtkObjectClass *) klass;
+	GtkWidgetClass *gto_class = (GtkWidgetClass *) klass;
 
 	gto_class->destroy = gfs_destroy;
 
-	gfs_parent_class = g_type_class_peek (gtk_hbox_get_type ());
+	gfs_parent_class = g_type_class_peek (gtk_box_get_type ());
 
 	gfs_signals [FONT_CHANGED] =
 		g_signal_new (
@@ -431,7 +430,7 @@ gfs_class_init (GObjectClass *klass)
 }
 
 GSF_CLASS (GOFontSel, go_font_sel,
-	   gfs_class_init, gfs_init, GTK_TYPE_HBOX)
+	   gfs_class_init, gfs_init, GTK_TYPE_BOX)
 
 GtkWidget *
 go_font_sel_new (void)
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index 2b7b9d7..78fad7c 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -22,7 +22,6 @@
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
 #include <goffice/utils/go-marshalers.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -100,7 +99,7 @@ typedef enum {
 } FormatWidget;
 
 struct  _GOFormatSel {
-	GtkHBox   box;
+	GtkBox   box;
 	GtkBuilder *gui;
 
 	gpointer  value;
@@ -142,7 +141,7 @@ struct  _GOFormatSel {
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 
 	gboolean  (*format_changed)   (GOFormatSel *gfs, char const *fmt);
 	char     *(*generate_preview) (GOFormatSel *gfs, char *fmt);
@@ -851,8 +850,8 @@ study_format (GOFormat const *fmt, GOFormatDetails *details)
 		const char *str = go_format_as_XL (fmt);
 		if (!find_builtin (str, details->family, FALSE))
 			details->family = FMT_CUSTOM;
-	}	
-	
+	}
+
 	return details->family;
 }
 
@@ -992,7 +991,7 @@ nfs_init (GOFormatSel *gfs)
 		/* request width in number of chars */
 		context = gtk_widget_get_pango_context (w);
 		metrics = pango_context_get_metrics (context,
-						     gtk_widget_get_style(w)->font_desc,
+						     gtk_style_context_get_font (gtk_widget_get_style_context (w), GTK_STATE_NORMAL),
 						     pango_context_get_language (context));
 		char_width = pango_font_metrics_get_approximate_char_width (metrics);
 		gtk_widget_set_size_request (w, PANGO_PIXELS (char_width) * FORMAT_PREVIEW_MAX, -1);
@@ -1159,7 +1158,7 @@ go_format_sel_finalize (GObject *obj)
 		gfs->gui = NULL;
 	}
 
-	G_OBJECT_CLASS (g_type_class_peek (GTK_TYPE_HBOX))->finalize (obj);
+	G_OBJECT_CLASS (g_type_class_peek (GTK_TYPE_BOX))->finalize (obj);
 }
 
 static gboolean
@@ -1201,7 +1200,7 @@ nfs_class_init (GObjectClass *klass)
 }
 
 GSF_CLASS (GOFormatSel, go_format_sel,
-	   nfs_class_init, nfs_init, GTK_TYPE_HBOX)
+	   nfs_class_init, nfs_init, GTK_TYPE_BOX)
 
 /**
  * go_format_sel_new_full:
diff --git a/goffice/gtk/go-format-sel.ui b/goffice/gtk/go-format-sel.ui
index 185dc97..71511b9 100644
--- a/goffice/gtk/go-format-sel.ui
+++ b/goffice/gtk/go-format-sel.ui
@@ -7,21 +7,21 @@
     <property name="step_increment">1</property>
     <property name="page_increment">3</property>
   </object>
-  <object class="GtkVBox" id="number_box">
+  <object class="GtkBox" id="number_box">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <child>
-      <object class="GtkHBox" id="hbox1">
+      <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="spacing">12</property>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkBox" id="vbox1">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
-              <object class="GtkVBox" id="vbox4">
+              <object class="GtkBox" id="vbox4">
                 <property name="visible">True</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
@@ -71,7 +71,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="preview_box">
+              <object class="GtkBox" id="preview_box">
                 <property name="visible">True</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
@@ -133,7 +133,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox2">
+          <object class="GtkBox" id="vbox2">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
@@ -328,7 +328,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHSeparator" id="hseparator1">
+              <object class="GtkSeparator" id="hseparator1">
                 <property name="visible">True</property>
               </object>
               <packing>
@@ -337,7 +337,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="format_decimal_box">
+              <object class="GtkBox" id="format_decimal_box">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
@@ -414,7 +414,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="format_superscript_box">
+              <object class="GtkBox" id="format_superscript_box">
                 <property name="visible">True</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
@@ -464,7 +464,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="format_symbol_box">
+              <object class="GtkBox" id="format_symbol_box">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
@@ -579,7 +579,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="format_code_box">
+              <object class="GtkBox" id="format_code_box">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
diff --git a/goffice/gtk/go-graph-widget.c b/goffice/gtk/go-graph-widget.c
index 0c20d86..512ca4a 100644
--- a/goffice/gtk/go-graph-widget.c
+++ b/goffice/gtk/go-graph-widget.c
@@ -24,7 +24,6 @@
 #include <goffice/graph/gog-object.h>
 #include <goffice/graph/gog-renderer.h>
 #include <goffice/math/go-math.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 
@@ -131,26 +130,19 @@ go_graph_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 	GTK_WIDGET_CLASS (graph_parent_klass)->size_allocate (widget, allocation);
 }
 
-
 static gboolean
-go_graph_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
+go_graph_widget_draw (GtkWidget *widget, cairo_t *cairo)
 {
 	GOGraphWidget *w = GO_GRAPH_WIDGET (widget);
-	GdkDrawable *drawable = gtk_layout_get_bin_window (GTK_LAYOUT (widget));
-	cairo_t *cairo;
 	cairo_surface_t *surface;
 
-	if (event->window != drawable)
-		return FALSE;
 
 	surface = gog_renderer_get_cairo_surface (w->renderer);
 	if (surface != NULL) {
-		cairo = gdk_cairo_create (drawable);
 		cairo_rectangle (cairo, w->xoffset, w->yoffset, w->width, w->height);
 		cairo_clip (cairo);
 		cairo_set_source_surface (cairo, surface, w->xoffset, w->yoffset);
 		cairo_paint (cairo);
-		cairo_destroy (cairo);
 	}
 
 	return FALSE;
@@ -205,8 +197,8 @@ go_graph_widget_motion_notify_event (GtkWidget *widget,
 
 	if (gw->button_pressed) {
 		GtkAdjustment *hadjustment, *vadjustment;
-		hadjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (gw));
-		vadjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (gw));
+		hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gw));
+		vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (gw));
 		gdk_window_get_pointer (gtk_widget_get_window (widget),
 					&x, &y, NULL);
 
@@ -339,7 +331,7 @@ go_graph_widget_class_init (GOGraphWidgetClass *klass)
 	object_class->get_property = go_graph_widget_get_property;
 	object_class->set_property = go_graph_widget_set_property;
 	widget_class->size_allocate = go_graph_widget_size_allocate;
-	widget_class->expose_event = go_graph_widget_expose_event;
+	widget_class->draw = go_graph_widget_draw;
 	widget_class->button_press_event = go_graph_widget_button_press_event;
 	widget_class->button_release_event = go_graph_widget_button_release_event;
 	widget_class->motion_notify_event = go_graph_widget_motion_notify_event;
diff --git a/goffice/gtk/go-image-save-dialog-extra.ui b/goffice/gtk/go-image-save-dialog-extra.ui
index b92e62c..e7bcca5 100644
--- a/goffice/gtk/go-image-save-dialog-extra.ui
+++ b/goffice/gtk/go-image-save-dialog-extra.ui
@@ -9,12 +9,12 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkVBox" id="image_save_dialog_extra">
+  <object class="GtkBox" id="image_save_dialog_extra">
     <property name="visible">True</property>
     <property name="orientation">vertical</property>
     <property name="spacing">12</property>
     <child>
-      <object class="GtkHBox" id="file_type_box">
+      <object class="GtkBox" id="file_type_box">
         <property name="visible">True</property>
         <property name="spacing">6</property>
         <child>
diff --git a/goffice/gtk/go-image-sel.ui b/goffice/gtk/go-image-sel.ui
index f0a421c..e6ccb53 100644
--- a/goffice/gtk/go-image-sel.ui
+++ b/goffice/gtk/go-image-sel.ui
@@ -1,29 +1,74 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkDialog" id="go-image-sel">
+    <property name="can_focus">False</property>
     <property name="border_width">5</property>
     <property name="modal">True</property>
     <property name="window_position">center-on-parent</property>
     <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
+      <object class="GtkBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel-button">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="ok-button">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
-          <object class="GtkVBox" id="image-vbox">
+          <object class="GtkBox" id="image-vbox">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkScrolledWindow" id="scrolledwindow1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="hscrollbar_policy">automatic</property>
-                <property name="vscrollbar_policy">automatic</property>
                 <child>
                   <object class="GtkIconView" id="image-iconview">
                     <property name="width_request">200</property>
@@ -35,42 +80,51 @@
                 </child>
               </object>
               <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkHSeparator" id="hseparator1">
+              <object class="GtkSeparator" id="hseparator1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox1">
+              <object class="GtkBox" id="vbox1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">5</property>
                 <child>
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">&lt;b&gt;Add an image&lt;/b&gt;</property>
                     <property name="use_markup">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="left_padding">15</property>
                     <child>
                       <object class="GtkTable" id="new-image-table">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="n_rows">2</property>
                         <property name="n_columns">3</property>
                         <property name="column_spacing">15</property>
@@ -81,6 +135,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="use_stock">True</property>
                           </object>
                           <packing>
@@ -93,18 +148,22 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
+                            <property name="use_action_appearance">False</property>
                             <child>
                               <object class="GtkAlignment" id="alignment2">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xscale">0</property>
                                 <property name="yscale">0</property>
                                 <child>
-                                  <object class="GtkHBox" id="hbox4">
+                                  <object class="GtkBox" id="hbox4">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="spacing">2</property>
                                     <child>
                                       <object class="GtkImage" id="image1">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-open</property>
                                       </object>
                                       <packing>
@@ -116,6 +175,7 @@
                                     <child>
                                       <object class="GtkLabel" id="label32">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="label" translatable="yes">_Select...</property>
                                         <property name="use_underline">True</property>
                                       </object>
@@ -152,6 +212,7 @@
                         <child>
                           <object class="GtkLabel" id="label2">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Name:</property>
                           </object>
@@ -169,6 +230,8 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -181,60 +244,22 @@
             </child>
           </object>
           <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkHSeparator" id="hseparator2">
+          <object class="GtkSeparator" id="hseparator2">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="position">2</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel-button">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="ok-button">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
       </object>
     </child>
     <action-widgets>
diff --git a/goffice/gtk/go-locale-sel.c b/goffice/gtk/go-locale-sel.c
index d74c53c..750fd6a 100644
--- a/goffice/gtk/go-locale-sel.c
+++ b/goffice/gtk/go-locale-sel.c
@@ -269,13 +269,13 @@ locale_order (const void *_a, const void *_b)
 static GHashTable *locale_hash;
 
 struct _GOLocaleSel {
-	GtkHBox box;
+	GtkBox box;
 	GOOptionMenu *locales;
 	GtkMenu *locales_menu;
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 
 	gboolean (* locale_changed) (GOLocaleSel *ls, char const *new_locale);
 } GOLocaleSelClass;
@@ -547,7 +547,7 @@ ls_class_init (GtkWidgetClass *widget_klass)
 }
 
 GSF_CLASS (GOLocaleSel, go_locale_sel,
-	   ls_class_init, ls_init, GTK_TYPE_HBOX)
+	   ls_class_init, ls_init, GTK_TYPE_BOX)
 
 GtkWidget *
 go_locale_sel_new (void)
diff --git a/goffice/gtk/go-optionmenu.c b/goffice/gtk/go-optionmenu.c
index c5c3c30..ad884db 100644
--- a/goffice/gtk/go-optionmenu.c
+++ b/goffice/gtk/go-optionmenu.c
@@ -33,7 +33,6 @@
 
 #include <goffice/goffice-config.h>
 #include "go-optionmenu.h"
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
@@ -132,7 +131,7 @@ go_option_menu_position (GtkMenu  *menu,
 
 	widget = GTK_WIDGET (option_menu);
 
-	gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
+	gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
 	menu_width = requisition.width;
 
 	gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
@@ -147,13 +146,13 @@ go_option_menu_position (GtkMenu  *menu,
 
 		if (GTK_IS_CHECK_MENU_ITEM (child) &&
 		    gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (child))) {
-			gtk_widget_get_child_requisition (child, &requisition);
+			gtk_widget_get_preferred_size (child, &requisition, NULL);
 			menu_ypos -= requisition.height / 2;
 			break;
 		}
 
 		if (gtk_widget_get_visible (child)) {
-			gtk_widget_get_child_requisition (child, &requisition);
+			gtk_widget_get_preferred_size (child, &requisition, NULL);
 			menu_ypos -= requisition.height;
 		}
 
@@ -202,8 +201,8 @@ go_option_menu_key_press (GtkWidget   *widget,
 	GOOptionMenu *option_menu = GO_OPTION_MENU (widget);
 
 	switch (event->keyval) {
-	case GDK_KP_Space:
-	case GDK_space:
+	case GDK_KEY_KP_Space:
+	case GDK_KEY_space:
 		gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL,
 				go_option_menu_position, option_menu,
 				0, event->time);
@@ -213,12 +212,21 @@ go_option_menu_key_press (GtkWidget   *widget,
 	return FALSE;
 }
 
-
 static void
 cb_select (GtkMenuItem *item, GOOptionMenu *option_menu)
 {
 	go_option_menu_select_item (option_menu, item);
 	g_signal_emit (option_menu, signals[CHANGED], 0);
+	option_menu->active = TRUE;
+}
+
+
+static void
+cb_unselect (GtkMenuItem *item, GOOptionMenu *option_menu)
+{
+	go_option_menu_select_item (option_menu, item);
+	g_signal_emit (option_menu, signals[CHANGED], 0);
+	option_menu->active = FALSE;
 }
 
 static void
@@ -238,14 +246,19 @@ handle_menu_signals (GOOptionMenu *option_menu, gboolean connect)
 			if (sub)
 				children = g_list_concat (children,
 							  gtk_container_get_children (GTK_CONTAINER (sub)));
-			else if (connect)
+			else if (connect) {
 				g_signal_connect (child, "activate",
 						  G_CALLBACK (cb_select),
 						  option_menu);
-
-			else
+				g_signal_connect (child, "deactivate",
+						  G_CALLBACK (cb_unselect),
+						  option_menu);
+			} else {
 				g_signal_handlers_disconnect_by_func
 					(child, G_CALLBACK (cb_select), option_menu);
+				g_signal_handlers_disconnect_by_func
+					(child, G_CALLBACK (cb_unselect), option_menu);
+			}
 
 		}
 	}
@@ -265,7 +278,7 @@ go_option_menu_set_menu (GOOptionMenu *option_menu,
 		return;
 
 	if (option_menu->menu) {
-		if (gtk_menu_shell_get_active (option_menu->menu))
+		if (option_menu->active)
 			gtk_menu_shell_cancel (option_menu->menu);
 
 		handle_menu_signals (option_menu, FALSE);
@@ -275,6 +288,7 @@ go_option_menu_set_menu (GOOptionMenu *option_menu,
 	}
 
 	option_menu->menu = shell;
+	option_menu->active = FALSE;
 
 	if (shell) {
 		g_object_ref (shell);
@@ -370,13 +384,13 @@ go_option_menu_get_property (GObject            *object,
 }
 
 static void
-go_option_menu_destroy (GtkObject *object)
+go_option_menu_destroy (GtkWidget *widget)
 {
 	GOOptionMenu *option_menu;
 
-	g_return_if_fail (GO_IS_OPTION_MENU (object));
+	g_return_if_fail (GO_IS_OPTION_MENU (widget));
 
-	option_menu = GO_OPTION_MENU (object);
+	option_menu = GO_OPTION_MENU (widget);
 
 	if (option_menu->menu) {
 		gtk_widget_destroy (GTK_WIDGET (option_menu->menu));
@@ -385,14 +399,13 @@ go_option_menu_destroy (GtkObject *object)
 	}
 	option_menu->selected = NULL;
 
-	GTK_OBJECT_CLASS (parent_class)->destroy (object);
+	GTK_WIDGET_CLASS (parent_class)->destroy (widget);
 }
 
 static void
 go_option_menu_class_init (GOOptionMenuClass *class)
 {
 	GObjectClass *gobject_class = (GObjectClass*) class;
-	GtkObjectClass *object_class = (GtkObjectClass*) class;
 	GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
 
 	parent_class = g_type_class_peek_parent (class);
@@ -408,7 +421,7 @@ go_option_menu_class_init (GOOptionMenuClass *class)
 
 	gobject_class->set_property = go_option_menu_set_property;
 	gobject_class->get_property = go_option_menu_get_property;
-	object_class->destroy = go_option_menu_destroy;
+	widget_class->destroy = go_option_menu_destroy;
 	widget_class->button_press_event = go_option_menu_button_press;
 	widget_class->key_press_event = go_option_menu_key_press;
 
@@ -431,7 +444,7 @@ go_option_menu_init (GOOptionMenu *option_menu)
 	gtk_widget_set_can_default (GTK_WIDGET (option_menu), FALSE);
 	gtk_widget_set_receives_default (GTK_WIDGET (option_menu), FALSE);
 
-	box = GTK_BOX (gtk_hbox_new (FALSE, FALSE));
+	box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
 
 	option_menu->menu = NULL;
 	option_menu->selected = NULL;
@@ -444,7 +457,7 @@ go_option_menu_init (GOOptionMenu *option_menu)
 	g_object_set (arrow, "xalign", 0.75, NULL);
 	gtk_box_pack_end (box, arrow, FALSE, FALSE, 0);
 
-	sep = gtk_vseparator_new ();
+	sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
 	gtk_box_pack_end (box, sep, FALSE, FALSE, 0);
 
 	gtk_container_add (GTK_CONTAINER (option_menu), GTK_WIDGET (box));
diff --git a/goffice/gtk/go-optionmenu.h b/goffice/gtk/go-optionmenu.h
index 65252b3..340d793 100644
--- a/goffice/gtk/go-optionmenu.h
+++ b/goffice/gtk/go-optionmenu.h
@@ -56,6 +56,7 @@ struct _GOOptionMenu
 	GtkMenuShell *menu;
 	GtkMenuItem *selected;
 	GtkLabel *button_label;
+	gboolean active;
 };
 
 struct _GOOptionMenuClass
diff --git a/goffice/gtk/go-palette.c b/goffice/gtk/go-palette.c
index 4de7fdd..fba38a3 100644
--- a/goffice/gtk/go-palette.c
+++ b/goffice/gtk/go-palette.c
@@ -21,7 +21,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <glib/gi18n-lib.h>
 #include <gdk/gdkkeysyms.h>
@@ -203,16 +202,13 @@ go_palette_finalize (GObject *object)
 }
 
 static gboolean
-cb_swatch_expose (GtkWidget *swatch, GdkEventExpose *event, GOPalette *palette)
+cb_swatch_draw (GtkWidget *swatch, cairo_t *cr, GOPalette *palette)
 {
 	if (palette->priv->swatch_render) {
-		cairo_t *cr;
 		GdkRectangle area;
 		int index;
 		GtkAllocation allocation;
 
-		cr = gdk_cairo_create (gtk_widget_get_window (swatch));
-
 		gtk_widget_get_allocation (swatch, &allocation);
 		area.x = 0;
 		area.y = 0;
@@ -223,7 +219,6 @@ cb_swatch_expose (GtkWidget *swatch, GdkEventExpose *event, GOPalette *palette)
 
 		(palette->priv->swatch_render) (cr, &area, index, palette->priv->data);
 
-		cairo_destroy (cr);
 	}
 	return TRUE;
 }
@@ -258,7 +253,7 @@ go_palette_menu_item_new (GOPalette *palette, int index)
 		char const *tip;
 
 		tip = priv->get_tooltip (index, priv->data);
-		go_widget_set_tooltip_text (item, tip);
+		gtk_widget_set_tooltip_text (item, tip);
 	}
 
 	g_signal_connect (item, "activate", G_CALLBACK (cb_menu_item_activate), palette);
@@ -406,7 +401,7 @@ go_palette_swatch_new (GOPalette *palette, int index)
 	swatch = gtk_drawing_area_new ();
 
 	g_object_set_data (G_OBJECT (swatch), "index", GINT_TO_POINTER (index));
-	g_signal_connect (G_OBJECT (swatch), "expose-event", G_CALLBACK (cb_swatch_expose), palette);
+	g_signal_connect (G_OBJECT (swatch), "draw", G_CALLBACK (cb_swatch_draw), palette);
 	gtk_widget_set_size_request (swatch,
 				     palette->priv->swatch_width,
 				     palette->priv->swatch_height);
diff --git a/goffice/gtk/go-rotation-sel.c b/goffice/gtk/go-rotation-sel.c
index 967f7dd..52e287c 100644
--- a/goffice/gtk/go-rotation-sel.c
+++ b/goffice/gtk/go-rotation-sel.c
@@ -19,14 +19,13 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
 #include <string.h>
 
 struct _GORotationSel {
-	GtkHBox		 box;
+	GtkBox		 box;
 	GtkBuilder	*gui;
 	int		 angle;
 
@@ -41,7 +40,7 @@ struct _GORotationSel {
 };
 
 typedef struct {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 	void (* rotation_changed) (GORotationSel *grs, int angle);
 } GORotationSelClass;
 
@@ -105,10 +104,10 @@ cb_rotate_canvas_realize (GocCanvas *canvas, GORotationSel *grs)
 	GocGroup  *group = goc_canvas_get_root (canvas);
 	int i;
 	GOStyle *go_style;
-	GtkStyle *style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (canvas)));
-	style->bg[GTK_STATE_NORMAL] = style->white;
-	gtk_widget_set_style (GTK_WIDGET (canvas), style);
-	g_object_unref (style);
+	GdkRGBA color = {1., 1., 1., 1.};
+
+	gtk_widget_override_background_color (GTK_WIDGET (canvas),
+	                                      GTK_STATE_NORMAL, &color);
 
 	for (i = 0 ; i <= 12 ; i++) {
 		double rad = (i-6) * M_PI / 12.;
@@ -187,9 +186,11 @@ cb_rotate_canvas_button (GocCanvas *canvas, GdkEventButton *event, GORotationSel
 	if (event->type == GDK_BUTTON_PRESS) {
 		set_rot_from_point (grs, event->x, event->y);
 		if (grs->motion_handle == 0) {
-			gdk_pointer_grab (gtk_layout_get_bin_window (&canvas->base), FALSE,
-				GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
-				NULL, NULL, event->time);
+			gdk_device_grab (gdk_event_get_device ((GdkEvent *) event),
+			                 gtk_layout_get_bin_window (&canvas->base),
+			                 GDK_OWNERSHIP_APPLICATION, FALSE,
+					 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+					 NULL, event->time);
 
 			grs->motion_handle = g_signal_connect (G_OBJECT (canvas), "motion_notify_event",
 				G_CALLBACK (cb_rotate_motion_notify_event), grs);
@@ -197,8 +198,8 @@ cb_rotate_canvas_button (GocCanvas *canvas, GdkEventButton *event, GORotationSel
 		return TRUE;
 	} else if (event->type == GDK_BUTTON_RELEASE) {
 		if (grs->motion_handle != 0) {
-			gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (canvas)),
-				event->time);
+			gdk_device_ungrab (gdk_event_get_device ((GdkEvent *) event),
+			                   event->time);
 			g_signal_handler_disconnect (canvas, grs->motion_handle);
 			grs->motion_handle = 0;
 		}
@@ -263,7 +264,7 @@ grs_class_init (GObjectClass *klass)
 	GObjectClass *gobj_class = (GObjectClass *) klass;
 	gobj_class->finalize = grs_finalize;
 
-	grs_parent_class = g_type_class_peek (gtk_hbox_get_type ());
+	grs_parent_class = g_type_class_peek (gtk_box_get_type ());
 	grs_signals [ROTATION_CHANGED] = g_signal_new ("rotation-changed",
 		G_OBJECT_CLASS_TYPE (klass),	G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (GORotationSelClass, rotation_changed),
@@ -273,7 +274,7 @@ grs_class_init (GObjectClass *klass)
 }
 
 GSF_CLASS (GORotationSel, go_rotation_sel,
-	   grs_class_init, grs_init, GTK_TYPE_HBOX)
+	   grs_class_init, grs_init, GTK_TYPE_BOX)
 
 GtkWidget *
 go_rotation_sel_new (void)
diff --git a/goffice/gtk/go-rotation-sel.ui b/goffice/gtk/go-rotation-sel.ui
index 9c45268..e13e141 100644
--- a/goffice/gtk/go-rotation-sel.ui
+++ b/goffice/gtk/go-rotation-sel.ui
@@ -8,7 +8,7 @@
     <property name="step_increment">1</property>
     <property name="page_increment">5</property>
   </object>
-  <object class="GtkVBox" id="toplevel">
+  <object class="GtkBox" id="toplevel">
     <property name="visible">True</property>
     <property name="orientation">vertical</property>
     <property name="spacing">12</property>
@@ -26,7 +26,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="hbox44">
+      <object class="GtkBox" id="hbox44">
         <property name="visible">True</property>
         <child>
           <object class="GtkLabel" id="label73">
@@ -40,12 +40,12 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox53">
+          <object class="GtkBox" id="vbox53">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkHBox" id="hbox58">
+              <object class="GtkBox" id="hbox58">
                 <property name="visible">True</property>
                 <child>
                   <object class="GtkScrolledWindow" id="rotate_canvas_container">
@@ -74,7 +74,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox39">
+              <object class="GtkBox" id="hbox39">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
diff --git a/goffice/gtk/go-selector.c b/goffice/gtk/go-selector.c
index 4e06c60..dfa83cd 100644
--- a/goffice/gtk/go-selector.c
+++ b/goffice/gtk/go-selector.c
@@ -21,7 +21,6 @@
 
 #include <goffice/goffice-config.h>
 #include <goffice/gtk/goffice-gtk.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include "go-selector.h"
 
@@ -71,7 +70,7 @@ struct _GOSelectorPrivate {
 	gboolean			dnd_initialized;
 };
 
-G_DEFINE_TYPE (GOSelector, go_selector, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GOSelector, go_selector, GTK_TYPE_BOX)
 
 static void
 go_selector_init (GOSelector *selector)
@@ -96,7 +95,7 @@ go_selector_init (GOSelector *selector)
 				G_CALLBACK (go_selector_key_press), selector);
 	gtk_widget_show (priv->button);
 
-	priv->box = gtk_hbox_new (FALSE, 0);
+	priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_add (GTK_CONTAINER (priv->button),
 			   priv->box);
 	gtk_widget_show (priv->box);
@@ -107,7 +106,7 @@ go_selector_init (GOSelector *selector)
 			    priv->alignment, TRUE, TRUE, 0);
 	gtk_widget_show (priv->alignment);
 
-	priv->separator = gtk_vseparator_new ();
+	priv->separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
 	gtk_box_pack_start (GTK_BOX (priv->box),
 			    priv->separator, FALSE, FALSE, 0);
 	gtk_widget_show (priv->separator);
@@ -156,6 +155,7 @@ go_selector_finalize (GObject *object)
 
 	priv = GO_SELECTOR (object)->priv;
 
+	GO_SELECTOR (object)->priv = NULL; /* we need that to avoid side effects when destroying the palette */
 	if (priv->palette)
 		g_object_unref (priv->palette);
 	g_free (priv->dnd_type.target);
@@ -251,8 +251,10 @@ go_selector_popdown (GOSelector *selector)
 
 	priv = selector->priv;
 
-	gtk_menu_popdown (GTK_MENU (priv->palette));
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), FALSE);
+	if (priv) {
+		gtk_menu_popdown (GTK_MENU (priv->palette));
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), FALSE);
+	}
 }
 
 static void
@@ -280,7 +282,7 @@ go_selector_key_press (GtkWidget   *widget,
 
 	priv = selector->priv;
 
-	if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) &&
+	if ((event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_KP_Down) &&
 	    state == GDK_MOD1_MASK) {
 		go_selector_popup (selector);
 		return TRUE;
@@ -294,36 +296,36 @@ go_selector_key_press (GtkWidget   *widget,
 
 	switch (event->keyval)
 	{
-		case GDK_Down:
-		case GDK_KP_Down:
+		case GDK_KEY_Down:
+		case GDK_KEY_KP_Down:
 			if (priv->selected_index < n_swatches - 1) {
 				index = priv->selected_index + 1;
 				found = TRUE;
 				break;
 			}
 			/* else fall through */
-		case GDK_Page_Up:
-		case GDK_KP_Page_Up:
-		case GDK_Home:
-		case GDK_KP_Home:
+		case GDK_KEY_Page_Up:
+		case GDK_KEY_KP_Page_Up:
+		case GDK_KEY_Home:
+		case GDK_KEY_KP_Home:
 			if (priv->selected_index != 0) {
 				index = 0;
 				found = TRUE;
 			}
 			break;
 
-		case GDK_Up:
-		case GDK_KP_Up:
+		case GDK_KEY_Up:
+		case GDK_KEY_KP_Up:
 			if (priv->selected_index  > 0) {
 				index = priv->selected_index - 1;
 				found = TRUE;
 				break;
 			}
 			/* else fall through */
-		case GDK_Page_Down:
-		case GDK_KP_Page_Down:
-		case GDK_End:
-		case GDK_KP_End:
+		case GDK_KEY_Page_Down:
+		case GDK_KEY_KP_Page_Down:
+		case GDK_KEY_End:
+		case GDK_KEY_KP_End:
 			if (priv->selected_index != n_swatches - 1) {
 				index = n_swatches - 1;
 				found = TRUE;
diff --git a/goffice/gtk/go-selector.h b/goffice/gtk/go-selector.h
index 5c53381..6ef6453 100644
--- a/goffice/gtk/go-selector.h
+++ b/goffice/gtk/go-selector.h
@@ -39,14 +39,14 @@ typedef struct _GOSelectorClass   GOSelectorClass;
 
 struct _GOSelector
 {
-	GtkHBox parent;
+	GtkBox parent;
 
 	GOSelectorPrivate *priv;
 };
 
 struct _GOSelectorClass
 {
-	GtkHBoxClass parent_class;
+	GtkBoxClass parent_class;
 
 	/* signals */
 	void (*activate)		(GtkWidget *selector);
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index b2ba9ac..5be302d 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -22,9 +22,9 @@
 #include <goffice/goffice-config.h>
 #include <goffice/goffice.h>
 #include <goffice/goffice-priv.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <gdk/gdkkeysyms.h>
+
 #include <atk/atkrelation.h>
 #include <atk/atkrelationset.h>
 #include <glib/gi18n-lib.h>
@@ -41,6 +41,10 @@
 #define PREVIEW_HSIZE 150
 #define PREVIEW_VSIZE 150
 
+#ifndef GDK_KEY_Escape
+#       define GDK_KEY_Escape GDK_Escape
+#endif
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -251,6 +255,38 @@ go_gtk_builder_combo_box_init_text (GtkBuilder *gui, char const *widget_name)
 	return box;
 }
 
+void
+go_gtk_combo_box_append_text (GtkComboBox *combo, char const *str)
+{
+	GtkListStore *model;
+	GtkTreeIter iter;
+
+	g_return_if_fail (GTK_IS_COMBO_BOX (combo));
+	g_return_if_fail (str != NULL);
+
+	model = GTK_LIST_STORE (gtk_combo_box_get_model (combo));
+	gtk_list_store_append (model, &iter);
+	gtk_list_store_set (model, &iter, 0, str, -1);
+}
+
+void
+go_gtk_combo_box_remove_text (GtkComboBox *combo, int position)
+{
+	GtkTreeModel *model;
+	GtkListStore *store;
+	GtkTreeIter iter;
+
+	g_return_if_fail (GTK_IS_COMBO_BOX_TEXT (combo));
+	g_return_if_fail (position >= 0);
+
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
+	store = GTK_LIST_STORE (model);
+	g_return_if_fail (GTK_IS_LIST_STORE (store));
+
+	if (gtk_tree_model_iter_nth_child (model, &iter, NULL, position))
+		gtk_list_store_remove (store, &iter);
+}
+
 int
 go_gtk_builder_group_value (GtkBuilder *gui, char const * const group[])
 {
@@ -382,7 +418,7 @@ go_gtk_window_set_transient (GtkWindow *toplevel, GtkWindow *window)
 static gint
 cb_non_modal_dialog_keypress (GtkWidget *w, GdkEventKey *e)
 {
-	if(e->keyval == GDK_Escape) {
+	if(e->keyval == GDK_KEY_Escape) {
 		gtk_widget_destroy (w);
 		return TRUE;
 	}
@@ -483,7 +519,7 @@ filter_images (const GtkFileFilterInfo *filter_info, gpointer data)
 		ext++;
 
 		if (!have_pixbufexts) {
-			GSList *l, *pixbuf_fmts = gdk_pixbuf_get_formats ();
+			GSList *pixbuf_fmts = gdk_pixbuf_get_formats ();
 
 			for (l = pixbuf_fmts; l != NULL; l = l->next) {
 				GdkPixbufFormat *fmt = l->data;
@@ -602,7 +638,7 @@ gui_image_chooser_new (gboolean is_save)
 
 	/* Preview */
 	{
-		GtkWidget *vbox = gtk_vbox_new (FALSE, 2);
+		GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
 		GtkWidget *preview_image = gtk_image_new ();
 		GtkWidget *preview_label = gtk_label_new ("");
 
@@ -730,7 +766,7 @@ go_gui_get_image_save_info (GtkWindow *toplevel, GSList *supported_formats,
 			for (l = supported_formats, i = 0; l != NULL; l = l->next, i++) {
 				format = GPOINTER_TO_UINT (l->data);
 				format_info = go_image_get_format_info (format);
-				gtk_combo_box_append_text (format_combo, _(format_info->desc));
+				go_gtk_combo_box_append_text (format_combo, _(format_info->desc));
 				if (format == state->format)
 					gtk_combo_box_set_active (format_combo, i);
 			}
@@ -1137,69 +1173,6 @@ go_gtk_query_yes_no (GtkWindow *parent, gboolean default_answer,
 		go_gtk_dialog_run (GTK_DIALOG (dialog), parent);
 }
 
-#ifndef HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT
-static GtkTooltips *
-get_tooltips (GObject *obj)
-{
-	GtkTooltips *tips = g_object_get_data (obj, "-go-tips");
-
-	if (!tips) {
-		tips = gtk_tooltips_new ();
-
-#if GLIB_CHECK_VERSION(2,10,0) && GTK_CHECK_VERSION(2,8,14)
-		g_object_ref_sink (tips);
-#else
-		g_object_ref (tips);
-		gtk_object_sink (GTK_OBJECT (tips));
-#endif
-		g_object_set_data_full (obj, "-go-tips", tips,
-					(GDestroyNotify)g_object_unref);
-	}
-
-	return tips;
-}
-#endif
-
-void
-go_widget_set_tooltip_text (GtkWidget *widget, char const *tip)
-{
-#ifdef HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT
-	gtk_widget_set_tooltip_text (widget, tip);
-#else
-	GtkTooltips *tips = get_tooltips (G_OBJECT (widget));
-	gtk_tooltips_set_tip (tips, widget, tip, NULL);
-#endif
-}
-
-void
-go_tool_item_set_tooltip_text (GtkToolItem *item, char const *tip)
-{
-#ifdef HAVE_GTK_TOOL_ITEM_SET_TOOLTIP_TEXT
-	gtk_tool_item_set_tooltip_text (item, tip);
-#else
-	GtkTooltips *tips = get_tooltips (G_OBJECT (item));
-	gtk_tool_item_set_tooltip (item, tips, tip, NULL);
-#endif
-}
-
-
-#ifndef HAVE_GTK_DIALOG_GET_RESPONSE_FOR_WIDGET
-/* This is public from 2.8 onwards.   */
-static gint
-gtk_dialog_get_response_for_widget (GtkDialog *dialog, GtkWidget *widget)
-{
-	struct {
-		gint response_id;
-	} const *rd = g_object_get_data (G_OBJECT (widget),
-				   "gtk-dialog-response-data");
-	if (!rd)
-		return GTK_RESPONSE_NONE;
-	else
-		return rd->response_id;
-}
-#endif
-
-
 /**
  * go_dialog_guess_alternative_button_order:
  * @dialog : #GtkDialog
@@ -1312,7 +1285,7 @@ go_menu_position_below (GtkMenu  *menu,
 		sy += size.y;
 	}
 
-	gtk_widget_size_request (GTK_WIDGET (menu), &req);
+	gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
 
 	if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
 		*x = sx;
@@ -1354,11 +1327,7 @@ go_menu_position_below (GtkMenu  *menu,
 GError *
 go_gtk_url_show (gchar const *url, GdkScreen *screen)
 {
-#if defined(HAVE_GTK_SHOW_URI)
 	GError *error = NULL;
 	gtk_show_uri (screen, url, GDK_CURRENT_TIME, &error);
 	return error;
-#else
-	return go_url_show (url);
-#endif
 }
diff --git a/goffice/gtk/goffice-gtk.h b/goffice/gtk/goffice-gtk.h
index 00e4f5c..d309d8c 100644
--- a/goffice/gtk/goffice-gtk.h
+++ b/goffice/gtk/goffice-gtk.h
@@ -73,6 +73,9 @@ GtkWidget *go_gtk_builder_get_widget (GtkBuilder *gui,
 				      char const *widget_name);
 GtkComboBox *go_gtk_builder_combo_box_init_text (GtkBuilder *gui,
 						 char const *widget_name);
+void	   go_gtk_combo_box_append_text (GtkComboBox *combo, char const *str);
+void	   go_gtk_combo_box_remove_text (GtkComboBox *combo, int position);
+
 int	   go_gtk_builder_group_value (GtkBuilder *gui,
 				       char const * const group[]);
 
@@ -113,9 +116,6 @@ void	   go_atk_setup_label	 	(GtkWidget *label, GtkWidget *target);
 
 void       go_dialog_guess_alternative_button_order (GtkDialog *dialog);
 
-void       go_widget_set_tooltip_text (GtkWidget *widget, const gchar *tip);
-void       go_tool_item_set_tooltip_text (GtkToolItem *item, const gchar *tip);
-
 void 	   go_menu_position_below (GtkMenu *menu, gint *x, gint *y,
 				   gint *push_in, gpointer user_data);
 
diff --git a/goffice/math/go-regression.c b/goffice/math/go-regression.c
index fc65f80..a4b7566 100644
--- a/goffice/math/go-regression.c
+++ b/goffice/math/go-regression.c
@@ -1150,7 +1150,7 @@ SUFFIX(go_exponential_regression) (MATRIX xss, int dim,
  * @res: output place for constant[0] and root1[1], root2[2],... There will be dim+1 results.
  * @stat_ : non-NULL storage for additional results.
  *
- * Performs one-dimensional linear regressions on the input points as 
+ * Performs one-dimensional linear regressions on the input points as
  * go_exponential_regression, but returns the logarithm of the coefficients instead
  * or the coefficients themselves.
  * Fits to "y = b * exp (m1*x1) * ... * exp (md*xd) " or equivalently to
@@ -1206,7 +1206,7 @@ SUFFIX(go_exponential_regression_as_log) (MATRIX xss, int dim,
 	g_free (log_ys);
 	return result;
 }
- 
+
 /**
  * go_power_regression:
  * @xss: x-vectors (i.e. independent data)
diff --git a/goffice/utils/go-color.c b/goffice/utils/go-color.c
index 16af3d2..0e5e209 100644
--- a/goffice/utils/go-color.c
+++ b/goffice/utils/go-color.c
@@ -43,9 +43,9 @@ go_color_from_str (gchar const *str, GOColor *res)
 	}
 #ifdef GOFFICE_WITH_GTK
 	 else {
-		GdkColor color;
-		if (gdk_color_parse (str, &color)) {
-			*res = GO_COLOR_FROM_GDK (color);
+		GdkRGBA color;
+		if (gdk_rgba_parse (&color, str)) {
+			*res = GO_COLOR_FROM_GDK_RGBA (color);
 			return TRUE;
 		}
 	}
@@ -82,15 +82,13 @@ go_color_to_pango (GOColor color, gboolean is_fore)
 #ifdef GOFFICE_WITH_GTK
 #include <gdk/gdk.h>
 
-GdkColor *
-go_color_to_gdk	(GOColor color, GdkColor *res)
+GdkRGBA *
+go_color_to_gdk_rgba (GOColor color, GdkRGBA *res)
 {
-	res->red    = GO_COLOR_UINT_R (color);
-	res->red   |= (res->red << 8);
-	res->green  = GO_COLOR_UINT_G (color);
-	res->green |= (res->green << 8);
-	res->blue   = GO_COLOR_UINT_B (color);
-	res->blue  |= (res->blue << 8);
+	res->red    = GO_COLOR_DOUBLE_R (color);
+	res->green  = GO_COLOR_DOUBLE_G (color);
+	res->blue   = GO_COLOR_DOUBLE_B (color);
+	res->alpha  = GO_COLOR_DOUBLE_A (color);
 
 	return res;
 }
diff --git a/goffice/utils/go-color.h b/goffice/utils/go-color.h
index b3a7cd5..295bede 100644
--- a/goffice/utils/go-color.h
+++ b/goffice/utils/go-color.h
@@ -41,7 +41,7 @@ typedef struct {
   cpp-perils...
 */
 
-#define GO_COLOR_FROM_GDK(c)	GO_COLOR_FROM_RGBA(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff)
+#define GO_COLOR_FROM_GDK_RGBA(c)	GO_COLOR_FROM_RGBA((int)((c).red * 255.), (int)((c).green * 255.), (int)((c).blue * 255.), (int)((c).alpha * 255.))
 
 #define GO_COLOR_FROM_RGB(r,g,b)	((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|0xff)
 #define GO_COLOR_FROM_RGBA(r,g,b,a)	((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|(guint)(a&0xff))
@@ -85,7 +85,7 @@ gboolean  go_color_from_str (char const *str, GOColor *res);
 gchar    *go_color_as_str   (GOColor color);
 PangoAttribute *go_color_to_pango (GOColor color, gboolean is_fore);
 #ifdef GOFFICE_WITH_GTK
-GdkColor *go_color_to_gdk   (GOColor color, GdkColor *res);
+GdkRGBA *go_color_to_gdk_rgba   (GOColor color, GdkRGBA *res);
 #endif
 
 G_END_DECLS
diff --git a/goffice/utils/go-file.c b/goffice/utils/go-file.c
index a61c9a4..39a1499 100644
--- a/goffice/utils/go-file.c
+++ b/goffice/utils/go-file.c
@@ -34,7 +34,7 @@
 #include <windows.h>
 #include <io.h>
 #endif
-#ifdef HAVE_GTK_SHOW_URI
+#ifdef GOFFICE_WITH_GTK
 #include <gtk/gtk.h>
 #endif
 #include <string.h>
@@ -987,7 +987,7 @@ go_url_encode (gchar const *text, int type)
 GError *
 go_url_show (gchar const *url)
 {
-#ifdef HAVE_GTK_SHOW_URI
+#ifdef GOFFICE_WITH_GTK
 	GError *error = NULL;
 	gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
 	return error;
@@ -1046,7 +1046,7 @@ go_url_check_extension (gchar const *uri,
  *
  * returns: the mime type for the file as a newly allocated string. Needs to
  * be freed with g_free().
-**/ 
+**/
 
 gchar *
 go_get_mime_type (gchar const *uri)
@@ -1107,7 +1107,7 @@ go_get_mime_type (gchar const *uri)
  *
  * returns: the mime type for the data as a newly allocated string. Needs to
  * be freed with g_free().
-**/ 
+**/
 gchar *
 go_get_mime_type_for_data (gconstpointer data, int data_size)
 {
@@ -1147,12 +1147,11 @@ go_get_mime_type_for_data (gconstpointer data, int data_size)
  * returns: the description for the mime type as a newly allocated string.
  * Needs to be freed with g_free(). If the description is not found, the
  * mime type itself will be returned.
-**/ 
+**/
 
 gchar *
 go_mime_type_get_description (gchar const *mime_type)
 {
-#ifdef HAVE_G_CONTENT_TYPE_FROM_MIME_TYPE
 	char *content_type = g_content_type_from_mime_type (mime_type);
 	char *description = NULL;
 	if (content_type) {
@@ -1160,9 +1159,6 @@ go_mime_type_get_description (gchar const *mime_type)
 		g_free (content_type);
 	}
 	return description ? description : g_strdup (mime_type);
-#else
-	return g_content_type_get_description (mime_type);
-#endif
 }
 
 /* ------------------------------------------------------------------------- */
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 354baf2..c1d94cb 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -6173,7 +6173,7 @@ go_format_output_fraction_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
 							if (with_extension)
 								gsf_xml_out_add_cstr_unchecked
 									(xout, GNMSTYLE "no-integer-part", "true");
-							
+
 						}
 				/* In ODF1.2, absence of NUMBER "min-integer-digits" means not to show an       */
 				/* integer part. In ODF 1.1 we used a foreign element: gnm:no-integer-part=true */
diff --git a/goffice/utils/go-image.c b/goffice/utils/go-image.c
index 357ace4..ff16327 100644
--- a/goffice/utils/go-image.c
+++ b/goffice/utils/go-image.c
@@ -20,10 +20,7 @@
  */
 
 #include <goffice/goffice-config.h>
-#include <goffice/utils/go-color.h>
-#include <goffice/utils/go-image.h>
-#include <goffice/utils/go-cairo.h>
-#include <glib/gi18n-lib.h>
+#include <goffice/goffice.h>
 #include <string.h>
 #include <gsf/gsf-utils.h>
 #include <gsf/gsf-impl-utils.h>
@@ -59,9 +56,7 @@ go_mime_to_image_format (char const *mime_type)
 		"image/x-emf", "emf",
 		"application/pdf", "pdf",
 		"application/postscript", "ps",
-#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
 		"image/x-eps", "eps",
-#endif
 	};
 
 	for (i = 0; i < G_N_ELEMENTS (exceptions); i += 2)
@@ -94,9 +89,7 @@ go_image_format_to_mime (char const *format)
 		"emf", "image/x-emf",
 		"pdf", "application/pdf",
 		"ps", "application/postscript",
-#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
 		"eps", "image/x-eps",
-#endif
 	};
 
 	if (format == NULL)
@@ -143,13 +136,8 @@ static GOImageFormatInfo const image_format_infos[GO_IMAGE_FORMAT_UNKNOWN] = {
 	 (char *) "emf", FALSE, FALSE, TRUE},
 	{GO_IMAGE_FORMAT_WMF, (char *) "wmf",  (char *) N_("WMF (windows metafile)"),
 	 (char *) "wmf", FALSE, FALSE, TRUE},
-#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
 	{GO_IMAGE_FORMAT_EPS,  (char *) "eps",   (char *) N_("EPS (encapsulated postscript)"),
 	 (char *) "eps",  FALSE, TRUE, TRUE},
-#else
-	{GO_IMAGE_FORMAT_EPS,  (char *) "",   (char *) "",
-	 (char *) "",  FALSE, FALSE, FALSE},
-#endif
 };
 
 static void
diff --git a/goffice/utils/go-path.c b/goffice/utils/go-path.c
index 66751a9..1922baf 100644
--- a/goffice/utils/go-path.c
+++ b/goffice/utils/go-path.c
@@ -70,7 +70,7 @@ struct _GOPath {
 	GOPathDataBuffer *data_buffer_tail;
 
 	GOPathOptions 	  options;
-	unsigned	  refs; 
+	unsigned	  refs;
 };
 
 static void
diff --git a/goffice/utils/go-style-prefs.ui b/goffice/utils/go-style-prefs.ui
index fb97d9a..b6e5eae 100644
--- a/goffice/utils/go-style-prefs.ui
+++ b/goffice/utils/go-style-prefs.ui
@@ -1,7 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 2.12 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">30</property>
     <property name="step_increment">0.10000000000000001</property>
@@ -17,63 +16,237 @@
     <property name="step_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment4">
-    <property name="value">5</property>
     <property name="lower">1</property>
     <property name="upper">200</property>
+    <property name="value">5</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkListStore" id="model1">
-    <columns>
-      <!-- column-name gchararray -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">None</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Pattern</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Bicolor gradient</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Unicolor gradient</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Image</col>
-      </row>
-    </data>
+  <object class="GtkBox" id="go_style_font_prefs">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">12</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkBox" id="hbox5">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="GtkBox" id="color_box">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="font_color_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Co_lor:</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
   </object>
-  <object class="GtkListStore" id="model2">
-    <columns>
-      <!-- column-name gchararray -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">stretched</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">wallpaper</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">centered</col>
-      </row>
-    </data>
+  <object class="GtkAlignment" id="go_style_marker_prefs">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="xalign">0</property>
+    <property name="yalign">0</property>
+    <property name="xscale">0</property>
+    <property name="yscale">0</property>
+    <property name="top_padding">12</property>
+    <property name="bottom_padding">12</property>
+    <property name="left_padding">12</property>
+    <property name="right_padding">12</property>
+    <child>
+      <object class="GtkBox" id="marker_box">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="marker_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">&lt;b&gt;Marker&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkAlignment" id="alignment7">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">18</property>
+            <child>
+              <object class="GtkTable" id="marker_table">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="n_rows">4</property>
+                <property name="n_columns">3</property>
+                <property name="column_spacing">12</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="marker_fill_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">_Fill:</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="marker_outline_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">O_utline:</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label7">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">pts</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">2</property>
+                    <property name="right_attach">3</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="marker_size_spin">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">â</property>
+                    <property name="adjustment">adjustment4</property>
+                    <property name="climb_rate">1</property>
+                    <property name="numeric">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="marker_size_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Si_ze:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">marker_size_spin</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="marker_shape_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Sha_pe:</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"></property>
+                  </packing>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
   </object>
-  <object class="GtkHBox" id="go_style_prefs">
+  <object class="GtkBox" id="go_style_prefs">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="border_width">12</property>
     <property name="spacing">24</property>
     <child>
-      <object class="GtkVBox" id="outline_box">
+      <object class="GtkBox" id="outline_box">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <child>
           <object class="GtkLabel" id="outline_label">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">&lt;b&gt;Outline&lt;/b&gt;</property>
             <property name="use_markup">True</property>
@@ -87,11 +260,13 @@
         <child>
           <object class="GtkAlignment" id="alignment5">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="top_padding">6</property>
             <property name="left_padding">18</property>
             <child>
               <object class="GtkTable" id="outline_table">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="n_rows">3</property>
                 <property name="n_columns">3</property>
                 <property name="column_spacing">12</property>
@@ -99,6 +274,7 @@
                 <child>
                   <object class="GtkLabel" id="label37">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">St_yle:</property>
                     <property name="use_underline">True</property>
@@ -111,6 +287,7 @@
                 <child>
                   <object class="GtkLabel" id="outline_color_label">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Co_lor:</property>
                     <property name="use_underline">True</property>
@@ -125,6 +302,7 @@
                 <child>
                   <object class="GtkLabel" id="label35">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">pts</property>
                   </object>
@@ -141,7 +319,7 @@
                   <object class="GtkSpinButton" id="outline_size_spin">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="invisible_char">&#x2022;</property>
+                    <property name="invisible_char">â</property>
                     <property name="adjustment">adjustment1</property>
                     <property name="climb_rate">1</property>
                     <property name="digits">1</property>
@@ -158,6 +336,7 @@
                 <child>
                   <object class="GtkLabel" id="outline_size_label">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Size:</property>
                     <property name="use_underline">True</property>
@@ -199,12 +378,14 @@
       </packing>
     </child>
     <child>
-      <object class="GtkVBox" id="line_box">
+      <object class="GtkBox" id="line_box">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <child>
           <object class="GtkLabel" id="line_label">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">&lt;b&gt;Line&lt;/b&gt;</property>
             <property name="use_markup">True</property>
@@ -218,12 +399,14 @@
         <child>
           <object class="GtkAlignment" id="alignment6">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="top_padding">6</property>
             <property name="bottom_padding">10</property>
             <property name="left_padding">18</property>
             <child>
               <object class="GtkTable" id="line_table">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="n_rows">3</property>
                 <property name="n_columns">3</property>
                 <property name="column_spacing">12</property>
@@ -232,7 +415,7 @@
                   <object class="GtkSpinButton" id="line_size_spin">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="invisible_char">&#x2022;</property>
+                    <property name="invisible_char">â</property>
                     <property name="adjustment">adjustment2</property>
                     <property name="climb_rate">1</property>
                     <property name="digits">1</property>
@@ -250,6 +433,7 @@
                 <child>
                   <object class="GtkLabel" id="label36">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">St_yle:</property>
                     <property name="use_underline">True</property>
@@ -262,6 +446,7 @@
                 <child>
                   <object class="GtkLabel" id="label34">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">pts</property>
                   </object>
@@ -277,6 +462,7 @@
                 <child>
                   <object class="GtkLabel" id="line_size_label">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Size:</property>
                     <property name="use_underline">True</property>
@@ -292,6 +478,7 @@
                 <child>
                   <object class="GtkLabel" id="line_color_label">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Co_lor:</property>
                     <property name="use_underline">True</property>
@@ -332,12 +519,14 @@
       </packing>
     </child>
     <child>
-      <object class="GtkVBox" id="fill_box">
+      <object class="GtkBox" id="fill_box">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <child>
           <object class="GtkLabel" id="fill_label">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">&lt;b&gt;Fill&lt;/b&gt;</property>
             <property name="use_markup">True</property>
@@ -351,24 +540,27 @@
         <child>
           <object class="GtkAlignment" id="alignment4">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="top_padding">6</property>
             <property name="left_padding">18</property>
             <child>
-              <object class="GtkVBox" id="vbox1">
+              <object class="GtkBox" id="vbox1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkHBox" id="hbox2">
+                  <object class="GtkBox" id="hbox2">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="spacing">12</property>
                     <child>
                       <object class="GtkLabel" id="fill_type_label">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">_Type:</property>
                         <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">fill_type_menu</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -377,68 +569,73 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkComboBox" id="fill_type_menu">
+                      <object class="GtkComboBoxText" id="fill-type-menu">
                         <property name="visible">True</property>
-                        <property name="model">model1</property>
-                        <child>
-                          <object class="GtkCellRendererText" id="renderer1"/>
-                          <attributes>
-                            <attribute name="text">0</attribute>
-                          </attributes>
-                        </child>
+                        <property name="can_focus">False</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkHBox" id="fill_extension_box">
+                  <object class="GtkBox" id="fill_extension_box">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <placeholder/>
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkNotebook" id="fill_notebook">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="show_tabs">False</property>
                     <property name="show_border">False</property>
                     <child>
                       <object class="GtkLabel" id="label31">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                     </child>
                     <child type="tab">
                       <object class="GtkLabel" id="label16">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                       <packing>
                         <property name="tab_fill">False</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkVBox" id="vbox3">
+                      <object class="GtkBox" id="vbox3">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="orientation">vertical</property>
                         <property name="spacing">6</property>
                         <child>
-                          <object class="GtkHBox" id="fill_gradient_box">
+                          <object class="GtkBox" id="fill_gradient_box">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">12</property>
                             <child>
                               <object class="GtkLabel" id="fill_gradient_label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Direction:</property>
                                 <property name="use_underline">True</property>
@@ -457,12 +654,14 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkHBox" id="fill_pattern_box">
+                          <object class="GtkBox" id="fill_pattern_box">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">12</property>
                             <child>
                               <object class="GtkLabel" id="fill_pattern_label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Pattern:</property>
                                 <property name="use_underline">True</property>
@@ -481,12 +680,14 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkHBox" id="fill_foreground_box">
+                          <object class="GtkBox" id="fill_foreground_box">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">12</property>
                             <child>
                               <object class="GtkLabel" id="fill_foreground_label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Foreground:</property>
                                 <property name="use_underline">True</property>
@@ -505,12 +706,14 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkHBox" id="fill_background_box">
+                          <object class="GtkBox" id="fill_background_box">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">12</property>
                             <child>
                               <object class="GtkLabel" id="fill_background_label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Background:</property>
                                 <property name="use_underline">True</property>
@@ -529,12 +732,14 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkHBox" id="fill_brightness_box">
+                          <object class="GtkBox" id="fill_brightness_box">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">12</property>
                             <child>
                               <object class="GtkLabel" id="fill_brightness_label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">B_rightness:</property>
                                 <property name="use_underline">True</property>
@@ -547,7 +752,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkHScale" id="fill_brightness_scale">
+                              <object class="GtkScale" id="fill_brightness_scale">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="adjustment">adjustment3</property>
@@ -558,6 +763,8 @@
                                 <property name="draw_value">False</property>
                               </object>
                               <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -576,6 +783,7 @@
                     <child type="tab">
                       <object class="GtkLabel" id="label18">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                       <packing>
                         <property name="position">1</property>
@@ -585,29 +793,34 @@
                     <child>
                       <object class="GtkTable" id="fill_image_table">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="n_rows">3</property>
                         <property name="n_columns">3</property>
                         <property name="column_spacing">12</property>
                         <property name="row_spacing">6</property>
                         <child>
-                          <object class="GtkVBox" id="vbox2">
+                          <object class="GtkBox" id="vbox2">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="orientation">vertical</property>
                             <child>
                               <object class="GtkImage" id="fill_image_sample">
                                 <property name="width_request">100</property>
                                 <property name="height_request">60</property>
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="stock">gtk-missing-image</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="image-size-label">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -627,6 +840,7 @@
                         <child>
                           <object class="GtkLabel" id="label33">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="xalign">0</property>
                           </object>
                           <packing>
@@ -640,18 +854,22 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="use_action_appearance">False</property>
                             <child>
                               <object class="GtkAlignment" id="alignment2">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xscale">0</property>
                                 <property name="yscale">0</property>
                                 <child>
-                                  <object class="GtkHBox" id="hbox4">
+                                  <object class="GtkBox" id="hbox4">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="spacing">2</property>
                                     <child>
                                       <object class="GtkImage" id="image1">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="stock">gtk-open</property>
                                       </object>
                                       <packing>
@@ -663,6 +881,7 @@
                                     <child>
                                       <object class="GtkLabel" id="label32">
                                         <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
                                         <property name="label" translatable="yes">_Select...</property>
                                         <property name="use_underline">True</property>
                                       </object>
@@ -686,30 +905,12 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkComboBox" id="fill_image_fit">
-                            <property name="visible">True</property>
-                            <property name="model">model2</property>
-                            <child>
-                              <object class="GtkCellRendererText" id="renderer2"/>
-                              <attributes>
-                                <attribute name="text">0</attribute>
-                              </attributes>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="x_options">GTK_SHRINK | GTK_FILL</property>
-                            <property name="y_options">GTK_SHRINK</property>
-                          </packing>
-                        </child>
-                        <child>
                           <object class="GtkLabel" id="fill_image_fit_label">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Fit:</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">fill_image_fit</property>
                           </object>
                           <packing>
                             <property name="x_options">GTK_SHRINK | GTK_FILL</property>
@@ -719,6 +920,21 @@
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <object class="GtkComboBoxText" id="fill-image-fit">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <items>
+                              <item translatable="yes">stretched</item>
+                              <item translatable="yes">wallpaper</item>
+                              <item translatable="yes">centered</item>
+                            </items>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
                         <property name="position">2</property>
@@ -728,6 +944,7 @@
                     <child type="tab">
                       <object class="GtkLabel" id="label19">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                       <packing>
                         <property name="position">2</property>
@@ -758,201 +975,4 @@
       </packing>
     </child>
   </object>
-  <object class="GtkVBox" id="go_style_font_prefs">
-    <property name="visible">True</property>
-    <property name="border_width">12</property>
-    <property name="orientation">vertical</property>
-    <property name="spacing">12</property>
-    <child>
-      <object class="GtkHBox" id="hbox5">
-        <property name="visible">True</property>
-        <child>
-          <object class="GtkHBox" id="color_box">
-            <property name="visible">True</property>
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkLabel" id="font_color_label">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Co_lor:</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
-      </packing>
-    </child>
-  </object>
-  <object class="GtkAlignment" id="go_style_marker_prefs">
-    <property name="visible">True</property>
-    <property name="xalign">0</property>
-    <property name="yalign">0</property>
-    <property name="xscale">0</property>
-    <property name="yscale">0</property>
-    <property name="top_padding">12</property>
-    <property name="bottom_padding">12</property>
-    <property name="left_padding">12</property>
-    <property name="right_padding">12</property>
-    <child>
-      <object class="GtkVBox" id="marker_box">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkLabel" id="marker_label">
-            <property name="visible">True</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">&lt;b&gt;Marker&lt;/b&gt;</property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkAlignment" id="alignment7">
-            <property name="visible">True</property>
-            <property name="top_padding">6</property>
-            <property name="left_padding">18</property>
-            <child>
-              <object class="GtkTable" id="marker_table">
-                <property name="visible">True</property>
-                <property name="n_rows">4</property>
-                <property name="n_columns">3</property>
-                <property name="column_spacing">12</property>
-                <property name="row_spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="marker_fill_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Fill:</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="marker_outline_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">O_utline:</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label7">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">pts</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="right_attach">3</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkSpinButton" id="marker_size_spin">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">&#x2022;</property>
-                    <property name="adjustment">adjustment4</property>
-                    <property name="climb_rate">1</property>
-                    <property name="numeric">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="marker_size_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Si_ze:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">marker_size_spin</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="marker_shape_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Sha_pe:</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
 </interface>
diff --git a/goffice/utils/go-style.c b/goffice/utils/go-style.c
index 5523867..bd102bd 100644
--- a/goffice/utils/go-style.c
+++ b/goffice/utils/go-style.c
@@ -526,7 +526,7 @@ fill_image_init (StylePrefState *state)
 
 	sample = go_gtk_builder_get_widget (state->gui, "fill_image_sample");
 	gtk_widget_set_size_request (sample, HSCALE + 10, VSCALE + 10);
-	type   = go_gtk_builder_get_widget (state->gui, "fill_image_fit");
+	type   = go_gtk_builder_get_widget (state->gui, "fill-image-fit");
 
 	state->fill.image.image = NULL;
 
@@ -655,9 +655,9 @@ fill_init (StylePrefState *state, gboolean enable, GOEditor *editor)
 	}
 	fill_update_visibilies (type, state);
 
-	w = go_gtk_builder_get_widget (state->gui, "fill_type_menu");
+	w = go_gtk_builder_get_widget (state->gui, "fill-type-menu");
 	if (state->doc == NULL)
-		gtk_combo_box_remove_text (GTK_COMBO_BOX (w), FILL_TYPE_IMAGE);
+		gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (w), FILL_TYPE_IMAGE);
 	gtk_combo_box_set_active (GTK_COMBO_BOX (w), type);
 	g_signal_connect (G_OBJECT (w),
 		"changed",
@@ -904,7 +904,7 @@ text_layout_init (StylePrefState *state, guint32 enable, GOEditor *editor, GOCmd
 		style->text_layout.angle);
 	g_signal_connect (G_OBJECT (w), "rotation-changed",
 		G_CALLBACK (cb_angle_changed), state);
-	box = gtk_vbox_new (FALSE, 6);
+	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 	gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
 	gtk_container_set_border_width (GTK_CONTAINER (box), 12);
 	go_editor_add_page (editor, box, _("Text"));
diff --git a/goffice/utils/goffice-utils.h b/goffice/utils/goffice-utils.h
index 7dfcc66..7869bc9 100644
--- a/goffice/utils/goffice-utils.h
+++ b/goffice/utils/goffice-utils.h
@@ -76,6 +76,26 @@ typedef enum {
 	GO_LINE_INTERPOLATION_MAX
 } GOLineInterpolation;
 
+typedef enum
+{
+  GO_ANCHOR_CENTER,
+  GO_ANCHOR_NORTH,
+  GO_ANCHOR_NORTH_WEST,
+  GO_ANCHOR_NORTH_EAST,
+  GO_ANCHOR_SOUTH,
+  GO_ANCHOR_SOUTH_WEST,
+  GO_ANCHOR_SOUTH_EAST,
+  GO_ANCHOR_WEST,
+  GO_ANCHOR_EAST,
+  GO_ANCHOR_N		= GO_ANCHOR_NORTH,
+  GO_ANCHOR_NW		= GO_ANCHOR_NORTH_WEST,
+  GO_ANCHOR_NE		= GO_ANCHOR_NORTH_EAST,
+  GO_ANCHOR_S		= GO_ANCHOR_SOUTH,
+  GO_ANCHOR_SW		= GO_ANCHOR_SOUTH_WEST,
+  GO_ANCHOR_SE		= GO_ANCHOR_SOUTH_EAST,
+  GO_ANCHOR_W		= GO_ANCHOR_WEST,
+  GO_ANCHOR_E		= GO_ANCHOR_EAST
+} GOAnchorType;
 
 G_END_DECLS
 
diff --git a/goffice/utils/regutf8.c b/goffice/utils/regutf8.c
index bc4aae4..3f32dd6 100644
--- a/goffice/utils/regutf8.c
+++ b/goffice/utils/regutf8.c
@@ -7,9 +7,6 @@
 
 #include <goffice/goffice-config.h>
 #include "regutf8.h"
-#ifndef HAVE_G_REGEX_ERROR_STRAY_BACKSLASH
-#include <pcre.h>
-#endif
 #include "go-glib-extras.h"
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -21,11 +18,7 @@ void
 go_regfree (GORegexp *gor)
 {
 	if (gor->ppcre) {
-#ifdef HAVE_G_REGEX_ERROR_STRAY_BACKSLASH
 		g_regex_unref (gor->ppcre);
-#else
-		pcre_free (gor->ppcre);
-#endif
 		gor->ppcre = NULL;
 	}
 }
@@ -70,7 +63,6 @@ go_regerror (int errcode, const GORegexp *gor, char *dst, size_t dstsize)
 int
 go_regcomp (GORegexp *gor, const char *pat, int cflags)
 {
-#ifdef HAVE_G_REGEX_ERROR_STRAY_BACKSLASH
 	GError *error = NULL;
 	GRegex *r;
 	int coptions =
@@ -119,47 +111,6 @@ go_regcomp (GORegexp *gor, const char *pat, int cflags)
 		gor->nosub = (cflags & GO_REG_NOSUB) != 0;
 		return 0;
 	}
-#else
-	const char *errorptr;
-	int errorofs, errorcode;
-	pcre *r;
-	int coptions =
-		PCRE_UTF8 |
-		PCRE_NO_UTF8_CHECK |
-		((cflags & GO_REG_ICASE) ? PCRE_CASELESS : 0) |
-		((cflags & GO_REG_NEWLINE) ? PCRE_MULTILINE : 0);
-
-	if (&pcre_compile2 == NULL) {
-		g_error ("libgoffice has been dynamically linked against a libpcre\n"
-				"that lacks the pcre_compile2 function.  This indicates a\n"
-				"distribution dependency problem.  Please report this at\n"
-				"bugzilla.gnome.org and for you distribution.");
-	}
-
-	gor->ppcre = r = pcre_compile2 (pat, coptions,
-			&errorcode, &errorptr, &errorofs,
-			NULL);
-
-	if (r == NULL) {
-		switch (errorcode) {
-		case 1: case 2: case 3: case 37: return GO_REG_EESCAPE;
-		case 4: case 5: return GO_REG_EBRACE;
-		case 6: return GO_REG_EBRACK;
-		case 7: case 30: return GO_REG_ECTYPE;
-		case 8: return GO_REG_ERANGE;
-		case 9: case 10: return GO_REG_BADRPT;
-		case 14: case 18: case 22: return GO_REG_EPAREN;
-		case 15: return GO_REG_ESUBREG;
-		case 19: case 20: return GO_REG_ESIZE;
-		case 21: return GO_REG_ESPACE;
-		default: return GO_REG_BADPAT;
-		}
-	} else {
-		gor->re_nsub = pcre_info (r, NULL, NULL);
-		gor->nosub = (cflags & GO_REG_NOSUB) != 0;
-		return 0;
-	}
-#endif
 	return 0;
 }
 
@@ -167,7 +118,6 @@ int
 go_regexec (const GORegexp *gor, const char *txt,
 	    size_t nmatch, GORegmatch *pmatch, int eflags)
 {
-#ifdef HAVE_G_REGEX_ERROR_STRAY_BACKSLASH
 	int eoptions =
 		((eflags & GO_REG_NOTBOL) ? G_REGEX_MATCH_NOTBOL : 0) |
 		((eflags & GO_REG_NOTEOL) ? G_REGEX_MATCH_NOTEOL : 0);
@@ -196,62 +146,6 @@ go_regexec (const GORegexp *gor, const char *txt,
 		g_match_info_free (match_info);
 
 	return matched ? GO_REG_NOERROR : GO_REG_NOMATCH;
-#else
-	size_t txtlen = strlen (txt);
-	int eoptions =
-		((eflags & GO_REG_NOTBOL) ? PCRE_NOTBOL : 0) |
-		((eflags & GO_REG_NOTEOL) ? PCRE_NOTEOL : 0);
-	int res;
-	int *offsets, *allocated;
-	int offsetcount;
-	if (gor->nosub)
-		nmatch = 0;
-
-	if (nmatch > 0) {
-		/* Paranoia.  */
-		if (nmatch >= G_MAXINT / sizeof (int) / 3)
-			return GO_REG_ESPACE;
-
-		offsetcount = nmatch * 3;
-		offsets = allocated = g_try_new (int, offsetcount);
-		if (!offsets)
-			return GO_REG_ESPACE;
-	} else {
-		offsets = allocated = NULL;
-		offsetcount = 0;
-	}
-
-	res = pcre_exec (gor->ppcre, NULL, txt, txtlen, 0, eoptions,
-			offsets, offsetcount);
-	if (res >= 0) {
-		int i;
-
-		if (res == 0) res = nmatch;
-
-		for (i = 0; i < res; i++) {
-			pmatch[i].rm_so = offsets[i * 2];
-			pmatch[i].rm_eo = offsets[i * 2 + 1];
-		}
-		for (; i < (int)nmatch; i++) {
-			pmatch[i].rm_so = -1;
-			pmatch[i].rm_eo = -1;
-		}
-		g_free (allocated);
-		return GO_REG_NOERROR;
-	}
-
-	g_free (allocated);
-	switch (res) {
-	case PCRE_ERROR_NOMATCH:
-		return GO_REG_NOMATCH;
-	case PCRE_ERROR_BADUTF8:
-	case PCRE_ERROR_BADUTF8_OFFSET:
-		/* POSIX doesn't seem to foresee this kind of error.  */
-		return GO_REG_BADPAT;
-	default:
-		return GO_REG_ESPACE;
-	}
-#endif
 }
 
 /* ------------------------------------------------------------------------- */
diff --git a/libgoffice.pc.in b/libgoffice.pc.in
index 0a0611d..bb9e521 100644
--- a/libgoffice.pc.in
+++ b/libgoffice.pc.in
@@ -6,9 +6,9 @@ includedir= includedir@
 Name: libGOffice
 Description: G Office support library
 Version: @VERSION@
-Requires.private: glib-2.0 gobject-2.0 gio-2.0 libgsf-1 libxml-2.0 gtk+-2.0 cairo pangocairo @EXTRA_DEPS@
+Requires.private: glib-2.0 gobject-2.0 gio-2.0 libgsf-1 libxml-2.0 gtk+-3.0 cairo pangocairo @EXTRA_DEPS@
 Libs: -L${libdir} -lgoffice- GOFFICE_API_VER@
 Libs.private: @EXTRA_LIBS@
 Cflags: -I${includedir}/libgoffice- GOFFICE_API_VER@ @EXTRA_INCLUDES@
 
-PluginDir=${libdir}/goffice/@VERSION@/plugins
+PluginDir=${libdir}/goffice/@GOFFICE_API_VER@/plugins
diff --git a/plugins/plot_barcol/gog-barcol-prefs.c b/plugins/plot_barcol/gog-barcol-prefs.c
index 0df2be2..34075f5 100644
--- a/plugins/plot_barcol/gog-barcol-prefs.c
+++ b/plugins/plot_barcol/gog-barcol-prefs.c
@@ -23,7 +23,6 @@
 #include "gog-barcol.h"
 #include <goffice/gtk/goffice-gtk.h>
 #include <goffice/app/go-plugin.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 GtkWidget *gog_barcol_plot_pref (GogBarColPlot *plot, GOCmdContext *cc);
 
diff --git a/plugins/plot_barcol/gog-barcol.c b/plugins/plot_barcol/gog-barcol.c
index 5f9bca6..a7027b8 100644
--- a/plugins/plot_barcol/gog-barcol.c
+++ b/plugins/plot_barcol/gog-barcol.c
@@ -462,7 +462,7 @@ gog_barcol_view_get_data_at_point (GogPlotView *view, double x, double y, GogSer
 
 			if (i >= lengths[j])
 				continue;
-			
+
 			tmp = vals[j][i];
 			valid = TRUE;
 			if (!gog_axis_map_finite (map, tmp)) {
diff --git a/plugins/plot_barcol/gog-minmax.c b/plugins/plot_barcol/gog-minmax.c
index 4e9c856..a53ff65 100644
--- a/plugins/plot_barcol/gog-minmax.c
+++ b/plugins/plot_barcol/gog-minmax.c
@@ -30,7 +30,6 @@
 #include <goffice/utils/go-persist.h>
 #include <goffice/utils/go-styled-object.h>
 #include <goffice/app/go-plugin.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <glib/gi18n-lib.h>
 #include <gsf/gsf-impl-utils.h>
diff --git a/plugins/plot_distrib/gog-boxplot.c b/plugins/plot_distrib/gog-boxplot.c
index ed64281..287c0cb 100644
--- a/plugins/plot_distrib/gog-boxplot.c
+++ b/plugins/plot_distrib/gog-boxplot.c
@@ -35,7 +35,6 @@
 #include <goffice/utils/go-marker.h>
 #include <goffice/utils/go-path.h>
 #include <goffice/utils/go-persist.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <glib/gi18n-lib.h>
 #include <gsf/gsf-impl-utils.h>
diff --git a/plugins/plot_distrib/gog-histogram.c b/plugins/plot_distrib/gog-histogram.c
index 9a38c82..9ede760 100644
--- a/plugins/plot_distrib/gog-histogram.c
+++ b/plugins/plot_distrib/gog-histogram.c
@@ -253,13 +253,13 @@ gog_histogram_plot_set_property (GObject *obj, guint param_id,
 			/* force axis bounds reevaluation */
 			model->x.minima = model->y.minima = G_MAXDOUBLE;
 			gog_object_request_update (GOG_OBJECT (model));
-		}	
+		}
 		break;
 	case HISTOGRAM_PROP_CUMULATIVE:
 		if (g_value_get_boolean (value) != model->cumulative) {
 			model->cumulative = !model->cumulative;
 			gog_object_request_update (GOG_OBJECT (model));
-		}	
+		}
 		break;
 	case HISTOGRAM_PROP_BEFORE_GRID:
 		GOG_PLOT (obj)->rendering_order = (g_value_get_boolean (value))?
@@ -284,7 +284,7 @@ vertical_changed_cb (GtkToggleButton *btn, GogHistogramPlot *model)
 		gog_object_request_update (GOG_OBJECT (model));
 		/* force axis bounds reevaluation */
 		model->x.minima = model->y.minima = G_MAXDOUBLE;
-	}	
+	}
 }
 
 static void
@@ -293,7 +293,7 @@ cumulative_changed_cb (GtkToggleButton *btn, GogHistogramPlot *model)
 	if (gtk_toggle_button_get_active (btn) != model->cumulative) {
 		model->cumulative = !model->cumulative;
 		gog_object_request_update (GOG_OBJECT (model));
-	}	
+	}
 }
 
 static void
@@ -361,15 +361,15 @@ gog_histogram_plot_class_init (GogPlotClass *gog_plot_klass)
 	gobject_klass->set_property = gog_histogram_plot_set_property;
 
 	g_object_class_install_property (gobject_klass, HISTOGRAM_PROP_VERTICAL,
-		g_param_spec_boolean ("vertical", 
+		g_param_spec_boolean ("vertical",
 			_("Vertical"),
-			_("Draw the histogram vertically or horizontally"), 
+			_("Draw the histogram vertically or horizontally"),
 			TRUE,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
 	g_object_class_install_property (gobject_klass, HISTOGRAM_PROP_CUMULATIVE,
-		g_param_spec_boolean ("cumulative", 
+		g_param_spec_boolean ("cumulative",
 			_("Cumulative"),
-			_("Use cumulated data"), 
+			_("Use cumulated data"),
 			FALSE,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
 	g_object_class_install_property (gobject_klass, HISTOGRAM_PROP_BEFORE_GRID,
@@ -760,35 +760,35 @@ gog_histogram_plot_view_render (GogView *view, GogViewAllocation const *bbox)
 					alloc.x = area->x + 2; /* FIXME: replace 2 by something configurable */
 					alloc.y = area->y + 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_NORTH_WEST, FALSE);
+							        GO_ANCHOR_NORTH_WEST, FALSE);
 					text = (text2)? text2: _("Second values");
 					alloc.y = area->y + area->h - 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_SOUTH_WEST, FALSE);
+							        GO_ANCHOR_SOUTH_WEST, FALSE);
 				} else {
 					alloc.x = area->x + area->w - 2; /* FIXME: replace 2 by something configurable */
 					alloc.y = area->y + area->h - 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_SOUTH_EAST, FALSE);
+							        GO_ANCHOR_SOUTH_EAST, FALSE);
 					text = (text2)? text2: _("Second values");
 					alloc.x = area->x + 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_SOUTH_WEST, FALSE);
+							        GO_ANCHOR_SOUTH_WEST, FALSE);
 				}
 			} else {
 				alloc.x = area->x + area->w - 2; /* FIXME: replace 2 by something configurable */
 				alloc.y = area->y + 2;
 				gog_renderer_draw_text (view->renderer, text, &alloc,
-					                GTK_ANCHOR_NORTH_EAST, FALSE);
+					                GO_ANCHOR_NORTH_EAST, FALSE);
 				text = (text2)? text2: _("Second values");
 				if (model->vertical) {
 					alloc.y = area->y + area->h - 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_SOUTH_EAST, FALSE);
+							        GO_ANCHOR_SOUTH_EAST, FALSE);
 				} else {
 					alloc.x = area->x + 2;
 					gog_renderer_draw_text (view->renderer, text, &alloc,
-							        GTK_ANCHOR_NORTH_WEST, FALSE);
+							        GO_ANCHOR_NORTH_WEST, FALSE);
 				}
 			}
 			g_free (text1);
diff --git a/plugins/plot_distrib/gog-probability-plot.c b/plugins/plot_distrib/gog-probability-plot.c
index 292bb86..1fe44d6 100644
--- a/plugins/plot_distrib/gog-probability-plot.c
+++ b/plugins/plot_distrib/gog-probability-plot.c
@@ -423,7 +423,7 @@ gog_probability_plot_view_render (GogView *view, GogViewAllocation const *bbox)
 
 	for (ptr = view->children ; ptr != NULL ; ptr = ptr->next)
 		gog_view_render	(ptr->data, bbox);
-	
+
 	area = gog_chart_view_get_plot_area (view->parent);
 	chart_map = gog_chart_map_new (chart, area,
 				       GOG_PLOT (model)->axis[GOG_AXIS_X],
diff --git a/plugins/plot_pie/gog-pie-prefs.c b/plugins/plot_pie/gog-pie-prefs.c
index 68dcd71..971bb77 100644
--- a/plugins/plot_pie/gog-pie-prefs.c
+++ b/plugins/plot_pie/gog-pie-prefs.c
@@ -24,7 +24,6 @@
 
 #include <goffice/gtk/goffice-gtk.h>
 #include <goffice/app/go-plugin.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 GtkWidget *gog_pie_series_element_pref   (GogPieSeriesElement *element, GOCmdContext *cc);
 
diff --git a/plugins/plot_pie/gog-pie-series.ui b/plugins/plot_pie/gog-pie-series.ui
index 110b659..f1d6417 100644
--- a/plugins/plot_pie/gog-pie-series.ui
+++ b/plugins/plot_pie/gog-pie-series.ui
@@ -7,7 +7,7 @@
     <property name="step_increment">10</property>
     <property name="page_increment">50</property>
   </object>
-  <object class="GtkVBox" id="gog_pie_series_element_prefs">
+  <object class="GtkBox" id="gog_pie_series_element_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
diff --git a/plugins/plot_pie/gog-pie.c b/plugins/plot_pie/gog-pie.c
index a9d1425..e5bcaee 100644
--- a/plugins/plot_pie/gog-pie.c
+++ b/plugins/plot_pie/gog-pie.c
@@ -910,7 +910,7 @@ gog_pie_view_render (GogView *view, GogViewAllocation const *bbox)
 
 	if (num_series <= 0)
 		return;
-	
+
 	separation_max = .0;
 	outline_width_max = .0;
 	if ((style = go_styled_object_get_style (GO_STYLED_OBJECT (series))))
diff --git a/plugins/plot_radar/gog-radar.c b/plugins/plot_radar/gog-radar.c
index bdfacfb..59a48fa 100644
--- a/plugins/plot_radar/gog-radar.c
+++ b/plugins/plot_radar/gog-radar.c
@@ -983,7 +983,7 @@ gog_rt_view_render (GogView *view, GogViewAllocation const *bbox)
 				if (gog_error_bar_is_visible (polar_series->a_errors)) {
 					GogErrorBar const *bar = polar_series->a_errors;
 					if (gog_error_bar_get_bounds (bar, count, &errmin, &errmax)) {
-						gog_error_bar_render (bar, view->renderer, 
+						gog_error_bar_render (bar, view->renderer,
 								      chart_map,
 								      c_vals[count], r_vals[count],
 								      errmin, errmax,
@@ -1297,7 +1297,7 @@ gog_rt_series_finalize (GObject *obj)
 	GogRTSeries *series = GOG_RT_SERIES (obj);
 
 	if (series->r_errors != NULL) {
-		g_object_unref (series->r_errors); 
+		g_object_unref (series->r_errors);
 		series->r_errors = NULL;
 	}
 
@@ -1347,10 +1347,10 @@ gog_rt_series_class_init (GogStyledObjectClass *gso_klass)
 	obj_klass->populate_editor = gog_rt_series_populate_editor;
 #endif
 	g_object_class_install_property (gobject_klass, RT_SERIES_PROP_RERRORS,
-		g_param_spec_object ("r-errors", 
+		g_param_spec_object ("r-errors",
 			_("Radial error bars"),
 			_("GogErrorBar *"),
-			GOG_TYPE_ERROR_BAR, 
+			GOG_TYPE_ERROR_BAR,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
 
 	series_klass->has_interpolation = TRUE;
@@ -1441,7 +1441,7 @@ gog_polar_series_finalize (GObject *obj)
 	GogPolarSeries *series = GOG_POLAR_SERIES (obj);
 
 	if (series->a_errors != NULL) {
-		g_object_unref (series->a_errors); 
+		g_object_unref (series->a_errors);
 		series->a_errors = NULL;
 	}
 
@@ -1473,10 +1473,10 @@ gog_polar_series_class_init (GogObjectClass *gog_klass)
 	gog_klass->populate_editor = gog_polar_series_populate_editor;
 #endif
 	g_object_class_install_property (gobject_klass, POLAR_SERIES_PROP_AERRORS,
-		g_param_spec_object ("a-errors", 
+		g_param_spec_object ("a-errors",
 			_("Angular error bars"),
 			_("GogErrorBar *"),
-			GOG_TYPE_ERROR_BAR, 
+			GOG_TYPE_ERROR_BAR,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
 }
 
diff --git a/plugins/plot_surface/gog-xyz-surface-prefs.c b/plugins/plot_surface/gog-xyz-surface-prefs.c
index 1ecf9df..220e888 100644
--- a/plugins/plot_surface/gog-xyz-surface-prefs.c
+++ b/plugins/plot_surface/gog-xyz-surface-prefs.c
@@ -23,7 +23,6 @@
 #include "gog-xyz-surface.h"
 #include <goffice/gtk/goffice-gtk.h>
 #include <goffice/app/go-plugin.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <string.h>
 
@@ -116,7 +115,7 @@ gog_xyz_surface_plot_pref (GogXYZPlot *plot, GogDataAllocator *dalloc, GOCmdCont
 		gtk_widget_hide (state->x_entry);
 	w = go_gtk_builder_get_widget (gui, "calc-cols-btn");
 	g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (cb_cols_toggled), state);
-		
+
 	state->y_spin = w = go_gtk_builder_get_widget (gui, "rows_spinner");
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), plot->rows);
 	g_signal_connect (G_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w))),
diff --git a/plugins/plot_surface/gog-xyz-surface-prefs.ui b/plugins/plot_surface/gog-xyz-surface-prefs.ui
index e1d01f1..8b651df 100644
--- a/plugins/plot_surface/gog-xyz-surface-prefs.ui
+++ b/plugins/plot_surface/gog-xyz-surface-prefs.ui
@@ -128,7 +128,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="rows-box">
+      <object class="GtkBox" id="rows-box">
         <property name="visible">True</property>
         <child>
           <object class="GtkLabel" id="rows-nb-lbl">
@@ -167,7 +167,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="cols-box">
+      <object class="GtkBox" id="cols-box">
         <property name="visible">True</property>
         <child>
           <object class="GtkLabel" id="cols-nb-lbl">
diff --git a/plugins/plot_xy/gog-bubble-prefs.c b/plugins/plot_xy/gog-bubble-prefs.c
index 1e5a796..6aac7f7 100644
--- a/plugins/plot_xy/gog-bubble-prefs.c
+++ b/plugins/plot_xy/gog-bubble-prefs.c
@@ -23,7 +23,6 @@
 #include "gog-xy.h"
 #include <goffice/gtk/goffice-gtk.h>
 #include <goffice/app/go-plugin.h>
-#include <goffice/gtk/go-gtk-compat.h>
 
 #include <string.h>
 
diff --git a/plugins/plot_xy/gog-bubble-prefs.ui b/plugins/plot_xy/gog-bubble-prefs.ui
index 16575d9..f5c83c7 100644
--- a/plugins/plot_xy/gog-bubble-prefs.ui
+++ b/plugins/plot_xy/gog-bubble-prefs.ui
@@ -112,7 +112,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkHBox" id="scale_box">
+      <object class="GtkBox" id="scale_box">
         <property name="visible">True</property>
         <property name="spacing">12</property>
         <child>
diff --git a/plugins/plot_xy/gog-xy-dropbar.c b/plugins/plot_xy/gog-xy-dropbar.c
index 2e4bb3b..59b5f08 100644
--- a/plugins/plot_xy/gog-xy-dropbar.c
+++ b/plugins/plot_xy/gog-xy-dropbar.c
@@ -151,7 +151,7 @@ gog_xy_dropbar_populate_editor (GogObject *obj,
 			"toggled",
 			G_CALLBACK (horizontal_cb), obj);
 		w = go_gtk_builder_get_widget (gui, "width-btn");
-		gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), dropbar->width); 
+		gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), dropbar->width);
 		g_signal_connect (G_OBJECT (w),
 			"value_changed",
 			G_CALLBACK (value_changed_cb), obj);
@@ -318,7 +318,7 @@ gog_xy_dropbar_plot_class_init (GObjectClass *gobject_klass)
 			_("Bars width as a percetage of the plot width"),
 			0., 20., 5.,   /* using arbitrarily 20%. as maximum value */
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
-	
+
 	gog_object_klass->type_name	= gog_xy_dropbar_plot_type_name;
 	gog_object_klass->update	= gog_xy_dropbar_plot_update;
 	gog_object_klass->view_type	= gog_xy_dropbar_view_get_type ();
diff --git a/plugins/plot_xy/gog-xy-series-prefs.ui b/plugins/plot_xy/gog-xy-series-prefs.ui
index 465d076..9dd5583 100644
--- a/plugins/plot_xy/gog-xy-series-prefs.ui
+++ b/plugins/plot_xy/gog-xy-series-prefs.ui
@@ -2,7 +2,7 @@
 <interface>
   <!-- interface-requires gtk+ 2.12 -->
   <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkVBox" id="gog_xy_series_prefs">
+  <object class="GtkBox" id="gog_xy_series_prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index 14ba28a..d9d442a 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -955,7 +955,7 @@ gog_xy_view_get_data_at_point (GogPlotView *view, double x, double y, GogSeries
 	x_map = gog_chart_map_get_axis_map (chart_map, 0);
 	y_map = gog_chart_map_get_axis_map (chart_map, 1);
 
-	/* because series and overrides are GSLists, we have to copy the lists and to 
+	/* because series and overrides are GSLists, we have to copy the lists and to
 	 reverse them to get the right point (in case of overlap) */
 	ser = g_slist_reverse (g_slist_copy (model->base.series));
 	for (ptr = ser ; ptr != NULL ; ptr = ptr->next) {
diff --git a/plugins/reg_linear/gog-lin-reg.c b/plugins/reg_linear/gog-lin-reg.c
index e84eb65..b78c97b 100644
--- a/plugins/reg_linear/gog-lin-reg.c
+++ b/plugins/reg_linear/gog-lin-reg.c
@@ -157,7 +157,7 @@ gog_lin_reg_curve_populate_editor (GogRegCurve *reg_curve, gpointer table)
 	g_object_get (G_OBJECT (table), "n-rows", &rows, "n-columns", &columns, NULL);
 	gtk_table_resize (table, rows + 1, columns);
 	w = gtk_check_button_new_with_label (_("Affine"));
-	go_widget_set_tooltip_text (w, _("Uncheck to force zero intercept"));
+	gtk_widget_set_tooltip_text (w, _("Uncheck to force zero intercept"));
 	gtk_widget_show (w);
 	gtk_table_attach (table, w, 0, columns, rows, rows + 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), lin->affine);
diff --git a/plugins/smoothing/gog-exp-smooth.c b/plugins/smoothing/gog-exp-smooth.c
index 03dae59..eeaef81 100644
--- a/plugins/smoothing/gog-exp-smooth.c
+++ b/plugins/smoothing/gog-exp-smooth.c
@@ -62,7 +62,7 @@ gog_exp_smooth_populate_editor (GogObject *obj,
 	GtkWidget *label, *box, *w = go_gtk_builder_get_widget (gui, "steps");
 	GtkTable *table;
 
-	go_widget_set_tooltip_text (w, _("Number of interpolation steps"));
+	gtk_widget_set_tooltip_text (w, _("Number of interpolation steps"));
 	gtk_spin_button_set_range (GTK_SPIN_BUTTON (w), 10, G_MAXINT);
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), es->steps);
 	g_signal_connect (G_OBJECT (w), "value-changed", G_CALLBACK (steps_changed_cb), obj);
@@ -70,7 +70,7 @@ gog_exp_smooth_populate_editor (GogObject *obj,
 	w = GTK_WIDGET (gog_data_allocator_editor (dalloc, set, 0, GOG_DATA_SCALAR));
 	box = gtk_event_box_new ();
 	gtk_container_add (GTK_CONTAINER (box), w);
-	go_widget_set_tooltip_text (box, _("Default period is 10 * (xmax - xmin)/(nvalues - 1)\n"
+	gtk_widget_set_tooltip_text (box, _("Default period is 10 * (xmax - xmin)/(nvalues - 1)\n"
 					"If no value or a negative (or nul) value is provided, the "
 					"default will be used"));
 	gtk_widget_show_all (box);
diff --git a/plugins/smoothing/gog-moving-avg.c b/plugins/smoothing/gog-moving-avg.c
index 6da357f..98e704c 100644
--- a/plugins/smoothing/gog-moving-avg.c
+++ b/plugins/smoothing/gog-moving-avg.c
@@ -101,12 +101,12 @@ gog_moving_avg_populate_editor (GogObject *obj,
 	char	 *path = g_build_filename (dir, "gog-moving-avg.ui", NULL);
 	GtkBuilder *gui = go_gtk_builder_new (path, GETTEXT_PACKAGE, cc);
 	GtkWidget *w = go_gtk_builder_get_widget (gui, "span");
-	go_widget_set_tooltip_text (w, _("Number of values from which to calculate an average"));
+	gtk_widget_set_tooltip_text (w, _("Number of values from which to calculate an average"));
 	gtk_spin_button_set_range (GTK_SPIN_BUTTON (w), 2, G_MAXINT);
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), ma->span);
 	g_signal_connect (G_OBJECT (w), "value-changed", G_CALLBACK (span_changed_cb), obj);
 	w = go_gtk_builder_get_widget (gui, "xavg");
-	go_widget_set_tooltip_text (w, _("Whether to average x values as well or use the last one"));
+	gtk_widget_set_tooltip_text (w, _("Whether to average x values as well or use the last one"));
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), ma->xavg);
 	g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (xavg_toggled_cb), obj);
 	w = go_gtk_builder_get_widget (gui, "mv-avg-prefs");
diff --git a/plugins/smoothing/gog-moving-avg.ui b/plugins/smoothing/gog-moving-avg.ui
index 8aa3db8..1862c57 100644
--- a/plugins/smoothing/gog-moving-avg.ui
+++ b/plugins/smoothing/gog-moving-avg.ui
@@ -8,13 +8,13 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkVBox" id="mv-avg-prefs">
+  <object class="GtkBox" id="mv-avg-prefs">
     <property name="visible">True</property>
     <property name="border_width">12</property>
     <property name="orientation">vertical</property>
     <property name="spacing">6</property>
     <child>
-      <object class="GtkHBox" id="hbox1">
+      <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="spacing">6</property>
         <child>
diff --git a/tests/go-demo.c b/tests/go-demo.c
index 56a7190..1fe564d 100644
--- a/tests/go-demo.c
+++ b/tests/go-demo.c
@@ -117,7 +117,7 @@ setup_page (GtkNotebook *notebook, const gchar *service_id)
 	GOStyle *style;
 	PangoFontDescription *desc;
 
-	child = gtk_vbox_new (FALSE, 0);
+	child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 	gtk_notebook_append_page (notebook, child, gtk_label_new (service_id));
 	/* Create a graph widget and add it to the GtkVBox */
 	w = go_graph_widget_new (NULL);
diff --git a/tests/mf-demo.c b/tests/mf-demo.c
index ab68fbf..c35bc03 100644
--- a/tests/mf-demo.c
+++ b/tests/mf-demo.c
@@ -44,8 +44,8 @@ typedef struct {
 	double y;
 	double curx;
 	double cury;
-	gint curfg; 
-	gint curbg; 
+	gint curfg;
+	gint curbg;
 	gint curfnt;
 	gint curpal;
 	gint curreg;
@@ -54,7 +54,7 @@ typedef struct {
 	guint pfm;
 	Color bkclr;
 	Color txtclr;
-} DC; 
+} DC;
 
 typedef struct {
 	guint type; /* 1 pen, 2 brush, 3 font, 4 region, 5 palette */
@@ -203,9 +203,9 @@ void mr_poly (GsfInput* input, Page* pg, GocCanvas* canvas, int type);
 int find_obj (Page* pg);
 void read_color (GsfInput* input, Color* clr);
 void read_point (GsfInput* input, double* y, double* x);
-void set_anchor (Page* pg, GtkAnchorType* anchor);
+void set_anchor (Page* pg, GOAnchorType* anchor);
 void set_align (GsfInput* input, Page* pg, double* x, double* y);
-void set_text (Page* pg, GocCanvas* canvas, char* txt, int len, GtkAnchorType* anchor, double* x, double* y);
+void set_text (Page* pg, GocCanvas* canvas, char* txt, int len, GOAnchorType* anchor, double* x, double* y);
 char* symbol_to_utf (char* txt);
 char* mtextra_to_utf (char* txt);
 
@@ -222,8 +222,8 @@ init_dc (DC *dc)
 	dc->y = 0;
 	dc->curx = 0;
 	dc->cury = 0;
-	dc->curfg = -1; 
-	dc->curbg = -1; 
+	dc->curfg = -1;
+	dc->curbg = -1;
 	dc->curfnt = -1;
 	dc->curpal = -1;
 	dc->curreg = -1;
@@ -263,7 +263,7 @@ mr_convcoord (double* x, double* y, Page* pg)
 }
 
 void
-set_anchor (Page* pg, GtkAnchorType* anchor)
+set_anchor (Page* pg, GOAnchorType* anchor)
 {
 	DC *dc;
 
@@ -273,39 +273,39 @@ set_anchor (Page* pg, GtkAnchorType* anchor)
 	case 0: /* right */
 		switch(dc->txtalign & 24) {
 			case 0: /* top */
-				*anchor = GTK_ANCHOR_SOUTH_WEST;
+				*anchor = GO_ANCHOR_SOUTH_WEST;
 				break;
 			case 8: /* bottom */
-				*anchor = GTK_ANCHOR_NORTH_WEST;
+				*anchor = GO_ANCHOR_NORTH_WEST;
 				break;
 			case 24: /* baseline */
-				*anchor = GTK_ANCHOR_WEST;
+				*anchor = GO_ANCHOR_WEST;
 				break;
 		}
 		break;
 	case 2: /* left */
 		switch(dc->txtalign & 24) {
 			case 0: /* top */
-				*anchor = GTK_ANCHOR_SOUTH_EAST;
+				*anchor = GO_ANCHOR_SOUTH_EAST;
 				break;
 			case 8: /* bottom */
-				*anchor = GTK_ANCHOR_NORTH_EAST;
+				*anchor = GO_ANCHOR_NORTH_EAST;
 				break;
 			case 24: /* baseline */
-				*anchor = GTK_ANCHOR_EAST;
+				*anchor = GO_ANCHOR_EAST;
 				break;
 		}
 		break;
 	case 6: /* center */
 		switch(dc->txtalign & 24) {
 			case 0: /* top */
-				*anchor = GTK_ANCHOR_SOUTH;
+				*anchor = GO_ANCHOR_SOUTH;
 				break;
 			case 8: /* bottom */
-				*anchor = GTK_ANCHOR_NORTH;
+				*anchor = GO_ANCHOR_NORTH;
 				break;
 			case 24: /* baseline */
-				*anchor = GTK_ANCHOR_CENTER;
+				*anchor = GO_ANCHOR_CENTER;
 				break;
 		}
 	}
@@ -330,7 +330,7 @@ set_align (GsfInput* input, Page* pg, double* x, double* y)
 }
 
 void
-set_text (Page* pg, GocCanvas* canvas, char* txt, int len, GtkAnchorType* anchor, double* x, double* y)
+set_text (Page* pg, GocCanvas* canvas, char* txt, int len, GOAnchorType* anchor, double* x, double* y)
 {
 	GocItem *gocitem;
 	char *utxt;
@@ -351,7 +351,7 @@ set_text (Page* pg, GocCanvas* canvas, char* txt, int len, GtkAnchorType* anchor
 		} else {
 			utxt = g_convert (txt, len, "utf8", font->charset, NULL, NULL, NULL);
 		}
-		
+
 	} else {
 		utxt = g_convert (txt, len, "utf8", "ASCII", NULL, NULL, NULL);
 	}
@@ -400,10 +400,10 @@ find_obj (Page* pg)
 	return i;
 }
 
-typedef void 
+typedef void
 (*Handler) (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas);
 
-Handler mfrec_dump[70] = 
+Handler mfrec_dump[70] =
 {
 	mr0, mr1, mr2, mr3, mr4, mr5, mr6, mr7, mr8, mr9,
 	mr10, mr11, mr12, mr13, mr14, mr15, mr16, mr17, mr18, mr19,
@@ -430,7 +430,7 @@ parse (GsfInput* input, GocCanvas* canvas)
 	double x1, y1, x2, y2, w, h;
 	DC *dc;
 
-	mypg = malloc (sizeof (Page));  
+	mypg = malloc (sizeof (Page));
 	fsize = gsf_input_size (input);
 	data = gsf_input_read (input, 4, NULL);
 	switch (GSF_LE_GET_GUINT32 (data)) {
@@ -477,7 +477,7 @@ parse (GsfInput* input, GocCanvas* canvas)
 				dc->VPx = mypg->h * w / h;
 			}
 			mypg->zoom = dc->VPx / w;
-			mypg->type = 1; 
+			mypg->type = 1;
 			dc->Wx = w;
 			dc->Wy = h;
 		} else {
@@ -485,7 +485,7 @@ parse (GsfInput* input, GocCanvas* canvas)
 		}
 
 		gsf_input_seek (input, offset, G_SEEK_SET);
-		while (offset < fsize - 6) {  // check if it's end of file already
+		while (offset < fsize - 6) {  /* check if it's end of file already */
 			data = gsf_input_read (input, 4, NULL);
 			rsize = GSF_LE_GET_GUINT32 (data);
 			data = gsf_input_read (input, 2, NULL);
@@ -525,7 +525,7 @@ set_font (Page *pg, GocItem *item)
 
 	mfo = g_hash_table_lookup (pg->mfobjs, GINT_TO_POINTER (dc->curfnt));
 	font = mfo->values;
-	// convert font values to PangoAttrList
+	/* convert font values to PangoAttrList */
 	if (font->escape > 0) {
 		rot = (double) (font->escape % 3600) * M_PI / 1800.;
 		goc_item_set (item, "rotation", M_PI * 2 - rot, NULL);
@@ -598,7 +598,7 @@ stroke (Page *pg, GocItem *item)
 		if (3 > (pstyle & 0xF000) >> 12) {
 			style->line.join = capjoin[(pstyle & 0xF000) >> 12];
 		}
-		
+
 		if (pstyle > 5)
 			pstyle = 0;
 		style->line.dash_type = dashes[pstyle];
@@ -658,10 +658,10 @@ fill (Page *pg, GocItem *item)
 void
 mr0 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-//g_print("!EOF ");
+/*	g_print("!EOF ");*/
 }
 
-// -------------- SaveDC ----------------
+/* -------------- SaveDC ---------------- */
 void
 mr1 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
@@ -675,16 +675,16 @@ mr1 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas
 void
 mr2 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("RealizePalette ");
+/*	g_print("RealizePalette ");*/
 }
 
 void
 mr3 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SetPalEntries ");
+/*	g_print("SetPalEntries ");*/
 }
 
-// ------------- CreatePalette ------------
+/* ------------- CreatePalette ------------ */
 void
 mr4 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
@@ -696,7 +696,7 @@ mr4 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas
 	g_hash_table_insert ((*pg).mfobjs, GINT_TO_POINTER (find_obj (pg)), mf);
 }
 
-// ------------- SetBKMode -----------------
+/* ------------- SetBKMode ----------------- */
 void
 mr5 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
@@ -712,23 +712,23 @@ mr5 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas
 void
 mr6 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SetMapMode ");
+/*	g_print("SetMapMode ");*/
 }
 
 void
 mr7 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SetROP2 ");
+/*	g_print("SetROP2 ");*/
 }
 
-// ------------- SetReLabs -------------
+/* ------------- SetReLabs ------------- */
 void
 mr8 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
 	/* FIXME: Exclude, should never be used */
 }
 
-// ----------------- SetPolyfillMode -----------------
+/* ----------------- SetPolyfillMode ----------------- */
 void
 mr9 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
@@ -747,16 +747,16 @@ mr9 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas
 void
 mr10 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SetStrechBLTMode ");
+/*	g_print("SetStrechBLTMode ");*/
 }
 
 void
 mr11 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SetTextCharExtra ");
+/*	g_print("SetTextCharExtra ");*/
 }
 
-// ---------------- RestoreDC -----------------------
+/* ---------------- RestoreDC ----------------------- */
 void
 mr12 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
@@ -775,22 +775,22 @@ mr12 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canva
 void
 mr13 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("InvertRegion ");
+/*	g_print("InvertRegion ");*/
 }
 
 void
 mr14 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("PaintRegion ");
+/*	g_print("PaintRegion ");*/
 }
 
 void
 mr15 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas *canvas)
 {
-  //g_print("SelectClipRegion ");
+/*	g_print("SelectClipRegion ");*/
 }
 
-// -------------------- Select Object -----------------
+/* -------------------- Select Object ----------------- */
 void
 mr16 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -802,7 +802,7 @@ mr16 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	dc = &g_array_index (pg->dcs, DC, pg->curdc);
 	data = gsf_input_read (input, 2, NULL);
 	idx = GSF_LE_GET_GUINT16 (data);
- 
+
 	mf = g_hash_table_lookup (pg->mfobjs, GINT_TO_POINTER (idx));
 	switch (mf->type) {
 	case 1:
@@ -826,7 +826,7 @@ mr16 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek (input, -2, G_SEEK_CUR);
 }
 
-// ---------------- SetTextAlign -----------------------
+/* ---------------- SetTextAlign ----------------------- */
 void
 mr17 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -842,10 +842,10 @@ mr17 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr18 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("ResizePalette ");
+/*	g_print("ResizePalette ");*/
 }
 
-// --------------- DIBCreatePatternBrush --------------
+/* --------------- DIBCreatePatternBrush -------------- */
 void
 mr19 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -861,7 +861,7 @@ mr19 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gint32 rollback = 6 - rsize * 2;
 
 	brush = malloc (sizeof (Brush));
-	brush->style = 3; // DibPattern brush
+	brush->style = 3; /* DibPattern brush */
 	gsf_input_seek(input, 8, G_SEEK_CUR);
 	data = gsf_input_read (input, 4, NULL);
 	w = GSF_LE_GET_GUINT32 (data);
@@ -908,7 +908,7 @@ mr19 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	brush->bdata.width = w;
 	brush->bdata.height = h;
 	brush->bdata.data = gpb;
-	
+
 	mf = malloc (sizeof (MFobj));
 	mf->type = 2;
 	mf->values = brush;
@@ -916,14 +916,14 @@ mr19 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 
 }
 
-//  -------------- SetLayout --------------------
+/* -------------- SetLayout -------------------- */
 void
 mr20 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 
 }
 
-//  -------------- DeleteObject --------------------
+/* -------------- DeleteObject -------------------- */
 void
 mr21 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -936,7 +936,7 @@ mr21 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek(input, -2, G_SEEK_CUR);
 }
 
-//  -------------- CreatePatternBrush --------------------
+/*  -------------- CreatePatternBrush -------------------- */
 void
 mr22 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -948,7 +948,7 @@ mr22 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	g_hash_table_insert ((*pg).mfobjs, GINT_TO_POINTER (find_obj (pg)), mf);
 }
 
-//  -------------- SetBKColor --------------------
+/*  -------------- SetBKColor -------------------- */
 void
 mr23 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -959,7 +959,7 @@ mr23 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek (input, -3, G_SEEK_CUR);
 }
 
-//  -------------- SetTextColor --------------------
+/*  -------------- SetTextColor -------------------- */
 void
 mr24 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -973,10 +973,10 @@ mr24 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr25 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("SetTextJustification ");
+/*	g_print("SetTextJustification ");*/
 }
 
-// ---------------- SetWindowOrg -----------------
+/* ---------------- SetWindowOrg ----------------- */
 void
 mr26 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -987,7 +987,7 @@ mr26 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
-//  ---------------- SetWindowExt -------------------
+/*  ---------------- SetWindowExt ------------------- */
 void
 mr27 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1008,29 +1008,29 @@ mr27 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	}
 }
 
-//  ----------------- SetViewportOrg -------------------
+/*  ----------------- SetViewportOrg ------------------- */
 void
 mr28 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 	DC *dc;
 
 	dc = &g_array_index (pg->dcs, DC, pg->curdc);
-	read_point (input, &dc->VPOy, &dc->VPOx); 
+	read_point (input, &dc->VPOy, &dc->VPOx);
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
-//  ----------------- SetViewportExt --------------------
+/*  ----------------- SetViewportExt -------------------- */
 void
 mr29 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 	DC *dc;
 
 	dc = &g_array_index (pg->dcs, DC, pg->curdc);
-	read_point (input, &dc->VPy, &dc->VPx); 
+	read_point (input, &dc->VPy, &dc->VPx);
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
-// ------------------- OffsetWindowOrg ------------------
+/* ------------------- OffsetWindowOrg ------------------ */
 void
 mr30 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1044,7 +1044,7 @@ mr30 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
-// ------------------- OffsetViewportOrg ----------------
+/* ------------------- OffsetViewportOrg ---------------- */
 void
 mr31 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1058,7 +1058,7 @@ mr31 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
-//  ------------------ LineTo --------------------
+/*  ------------------ LineTo -------------------- */
 void
 mr32 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1077,7 +1077,7 @@ mr32 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	stroke (pg, gocitem);
 }
 
-//  ------------------ MoveTo --------------------
+/*  ------------------ MoveTo -------------------- */
 void
 mr33 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1095,28 +1095,28 @@ mr33 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr34 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("OffsetClipRgn ");
+/*	g_print("OffsetClipRgn ");*/
 }
 
 void
 mr35 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("FillRegion ");
+/*	g_print("FillRegion ");*/
 }
 
 void
 mr36 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("SetMapperFlags ");
+/*	g_print("SetMapperFlags ");*/
 }
 
 void
 mr37 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("SelectPalette ");
+/*	g_print("SelectPalette ");*/
 }
 
-//  ------------------ CreatePenIndirect -------------------
+/*  ------------------ CreatePenIndirect ------------------- */
 void
 mr38 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1142,7 +1142,7 @@ mr38 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 }
 
 
-// ----------------- CreateFontIndirect -------------
+/* ----------------- CreateFontIndirect ------------- */
 void
 mr39 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1241,7 +1241,7 @@ mr39 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	g_hash_table_insert ((*pg).mfobjs, GINT_TO_POINTER (find_obj (pg)), mf);
 }
 
-// ---------------- CreateBrushIndirect ---------------
+/* ---------------- CreateBrushIndirect --------------- */
 void
 mr40 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1255,7 +1255,7 @@ mr40 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	read_color (input, &brush->clr);
 	gsf_input_seek (input, 1, G_SEEK_CUR); /* skip "clr.a" */
 	data = gsf_input_read (input, 2, NULL);
-	brush->hatch = GSF_LE_GET_GUINT16 (data); 
+	brush->hatch = GSF_LE_GET_GUINT16 (data);
 	gsf_input_seek (input, -8, G_SEEK_CUR);
 	mf = malloc (sizeof (MFobj));
 	mf->type = 2;
@@ -1291,14 +1291,14 @@ mr_poly (GsfInput* input, Page* pg, GocCanvas* canvas, int type)
 	gsf_input_seek (input, -len * 4 - 2, G_SEEK_CUR);
 }
 
-//  ---------- Polygon ----------------
+/*  ---------- Polygon ---------------- */
 void
 mr41 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 	mr_poly (input, pg, canvas, 0);
 }
 
-//  ---------- Polyline ----------------
+/*  ---------- Polyline ---------------- */
 void
 mr42 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1308,25 +1308,25 @@ mr42 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr43 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("ScaleWindowExtEx ");
+/*	g_print("ScaleWindowExtEx ");*/
 }
 
 void
 mr44 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("ScaleViewportExt ");
+/*	g_print("ScaleViewportExt ");*/
 }
 
 void
 mr45 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("ExcludeClipRect ");
+/*	g_print("ExcludeClipRect ");*/
 }
 
 void
 mr46 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("IntersectClipRect ");
+/*	g_print("IntersectClipRect ");*/
 }
 
 void
@@ -1367,7 +1367,7 @@ mr_rect (GsfInput* input, Page* pg, GocCanvas* canvas, int type)
 	gsf_input_seek (input, -8, G_SEEK_CUR);
 }
 
-// ----------------- Ellipse ---------------
+/* ----------------- Ellipse --------------- */
 void
 mr47 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1377,10 +1377,10 @@ mr47 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr48 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("FloodFill ");
+/*	g_print("FloodFill ");*/
 }
 
-//  ---------------- Rectangle --------------
+/*  ---------------- Rectangle -------------- */
 void
 mr49 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1390,22 +1390,22 @@ mr49 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr50 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("SetPixel ");
+/*	g_print("SetPixel ");*/
 }
 
 void
 mr51 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("FrameRegion ");
+/*	g_print("FrameRegion ");*/
 }
 
 void
 mr52 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("AnimatePalette ");
+/*	g_print("AnimatePalette ");*/
 }
 
-//---------------- TextOut --------------------
+/*---------------- TextOut -------------------- */
 void
 mr53 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1413,7 +1413,7 @@ mr53 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	char *txt;
 	double x, y;
 	int len, shift = 0;
-	GtkAnchorType anchor = GTK_ANCHOR_NORTH_WEST;
+	GOAnchorType anchor = GO_ANCHOR_NORTH_WEST;
 
 	set_anchor (pg, &anchor);
 	data = gsf_input_read (input, 2, NULL);
@@ -1429,7 +1429,7 @@ mr53 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	set_text (pg, canvas, txt, len, &anchor, &x, &y);
 }
 
-//  ------------ PolyPolygon ------------
+/*  ------------ PolyPolygon ------------ */
 void
 mr54 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1447,7 +1447,7 @@ mr54 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	npoly = GSF_LE_GET_GINT16 (data);
 	curpos = gsf_input_tell (input);
 	array = goc_int_array_new (npoly);
-	
+
 	for (j = 0; j < npoly; j++) {
 		gsf_input_seek (input, curpos + j * 2, G_SEEK_SET);
 		data = gsf_input_read (input, 2, NULL);
@@ -1474,31 +1474,31 @@ mr54 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr55 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("ExtFloodFill ");
+/*	g_print("ExtFloodFill ");*/
 }
 
-//  ---------------- RoundRect ----------------------
+/*  ---------------- RoundRect ---------------------- */
 void
 mr56 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-	mr_rect (input, pg, canvas, 15); 
+	mr_rect (input, pg, canvas, 15);
 	gsf_input_seek (input, -4, G_SEEK_CUR);
 }
 
 void
 mr57 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("PatBLT ");
+/*	g_print("PatBLT ");*/
 }
 
-// ------------------ Escape ------------------------
+/* ------------------ Escape ------------------------ */
 void
 mr58 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 
 }
 
-//------------------ CreateRegion ------------------
+/* ------------------ CreateRegion ------------------ */
 void
 mr59 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1516,7 +1516,7 @@ mr_arc (GsfInput* input, Page* pg, GocCanvas* canvas, int type)
 	Arc *arc;
 	GocItem *gocitem;
 	double a1, a2, xc, yc, rx, ry;
-	
+
 	arc = malloc (sizeof (Arc));
 	read_point (input, &arc->ye, &arc->xe);
 	read_point (input, &arc->ys, &arc->xs);
@@ -1548,21 +1548,21 @@ mr_arc (GsfInput* input, Page* pg, GocCanvas* canvas, int type)
 		fill (pg, gocitem);
 }
 
-//  ---------------- Arc ----------------
+/*  ---------------- Arc ---------------- */
 void
 mr60 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 	mr_arc (input, pg, canvas, 0);
 }
 
-//  ----------------- Pie -----------------
+/*  ----------------- Pie ----------------- */
 void
 mr61 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
 	mr_arc (input, pg, canvas, 2);
 }
 
-//  ---------------- Chord ------------------
+/*  ---------------- Chord ------------------ */
 void
 mr62 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1572,16 +1572,16 @@ mr62 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr63 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("BitBLT ");
+/*	g_print("BitBLT ");*/
 }
 
 void
 mr64 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("DIBBitBLT ");
+/*	g_print("DIBBitBLT ");*/
 }
 
-// ----------------- ExtTextOut ----------------
+/* ----------------- ExtTextOut ---------------- */
 void
 mr65 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1589,7 +1589,7 @@ mr65 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 	char *txt;
 	double x, y;
 	int len, flag;
-	GtkAnchorType anchor = GTK_ANCHOR_SOUTH_WEST;
+	GOAnchorType anchor = GO_ANCHOR_SOUTH_WEST;
 
 	set_anchor (pg, &anchor);
 	set_align (input, pg, &x, &y);
@@ -1606,23 +1606,23 @@ mr65 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canva
 void
 mr66 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("StretchBlt ");
+/*	g_print("StretchBlt ");*/
 }
 
-// ----------------- DIBStretchBlt -----------------------
+/* ----------------- DIBStretchBlt ----------------------- */
 void
 mr67 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-
+/*	g_print("DIBStretchBlt ");*/
 }
 
 void
 mr68 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
-  //g_print("SetDIBtoDEV ");
+/*	g_print("SetDIBtoDEV ");*/
 }
 
-// ---------------- StretchDIB --------------------
+/* ---------------- StretchDIB -------------------- */
 void
 mr69 (GsfInput* input, guint rsize, Page* pg, GHashTable* objs, GocCanvas* canvas)
 {
@@ -1817,7 +1817,7 @@ init_esc (void)
 		0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0025, 0x0026, 0x002A, 0x0100, 0x0102,
 		0x0200, 0x0201, 0x0202, 0x0801, 0x0C01, 0x1000, 0x1001, 0x1002, 0x100E, 0x100F,
 		0x1010, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, 0x1018, 0x1019, 0x101A, 0x11D8};
-		
+
 	escrecords = g_hash_table_new (g_direct_hash, g_direct_equal);
 	for (i = 0; i < 60; i++)
 		g_hash_table_insert (escrecords, GINT_TO_POINTER (escid[i]), GINT_TO_POINTER (escarray[i]));
@@ -1835,7 +1835,7 @@ static void
 my_test (GocCanvas *canvas, GdkEventButton *event, G_GNUC_UNUSED gpointer data)
 {
 	double ppu=1.;
-	
+
 	ppu = goc_canvas_get_pixels_per_unit (canvas);
 	if (1 == event->button) {
 		ppu = ppu / 1.5;
@@ -1874,9 +1874,9 @@ open_file (char const *filename, GtkWidget *nbook)
 		return;
 	}
 
-	canvas =g_object_new (GOC_TYPE_CANVAS, NULL);
+	canvas = g_object_new (GOC_TYPE_CANVAS, NULL);
 	doc = g_object_new (GO_TYPE_DOC, NULL);
-	goc_canvas_set_document (canvas, doc); 
+	goc_canvas_set_document (canvas, doc);
 	g_signal_connect_swapped (canvas, "button-press-event", G_CALLBACK (my_test), canvas);
 
 	window = gtk_scrolled_window_new (NULL, NULL);
@@ -1925,7 +1925,7 @@ on_open (GtkMenuItem *menuitem, GtkWidget *nbook)
 int
 main (int argc, char *argv[])
 {
-	GtkWidget *window, *file_menu, *menu_bar, *file_item, *open_item, *close_item, *quit_item, *box, *nbook;
+	GtkWidget *window, *file_menu, *menu_bar, *file_item, *open_item, *close_item, *quit_item, *grid, *nbook;
 
 	gtk_init (&argc, &argv);
 	gsf_init ();
@@ -1936,9 +1936,11 @@ main (int argc, char *argv[])
 	gtk_window_set_title (GTK_WINDOW (window), "MF demo");
 	g_signal_connect (window, "destroy", gtk_main_quit, NULL);
 
-	box = gtk_vbox_new (FALSE, 0);
+	grid = gtk_grid_new ();
+	g_object_set (G_OBJECT (grid), "orientation", GTK_ORIENTATION_VERTICAL, NULL);
 	menu_bar = gtk_menu_bar_new ();
 	nbook = gtk_notebook_new ();
+	g_object_set (G_OBJECT (nbook), "expand", TRUE, "margin", 2, NULL);
 
 	file_menu = gtk_menu_new();
 	file_item = gtk_menu_item_new_with_label ("File");
@@ -1955,11 +1957,11 @@ main (int argc, char *argv[])
 
 	gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_item), file_menu);
 
-	gtk_menu_bar_append(GTK_MENU_BAR (menu_bar), file_item );
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), file_item );
 
-	gtk_box_pack_start (GTK_BOX (box), menu_bar, FALSE, FALSE, 2);
-	gtk_box_pack_start (GTK_BOX (box), nbook, TRUE, TRUE, 2);
-	gtk_container_add (GTK_CONTAINER (window), box);
+	gtk_container_add (GTK_CONTAINER (grid), menu_bar);
+	gtk_container_add (GTK_CONTAINER (grid), nbook);
+	gtk_container_add (GTK_CONTAINER (window), grid);
 	gtk_widget_show_all (GTK_WIDGET (window));
 
 	if (argc > 1)
diff --git a/tests/pie-demo.c b/tests/pie-demo.c
index fcbdb74..32f2270 100644
--- a/tests/pie-demo.c
+++ b/tests/pie-demo.c
@@ -67,7 +67,7 @@ main (int argc, char *argv[])
 	gtk_window_set_title (GTK_WINDOW (window), "pie demo");
 	g_signal_connect (window, "destroy", gtk_main_quit, NULL);
 
-	box = gtk_vbox_new (FALSE, 0);
+	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 	w = gtk_button_new_from_stock (GTK_STOCK_QUIT);
 	g_signal_connect_swapped (w, "clicked", G_CALLBACK (on_quit), window);
 	gtk_box_pack_end (GTK_BOX (box), w, FALSE, FALSE, 0);
diff --git a/tests/shapes-demo.c b/tests/shapes-demo.c
index 71d0241..2a9bbeb 100644
--- a/tests/shapes-demo.c
+++ b/tests/shapes-demo.c
@@ -19,7 +19,6 @@
  */
 
 #include <gtk/gtk.h>
-#include <goffice/gtk/go-gtk-compat.h>
 #include <goffice/goffice.h>
 
 
@@ -32,9 +31,9 @@ open_file (GocCanvas* canvas, char* filename)
 	FILE	*fd;
 	char	*s;
 	size_t	n = 64;
-	
+
 	s = (char *) malloc (n + 1);
-	
+
 	if (NULL == (fd = fopen (filename, "r"))) {
 		g_print ("The file can't be opened!\n");
 		return;
@@ -76,12 +75,12 @@ my_test (GocCanvas *canvas, GdkEventButton *event, G_GNUC_UNUSED gpointer data)
 	double x,y;
 	GOStyle *style;
 	double ppu=1.;
-	
+
 	g_print ("# %.0f %.0f Button: %d. ", event->x, event->y, event->button);
 
 	if (event->window != gtk_layout_get_bin_window (&canvas->base))
 		return;
-		
+
 	x = (canvas->direction == GOC_DIRECTION_RTL)?
 		canvas->scroll_x1 +  (canvas->width - event->x) / canvas->pixels_per_unit:
 		canvas->scroll_x1 +  event->x / canvas->pixels_per_unit;
@@ -121,7 +120,7 @@ parse_line (GocCanvas *canvas, gchar *entry)
 	int		cmd = -1;
 	GocPoints *points;
 	GocIntArray *array;
-	
+
 	/* check for "comment" */
 	if (g_str_has_prefix (entry, "#"))
 		return;
@@ -320,7 +319,7 @@ parse_line (GocCanvas *canvas, gchar *entry)
 		} else {
 			on_open (canvas);
 		}
-		
+
 		break;
 	default:
 		break;
@@ -336,7 +335,7 @@ enter_callback (GocCanvas* canvas, GtkWidget *entry, G_GNUC_UNUSED gpointer data
 {
 	char *entry_text;
 	const gchar *clean = "";
-			
+
 	entry_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
 	if (0 != gtk_entry_get_text_length (GTK_ENTRY (entry))) {
 		g_print ("%s\n", entry_text);
@@ -349,7 +348,7 @@ enter_callback (GocCanvas* canvas, GtkWidget *entry, G_GNUC_UNUSED gpointer data
 int
 main (int argc, char *argv[])
 {
-	GtkWidget *window, *box, *hbox, *widget;
+	GtkWidget *window, *grid, *widget;
 	GocCanvas *canvas;
 
 
@@ -363,23 +362,23 @@ main (int argc, char *argv[])
 	gtk_window_set_title (GTK_WINDOW (window), "shapes demo");
 	g_signal_connect (window, "destroy", gtk_main_quit, NULL);
 
-	box = gtk_vbox_new (FALSE, 0);
-	hbox = gtk_hbox_new (FALSE, 0);
-	canvas =g_object_new (GOC_TYPE_CANVAS, NULL);
+	grid = gtk_grid_new ();
+	g_object_set (G_OBJECT (grid), "orientation", GTK_ORIENTATION_VERTICAL, NULL);
+	canvas = g_object_new (GOC_TYPE_CANVAS, "expand", TRUE, NULL);
 	g_signal_connect_swapped (canvas, "button-press-event", G_CALLBACK (my_test), canvas);
-	gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(canvas), TRUE, TRUE, 0);
+	gtk_container_add (GTK_CONTAINER (grid), GTK_WIDGET(canvas));
 
-	widget = gtk_hseparator_new ();
-	gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
+	widget = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+	gtk_container_add (GTK_CONTAINER (grid), widget);
 
 
 	widget = gtk_entry_new ();
 	gtk_entry_set_max_length (GTK_ENTRY (widget), 80);
 	g_signal_connect_swapped (G_OBJECT (widget), "activate", G_CALLBACK (enter_callback), canvas);
 
-	gtk_box_pack_end (GTK_BOX (box), widget, FALSE, FALSE, 0);
+	gtk_container_add (GTK_CONTAINER (grid), widget);
 
-	gtk_container_add (GTK_CONTAINER (window), box);
+	gtk_container_add (GTK_CONTAINER (window), grid);
 	gtk_widget_show_all (GTK_WIDGET (window));
 	if (argc > 1)
 		open_file (canvas, *(argv+1));



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