#ifndef OUTPUT_CHARTS_SCATTERPLOT_H
#define OUTPUT_CHARTS_SCATTERPLOT_H 1
-#include "output/chart-item.h"
+#include "output/chart.h"
/* Indices for the scatterplot_proto members */
enum
/* A scatterplot. */
struct scatterplot_chart
{
- struct chart_item chart_item;
+ struct chart chart;
struct casereader *data;
- const struct variable *byvar;
- const char *xlabel;
- const char *ylabel;
+ struct variable *byvar;
+ char *xlabel;
+ char *ylabel;
double y_min, y_max;
double x_min, x_max;
};
struct scatterplot_chart *
-scatterplot_create (const struct casereader *,
+scatterplot_create (struct casereader *,
const char *xlabel,
const char *ylabel,
const struct variable *,
const char *label,
double xmin, double xmax, double ymin, double ymax);
\f
-/* This boilerplate for scatterplot_chart, a subclass of chart_item, was
+/* This boilerplate for scatterplot_chart, a subclass of chart, was
autogenerated by mk-class-boilerplate. */
#include <assert.h>
#include "libpspp/cast.h"
-extern const struct chart_item_class scatterplot_chart_class;
+extern const struct chart_class scatterplot_chart_class;
/* Returns true if SUPER is a scatterplot_chart, otherwise false. */
static inline bool
-is_scatterplot_chart (const struct chart_item *super)
+is_scatterplot_chart (const struct chart *super)
{
return super->class == &scatterplot_chart_class;
}
/* Returns SUPER converted to scatterplot_chart. SUPER must be a scatterplot_chart, as
reported by is_scatterplot_chart. */
static inline struct scatterplot_chart *
-to_scatterplot_chart (const struct chart_item *super)
+to_scatterplot_chart (const struct chart *super)
{
assert (is_scatterplot_chart (super));
- return UP_CAST (super, struct scatterplot_chart, chart_item);
+ return UP_CAST (super, struct scatterplot_chart, chart);
}
-/* Returns INSTANCE converted to chart_item. */
-static inline struct chart_item *
+/* Returns INSTANCE converted to chart. */
+static inline struct chart *
scatterplot_chart_super (const struct scatterplot_chart *instance)
{
- return CONST_CAST (struct chart_item *, &instance->chart_item);
+ return CONST_CAST (struct chart *, &instance->chart);
}
/* Increments INSTANCE's reference count and returns INSTANCE. */
static inline struct scatterplot_chart *
scatterplot_chart_ref (const struct scatterplot_chart *instance)
{
- return to_scatterplot_chart (chart_item_ref (&instance->chart_item));
+ return to_scatterplot_chart (chart_ref (&instance->chart));
}
/* Decrements INSTANCE's reference count, then destroys INSTANCE if
static inline void
scatterplot_chart_unref (struct scatterplot_chart *instance)
{
- chart_item_unref (&instance->chart_item);
+ chart_unref (&instance->chart);
}
/* Returns true if INSTANCE's reference count is greater than 1,
static inline bool
scatterplot_chart_is_shared (const struct scatterplot_chart *instance)
{
- return chart_item_is_shared (&instance->chart_item);
+ return chart_is_shared (&instance->chart);
}
static inline void
scatterplot_chart_submit (struct scatterplot_chart *instance)
{
- chart_item_submit (&instance->chart_item);
+ chart_submit (&instance->chart);
}
\f
#endif /* output/charts/scatterplot.h */