3 // <groff_src_dir>/src/include/printer.h
5 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
6 Free Software Foundation, Inc.
8 Written by James Clark (jjc@jclark.com)
10 Last update: 15 Dec 2004
12 This file is part of groff.
14 groff is free software; you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2, or (at your option)
19 groff is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with groff; see the file COPYING. If not, write to the Free
26 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
32 The class `printer' performs the postprocessing. Each
33 postprocessor only needs to implement a derived class of `printer' and
34 a suitable function `make_printer' for the device-dependent tasks.
35 Then the methods of class `printer' are called automatically by
36 `do_file()' in `input.cpp'.
54 struct font_pointer_list {
56 font_pointer_list *next;
58 font_pointer_list(font *, font_pointer_list *);
65 void load_font(int i, const char *name);
66 void set_ascii_char(unsigned char c, const environment *env,
68 void set_special_char(const char *nm, const environment *env,
70 virtual void set_numbered_char(int n, const environment *env,
72 int set_char_and_width(const char *nm, const environment *env,
73 int *widthp, font **f);
74 font *get_font_from_index(int fontno);
75 virtual void draw(int code, int *p, int np, const environment *env);
76 // perform change of line color (text, outline) in the print-out
77 virtual void change_color(const environment * const env);
78 // perform change of fill color in the print-out
79 virtual void change_fill_color(const environment * const env);
80 virtual void begin_page(int) = 0;
81 virtual void end_page(int page_length) = 0;
82 virtual font *make_font(const char *nm);
83 virtual void end_of_line();
84 virtual void special(char *arg, const environment *env,
86 virtual void devtag(char *arg, const environment *env,
90 font_pointer_list *font_list;
94 // information about named characters
98 const char *named_char_s;
102 font *find_font(const char *);
103 virtual void set_char(int index, font *f, const environment *env,
104 int w, const char *name) = 0;
107 printer *make_printer();