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