3 // <groff_src_dir>/src/include/printer.h
5 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2006,
7 Free Software Foundation, Inc.
9 Written by James Clark (jjc@jclark.com)
11 Last update: 5 Jan 2009
13 This file is part of groff.
15 groff is free software; you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
20 groff is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program. If not, see <http://www.gnu.org/licenses/>.
31 The class `printer' performs the postprocessing. Each
32 postprocessor only needs to implement a derived class of `printer' and
33 a suitable function `make_printer' for the device-dependent tasks.
34 Then the methods of class `printer' are called automatically by
35 `do_file()' in `input.cpp'.
53 struct font_pointer_list {
55 font_pointer_list *next;
57 font_pointer_list(font *, font_pointer_list *);
64 void load_font(int, const char *);
65 void set_ascii_char(unsigned char, const environment *, int * = 0);
66 void set_special_char(const char *, const environment *, int * = 0);
67 virtual void set_numbered_char(int, const environment *, int * = 0);
68 glyph *set_char_and_width(const char *, const environment *,
70 font *get_font_from_index(int);
71 virtual void draw(int, int *, int, const environment *);
72 // perform change of line color (text, outline) in the print-out
73 virtual void change_color(const environment * const);
74 // perform change of fill color in the print-out
75 virtual void change_fill_color(const environment * const);
76 virtual void begin_page(int) = 0;
77 virtual void end_page(int) = 0;
78 virtual font *make_font(const char *);
79 virtual void end_of_line();
80 virtual void special(char *, const environment *, char = 'p');
81 virtual void devtag(char *, const environment *, char = 'p');
84 font_pointer_list *font_list;
88 // information about named characters
92 const char *named_char_s;
96 font *find_font(const char *);
97 virtual void set_char(glyph *, font *, const environment *, int,
101 printer *make_printer();