/contrib/groff/src/preproc/pic/common.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 80 lines · 57 code · 3 blank · 20 comment · 0 complexity · 11782388a9c563b49f5c53b25731fc6b MD5 · raw file

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2003
  3. Free Software Foundation, Inc.
  4. Written by James Clark (jjc@jclark.com)
  5. This file is part of groff.
  6. groff is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 2, or (at your option) any later
  9. version.
  10. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. for more details.
  14. You should have received a copy of the GNU General Public License along
  15. with groff; see the file COPYING. If not, write to the Free Software
  16. Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
  17. class common_output : public output {
  18. private:
  19. void dash_line(const position &start, const position &end,
  20. const line_type &lt, double dash_width, double gap_width,
  21. double *offsetp);
  22. void dash_arc(const position &cent, double rad,
  23. double start_angle, double end_angle, const line_type &lt,
  24. double dash_width, double gap_width, double *offsetp);
  25. void dot_line(const position &start, const position &end,
  26. const line_type &lt, double gap_width, double *offsetp);
  27. void dot_arc(const position &cent, double rad,
  28. double start_angle, double end_angle, const line_type &lt,
  29. double gap_width, double *offsetp);
  30. protected:
  31. virtual void dot(const position &, const line_type &) = 0;
  32. void ellipse_arc(const position &, const position &,
  33. const position &, const distance &,
  34. const line_type &);
  35. void dashed_circle(const position &, double rad, const line_type &);
  36. void dotted_circle(const position &, double rad, const line_type &);
  37. void dashed_ellipse(const position &, const distance &, const line_type &);
  38. void dotted_ellipse(const position &, const distance &, const line_type &);
  39. void dashed_arc(const position &, const position &, const position &,
  40. const line_type &);
  41. void dotted_arc(const position &, const position &, const position &,
  42. const line_type &);
  43. virtual void solid_arc(const position &cent, double rad, double start_angle,
  44. double end_angle, const line_type &lt);
  45. void dashed_rounded_box(const position &, const distance &, double,
  46. const line_type &);
  47. void dotted_rounded_box(const position &, const distance &, double,
  48. const line_type &);
  49. void solid_rounded_box(const position &, const distance &, double,
  50. const line_type &);
  51. void filled_rounded_box(const position &, const distance &, double, double);
  52. public:
  53. void start_picture(double sc, const position &ll, const position &ur) = 0;
  54. void finish_picture() = 0;
  55. void circle(const position &, double rad, const line_type &, double) = 0;
  56. void text(const position &, text_piece *, int, double) = 0;
  57. void line(const position &, const position *, int n, const line_type &) = 0;
  58. void polygon(const position *, int n, const line_type &, double) = 0;
  59. void spline(const position &, const position *, int n,
  60. const line_type &) = 0;
  61. void arc(const position &, const position &, const position &,
  62. const line_type &) = 0;
  63. void ellipse(const position &, const distance &,
  64. const line_type &, double) = 0;
  65. void rounded_box(const position &, const distance &, double,
  66. const line_type &, double);
  67. void set_color(char *, char *) = 0;
  68. void reset_color() = 0;
  69. char *get_last_filled() = 0;
  70. char *get_outline_color() = 0;
  71. };
  72. int compute_arc_center(const position &start, const position &cent,
  73. const position &end, position *result);