X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fchart-provider.h;h=9becb6f5ed2e200e69474e6059dc8d5bb259ff55;hb=c9a3c45e44c1c03d13d4eb186e3817bc836f75f8;hp=2ff4aafafddbdd6daf7039f1ec34e100debdcbc0;hpb=f8d14d07de8db5ba5aa1377650a69532ff744552;p=pspp-builds.git diff --git a/src/output/chart-provider.h b/src/output/chart-provider.h index 2ff4aafa..9becb6f5 100644 --- a/src/output/chart-provider.h +++ b/src/output/chart-provider.h @@ -17,6 +17,7 @@ #ifndef OUTPUT_CHART_PROVIDER_H #define OUTPUT_CHART_PROVIDER_H 1 +#include #include #include #include @@ -28,23 +29,6 @@ struct chart_colour uint8_t blue; }; -struct chart_class - { - void (*draw) (const struct chart *, plPlotter *); - void (*destroy) (struct chart *); - }; - -struct chart - { - const struct chart_class *class; - int ref_cnt; - }; - -void chart_init (struct chart *, const struct chart_class *); -bool chart_create_file (const char *type, const char *file_name_tmpl, - int number, plPlotterParams *, - char **file_namep, plPlotter **lpp); - /* The geometry of a chart. */ struct chart_geometry { @@ -59,11 +43,14 @@ struct chart_geometry int title_bottom ; + /* Legend. */ int legend_left ; int legend_right ; + const char **dataset; + int n_datasets; - /* Default font size for the plot (if zero, then use plotter default) */ - int font_size; + /* Default font size for the plot. */ + double font_size; struct chart_colour fill_colour; @@ -74,9 +61,29 @@ struct chart_geometry double x_max; double y_min; double y_max; + bool in_path; }; -void chart_geometry_init (plPlotter *, struct chart_geometry *); -void chart_geometry_free (plPlotter *); +struct chart_class + { + void (*draw) (const struct chart *, cairo_t *, struct chart_geometry *); + void (*destroy) (struct chart *); + }; + +struct chart + { + const struct chart_class *class; + int ref_cnt; + }; + +void chart_init (struct chart *, const struct chart_class *); + +void chart_geometry_init (cairo_t *, struct chart_geometry *, + double width, double length); +void chart_geometry_free (cairo_t *, struct chart_geometry *); + +void chart_draw (const struct chart *, cairo_t *, struct chart_geometry *); +char *chart_draw_png (const struct chart *, const char *file_name_template, + int number); #endif /* output/chart-provider.h */