goffice r2068 - in trunk: . goffice goffice/graph goffice/utils plugins/plot_xy



Author: mortenw
Date: Wed Apr 30 23:22:48 2008
New Revision: 2068
URL: http://svn.gnome.org/viewvc/goffice?rev=2068&view=rev

Log:
2008-04-30  Morten Welinder  <terra gnome org>

	* */*.[ch]: Make things compile --without-gtk.  Docs still do not
	work right.



Modified:
   trunk/ChangeLog
   trunk/goffice/goffice.c
   trunk/goffice/graph/gog-object.h
   trunk/goffice/graph/gog-renderer.c
   trunk/goffice/graph/gog-renderer.h
   trunk/goffice/utils/go-image.c
   trunk/plugins/plot_xy/gog-xy.c

Modified: trunk/goffice/goffice.c
==============================================================================
--- trunk/goffice/goffice.c	(original)
+++ trunk/goffice/goffice.c	Wed Apr 30 23:22:48 2008
@@ -107,7 +107,9 @@
 	/* keep trigger happy linkers from leaving things out */
 	plugin_services_init ();
 	gog_plugin_services_init ();
+#ifdef GOFFICE_HAVE_GTK
 	goc_plugin_services_init ();
+#endif
 	(void) GOG_GRAPH_TYPE;
 	(void) GOG_CHART_TYPE;
 	(void) GOG_PLOT_TYPE;
@@ -135,7 +137,9 @@
 {
 	gog_themes_shutdown ();
 	go_fonts_shutdown ();
+#ifdef GOFFICE_HAVE_GTK
 	goc_plugin_services_shutdown ();
+#endif
 	gog_plugin_services_shutdown ();
 	go_currency_date_format_shutdown ();
 	go_number_format_shutdown ();

Modified: trunk/goffice/graph/gog-object.h
==============================================================================
--- trunk/goffice/graph/gog-object.h	(original)
+++ trunk/goffice/graph/gog-object.h	Wed Apr 30 23:22:48 2008
@@ -24,6 +24,9 @@
 #include <goffice/graph/goffice-graph.h>
 #include <goffice/app/goffice-app.h>
 #include <glib-object.h>
+#ifdef GOFFICE_WITH_GTK
+#include <gtk/gtk.h>
+#endif
 
 G_BEGIN_DECLS
 
@@ -41,9 +44,8 @@
 GogEditor	*gog_editor_new 		  (void);
 void 		 gog_editor_free 		  (GogEditor *editor);
 void		 gog_editor_add_page 		  (GogEditor *editor, gpointer widget, char const *label);
-#ifdef GOFFICE_WITH_GTK
-#include <gtk/gtkwidget.h>
 void 		 gog_editor_set_store_page  	  (GogEditor *editor, unsigned *store_page);
+#ifdef GOFFICE_WITH_GTK
 void 		 gog_editor_register_widget 	  (GogEditor *editor, GtkWidget *widget);
 GtkWidget  	*gog_editor_get_registered_widget (GogEditor *editor, char const *name);
 GtkWidget 	*gog_editor_get_notebook 	  (GogEditor *editor);

Modified: trunk/goffice/graph/gog-renderer.c
==============================================================================
--- trunk/goffice/graph/gog-renderer.c	(original)
+++ trunk/goffice/graph/gog-renderer.c	Wed Apr 30 23:22:48 2008
@@ -1323,6 +1323,7 @@
 	if (rend->cairo_surface == NULL)
 		return NULL;
 
+#ifdef GOFFICE_WITH_GTK
 	if (rend->pixbuf == NULL) {
 		int width = cairo_image_surface_get_width (rend->cairo_surface);
 		int height = cairo_image_surface_get_height (rend->cairo_surface);
@@ -1333,6 +1334,7 @@
 							 width, height, rowstride, NULL, NULL);
 		go_cairo_convert_data_to_pixbuf (data, NULL, width, height, rowstride);
 	}
+#endif
 
 	return rend->pixbuf;
 }
@@ -1345,6 +1347,7 @@
 	return rend->cairo_surface;
 }
 
+#ifdef GOFFICE_WITH_GTK
 static gboolean
 _gsf_gdk_pixbuf_save (const gchar *buf,
 		      gsize count,
@@ -1359,6 +1362,7 @@
 
 	return ok;
 }
+#endif
 
 static cairo_status_t
 _cairo_write_func (void *closure,
@@ -1540,13 +1544,15 @@
 			if (pixbuf == NULL)
 				return FALSE;
 			format_info = go_image_get_format_info (format);
+#ifdef GOFFICE_WITH_GTK
 			if (!format_info->alpha_support)
-				output_pixbuf = gdk_pixbuf_composite_color_simple (pixbuf,
-										   gdk_pixbuf_get_width (pixbuf),
-										   gdk_pixbuf_get_height (pixbuf),
-										   GDK_INTERP_NEAREST,
-										   255, 256, 0xffffffff,
-										   0xffffffff);
+				output_pixbuf = gdk_pixbuf_composite_color_simple
+					(pixbuf,
+					 gdk_pixbuf_get_width (pixbuf),
+					 gdk_pixbuf_get_height (pixbuf),
+					 GDK_INTERP_NEAREST,
+					 255, 256, 0xffffffff,
+					 0xffffffff);
 			else
 				output_pixbuf = pixbuf;
 			result = gdk_pixbuf_save_to_callback (output_pixbuf,
@@ -1556,7 +1562,7 @@
 			if (!format_info->alpha_support)
 				g_object_unref (output_pixbuf);
 			return result;
-			break;
+#endif
 	}
 
 	return FALSE;

Modified: trunk/goffice/graph/gog-renderer.h
==============================================================================
--- trunk/goffice/graph/gog-renderer.h	(original)
+++ trunk/goffice/graph/gog-renderer.h	Wed Apr 30 23:22:48 2008
@@ -21,6 +21,7 @@
 #ifndef GOG_RENDERER_H
 #define GOG_RENDERER_H
 
+#include <goffice/goffice-features.h>
 #include <goffice/graph/goffice-graph.h>
 #include <goffice/utils/go-geometry.h>
 #include <goffice/utils/go-image.h>
@@ -30,13 +31,12 @@
 #include <gsf/gsf.h>
 #include <libart_lgpl/libart.h>
 
-#if 1 /* def GOFFICE_WITH_GTK breaks without goffice-config.h included */
+#ifdef GOFFICE_WITH_GTK
 #include <gtk/gtkenums.h>
 #include <goffice/gtk/goffice-gtk.h>
 #include <gdk/gdk.h>
 #else
-/* VILE HACK VILE HACK VILE HACK */
-typedef struct HACK_GdkPixbuf GdkPixbuf;
+typedef struct _GdkPixbuf GdkPixbuf;
 typedef enum
 {
   GTK_ANCHOR_CENTER,
@@ -57,7 +57,6 @@
   GTK_ANCHOR_W		= GTK_ANCHOR_WEST,
   GTK_ANCHOR_E		= GTK_ANCHOR_EAST
 } GtkAnchorType;
-/* VILE HACK VILE HACK VILE HACK */
 #endif
 
 #include <cairo.h>

Modified: trunk/goffice/utils/go-image.c
==============================================================================
--- trunk/goffice/utils/go-image.c	(original)
+++ trunk/goffice/utils/go-image.c	Wed Apr 30 23:22:48 2008
@@ -289,6 +289,8 @@
 	cairo_t *cairo;
 #ifdef GOFFICE_WITH_GTK
 	GdkPixbuf *pixbuf;
+#else
+	void *pixbuf;
 #endif
 };
 
@@ -301,10 +303,10 @@
 #endif
 };
 
-#ifdef GOFFICE_WITH_GTK
 static void
 pixbuf_to_cairo (GOImage *image)
 {
+#ifdef GOFFICE_WITH_GTK
 	unsigned char *src, *dst;
 
 	g_return_if_fail (IS_GO_IMAGE (image) && image->data && image->pixbuf);
@@ -315,8 +317,10 @@
 	g_return_if_fail (gdk_pixbuf_get_rowstride (image->pixbuf) == (int) image->rowstride);
 
 	go_cairo_convert_data_from_pixbuf (dst, src, image->width, image->height, image->rowstride);
+#endif
 }
 
+#ifdef GOFFICE_WITH_GTK
 static void
 cairo_to_pixbuf (GOImage *image)
 {
@@ -426,12 +430,10 @@
 static void
 go_image_finalize (GObject *obj)
 {
-	GOImage *image = GO_IMAGE	(obj);
+	GOImage *image = GO_IMAGE (obj);
 	g_free (image->data);
-#ifdef GOFFICE_WITH_GTK
 	if (image->pixbuf)
 		g_object_unref (image->pixbuf);
-#endif
 	(parent_klass->finalize) (obj);
 }
 

Modified: trunk/plugins/plot_xy/gog-xy.c
==============================================================================
--- trunk/plugins/plot_xy/gog-xy.c	(original)
+++ trunk/plugins/plot_xy/gog-xy.c	Wed Apr 30 23:22:48 2008
@@ -38,6 +38,11 @@
 #include <goffice/utils/go-line.h>
 #include <goffice/app/module-plugin-defs.h>
 
+#ifdef GOFFICE_WITH_GTK
+#include <goffice/gtk/goffice-gtk.h>
+#include <gtk/gtk.h>
+#endif
+
 #include <glib/gi18n-lib.h>
 #include <gsf/gsf-impl-utils.h>
 #include <math.h>
@@ -660,15 +665,12 @@
 }
 
 #ifdef GOFFICE_WITH_GTK
-#include <goffice/gtk/goffice-gtk.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkcombobox.h>
-
 static void
 hide_outliers_toggled_cb (GtkToggleButton *btn, GObject *obj)
 {
 	g_object_set (obj, "hide-outliers", gtk_toggle_button_get_active (btn), NULL);
 }
+#endif
 
 static void 
 gog_xy_color_plot_populate_editor (GogObject *obj,
@@ -676,7 +678,7 @@
 				   GogDataAllocator *dalloc,
 				   GOCmdContext *cc)
 {
-	GtkWidget *w;
+#ifdef GOFFICE_WITH_GTK
 	GladeXML *gui;
 	char const *dir;
 	char *path;
@@ -687,7 +689,7 @@
 	g_free (path);
 
 	if (gui != NULL) {
-		w = glade_xml_get_widget (gui, "hide-outliers");
+		GtkWidget *w = glade_xml_get_widget (gui, "hide-outliers");
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
 				(GOG_XY_COLOR_PLOT (obj))->hide_outliers);
 		g_signal_connect (G_OBJECT (w),
@@ -697,9 +699,9 @@
 		gog_editor_add_page (editor, w, _("Properties"));
 	}
 
+#endif
 	(GOG_OBJECT_CLASS(map_parent_klass)->populate_editor) (obj, editor, dalloc, cc);
 }
-#endif
 
 static void
 gog_xy_color_plot_set_property (GObject *obj, guint param_id,



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