source: trunk/dports/math/octave/files/patch-gl2ps_renderer.diff @ 133137

Last change on this file since 133137 was 133137, checked in by michaelld@…, 5 years ago

octave: fix gl2ps renderer interface for compiling using older clang (3.3 and earlier); should address ticket #44704.

File size: 2.5 KB
  • libinterp/corefcn/gl2ps-renderer.cc

    old new along with Octave; see the file COPYING. If not, see 
    3434#include "gl2ps-renderer.h"
    3535#include "gl2ps.h"
    3636
     37glps_renderer::glps_renderer (FILE *_fp, const std::string& _term)
     38  : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { }
     39
    3740void
    3841glps_renderer::draw (const graphics_object& go, const std::string print_cmd)
    3942{
    glps_renderer::draw_text (const text::properties& props) 
    253256                alignment_to_mode (halign, valign), props.get_rotation ());
    254257}
    255258
     259void
     260glps_renderer::set_linestyle (const std::string& s, bool use_stipple)
     261{
     262  opengl_renderer::set_linestyle (s, use_stipple);
     263
     264  if (s == "-" && ! use_stipple)
     265    gl2psDisable (GL2PS_LINE_STIPPLE);
     266  else
     267    gl2psEnable (GL2PS_LINE_STIPPLE);
     268}
     269
     270void
     271glps_renderer::set_polygon_offset (bool on, double offset)
     272{
     273  opengl_renderer::set_polygon_offset (on, offset);
     274  if (on)
     275    gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
     276  else
     277    gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
     278}
     279
     280void
     281glps_renderer::set_linewidth (float w)
     282{
     283  gl2psLineWidth (w);
     284}
     285
    256286#endif
  • libinterp/corefcn/gl2ps-renderer.h

    old new OCTINTERP_API 
    3333glps_renderer : public opengl_renderer
    3434{
    3535public:
    36   glps_renderer (FILE *_fp, const std::string& _term)
    37     : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { }
     36  glps_renderer (FILE *_fp, const std::string& _term);
    3837
    3938  ~glps_renderer (void) { }
    4039
    protected: 
    5251  void draw_pixels (GLsizei w, GLsizei h, GLenum format,
    5352                    GLenum type, const GLvoid *data);
    5453
    55   void set_linestyle (const std::string& s, bool use_stipple = false)
    56   {
    57     opengl_renderer::set_linestyle (s, use_stipple);
    58 
    59     if (s == "-" && ! use_stipple)
    60       gl2psDisable (GL2PS_LINE_STIPPLE);
    61     else
    62       gl2psEnable (GL2PS_LINE_STIPPLE);
    63   }
    64 
    65   void set_polygon_offset (bool on, double offset = 0.0)
    66   {
    67     opengl_renderer::set_polygon_offset (on, offset);
    68     if (on)
    69       gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
    70     else
    71       gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
    72   }
    73 
    74   void set_linewidth (float w)
    75   {
    76     gl2psLineWidth (w);
    77   }
     54  void set_linestyle (const std::string& s, bool use_stipple = false);
     55  void set_polygon_offset (bool on, double offset = 0.0);
     56  void set_linewidth (float w);
    7857
    7958private:
    8059  int alignment_to_mode (int ha, int va) const;
Note: See TracBrowser for help on using the repository browser.