|
Line 0
Link Here
|
|
|
1 |
--- src/gnome-utils/gnc-html-graph-gog.c.orig 2008-01-08 02:06:26.000000000 +0100 |
| 2 |
+++ src/gnome-utils/gnc-html-graph-gog.c 2009-05-04 23:45:42.167617782 +0200 |
| 3 |
@@ -46,7 +46,22 @@ |
| 4 |
#ifndef GTKHTML_USES_GTKPRINT |
| 5 |
# include <goffice/graph/gog-renderer-gnome-print.h> |
| 6 |
#endif |
| 7 |
-#include <goffice/graph/gog-style.h> |
| 8 |
+/* everything inside the following #ifndef can be safely removed when gnucash |
| 9 |
+requires libgoffice >= 0.7.5. */ |
| 10 |
+#ifndef GOG_TYPE_GRAPH |
| 11 |
+# define GOG_TYPE_GRAPH GOG_GRAPH_TYPE |
| 12 |
+# define GOG_TYPE_RENDERER GOG_RENDERER_TYPE |
| 13 |
+# define GO_TYPE_PLUGIN_LOADER_MODULE GO_PLUGIN_LOADER_MODULE_TYPE |
| 14 |
+# include <goffice/graph/gog-style.h> |
| 15 |
+# define GOStyle GogStyle |
| 16 |
+# define go_styled_object_get_style gog_styled_object_get_style |
| 17 |
+# define GO_STYLED_OBJECT GOG_STYLED_OBJECT |
| 18 |
+# define GO_STYLE_FILL_PATTERN GOG_FILL_STYLE_PATTERN |
| 19 |
+# define go_style_set_text_angle gog_style_set_text_angle |
| 20 |
+#else |
| 21 |
+# include <goffice/utils/go-style.h> |
| 22 |
+# include <goffice/utils/go-styled-object.h> |
| 23 |
+#endif |
| 24 |
#include <goffice/graph/gog-styled-object.h> |
| 25 |
#include <goffice/graph/gog-plot.h> |
| 26 |
#include <goffice/graph/gog-series.h> |
| 27 |
@@ -98,7 +113,7 @@ |
| 28 |
libgoffice_init(); |
| 29 |
|
| 30 |
/* Initialize plugins manager */ |
| 31 |
- go_plugins_init (NULL, NULL, NULL, NULL, TRUE, GO_PLUGIN_LOADER_MODULE_TYPE); |
| 32 |
+ go_plugins_init( NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE ); |
| 33 |
|
| 34 |
gnc_html_register_object_handler( "gnc-guppi-pie", handle_piechart ); |
| 35 |
gnc_html_register_object_handler( "gnc-guppi-bar", handle_barchart ); |
| 36 |
@@ -189,7 +204,7 @@ |
| 37 |
gog_object_update (GOG_OBJECT (graph)); |
| 38 |
|
| 39 |
#if defined(HAVE_GOFFICE_0_5) |
| 40 |
- renderer = GOG_RENDERER (g_object_new (GOG_RENDERER_TYPE, |
| 41 |
+ renderer = GOG_RENDERER (g_object_new (GOG_TYPE_RENDERER, |
| 42 |
"model", graph, |
| 43 |
NULL)); |
| 44 |
update_status = gog_renderer_update (renderer, eb->width, eb->height); |
| 45 |
@@ -229,7 +244,7 @@ |
| 46 |
GogObject **out_chart, |
| 47 |
GogPlot **out_plot) |
| 48 |
{ |
| 49 |
- *out_graph = g_object_new(GOG_GRAPH_TYPE, NULL); |
| 50 |
+ *out_graph = g_object_new(GOG_TYPE_GRAPH, NULL); |
| 51 |
*out_chart = gog_object_add_by_name(*out_graph, "Chart", NULL); |
| 52 |
*out_plot = gog_plot_new_by_name(plot_type_name); |
| 53 |
if (!*out_plot) |
| 54 |
@@ -401,7 +416,7 @@ |
| 55 |
GogObject *graph, *chart; |
| 56 |
GogPlot *plot; |
| 57 |
GogSeries *series; |
| 58 |
- GogStyle *style; |
| 59 |
+ GOStyle *style; |
| 60 |
GOData *label_data, *slice_data; |
| 61 |
int data_rows, data_cols; |
| 62 |
double *data = NULL; |
| 63 |
@@ -489,8 +504,8 @@ |
| 64 |
gog_series_set_dim (series, 1, slice_data, NULL); |
| 65 |
go_data_emit_changed (GO_DATA (slice_data)); |
| 66 |
|
| 67 |
- style = gog_styled_object_get_style (GOG_STYLED_OBJECT (series)); |
| 68 |
- style->fill.type = GOG_FILL_STYLE_PATTERN; |
| 69 |
+ style = go_styled_object_get_style( GO_STYLED_OBJECT(series) ); |
| 70 |
+ style->fill.type = GO_STYLE_FILL_PATTERN; |
| 71 |
if (gdk_color_parse (col_colors[i], &color)) { |
| 72 |
style->fill.auto_back = FALSE; |
| 73 |
go_pattern_set_solid (&style->fill.pattern, GDK_TO_UINT (color)); |
| 74 |
@@ -503,8 +518,8 @@ |
| 75 |
if (rotate_row_labels) { |
| 76 |
GogObject *object = gog_object_get_child_by_role ( |
| 77 |
chart, gog_object_find_role_by_name (chart, "X-Axis")); |
| 78 |
- style = gog_styled_object_get_style (GOG_STYLED_OBJECT (object)); |
| 79 |
- gog_style_set_text_angle (style, 90.0); |
| 80 |
+ style = go_styled_object_get_style( GO_STYLED_OBJECT(object) ); |
| 81 |
+ go_style_set_text_angle( style, 90.0 ); |
| 82 |
} |
| 83 |
|
| 84 |
set_chart_titles_from_hash (chart, eb); |
| 85 |
@@ -526,7 +541,7 @@ |
| 86 |
GogPlot *plot; |
| 87 |
GogSeries *series; |
| 88 |
GOData *sliceData; |
| 89 |
- GogStyle *style; |
| 90 |
+ GOStyle *style; |
| 91 |
int datasize; |
| 92 |
double *xData, *yData; |
| 93 |
gchar *marker_str, *color_str; |
| 94 |
@@ -556,7 +571,7 @@ |
| 95 |
} |
| 96 |
|
| 97 |
series = gog_plot_new_series( plot ); |
| 98 |
- style = gog_styled_object_get_style(GOG_STYLED_OBJECT(series)); |
| 99 |
+ style = go_styled_object_get_style(GO_STYLED_OBJECT(series)); |
| 100 |
|
| 101 |
sliceData = go_data_vector_val_new( xData, datasize, NULL ); |
| 102 |
gog_series_set_dim( series, 0, sliceData, NULL ); |
| 103 |
@@ -602,15 +617,15 @@ |
| 104 |
go_marker_set_fill_color(style->marker.mark, |
| 105 |
go_marker_get_outline_color(style->marker.mark)); |
| 106 |
} else { |
| 107 |
- GogStyle *chart_style = |
| 108 |
- gog_styled_object_get_style(GOG_STYLED_OBJECT(chart)); |
| 109 |
+ GOStyle *chart_style = |
| 110 |
+ go_styled_object_get_style(GO_STYLED_OBJECT(chart)); |
| 111 |
|
| 112 |
- if (chart_style->fill.type == GOG_FILL_STYLE_PATTERN |
| 113 |
+ if (chart_style->fill.type == GO_STYLE_FILL_PATTERN |
| 114 |
&& chart_style->fill.pattern.pattern == GO_PATTERN_SOLID) { |
| 115 |
style->marker.auto_fill_color = FALSE; |
| 116 |
go_marker_set_fill_color(style->marker.mark, |
| 117 |
chart_style->fill.pattern.back); |
| 118 |
- } else if (chart_style->fill.type == GOG_FILL_STYLE_PATTERN |
| 119 |
+ } else if (chart_style->fill.type == GO_STYLE_FILL_PATTERN |
| 120 |
&& chart_style->fill.pattern.pattern |
| 121 |
== GO_PATTERN_FOREGROUND_SOLID) { |
| 122 |
style->marker.auto_fill_color = FALSE; |
| 123 |
@@ -639,7 +654,7 @@ |
| 124 |
{ |
| 125 |
GogGraph *graph = GOG_GRAPH(g_object_get_data(G_OBJECT(eb), "graph")); |
| 126 |
# ifdef HAVE_GOFFICE_0_5 |
| 127 |
- GogRenderer *rend = g_object_new(GOG_RENDERER_TYPE, "model", graph, NULL); |
| 128 |
+ GogRenderer *rend = g_object_new(GOG_TYPE_RENDERER, "model", graph, NULL); |
| 129 |
# else |
| 130 |
GogRendererCairo *rend = g_object_new(GOG_RENDERER_CAIRO_TYPE, "model", graph, |
| 131 |
"cairo", cr, "is-vector", TRUE, NULL); |