diff --git a/configure.in b/configure.in
index 6df81b7..067d781 100644
--- a/configure.in
+++ b/configure.in
@@ -602,6 +602,29 @@ AC_SUBST(EXTRA_LIBS)
 AC_SUBST(EXTRA_INCLUDES)
 AC_SUBST(EXTRA_DEPS)
 
+# GObject Introspection
+have_introspection=false
+PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.4, have_introspection=true, have_introspection=false)
+AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection)
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+TYPELIBDIR=
+if $have_introspection; then
+   G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+   G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+   G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+   GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+   TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+fi
+AC_SUBST(G_IR_SCANNER)
+AC_SUBST(G_IR_COMPILER)
+AC_SUBST(G_IR_GENERATE)
+AC_SUBST(GIRDIR)
+AC_SUBST(TYPELIBDIR)
+
 dnl ******************
 dnl * Config defaults
 dnl ******************
diff --git a/goffice/Makefile.am b/goffice/Makefile.am
index e8ada78..39836b6 100644
--- a/goffice/Makefile.am
+++ b/goffice/Makefile.am
@@ -129,3 +129,85 @@ embedded-stuff.c: $(top_srcdir)/tools/embedder $(embedded_stuff)
 		COMPRESS $(embedded_stuff_compress) \
 		NOCOMPRESS $(embedded_stuff_raw) \
 		>$(abs_builddir)/$@
+
+
+BUILT_GIRSOURCES = \
+	GOffice-@GOFFICE_API_VER@.gir \
+	GoCanvas-@GOFFICE_API_VER@.gir \
+	GoGraph-@GOFFICE_API_VER@.gir
+
+GOffice-@GOFFICE_API_VER@.gir: list_of_sources
+GOffice-@GOFFICE_API_VER@.gir: libgoffice-@GOFFICE_API_VER@.la
+GOffice-@GOFFICE_API_VER@.gir: $(G_IR_SCANNER)
+	$(AM_V_GEN) $(G_IR_SCANNER) -v --namespace GOffice \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --add-include-path=$(srcdir) --add-include-path=. \
+	    --include=GObject-2.0 \
+	    --include=Gio-2.0 \
+	    --include=libxml2-2.0 \
+	    --include=Gtk-3.0 \
+	    --include=Gsf-1 \
+	    --identifier-prefix="GO" \
+	    --symbol-prefix="go" \
+	    --symbol-prefix="libgoffice" \
+	    --library=libgoffice-@GOFFICE_API_VER@.la \
+	    --libtool="$(LIBTOOL)" \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --output $@ \
+	    --pkg libgoffice-@GOFFICE_API_VER@ \
+	    -I$(top_srcdir) \
+	    `cat $(srcdir)/list_of_sources`
+
+GoCanvas-@GOFFICE_API_VER@.gir: list_of_sources
+GoCanvas-@GOFFICE_API_VER@.gir: libgoffice-@GOFFICE_API_VER@.la
+GoCanvas-@GOFFICE_API_VER@.gir: $(G_IR_SCANNER)
+	$(AM_V_GEN) $(G_IR_SCANNER) -v --namespace GoCanvas \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --add-include-path=$(srcdir) --add-include-path=. \
+	    --include=GObject-2.0 \
+	    --include=Gio-2.0 \
+	    --include=libxml2-2.0 \
+	    --include=Gtk-3.0 \
+	    --include=Gsf-1 \
+	    --identifier-prefix="Goc" \
+	    --symbol-prefix="goc" \
+	    --library=libgoffice-@GOFFICE_API_VER@.la \
+	    --libtool="$(LIBTOOL)" \
+	    --output $@ \
+	    --pkg libgoffice-@GOFFICE_API_VER@ \
+	    -I$(top_srcdir) \
+	    `cat $(srcdir)/list_of_sources`
+
+GoGraph-@GOFFICE_API_VER@.gir: list_of_sources
+GoGraph-@GOFFICE_API_VER@.gir: libgoffice-@GOFFICE_API_VER@.la
+GoGraph-@GOFFICE_API_VER@.gir: $(G_IR_SCANNER)
+	$(AM_V_GEN) $(G_IR_SCANNER) -v --namespace GoGraph \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --add-include-path=$(srcdir) --add-include-path=. \
+	    --include=GObject-2.0 \
+	    --include=Gio-2.0 \
+	    --include=libxml2-2.0 \
+	    --include=Gtk-3.0 \
+	    --include=Gsf-1 \
+	    --identifier-prefix="Gog" \
+	    --symbol-prefix="gog" \
+	    --library=libgoffice-@GOFFICE_API_VER@.la \
+	    --libtool="$(LIBTOOL)" \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --output $@ \
+	    --pkg libgoffice-@GOFFICE_API_VER@ \
+	    -I$(top_srcdir) \
+	    `cat $(srcdir)/list_of_sources`
+
+if HAVE_INTROSPECTION
+
+girdir = $(GIRDIR)
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F)
+
+endif # HAVE_INTROSPECTION
diff --git a/goffice/app/go-cmd-context-impl.h b/goffice/app/go-cmd-context-impl.h
index 9c7dd17..70ebc0c 100644
--- a/goffice/app/go-cmd-context-impl.h
+++ b/goffice/app/go-cmd-context-impl.h
@@ -8,17 +8,19 @@
 G_BEGIN_DECLS
 
 typedef struct {
+	void (*error)		(GOCmdContext *gcc, GError *err);
+	void (*error_info)  	(GOCmdContext *gcc, GOErrorInfo *err);
+	void (*error_info_list) (GOCmdContext *gcc, GSList *errs);
+} GOCmdErrorIFace;
+
+typedef struct {
 	GTypeInterface base;
 
 	char *  (*get_password)		(GOCmdContext *gcc,
 					 char const *filename);
 	void    (*set_sensitive)	(GOCmdContext *gcc,
 					 gboolean sensitive);
-	struct {
-		void (*error)		(GOCmdContext *gcc, GError *err);
-		void (*error_info)  	(GOCmdContext *gcc, GOErrorInfo *err);
-		void (*error_info_list) (GOCmdContext *gcc, GSList *errs);
-	} error;
+	GOCmdErrorIFace error;
 
 	void    (*progress_set)		(GOCmdContext *gcc, double val);
 	void    (*progress_message_set)	(GOCmdContext *gcc, gchar const *msg);
diff --git a/goffice/app/go-doc-impl.h b/goffice/app/go-doc-impl.h
index 5fb0798..b8c1774 100644
--- a/goffice/app/go-doc-impl.h
+++ b/goffice/app/go-doc-impl.h
@@ -37,14 +37,16 @@ struct _GODoc {
 	GHashTable	*imagebuf; /* used when loading/saving images */
 };
 
+struct _GOMetaDataIFace {
+	/* Reload doc statistics and update linked values */
+	void (*update)  (GODoc *doc);
+	void (*changed) (GODoc *doc);
+};
+
 typedef struct {
 	GObjectClass	base;
 
-	struct {
-		/* Reload doc statistics and update linked values */
-		void (*update)  (GODoc *doc);
-		void (*changed) (GODoc *doc);
-	} meta_data;
+	struct _GOMetaDataIFace meta_data;
 } GODocClass;
 
 #define GO_DOC_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GO_TYPE_DOC, GODocClass))
diff --git a/goffice/app/go-plugin-loader-module.h b/goffice/app/go-plugin-loader-module.h
index 588aefb..9eace2e 100644
--- a/goffice/app/go-plugin-loader-module.h
+++ b/goffice/app/go-plugin-loader-module.h
@@ -13,14 +13,15 @@ G_BEGIN_DECLS
 #define GO_PLUGIN_LOADER_MODULE_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST ((k), GO_TYPE_PLUGIN_LOADER_MODULE, GOPluginLoaderModuleClass))
 #define GO_IS_PLUGIN_LOADER_MODULE_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GO_TYPE_PLUGIN_LOADER_MODULE))
 
+typedef void (*GOPluginMethod) (GOPlugin *plugin, GOCmdContext *cc);
 typedef struct {
 	GObject	base;
 
 	gchar *module_file_name;
 	GModule *handle;
 
-	void (*plugin_init)	(GOPlugin *plugin, GOCmdContext *cc);
-	void (*plugin_shutdown) (GOPlugin *plugin, GOCmdContext *cc);
+	GOPluginMethod plugin_init;
+	GOPluginMethod plugin_shutdown;
 } GOPluginLoaderModule;
 typedef GObjectClass GOPluginLoaderModuleClass;
 
diff --git a/goffice/graph/gog-axis-line.c b/goffice/graph/gog-axis-line.c
index 5a0b7ec..f19566d 100644
--- a/goffice/graph/gog-axis-line.c
+++ b/goffice/graph/gog-axis-line.c
@@ -419,7 +419,6 @@ cb_position_toggled (GtkWidget *button, AxisBasePrefs *state)
 	GogAxisBase *axis_base = state->axis_base;
 	GogAxisPosition position;
 	char const *widget_name = gtk_buildable_get_name (GTK_BUILDABLE (button));
-	GSList *lines, *axes, *aptr, *lptr;
 
 	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
 		return;
diff --git a/goffice/graph/gog-plot.h b/goffice/graph/gog-plot.h
index 6989d8c..7ac1c41 100644
--- a/goffice/graph/gog-plot.h
+++ b/goffice/graph/gog-plot.h
@@ -26,9 +26,11 @@
 G_BEGIN_DECLS
 
 typedef struct {
-	struct {
-		double minima, maxima;
-	} val, logical;
+	double minima, maxima;
+} GogPlotBound;
+
+typedef struct {
+	GogPlotBound val, logical;
 	gboolean is_discrete;
 	gboolean center_on_ticks;
 	GOFormat *fmt;
diff --git a/goffice/math/go-complex.c b/goffice/math/go-complex.c
index b374d88..620a447 100644
--- a/goffice/math/go-complex.c
+++ b/goffice/math/go-complex.c
@@ -45,7 +45,7 @@
 /* ------------------------------------------------------------------------- */
 
 char *
-SUFFIX(go_complex_to_string) (SUFFIX(go_complex) const *src, char const *reformat,
+SUFFIX(go_complex_to_string) (SUFFIX(GOComplex) const *src, char const *reformat,
 		   char const *imformat, char imunit)
 {
 	char *re_buffer = NULL;
@@ -110,7 +110,7 @@ SUFFIX(is_unit_imaginary) (char const *src, DOUBLE *im, char *imunit)
 }
 
 int
-SUFFIX(go_complex_from_string) (SUFFIX(go_complex) *dst, char const *src, char *imunit)
+SUFFIX(go_complex_from_string) (SUFFIX(GOComplex) *dst, char const *src, char *imunit)
 {
 	DOUBLE x, y;
 	char *end;
@@ -164,7 +164,7 @@ SUFFIX(go_complex_from_string) (SUFFIX(go_complex) *dst, char const *src, char *
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_to_polar) (DOUBLE *mod, DOUBLE *angle, SUFFIX(go_complex) const *src)
+SUFFIX(go_complex_to_polar) (DOUBLE *mod, DOUBLE *angle, SUFFIX(GOComplex) const *src)
 {
 	*mod = SUFFIX(go_complex_mod) (src);
 	*angle = SUFFIX(go_complex_angle) (src);
@@ -173,7 +173,7 @@ SUFFIX(go_complex_to_polar) (DOUBLE *mod, DOUBLE *angle, SUFFIX(go_complex) cons
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_from_polar) (SUFFIX(go_complex) *dst, DOUBLE mod, DOUBLE angle)
+SUFFIX(go_complex_from_polar) (SUFFIX(GOComplex) *dst, DOUBLE mod, DOUBLE angle)
 {
 	SUFFIX(go_complex_init) (dst, mod * SUFFIX(cos) (angle), mod * SUFFIX(sin) (angle));
 }
@@ -181,7 +181,7 @@ SUFFIX(go_complex_from_polar) (SUFFIX(go_complex) *dst, DOUBLE mod, DOUBLE angle
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_mul) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SUFFIX(go_complex) const *b)
+SUFFIX(go_complex_mul) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *a, SUFFIX(GOComplex) const *b)
 {
 	SUFFIX(go_complex_init) (dst,
 		      a->re * b->re - a->im * b->im,
@@ -191,7 +191,7 @@ SUFFIX(go_complex_mul) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SU
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_div) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SUFFIX(go_complex) const *b)
+SUFFIX(go_complex_div) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *a, SUFFIX(GOComplex) const *b)
 {
 	DOUBLE bmod = SUFFIX(go_complex_mod) (b);
 
@@ -215,7 +215,7 @@ SUFFIX(go_complex_div) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SU
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_sqrt) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
+SUFFIX(go_complex_sqrt) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *src)
 {
 	if (SUFFIX(go_complex_real_p) (src)) {
 		if (src->re >= 0)
@@ -231,7 +231,7 @@ SUFFIX(go_complex_sqrt) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
 /* ------------------------------------------------------------------------- */
 
 void
-SUFFIX(go_complex_pow) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SUFFIX(go_complex) const *b)
+SUFFIX(go_complex_pow) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *a, SUFFIX(GOComplex) const *b)
 {
 	if (SUFFIX(go_complex_zero_p) (a) && SUFFIX(go_complex_real_p) (b)) {
 		if (b->re <= 0)
@@ -240,7 +240,7 @@ SUFFIX(go_complex_pow) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SU
 			SUFFIX(go_complex_real) (dst, 0);
 	} else {
 		DOUBLE res_r, res_a1, res_a2, res_a2_pi, r, arg;
-		SUFFIX(go_complex) F;
+		SUFFIX(GOComplex) F;
 
 		SUFFIX(go_complex_to_polar) (&r, &arg, a);
 		res_r = SUFFIX(pow) (r, b->re) * SUFFIX(exp) (-b->im * arg);
@@ -275,7 +275,7 @@ SUFFIX(go_complex_pow) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SU
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_init) (SUFFIX(go_complex) *dst, DOUBLE re, DOUBLE im)
+void SUFFIX(go_complex_init) (SUFFIX(GOComplex) *dst, DOUBLE re, DOUBLE im)
 {
 	dst->re = re;
 	dst->im = im;
@@ -283,13 +283,13 @@ void SUFFIX(go_complex_init) (SUFFIX(go_complex) *dst, DOUBLE re, DOUBLE im)
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_invalid) (SUFFIX(go_complex) *dst)
+void SUFFIX(go_complex_invalid) (SUFFIX(GOComplex) *dst)
 {
 	dst->re = SUFFIX(go_nan);
 	dst->im = SUFFIX(go_nan);
 }
 
-void SUFFIX(go_complex_real) (SUFFIX(go_complex) *dst, DOUBLE re)
+void SUFFIX(go_complex_real) (SUFFIX(GOComplex) *dst, DOUBLE re)
 {
 	dst->re = re;
 	dst->im = 0;
@@ -297,35 +297,35 @@ void SUFFIX(go_complex_real) (SUFFIX(go_complex) *dst, DOUBLE re)
 
 /* ------------------------------------------------------------------------- */
 
-int SUFFIX(go_complex_real_p) (SUFFIX(go_complex) const *src)
+int SUFFIX(go_complex_real_p) (SUFFIX(GOComplex) const *src)
 {
 	return src->im == 0;
 }
 
 /* ------------------------------------------------------------------------- */
 
-int SUFFIX(go_complex_zero_p) (SUFFIX(go_complex) const *src)
+int SUFFIX(go_complex_zero_p) (SUFFIX(GOComplex) const *src)
 {
 	return src->re == 0 && src->im == 0;
 }
 
 /* ------------------------------------------------------------------------- */
 
-int SUFFIX(go_complex_invalid_p) (SUFFIX(go_complex) const *src)
+int SUFFIX(go_complex_invalid_p) (SUFFIX(GOComplex) const *src)
 {
 	return !(SUFFIX(go_finite) (src->re) && SUFFIX(go_finite) (src->im));
 }
 
 /* ------------------------------------------------------------------------- */
 
-DOUBLE SUFFIX(go_complex_mod) (SUFFIX(go_complex) const *src)
+DOUBLE SUFFIX(go_complex_mod) (SUFFIX(GOComplex) const *src)
 {
 	return SUFFIX(hypot) (src->re, src->im);
 }
 
 /* ------------------------------------------------------------------------- */
 
-DOUBLE SUFFIX(go_complex_angle) (SUFFIX(go_complex) const *src)
+DOUBLE SUFFIX(go_complex_angle) (SUFFIX(GOComplex) const *src)
 {
 	return SUFFIX(atan2) (src->im, src->re);
 }
@@ -336,7 +336,7 @@ DOUBLE SUFFIX(go_complex_angle) (SUFFIX(go_complex) const *src)
  * nice round numbers not suffering from rounding errors).
  */
 
-DOUBLE SUFFIX(go_complex_angle_pi) (SUFFIX(go_complex) const *src)
+DOUBLE SUFFIX(go_complex_angle_pi) (SUFFIX(GOComplex) const *src)
 {
 	if (src->im == 0)
 		return (src->re >= 0 ? 0 : -1);
@@ -352,14 +352,14 @@ DOUBLE SUFFIX(go_complex_angle_pi) (SUFFIX(go_complex) const *src)
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_conj) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_conj) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *src)
 {
 	SUFFIX(go_complex_init) (dst, src->re, -src->im);
 }
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_scale_real) (SUFFIX(go_complex) *dst, DOUBLE f)
+void SUFFIX(go_complex_scale_real) (SUFFIX(GOComplex) *dst, DOUBLE f)
 {
 	dst->re *= f;
 	dst->im *= f;
@@ -367,21 +367,21 @@ void SUFFIX(go_complex_scale_real) (SUFFIX(go_complex) *dst, DOUBLE f)
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_add) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SUFFIX(go_complex) const *b)
+void SUFFIX(go_complex_add) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *a, SUFFIX(GOComplex) const *b)
 {
 	SUFFIX(go_complex_init) (dst, a->re + b->re, a->im + b->im);
 }
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_sub) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *a, SUFFIX(go_complex) const *b)
+void SUFFIX(go_complex_sub) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *a, SUFFIX(GOComplex) const *b)
 {
 	SUFFIX(go_complex_init) (dst, a->re - b->re, a->im - b->im);
 }
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_exp) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_exp) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *src)
 {
 	SUFFIX(go_complex_init) (dst,
 		SUFFIX(exp) (src->re) * SUFFIX(cos) (src->im),
@@ -390,7 +390,7 @@ void SUFFIX(go_complex_exp) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_ln) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_ln) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *src)
 {
 	SUFFIX(go_complex_init) (dst,
 		SUFFIX(log) (SUFFIX(go_complex_mod) (src)),
@@ -399,7 +399,7 @@ void SUFFIX(go_complex_ln) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *s
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_sin) ( SUFFIX(go_complex) *dst,  SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_sin) ( SUFFIX(GOComplex) *dst,  SUFFIX(GOComplex) const *src)
 {
 	SUFFIX(go_complex_init) (dst,
 		SUFFIX(sin) (src->re) * SUFFIX(cosh) (src->im),
@@ -408,7 +408,7 @@ void SUFFIX(go_complex_sin) ( SUFFIX(go_complex) *dst,  SUFFIX(go_complex) const
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_cos) (SUFFIX(go_complex) *dst,  SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_cos) (SUFFIX(GOComplex) *dst,  SUFFIX(GOComplex) const *src)
 {
 	SUFFIX(go_complex_init) (dst,
 		SUFFIX(cos) (src->re) * SUFFIX(cosh) (src->im),
@@ -417,9 +417,9 @@ void SUFFIX(go_complex_cos) (SUFFIX(go_complex) *dst,  SUFFIX(go_complex) const
 
 /* ------------------------------------------------------------------------- */
 
-void SUFFIX(go_complex_tan) (SUFFIX(go_complex) *dst, SUFFIX(go_complex) const *src)
+void SUFFIX(go_complex_tan) (SUFFIX(GOComplex) *dst, SUFFIX(GOComplex) const *src)
 {
-	SUFFIX(go_complex) s, c;
+	SUFFIX(GOComplex) s, c;
 
 	SUFFIX(go_complex_sin) (&s, src);
 	SUFFIX(go_complex_cos) (&c, src);
diff --git a/goffice/math/go-complex.h b/goffice/math/go-complex.h
index cf0813e..15d3a18 100644
--- a/goffice/math/go-complex.h
+++ b/goffice/math/go-complex.h
@@ -7,82 +7,86 @@ G_BEGIN_DECLS
 
 typedef struct {
 	double re, im;
-} go_complex;
+} GOComplex;
+
+#define go_complex GOComplex
 
 #ifdef GOFFICE_WITH_LONG_DOUBLE
 typedef struct {
 	long double re, im;
-} go_complexl;
+} GOComplexl;
+
+#define go_complexl GOComplexl
 #endif
 
 #include "go-math.h"
 
 /* ------------------------------------------------------------------------- */
 
-char *go_complex_to_string (go_complex const *src, char const *reformat,
+char *go_complex_to_string (GOComplex const *src, char const *reformat,
 			 char const *imformat, char imunit);
 
-int go_complex_from_string (go_complex *dst, char const *src, char *imunit);
-
-void go_complex_to_polar (double *mod, double *angle, go_complex const *src);
-void go_complex_from_polar (go_complex *dst, double mod, double angle);
-void go_complex_mul  (go_complex *dst, go_complex const *a, go_complex const *b);
-void go_complex_div  (go_complex *dst, go_complex const *a, go_complex const *b);
-void go_complex_pow  (go_complex *dst, go_complex const *a, go_complex const *b);
-void go_complex_sqrt (go_complex *dst, go_complex const *src);
-void go_complex_init (go_complex *dst, double re, double im);
-void go_complex_invalid (go_complex *dst);
-void go_complex_real (go_complex *dst, double re);
-int go_complex_real_p (go_complex const *src);
-int go_complex_zero_p (go_complex const *src);
-int go_complex_invalid_p (go_complex const *src);
-double go_complex_mod (go_complex const *src);
-double go_complex_angle (go_complex const *src);
-double go_complex_angle_pi (go_complex const *src);
-void go_complex_conj (go_complex *dst, go_complex const *src);
-void go_complex_scale_real (go_complex *dst, double f);
-void go_complex_add (go_complex *dst, go_complex const *a, go_complex const *b);
-void go_complex_sub (go_complex *dst, go_complex const *a, go_complex const *b);
-void go_complex_exp (go_complex *dst, go_complex const *src);
-void go_complex_ln (go_complex *dst, go_complex const *src);
-void go_complex_sin (go_complex *dst, go_complex const *src);
-void go_complex_cos (go_complex *dst, go_complex const *src);
-void go_complex_tan (go_complex *dst, go_complex const *src);
+int go_complex_from_string (GOComplex *dst, char const *src, char *imunit);
+
+void go_complex_to_polar (double *mod, double *angle, GOComplex const *src);
+void go_complex_from_polar (GOComplex *dst, double mod, double angle);
+void go_complex_mul  (GOComplex *dst, GOComplex const *a, GOComplex const *b);
+void go_complex_div  (GOComplex *dst, GOComplex const *a, GOComplex const *b);
+void go_complex_pow  (GOComplex *dst, GOComplex const *a, GOComplex const *b);
+void go_complex_sqrt (GOComplex *dst, GOComplex const *src);
+void go_complex_init (GOComplex *dst, double re, double im);
+void go_complex_invalid (GOComplex *dst);
+void go_complex_real (GOComplex *dst, double re);
+int go_complex_real_p (GOComplex const *src);
+int go_complex_zero_p (GOComplex const *src);
+int go_complex_invalid_p (GOComplex const *src);
+double go_complex_mod (GOComplex const *src);
+double go_complex_angle (GOComplex const *src);
+double go_complex_angle_pi (GOComplex const *src);
+void go_complex_conj (GOComplex *dst, GOComplex const *src);
+void go_complex_scale_real (GOComplex *dst, double f);
+void go_complex_add (GOComplex *dst, GOComplex const *a, GOComplex const *b);
+void go_complex_sub (GOComplex *dst, GOComplex const *a, GOComplex const *b);
+void go_complex_exp (GOComplex *dst, GOComplex const *src);
+void go_complex_ln (GOComplex *dst, GOComplex const *src);
+void go_complex_sin (GOComplex *dst, GOComplex const *src);
+void go_complex_cos (GOComplex *dst, GOComplex const *src);
+void go_complex_tan (GOComplex *dst, GOComplex const *src);
 
 /* ------------------------------------------------------------------------- */
 /* long double version                                                       */
 
 #ifdef GOFFICE_WITH_LONG_DOUBLE
 
-char *go_complex_to_stringl (go_complexl const *src, char const *reformat,
+char *go_complex_to_stringl (GOComplexl const *src, char const *reformat,
 			 char const *imformat, char imunit);
 
-int go_complex_from_stringl (go_complexl *dst, char const *src, char *imunit);
-
-void go_complex_to_polarl (long double *mod, long double *angle, go_complexl const *src);
-void go_complex_from_polarl (go_complexl *dst, long double mod, long double angle);
-void go_complex_mull  (go_complexl *dst, go_complexl const *a, go_complexl const *b);
-void go_complex_divl  (go_complexl *dst, go_complexl const *a, go_complexl const *b);
-void go_complex_powl  (go_complexl *dst, go_complexl const *a, go_complexl const *b);
-void go_complex_sqrtl (go_complexl *dst, go_complexl const *src);
-void go_complex_initl (go_complexl *dst, long double re, long double im);
-void go_complex_invalidl (go_complexl *dst);
-void go_complex_reall (go_complexl *dst, long double re);
-int go_complex_real_pl (go_complexl const *src);
-int go_complex_zero_pl (go_complexl const *src);
-int go_complex_invalid_pl (go_complexl const *src);
-long double go_complex_modl (go_complexl const *src);
-long double go_complex_anglel (go_complexl const *src);
-long double go_complex_angle_pil (go_complexl const *src);
-void go_complex_conjl (go_complexl *dst, go_complexl const *src);
-void go_complex_scale_reall (go_complexl *dst, long double f);
-void go_complex_addl (go_complexl *dst, go_complexl const *a, go_complexl const *b);
-void go_complex_subl (go_complexl *dst, go_complexl const *a, go_complexl const *b);
-void go_complex_expl (go_complexl *dst, go_complexl const *src);
-void go_complex_lnl (go_complexl *dst, go_complexl const *src);
-void go_complex_sinl (go_complexl *dst, go_complexl const *src);
-void go_complex_cosl (go_complexl *dst, go_complexl const *src);
-void go_complex_tanl (go_complexl *dst, go_complexl const *src);
+int go_complex_from_stringl (GOComplexl *dst, char const *src, char *imunit);
+
+void go_complex_to_polarl (long double *mod, long double *angle, GOComplexl const *src);
+void go_complex_from_polarl (GOComplexl *dst, long double mod, long double angle);
+void go_complex_mull  (GOComplexl *dst, GOComplexl const *a, GOComplexl const *b);
+void go_complex_divl  (GOComplexl *dst, GOComplexl const *a, GOComplexl const *b);
+void go_complex_powl  (GOComplexl *dst, GOComplexl const *a, GOComplexl const *b);
+void go_complex_sqrtl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_initl (GOComplexl *dst, long double re, long double im);
+void go_complex_invalidl (GOComplexl *dst);
+void go_complex_reall (GOComplexl *dst, long double re);
+int go_complex_real_pl (GOComplexl const *src);
+int go_complex_zero_pl (GOComplexl const *src);
+int go_complex_invalid_pl (GOComplexl const *src);
+long double go_complex_modl (GOComplexl const *src);
+long double go_complex_anglel (GOComplexl const *src);
+long double go_complex_angle_pil (GOComplexl const *src);
+void go_complex_conjl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_scale_reall (GOComplexl *dst, long double f);
+void go_complex_addl (GOComplexl *dst, GOComplexl const *a, GOComplexl const *b);
+void go_complex_subl (GOComplexl *dst, GOComplexl const *a, GOComplexl const *b);
+void go_complex_expl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_lnl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_sinl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_cosl (GOComplexl *dst, GOComplexl const *src);
+void go_complex_tanl (GOComplexl *dst, GOComplexl const *src);
 
 
 #endif	/* GOFFICE_WITH_LONG_DOUBLE */
diff --git a/goffice/utils/go-style.h b/goffice/utils/go-style.h
index 17e9347..8f7de96 100644
--- a/goffice/utils/go-style.h
+++ b/goffice/utils/go-style.h
@@ -77,6 +77,28 @@ typedef struct {
 } GOStyleLine;
 
 typedef struct {
+	GOGradientDirection dir;
+	double brightness; /* < 0 => 2 color */
+} GOStyleGradient;
+
+typedef struct {
+	GOImageType	 type;
+	GOImage	 *image;
+} GOStyleImage;
+
+typedef struct {
+	GOStyleFill	type;
+	gboolean	auto_type;
+	gboolean	auto_fore, auto_back;	/* share between pattern and gradient */
+	gboolean	invert_if_negative;	/* placeholder for XL */
+
+	/* This could all be a union but why bother ? */
+	GOPattern pattern;
+	GOStyleGradient gradient;
+	GOStyleImage image;
+} GOStyleArea;
+
+typedef struct {
 	GOMarker *mark;
 	gboolean auto_shape;
 	gboolean auto_outline_color;
@@ -90,23 +112,7 @@ struct _GOStyle {
 	GOStyleFlag	disable_theming;
 
 	GOStyleLine	line;
-	struct {
-		GOStyleFill	type;
-		gboolean	auto_type;
-		gboolean	auto_fore, auto_back;	/* share between pattern and gradient */
-		gboolean	invert_if_negative;	/* placeholder for XL */
-
-		/* This could all be a union but why bother ? */
-		GOPattern pattern;
-		struct {
-			GOGradientDirection dir;
-			double brightness; /* < 0 => 2 color */
-		} gradient;
-		struct {
-			GOImageType	 type;
-			GOImage	 *image;
-		} image;
-	} fill;
+	GOStyleArea fill;
 	GOStyleMark marker;
 	struct {
 		GOColor		 color;
