77void show_curve (GtkDrawingArea * area, cairo_t * cr,
int width,
int height, gpointer curve)
86 pid = ((
tint *)curve) -> a;
87 rid = ((
tint *)curve) -> b;
88 cid = ((
tint *)curve) -> c;
90 cairo_surface_t * surface = NULL;
93 where = this_curve -> format;
95 this_curve -> format = 0;
103 this_curve -> wsize[0] = width;
104 this_curve -> wsize[1] = height;
108 resol[j] = this_curve -> wsize[j];
109 if (this_curve -> curve_edit)
111 if (this_curve -> curve_edit ->
xyp[j] != NULL)
update_entry_int (GTK_ENTRY(this_curve -> curve_edit ->
xyp[j]), this_curve -> wsize[j]);
121 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
resol[0],
resol[1]);
137 cr = cairo_create (surface);
140 cairo_set_source_rgba (cr, this_curve -> backcolor.red,
141 this_curve -> backcolor.green,
142 this_curve -> backcolor.blue, alp);
144 cairo_set_source_rgba (cr, this_curve -> backcolor.red,
145 this_curve -> backcolor.green,
146 this_curve -> backcolor.blue, 1.0);
149 layout = pango_cairo_create_layout (cr);
161 this_curve ->
majt[j] =
scale (this_curve -> axmax[j] - this_curve -> axmin[j]);
162 this_curve -> mint[j] = 2;
165 cxy[j] = this_curve -> axmin[j];
167 xmax = this_curve -> axmax[0] -
cxy[0];
168 ymax = this_curve -> axmax[1] -
cxy[1];
175 if (this_curve -> curve_edit)
177 if (this_curve -> curve_edit ->
axischoice != NULL)
183 update_entry_int (GTK_ENTRY(this_curve -> curve_edit ->
nmi[j]), this_curve -> mint[j] - 1);
193 CurveExtra * ctmp = this_curve -> extrac -> last;
194 for ( j=0 ; j < this_curve -> extrac -> extras + 1; j++ )
196 if (this_curve -> draw_id == j)
198 if (this_curve -> bshift && this_curve ->
layout -> aspect && this_curve -> extrac -> extras) i ++;
199 k = (this_curve ->
layout -> aspect) ? i : 0;
205 this_curve ->
layout -> datacolor,
206 this_curve ->
scale[0],
207 this_curve ->
scale[1],
208 this_curve ->
layout -> aspect,
209 this_curve ->
layout -> dash,
210 this_curve ->
layout -> thickness,
211 this_curve ->
layout -> glyph,
212 this_curve ->
layout -> gsize,
213 this_curve ->
layout -> gfreq,
214 this_curve ->
layout -> hwidth,
215 this_curve ->
layout -> hopac,
216 this_curve ->
layout -> hpos,
217 this_curve -> extrac -> extras,
222 if (this_curve -> bshift && ctmp ->
layout -> aspect) i++;
223 k = (ctmp ->
layout -> aspect) ? i : 0;
228 get_project_by_id(ctmp ->
id.a) -> analysis[ctmp ->
id.b] -> curves[ctmp ->
id.c] -> ndata,
229 ctmp ->
layout -> datacolor,
230 this_curve ->
scale[0],
231 this_curve ->
scale[1],
234 ctmp ->
layout -> thickness,
241 this_curve -> extrac -> extras,
243 if (ctmp -> prev != NULL) ctmp = ctmp -> prev;
247 if (this_curve -> show_axis[1])
249 if (this_curve -> axmin[0] < 0.0 && this_curve -> axmax[0] > 0.0)
251 cairo_set_line_width (cr, 1.0);
253 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
260 if (this_curve -> show_axis[0])
262 if (this_curve -> axmin[1] < 0.0 && this_curve -> axmax[1] > 0.0)
264 cairo_set_line_width (cr, 1.0);
266 cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
282 this_curve -> surface = cairo_surface_reference (cairo_get_target (cr));
287 cairo_surface_destroy (surface);
289 else if (where == 2 || where == 4)
291 cairo_show_page (cr);
292 cairo_surface_destroy (surface);
296 cairo_surface_destroy (surface);
298 if (where > 0) cairo_destroy (cr);
299 this_curve -> displayed = TRUE;
void draw_curve(cairo_t *cr, int cid, int rid, project *this_proj, int points, ColRGBA withcolor, int xscale, int yscale, int asp, int vdash, double thick, int glyp, double gize, int freq, double hwidth, double hopac, int hpos, int extra, int pid)
draw target curve to the cairo drawing context