From 05c54bfdc6b809f5b21b791c92232150e9f4b4db Mon Sep 17 00:00:00 2001 From: wl Date: Sat, 11 Feb 2006 17:48:09 +0000 Subject: Make the glyph data type abstract. * src/include/font.h (glyph_t): New class. (name_to_index, number_to_index): Change return type to glyph_t. (font::contains, font::get_width, font::get_height, font::get_depth, font::get_character_type, font::get_kern, font::get_skew, font::get_italic_correction, font::get_left_italic_correction, font::get_subscript_correction, font::get_code, font::get_special_device_encoding, font::add_entry, font::copy_entry, font::add_kern, font::hash_kern): Change argument type to glyph_t. * src/libs/libgroff/font.cpp (struct font_kern_list): Change members type and constructor argument types to glyph_t. (font::contains, font::get_width, font::get_height, font::get_depth, font::get_character_type, font::get_kern, font::get_skew, font::get_italic_correction, font::get_left_italic_correction, font::get_subscript_correction, font::get_code, font::get_special_device_encoding, font::add_entry, font::copy_entry, font::add_kern, font::hash_kern): Change argument type to glyph_t. (font::load): Use glyph_t variables. * src/libs/libgroff/nametoindex.cpp (name_to_index, number_to_index): Change return type to glyph_t. * src/roff/troff/charinfo.h (charinfo::index): Change type to glyph_t. (charinfo::get_index): Change return type to glyph_t. * src/roff/troff/env.cpp: Include font.h. * src/roff/troff/node.cpp: Include font.h before charinfo.h. * src/roff/troff/input.cpp: Include font.h before charinfo.h. (charinfo::charinfo): Update. (name_to_index, number_to_index): Change return type to glyph_t. * src/include/printer.h (printer::set_char_and_width): Change return type to glyph_t. * src/libs/libdriver/printer.cpp (printer::set_char_and_width): Change return type to glyph_t. * src/devices/grodvi/dvi.cpp (dvi_printer::set_char): Change argument type to glyph_t. * src/devices/grohtml/post-html.cpp (page::add_and_encode): Update. (html_printer::space_glyph): Renamed from space_char_index. (html_printer::add_to_sbuf, html_printer::sbuf_continuation, html_printer::overstrike, html_printer::set_char): Change argument type to glyph_t. (html_printer::set_char_and_width): Change return type to glyph_t. * src/devices/grolbp/lbp.cpp (lbp_printer::set_char): Change argument type to glyph_t. * src/devices/grolj4/lj4.cpp (lj4_printer::set_char): Change argument type to glyph_t. * src/devices/grops/ps.cpp (ps_printer::space_glyph): Renamed from space_char_index. (ps_printer::set_subencoding, ps_printer::set_char): Change argument type to glyph_t. * src/devices/grotty/tty.cpp (tty_printer::set_char): Change argument type to glyph_t. --- src/devices/grotty/tty.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/devices/grotty') diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp index a959461f..81bc7180 100644 --- a/src/devices/grotty/tty.cpp +++ b/src/devices/grotty/tty.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005 +/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -215,7 +215,7 @@ class tty_printer : public printer { public: tty_printer(const char *device); ~tty_printer(); - void set_char(int, font *, const environment *, int, const char *name); + void set_char(glyph_t, font *, const environment *, int, const char *name); void draw(int code, int *p, int np, const environment *env); void special(char *arg, const environment *env, char type); void change_color(const environment * const env); @@ -360,12 +360,12 @@ schar tty_printer::color_to_idx(color *col) return idx; } -void tty_printer::set_char(int i, font *f, const environment *env, +void tty_printer::set_char(glyph_t gly, font *f, const environment *env, int w, const char *) { if (w % font::hor != 0) fatal("width of character not a multiple of horizontal resolution"); - add_char(f->get_code(i), w, + add_char(f->get_code(gly), w, env->hpos, env->vpos, env->col, env->fill, ((tty_font *)f)->get_mode()); -- cgit v1.2.1