|
From: Ethan M. <merritt@u.washington.edu> - 2009-09-08 16:27:33
|
On Tuesday 08 September 2009 01:44:25 Richard Henwood wrote: > On Mon, 2009-09-07 at 17:49 -0400, Allin Cottrell wrote: > > > > I think what Richard was asking is whether the "cairo drawing > > context" struct, or "cairo_t", that is used internally by gnuplot > > could somehow be exposed programmatically. But I don't see how > > this could be done -- seems to me it would require building > > gnuplot as a library, not a stand-alone executable. > > > > This is indeed what I am curious about. As you comment: if the 'cairo > drawing context' was exposed, it would then allow gnuplot to behave as a > library. i.e. if one was writing a cairo widget for a (typically GTK) > application, one may create a context (cairo_t), pass it to gnuplot > (along with some commands to plot a graph on it), and then return it to > the application for display. The two halves of your statement do not quite match up. While I understand wanting to pass gnuplot a context, e.g. a widget in an external application, I don't see what that has to do with making gnuplot into a library. This mode of operation is already supported by the qt, tkcanvas, and x11 terminal drivers. You initialize the context, invoke gnuplot, and tell it to draw into your existing context rather than creating a new one. Of course the details are different in each case. > In the first instance I thought I would raise this idea for discussion. > If it is technically feasible - and within the gnuplot mission - I think > there is an excellent opportunity to both have a extensive, publication > quality plotting library available to gtk/cairo application developers - > and increase usage of gnuplot. I personally think that plotting libraries, as opposed to plotting programs, are not the way to go. That's just my personal opinion, but it is based on years of programming experience using both approaches. > Any thoughts greatly appreciated. > Richard Ethan |