1 module iup.plot;
2 
3 import iup.iup: Ihandle;
4 
5 extern(C) {
6 
7     /* Initialize IupPlot widget class */
8     void IupPlotOpen();
9 
10     /* Create an IupPlot widget instance */
11     Ihandle* IupPlot();
12 
13     /***********************************************/
14     /*           Additional API                    */
15 
16     void IupPlotBegin(Ihandle *ih, int strXdata);
17     void IupPlotAdd(Ihandle *ih, double x, double y);
18     void IupPlotAddStr(Ihandle *ih, const(char) * x, double y);
19     void IupPlotAddSegment(Ihandle *ih, double x, double y);
20     int  IupPlotEnd(Ihandle *ih);
21 
22     int  IupPlotLoadData(Ihandle* ih, const(char) * filename, int strXdata);
23 
24     /* available only when linking with "iupluaplot" */
25     int IupPlotSetFormula(Ihandle* ih, int sample_count, const(char) * formula, const(char) * init);
26 
27     void IupPlotInsert(Ihandle *ih, int ds_index, int sample_index, double x, double y);
28     void IupPlotInsertStr(Ihandle *ih, int ds_index, int sample_index, const(char) * x, double y);
29     void IupPlotInsertSegment(Ihandle *ih, int ds_index, int sample_index, double x, double y);
30 
31     void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const(char) ** x, double* y, int count);
32     void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double *x, double *y, int count);
33 
34     void IupPlotAddSamples(Ihandle* ih, int ds_index, double *x, double *y, int count);
35     void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const(char) ** x, double* y, int count);
36 
37     void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double *x, double *y);
38     void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const(char) * *x, double *y);
39     int  IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index);
40     double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index);
41     void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y);
42     void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const(char) * x, double y);
43     void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected);
44     void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra);
45 
46     void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y);
47     void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y);
48 
49     int  IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index);
50 
51     struct _cdCanvas;
52 
53     void IupPlotPaintTo(Ihandle *ih, _cdCanvas* cnv);
54 
55     /***********************************************/
56 }