Mercurial > hg > octave-terminal
changeset 14418:933101fd5cbb
Use file descriptor instead of a FILE pointer for OpenGL printing.
Bug # 31641.
* __init_fltk__.cc:
* gl2ps_renderer.cc (gl2ps_renderer::draw):
* gl2ps_renderer.h:
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 28 Feb 2012 08:06:24 -0500 |
parents | 12d13534265c |
children | 2258a0b73eb8 |
files | src/DLD-FUNCTIONS/__init_fltk__.cc src/gl2ps-renderer.cc src/gl2ps-renderer.h |
diffstat | 3 files changed, 4 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -179,7 +179,7 @@ if (print_mode) { FILE *fp = octave_popen (print_cmd.c_str (), "w"); - glps_renderer rend (fileno (fp), print_term); + glps_renderer rend (fp, print_term); rend.draw (gh_manager::get_object (number));
--- a/src/gl2ps-renderer.cc +++ b/src/gl2ps-renderer.cc @@ -43,14 +43,6 @@ { in_draw = true; - FILE *fp = fdopen (fid, "wb"); - - if (! fp) - { - error ("gl2ps-renderer: fdopen failed"); - return; - } - GLint buffsize = 0, state = GL2PS_OVERFLOW; GLint viewport[4]; @@ -92,8 +84,6 @@ state = gl2psEndPage (); } - gnulib::fclose (fp); - in_draw = 0; } else
--- a/src/gl2ps-renderer.h +++ b/src/gl2ps-renderer.h @@ -31,8 +31,8 @@ glps_renderer : public opengl_renderer { public: - glps_renderer (const int _fid, const std::string& _term) - : opengl_renderer () , fid (_fid), term (_term), + glps_renderer (FILE *_fp, const std::string& _term) + : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { } ~glps_renderer (void) { } @@ -78,7 +78,7 @@ private: int alignment_to_mode (int ha, int va) const; - int fid; + FILE *fp; caseless_str term; double fontsize; std::string fontname;