T GUI: add a get_range() API function for xy_plot
This commit is contained in:
@@ -54,6 +54,8 @@ void container_set_child_growable(gui *_gui, widget *_this,
|
|||||||
int xy_plot_new_plot(gui *gui, widget *this, int color);
|
int xy_plot_new_plot(gui *gui, widget *this, int color);
|
||||||
void xy_plot_set_range(gui *gui, widget *this,
|
void xy_plot_set_range(gui *gui, widget *this,
|
||||||
float xmin, float xmax, float ymin, float ymax);
|
float xmin, float xmax, float ymin, float ymax);
|
||||||
|
void xy_plot_get_range(gui *gui, widget *this,
|
||||||
|
float *xmin, float *xmax, float *ymin, float *ymax);
|
||||||
void xy_plot_set_points(gui *gui, widget *this,
|
void xy_plot_set_points(gui *gui, widget *this,
|
||||||
int plot, int npoints, float *x, float *y);
|
int plot, int npoints, float *x, float *y);
|
||||||
void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height);
|
void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height);
|
||||||
|
|||||||
@@ -280,6 +280,22 @@ void xy_plot_set_range(gui *_gui, widget *_this,
|
|||||||
gunlock(g);
|
gunlock(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xy_plot_get_range(gui *_gui, widget *_this,
|
||||||
|
float *xmin, float *xmax, float *ymin, float *ymax)
|
||||||
|
{
|
||||||
|
struct gui *g = _gui;
|
||||||
|
struct xy_plot_widget *this = _this;
|
||||||
|
|
||||||
|
glock(g);
|
||||||
|
|
||||||
|
*xmin = this->xmin;
|
||||||
|
*xmax = this->xmax;
|
||||||
|
*ymin = this->ymin;
|
||||||
|
*ymax = this->ymax;
|
||||||
|
|
||||||
|
gunlock(g);
|
||||||
|
}
|
||||||
|
|
||||||
void xy_plot_set_points(gui *_gui, widget *_this, int plot,
|
void xy_plot_set_points(gui *_gui, widget *_this, int plot,
|
||||||
int npoints, float *x, float *y)
|
int npoints, float *x, float *y)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user