diff options
author | wl <wl> | 2006-02-17 16:39:42 +0000 |
---|---|---|
committer | wl <wl> | 2006-02-17 16:39:42 +0000 |
commit | 455b2e198f65238b4949ce278e06bd8f0f190c4d (patch) | |
tree | e85096b7e5ac2d732326405eee07f195804a8e04 /src/include | |
parent | b2e4361da9c612b09c2470258680d85569223a53 (diff) | |
download | groff-455b2e198f65238b4949ce278e06bd8f0f190c4d.tar.gz |
* src/include/font.h (name_to_glyph): Renamed from
font::name_to_index.
(number_to_glyph): Renamed from font::number_to_index.
(glyph_to_name): Renamed from font::index_to_name.
(glyph_to_number): Renamed from font::index_to_number.
* src/libs/libgroff/nametoindex.cpp: Likewise.
* src/roff/troff/charinfo.h (charinfo::as_glyph): Renamed from
charinfo::get_index.
* src/roff/troff/input.cpp: All callers changed.
* src/roff/troff/node.cpp: Likewise.
* src/libs/libgroff/font.cpp: Likewise.
* src/devices/grops/ps.cpp: Likewise.
* src/devices/grohtml/post-html.cpp: Likewise.
* src/libs/libdriver/printer.cpp: Likewise.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/font.h | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/src/include/font.h b/src/include/font.h index c71dafc4..3489b1ec 100644 --- a/src/include/font.h +++ b/src/include/font.h @@ -27,8 +27,7 @@ typedef void (*FONT_COMMAND_HANDLER)(const char *, // command int); // lineno // A glyph is represented by a font-independent `glyph' object. -// The functions font::name_to_index and font::number_to_index return such -// an object. +// The functions name_to_glyph and number_to_glyph return such an object. // // There are two types of glyphs: // @@ -54,7 +53,6 @@ struct glyphinfo { struct glyph { private: glyphinfo *ptr; // Pointer to the complete information. - friend class font; friend class character_indexer; friend class charinfo; glyph(glyphinfo *); // Glyph with given complete information. @@ -104,6 +102,37 @@ inline int glyph::operator!=(const glyph &other) const return ptr != other.ptr; } +// The next two functions and glyph::glyph_name() exist in two versions: one in +// roff/troff/input.cpp for troff, and one in +// libs/libgroff/nametoindex.cpp for the preprocessors and the +// postprocessors. +extern glyph name_to_glyph(const char *); // Convert the glyph with + // the given name (arg1) to a `glyph' object. This + // has the same semantics as the groff escape sequence + // \C'name'. If such a `glyph' object does not yet + // exist, a new one is allocated. +extern glyph number_to_glyph(int); // Convert the font-dependent glyph + // with the given number (in the font) to a `glyph' + // object. This has the same semantics as the groff + // escape sequence \N'number'. If such a `glyph' + // object does not yet exist, a new one is allocated. +inline const char *glyph_to_name(glyph); // Convert the given glyph + // back to its name. Return NULL if the glyph + // doesn't have a name. +inline int glyph_to_number(glyph); // Convert the given glyph back to + // its number. Return -1 if it does not designate + // a numbered character. + +inline const char *glyph_to_name(glyph g) +{ + return g.glyph_name(); +} + +inline int glyph_to_number(glyph g) +{ + return g.glyph_number(); +} + // Types used in non-public members of `class font'. struct font_kern_list; struct font_char_metric; @@ -240,27 +269,6 @@ public: // device) and initialize some static variables with // info from there. - // The next two functions exist in two versions: one in - // roff/troff/input.cpp for troff, and one in - // libs/libgroff/nametoindex.cpp for the preprocessors and the - // postprocessors. - static glyph name_to_index(const char *); // Convert the glyph with - // the given name (arg1) to a `glyph' object. This - // has the same semantics as the groff escape sequence - // \C'name'. If such a `glyph' object does not yet - // exist, a new one is allocated. - static glyph number_to_index(int); // Convert the font-dependent glyph - // with the given number (in the font) to a `glyph' - // object. This has the same semantics as the groff - // escape sequence \N'number'. If such a `glyph' - // object does not yet exist, a new one is allocated. - static const char *index_to_name(glyph); // Convert the given glyph - // back to its name. Return NULL if the glyph - // doesn't have a name. - static int index_to_number(glyph); // Convert the given glyph back to - // its number. Return -1 if it does not designate - // a numbered character. - static FONT_COMMAND_HANDLER set_unknown_desc_command_handler(FONT_COMMAND_HANDLER); // Register // a function which defines the semantics of @@ -374,14 +382,4 @@ protected: // case of failure. }; -inline const char *font::index_to_name(glyph g) -{ - return g.glyph_name(); -} - -inline int font::index_to_number(glyph g) -{ - return g.glyph_number(); -} - // end of font.h |