diff --git a/gtk2plot/gtkplotlinear.c b/gtk2plot/gtkplotlinear.c index 7b42b97..b46edf3 100644 --- a/gtk2plot/gtkplotlinear.c +++ b/gtk2plot/gtkplotlinear.c @@ -165,7 +165,7 @@ static void draw(GtkWidget *widget, cairo_t *cr) GtkPlot *plt; GtkAllocation alloc; gint dtt, ft, hg, j, k, lt, st, tf, to, tn, tnn, tx, tz, wd, xa, xl, xr, xr2, xt, xu, xv, xvn, xw, ya, yl, yr, yr2, yu, yv, yvn, yw; - gdouble av, delx, dely, dt, lr, lr2, vv, wv, zv; + gdouble av, delx, dely, dt, lr1, lr2, vv, wv, zv; guint lr3; gchar *str1=NULL; gchar lbl[BFL]; @@ -4183,12 +4183,12 @@ void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl) {(plot->xlab)=g_strdup(xl); (plot->ylab)=g_strdup(yl);} } -void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz) +void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz, GArray *st) { if (plot->xdata) g_array_free((plot->xdata), FALSE); if (plot->ydata) g_array_free((plot->ydata), FALSE); {(plot->xdata)=g_array_ref(xd); (plot->ydata)=g_array_ref(yd);} - gtk_plot_set_indices(GTK_PLOT(plot), nd, sz); + gtk_plot_set_indices(GTK_PLOT(plot), nd, sz, st); } static void gtk_plot_linear_finalise(GtkPlotLinear *plot) diff --git a/gtk2plot/gtkplotlinear.h b/gtk2plot/gtkplotlinear.h index 6f27a53..7173231 100644 --- a/gtk2plot/gtkplotlinear.h +++ b/gtk2plot/gtkplotlinear.h @@ -71,7 +71,7 @@ gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout); gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout); void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl); - void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz); + void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz, GArray *st); GtkWidget *gtk_plot_linear_new(void); G_END_DECLS #endif diff --git a/gtk2plot/gtkplotpolar.c b/gtk2plot/gtkplotpolar.c index a01db89..6e9ff7d 100644 --- a/gtk2plot/gtkplotpolar.c +++ b/gtk2plot/gtkplotpolar.c @@ -1758,10 +1758,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) {vv=g_array_index((plt->rd), gdouble, ft); wv=g_array_index((plt->gr), gdouble, ft); xv=g_array_index((plt->bl), gdouble, ft); yv=g_array_index((plt->al), gdouble, ft);} cairo_set_source_rgba(cr, vv, wv, xv, yv); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -2481,10 +2481,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) {vv=g_array_index((plt->rd), gdouble, ft); wv=g_array_index((plt->gr), gdouble, ft); xv=g_array_index((plt->bl), gdouble, ft); yv=g_array_index((plt->al), gdouble, ft);} cairo_set_source_rgba(cr, vv, wv, xv, yv); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -3290,10 +3290,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) {vv=g_array_index((plt->rd), gdouble, ft); wv=g_array_index((plt->gr), gdouble, ft); xv=g_array_index((plt->bl), gdouble, ft); yv=g_array_index((plt->al), gdouble, ft);} cairo_set_source_rgba(cr, vv, wv, xv, yv); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -4093,10 +4093,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) {vv=g_array_index((plt->rd), gdouble, ft); wv=g_array_index((plt->gr), gdouble, ft); xv=g_array_index((plt->bl), gdouble, ft); yv=g_array_index((plt->al), gdouble, ft);} cairo_set_source_rgba(cr, vv, wv, xv, yv); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -4897,10 +4897,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) {vv=g_array_index((plt->rd), gdouble, ft); wv=g_array_index((plt->gr), gdouble, ft); xv=g_array_index((plt->bl), gdouble, ft); yv=g_array_index((plt->al), gdouble, ft);} cairo_set_source_rgba(cr, vv, wv, xv, yv); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (j=ft+st; jrdata), gdouble, j); @@ -5546,12 +5546,12 @@ void gtk_plot_polar_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl) {(plot->rlab)=g_strdup(rl); (plot->thlab)=g_strdup(tl);} } -void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz) +void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz, GArray *st) { if (plot->rdata) g_array_free((plot->rdata), FALSE); if (plot->thdata) g_array_free((plot->thdata), FALSE); {(plot->rdata)=g_array_ref(rd); (plot->thdata)=g_array_ref(td);} - gtk_plot_set_indices(GTK_PLOT(plot), nd, sz); + gtk_plot_set_indices(GTK_PLOT(plot), nd, sz, st); } static void gtk_plot_polar_finalise(GtkPlotPolar *plot) diff --git a/gtk2plot/gtkplotpolar.h b/gtk2plot/gtkplotpolar.h index c653187..9600a5b 100644 --- a/gtk2plot/gtkplotpolar.h +++ b/gtk2plot/gtkplotpolar.h @@ -74,7 +74,7 @@ gboolean gtk_plot_polar_print_png(GtkWidget *widget, gchar *fout); gboolean gtk_plot_polar_print_svg(GtkWidget *widget, gchar *fout); void gtk_plot_polar_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl); - void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz); + void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz, GArray *st); GtkWidget *gtk_plot_polar_new(void); G_END_DECLS #endif diff --git a/gtk2plot/testplotlinear.c b/gtk2plot/testplotlinear.c index 46f7cbf..10debeb 100644 --- a/gtk2plot/testplotlinear.c +++ b/gtk2plot/testplotlinear.c @@ -512,8 +512,8 @@ void upg(GtkWidget *widget, gpointer data) int main(int argc, char *argv[]) { - AtkObject *atk_widget, *atk_label; - GArray *caa, *cab, *cag, *car, *nx, *sz, *x, *y; + AtkObject *atk_label, *atk_widget; + GArray *caa, *cab, *cag, *car, *nx, *st, *sz, *x, *y; gdouble fll, val; GtkAccelGroup *accel_group=NULL; GtkAdjustment *adj; diff --git a/gtk2plot/testplotpolar.c b/gtk2plot/testplotpolar.c index e8ab018..4fcdbb9 100644 --- a/gtk2plot/testplotpolar.c +++ b/gtk2plot/testplotpolar.c @@ -510,8 +510,8 @@ void upg(GtkWidget *widget, gpointer data) int main(int argc, char *argv[]) { - AtkObject *atk_widget, *atk_label; - GArray *caa, *cab, *cag, *car, *nx, *st, *sz, *x, *y; + AtkObject *atk_label, *atk_widget; + GArray *x, *y, *st, *sz, *nx, *car, *cab, *cag, *caa; gdouble fll, valx, valy; GtkAccelGroup *accel_group=NULL; GtkAdjustment *adj; diff --git a/gtk3plot/gtkplot.h b/gtk3plot/gtkplot.h index 6ab1e39..48122fe 100644 --- a/gtk3plot/gtkplot.h +++ b/gtk3plot/gtkplot.h @@ -49,8 +49,8 @@ }; void gtk_plot_set_font(GtkPlot *plot, PangoFontDescription *lf, PangoFontDescription *af); void gtk_plot_set_colour(GtkPlot *plot, GArray *cl); - void gtk_plot_polar_set_indices(GtkPlot *plot, GArray *nd, GArray *sz, GArray *st); - void gtk_plot_polar_set_index(GtkPlot *plot, GArray *nd); + void gtk_plot_set_indices(GtkPlot *plot, GArray *nd, GArray *sz, GArray *st); + void gtk_plot_set_index(GtkPlot *plot, GArray *nd); GtkWidget *gtk_plot_new(void); G_END_DECLS #endif diff --git a/gtk3plot/gtkplotlinear.c b/gtk3plot/gtkplotlinear.c index c06562a..f97bbe7 100644 --- a/gtk3plot/gtkplotlinear.c +++ b/gtk3plot/gtkplotlinear.c @@ -4172,12 +4172,12 @@ void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl) {(plot->xlab)=g_strdup(xl); (plot->ylab)=g_strdup(yl);} } -void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz) +void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz, GArray *st) { if (plot->xdata) g_array_free((plot->xdata), FALSE); if (plot->ydata) g_array_free((plot->ydata), FALSE); {(plot->xdata)=g_array_ref(xd); (plot->ydata)=g_array_ref(yd);} - gtk_plot_set_indices(GTK_PLOT(plot), nd, sz); + gtk_plot_set_indices(GTK_PLOT(plot), nd, sz, st); } static void gtk_plot_linear_finalise(GtkPlotLinear *plot) diff --git a/gtk3plot/gtkplotlinear.h b/gtk3plot/gtkplotlinear.h index 65d6932..ffa53ca 100644 --- a/gtk3plot/gtkplotlinear.h +++ b/gtk3plot/gtkplotlinear.h @@ -71,7 +71,7 @@ gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout); gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout); void gtk_plot_linear_set_label(GtkPlotLinear *plot, gchar *xl, gchar *yl); - void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz); + void gtk_plot_linear_set_data(GtkPlotLinear *plot, GArray *xd, GArray *yd, GArray *nd, GArray *sz, GArray *st); GtkWidget *gtk_plot_linear_new(void); G_END_DECLS #endif diff --git a/gtk3plot/gtkplotpolar.c b/gtk3plot/gtkplotpolar.c index 469bdcb..2b46b21 100644 --- a/gtk3plot/gtkplotpolar.c +++ b/gtk3plot/gtkplotpolar.c @@ -1755,10 +1755,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) vv=g_array_index((plt->cl), GdkRGBA, ft); cairo_set_source_rgba(cr, (vv.red), (vv.green), (vv.blue), (vv.alpha)); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -2478,10 +2478,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) vv=g_array_index((plt->cl), GdkRGBA, ft); cairo_set_source_rgba(cr, (vv.red), (vv.green), (vv.blue), (vv.alpha)); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -3287,10 +3287,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) vv=g_array_index((plt->cl), GdkRGBA, ft); cairo_set_source_rgba(cr, (vv.red), (vv.green), (vv.blue), (vv.alpha)); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -4090,10 +4090,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) vv=g_array_index((plt->cl), GdkRGBA, ft); cairo_set_source_rgba(cr, (vv.red), (vv.green), (vv.blue), (vv.alpha)); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (ssx=MY_2PI; ssx>-10; ssx-=MY_2PI) { r=g_array_index((plot->rdata), gdouble, ft); @@ -4894,10 +4894,10 @@ static void draw(GtkWidget *widget, cairo_t *cr) vv=g_array_index((plt->cl), GdkRGBA, ft); cairo_set_source_rgba(cr, (vv.red), (vv.green), (vv.blue), (vv.alpha)); ft=g_array_index((plt->ind), gint, k); - if (ft>=(plot->ydata->len)) break; + if (ft>=(plot->rdata->len)) break; st=g_array_index((plt->stride), gint, k); lt=(g_array_index((plt->sizes), gint, k)*st)+ft; - if (lt>(plot->ydata->len)) lt=(plot->ydata->len); + if (lt>(plot->rdata->len)) lt=(plot->rdata->len); for (j=ft; jrdata), gdouble, j); @@ -5533,12 +5533,12 @@ void gtk_plot_polar_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl) {(plot->rlab)=g_strdup(rl); (plot->thlab)=g_strdup(tl);} } -void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz) +void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz, Garray *st) { if (plot->rdata) g_array_free((plot->rdata), FALSE); if (plot->thdata) g_array_free((plot->thdata), FALSE); {(plot->rdata)=g_array_ref(rd); (plot->thdata)=g_array_ref(td);} - gtk_plot_set_indices(GTK_PLOT(plot), nd, sz); + gtk_plot_set_indices(GTK_PLOT(plot), nd, sz, st); } static void gtk_plot_polar_finalise(GtkPlotPolar *plot) diff --git a/gtk3plot/gtkplotpolar.h b/gtk3plot/gtkplotpolar.h index 8815dd3..dbea066 100644 --- a/gtk3plot/gtkplotpolar.h +++ b/gtk3plot/gtkplotpolar.h @@ -74,7 +74,7 @@ gboolean gtk_plot_polar_print_png(GtkWidget *widget, gchar *fout); gboolean gtk_plot_polar_print_svg(GtkWidget *widget, gchar *fout); void gtk_plot_polar_set_label(GtkPlotPolar *plot, gchar *rl, gchar *tl); - void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz); + void gtk_plot_polar_set_data(GtkPlotPolar *plot, GArray *rd, GArray *td, GArray *nd, GArray *sz, GArray *st); GtkWidget *gtk_plot_polar_new(void); G_END_DECLS #endif diff --git a/gtk3plot/testplotpolar.c b/gtk3plot/testplotpolar.c index e780da9..8b394af 100644 --- a/gtk3plot/testplotpolar.c +++ b/gtk3plot/testplotpolar.c @@ -465,13 +465,13 @@ int main(int argc, char *argv[]) AtkObject *atk_label, *atk_widget; GArray *cla, *nx, *st, *sz, *x, *y; GdkRGBA cl; - guint j; gdouble valx, valy; GtkAccelGroup *accel_group=NULL; GtkAdjustment *adj; GtkPlot *pt; GtkPlotPolar *plt; GtkWidget *butt, *grid, *grid2, *label, *mnb, *mni, *mnu, *pane; + guint j; gtk_init(&argc, &argv); window=gtk_window_new(GTK_WINDOW_TOPLEVEL);