=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/lib/glib,v retrieving revision 1.13 retrieving revision 1.14 diff -u -p -r1.13 -r1.14 --- OpenXM_contrib2/asir2000/lib/glib 2004/03/11 05:16:11 1.13 +++ OpenXM_contrib2/asir2000/lib/glib 2004/03/11 12:25:20 1.14 @@ -1,5 +1,5 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.12 2002/10/02 01:30:08 takayama Exp $ */ -/* $Id: glib,v 1.13 2004/03/11 05:16:11 takayama Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.13 2004/03/11 05:16:11 takayama Exp $ */ +/* $Id: glib,v 1.14 2004/03/11 12:25:20 takayama Exp $ */ /* BUG: this library has not yet been adapted to the new automatic launcher of ox_plot. 2002, Aug, 4. Do not load glib more than twice. @@ -429,6 +429,28 @@ def glib_ps(L) { write_to_tb("showpage \n",PS); return tb_to_string(PS); +} + +/*&usage begin: glib_ps_form(S) + It returns the PS code generated by executing {S} + (experimental). + BUG. Only one function call is allowed as an argument. + example: glib_ps_form(quote( glib_line(0,0,100,100) )); + ref: glib_tops +end: */ +def glib_ps_form(F) { + extern Glib_h; + extern Glib_ps; + H = Glib_h; /* push Glib_h */ + P = Glib_ps; /* push Glib_ps */ + + Glib_ps=1; Glib_h = []; + eval_quote(F); + /* bug. eval_str causes seg fault for ccurve.rr main(8) */ + R = glib_tops(); + Glib_h = H; /* pop Glib_h */ + Glib_ps = P; /* pop Glib_ps */ + return R; } /*&usage begin: glib_plot(F)