Ticket #26256: gnucash-2.2.9-goffice.patch
File gnucash-2.2.9-goffice.patch, 6.5 KB (added by chris.schwemmer@…, 14 years ago) |
---|
-
src/gnome-utils/gnc-html-graph-gog.c
46 46 #ifndef GTKHTML_USES_GTKPRINT 47 47 # include <goffice/graph/gog-renderer-gnome-print.h> 48 48 #endif 49 #include <goffice/graph/gog-style.h> 49 /* everything inside the following #ifndef can be safely removed when gnucash 50 requires libgoffice >= 0.7.5, the contents of the #else block must stay. */ 51 #ifndef GOG_TYPE_GRAPH 52 # define GOG_TYPE_GRAPH GOG_GRAPH_TYPE 53 # define GO_TYPE_PLUGIN_LOADER_MODULE GO_PLUGIN_LOADER_MODULE_TYPE 54 # define GOG_TYPE_RENDERER GOG_RENDERER_TYPE 55 # include <goffice/graph/gog-style.h> 56 # define GOStyle GogStyle 57 # define go_styled_object_get_style gog_styled_object_get_style 58 # define GO_STYLED_OBJECT GOG_STYLED_OBJECT 59 # define GO_STYLE_FILL_PATTERN GOG_FILL_STYLE_PATTERN 60 # define go_style_set_text_angle gog_style_set_text_angle 61 #else 62 # include <goffice/utils/go-style.h> 63 # include <goffice/utils/go-styled-object.h> 64 #endif 65 #ifndef GO_COLOR_FROM_GDK 66 # define GO_COLOR_FROM_GDK GDK_TO_UINT 67 #endif 50 68 #include <goffice/graph/gog-styled-object.h> 51 69 #include <goffice/graph/gog-plot.h> 52 70 #include <goffice/graph/gog-series.h> … … 98 116 libgoffice_init(); 99 117 100 118 /* Initialize plugins manager */ 101 go_plugins_init (NULL, NULL, NULL, NULL, TRUE, GO_ PLUGIN_LOADER_MODULE_TYPE);119 go_plugins_init (NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE); 102 120 103 121 gnc_html_register_object_handler( "gnc-guppi-pie", handle_piechart ); 104 122 gnc_html_register_object_handler( "gnc-guppi-bar", handle_barchart ); … … 189 207 gog_object_update (GOG_OBJECT (graph)); 190 208 191 209 #if defined(HAVE_GOFFICE_0_5) 192 renderer = GOG_RENDERER (g_object_new (GOG_ RENDERER_TYPE,210 renderer = GOG_RENDERER (g_object_new (GOG_TYPE_RENDERER, 193 211 "model", graph, 194 212 NULL)); 195 213 update_status = gog_renderer_update (renderer, eb->width, eb->height); … … 229 247 GogObject **out_chart, 230 248 GogPlot **out_plot) 231 249 { 232 *out_graph = g_object_new(GOG_ GRAPH_TYPE, NULL);250 *out_graph = g_object_new(GOG_TYPE_GRAPH, NULL); 233 251 *out_chart = gog_object_add_by_name(*out_graph, "Chart", NULL); 234 252 *out_plot = gog_plot_new_by_name(plot_type_name); 235 253 if (!*out_plot) … … 363 381 } 364 382 gog_object_add_by_name(chart, "Legend", NULL); 365 383 366 GOG_STYLED_OBJECT(graph)->style->outline.width = 5; 367 GOG_STYLED_OBJECT(graph)->style->outline.color = RGBA_BLACK; 384 #ifdef GO_COLOR_BLACK 385 GOG_STYLED_OBJECT(graph)->style->line.width = 5; 386 GOG_STYLED_OBJECT(graph)->style->line.color = GO_COLOR_BLACK; 387 #else 388 GO_STYLED_OBJECT(graph)->style->outline.width = 5; 389 GO_STYLED_OBJECT(graph)->style->outline.color = RGBA_BLACK; 390 #endif 368 391 369 392 series = gog_plot_new_series(plot); 370 393 labelData = go_data_vector_str_new((char const * const *)labels, datasize, NULL); … … 401 424 GogObject *graph, *chart; 402 425 GogPlot *plot; 403 426 GogSeries *series; 404 G ogStyle *style;427 GOStyle *style; 405 428 GOData *label_data, *slice_data; 406 429 int data_rows, data_cols; 407 430 double *data = NULL; … … 489 512 gog_series_set_dim (series, 1, slice_data, NULL); 490 513 go_data_emit_changed (GO_DATA (slice_data)); 491 514 492 style = go g_styled_object_get_style (GOG_STYLED_OBJECT (series));493 style->fill.type = GO G_FILL_STYLE_PATTERN;515 style = go_styled_object_get_style (GO_STYLED_OBJECT (series)); 516 style->fill.type = GO_STYLE_FILL_PATTERN; 494 517 if (gdk_color_parse (col_colors[i], &color)) { 495 518 style->fill.auto_back = FALSE; 496 go_pattern_set_solid (&style->fill.pattern, G DK_TO_UINT(color));519 go_pattern_set_solid (&style->fill.pattern, GO_COLOR_FROM_GDK (color)); 497 520 } else { 498 521 g_warning("cannot parse color [%s]", col_colors[i]); 499 522 } … … 503 526 if (rotate_row_labels) { 504 527 GogObject *object = gog_object_get_child_by_role ( 505 528 chart, gog_object_find_role_by_name (chart, "X-Axis")); 506 style = go g_styled_object_get_style (GOG_STYLED_OBJECT (object));507 go g_style_set_text_angle (style, 90.0);529 style = go_styled_object_get_style (GO_STYLED_OBJECT (object)); 530 go_style_set_text_angle (style, 90.0); 508 531 } 509 532 510 533 set_chart_titles_from_hash (chart, eb); … … 526 549 GogPlot *plot; 527 550 GogSeries *series; 528 551 GOData *sliceData; 529 G ogStyle *style;552 GOStyle *style; 530 553 int datasize; 531 554 double *xData, *yData; 532 555 gchar *marker_str, *color_str; … … 556 579 } 557 580 558 581 series = gog_plot_new_series( plot ); 559 style = go g_styled_object_get_style(GOG_STYLED_OBJECT(series));582 style = go_styled_object_get_style(GO_STYLED_OBJECT(series)); 560 583 561 584 sliceData = go_data_vector_val_new( xData, datasize, NULL ); 562 585 gog_series_set_dim( series, 0, sliceData, NULL ); … … 588 611 GdkColor color; 589 612 if (gdk_color_parse(color_str, &color)) { 590 613 style->marker.auto_outline_color = FALSE; 591 go_marker_set_outline_color(style->marker.mark, G DK_TO_UINT(color));614 go_marker_set_outline_color(style->marker.mark, GO_COLOR_FROM_GDK(color)); 592 615 style->line.auto_color = FALSE; 593 style->line.color = G DK_TO_UINT(color);616 style->line.color = GO_COLOR_FROM_GDK(color); 594 617 } else { 595 618 g_warning("cannot parse color [%s]", color_str); 596 619 } … … 602 625 go_marker_set_fill_color(style->marker.mark, 603 626 go_marker_get_outline_color(style->marker.mark)); 604 627 } else { 605 G ogStyle *chart_style =606 go g_styled_object_get_style(GOG_STYLED_OBJECT(chart));628 GOStyle *chart_style = 629 go_styled_object_get_style(GO_STYLED_OBJECT(chart)); 607 630 608 if (chart_style->fill.type == GO G_FILL_STYLE_PATTERN631 if (chart_style->fill.type == GO_STYLE_FILL_PATTERN 609 632 && chart_style->fill.pattern.pattern == GO_PATTERN_SOLID) { 610 633 style->marker.auto_fill_color = FALSE; 611 634 go_marker_set_fill_color(style->marker.mark, 612 635 chart_style->fill.pattern.back); 613 } else if (chart_style->fill.type == GO G_FILL_STYLE_PATTERN636 } else if (chart_style->fill.type == GO_STYLE_FILL_PATTERN 614 637 && chart_style->fill.pattern.pattern 615 638 == GO_PATTERN_FOREGROUND_SOLID) { 616 639 style->marker.auto_fill_color = FALSE; … … 639 662 { 640 663 GogGraph *graph = GOG_GRAPH(g_object_get_data(G_OBJECT(eb), "graph")); 641 664 # ifdef HAVE_GOFFICE_0_5 642 GogRenderer *rend = g_object_new(GOG_ RENDERER_TYPE, "model", graph, NULL);665 GogRenderer *rend = g_object_new(GOG_TYPE_RENDERER, "model", graph, NULL); 643 666 # else 644 667 GogRendererCairo *rend = g_object_new(GOG_RENDERER_CAIRO_TYPE, "model", graph, 645 668 "cairo", cr, "is-vector", TRUE, NULL);