home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / gnu / groff_src.lha / groff-1.10src / include / printer.h < prev    next >
C/C++ Source or Header  |  1995-06-22  |  2KB  |  67 lines

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  3.      Written by James Clark (jjc@jclark.com)
  4.  
  5. This file is part of groff.
  6.  
  7. groff is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 2, or (at your option) any later
  10. version.
  11.  
  12. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License along
  18. with groff; see the file COPYING.  If not, write to the Free Software
  19. Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  20.  
  21. struct environment {
  22.   int fontno;
  23.   int size;
  24.   int hpos;
  25.   int vpos;
  26.   int height;
  27.   int slant;
  28. };
  29.  
  30. struct font;
  31.  
  32. struct font_pointer_list {
  33.   font *p;
  34.   font_pointer_list *next;
  35.  
  36.   font_pointer_list(font *, font_pointer_list *);
  37. };
  38.  
  39. class printer {
  40. public:
  41.   printer();
  42.   virtual ~printer();
  43.   void load_font(int i, const char *name);
  44.   void set_ascii_char(unsigned char c, const environment *env,
  45.               int *widthp = 0);
  46.   void set_special_char(const char *nm, const environment *env,
  47.             int *widthp = 0);
  48.   void set_numbered_char(int n, const environment *env, int *widthp = 0);
  49.   virtual void draw(int code, int *p, int np, const environment *env);
  50.   virtual void begin_page(int) = 0;
  51.   virtual void end_page(int page_length) = 0;
  52.   virtual font *make_font(const char *nm);
  53.   virtual void end_of_line();
  54.   virtual void special(char *arg, const environment *env);
  55.   static int adjust_arc_center(const int *, double *);
  56. protected:
  57.   font_pointer_list *font_list;
  58. private:
  59.   font **font_table;
  60.   int nfonts;
  61.   font *find_font(const char *);
  62.   virtual void set_char(int index, font *f, const environment *env,
  63.             int w) = 0;
  64. };
  65.  
  66. printer *make_printer();
  67.