summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/Makefile.sub1
-rw-r--r--src/include/color.h4
-rw-r--r--src/include/symbol.h (renamed from src/roff/troff/symbol.h)5
-rw-r--r--src/libs/libgroff/Makefile.sub2
-rw-r--r--src/libs/libgroff/color.cpp5
-rw-r--r--src/libs/libgroff/symbol.cpp (renamed from src/roff/troff/symbol.cpp)9
-rw-r--r--src/roff/troff/Makefile.sub7
-rw-r--r--src/roff/troff/dictionary.cpp5
-rw-r--r--src/roff/troff/div.cpp3
-rw-r--r--src/roff/troff/env.cpp15
-rw-r--r--src/roff/troff/env.h4
-rw-r--r--src/roff/troff/input.cpp12
-rw-r--r--src/roff/troff/node.cpp3
-rw-r--r--src/roff/troff/number.cpp3
-rw-r--r--src/roff/troff/reg.cpp3
15 files changed, 50 insertions, 31 deletions
diff --git a/src/include/Makefile.sub b/src/include/Makefile.sub
index ef9c4648..a0ab6e14 100644
--- a/src/include/Makefile.sub
+++ b/src/include/Makefile.sub
@@ -23,6 +23,7 @@ HDRS=\
search.h \
searchpath.h \
stringclass.h \
+ symbol.h \
unicode.h
GENHDRS=defs.h
diff --git a/src/include/color.h b/src/include/color.h
index 205f70ef..2a1c62f0 100644
--- a/src/include/color.h
+++ b/src/include/color.h
@@ -24,6 +24,7 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stddef.h>
+#include "symbol.h"
enum color_scheme {DEFAULT, CMY, CMYK, RGB, GRAY};
@@ -38,8 +39,9 @@ private:
const size_t);
public:
+ symbol nm;
enum {MAX_COLOR_VAL = 0xffff};
- color() : scheme(DEFAULT){}
+ color(symbol s = default_symbol) : scheme(DEFAULT), nm(s) {}
color(const color * const);
~color();
void *operator new(size_t);
diff --git a/src/roff/troff/symbol.h b/src/include/symbol.h
index 5b7c9b19..af4a4c09 100644
--- a/src/roff/troff/symbol.h
+++ b/src/include/symbol.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -78,3 +79,5 @@ inline int symbol::is_empty() const
}
symbol concat(symbol, symbol);
+
+extern symbol default_symbol;
diff --git a/src/libs/libgroff/Makefile.sub b/src/libs/libgroff/Makefile.sub
index 51eb84ab..b0a97518 100644
--- a/src/libs/libgroff/Makefile.sub
+++ b/src/libs/libgroff/Makefile.sub
@@ -35,6 +35,7 @@ OBJS=\
searchpath.$(OBJEXT) \
string.$(OBJEXT) \
strsave.$(OBJEXT) \
+ symbol.$(OBJEXT) \
tmpfile.$(OBJEXT) \
tmpname.$(OBJEXT) \
unicode.$(OBJEXT) \
@@ -74,6 +75,7 @@ CCSRCS=\
$(srcdir)/searchpath.cpp \
$(srcdir)/string.cpp \
$(srcdir)/strsave.cpp \
+ $(srcdir)/symbol.cpp \
$(srcdir)/tmpfile.cpp \
$(srcdir)/tmpname.cpp \
$(srcdir)/unicode.cpp \
diff --git a/src/libs/libgroff/color.cpp b/src/libs/libgroff/color.cpp
index da138dc4..2a01ae5e 100644
--- a/src/libs/libgroff/color.cpp
+++ b/src/libs/libgroff/color.cpp
@@ -2,9 +2,9 @@
/* <groff_src_dir>/src/libs/libgroff/color.cpp
-Last update: 13 Apr 2003
+Last update: 07 Jan 2004
-Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Gaius Mulley <gaius@glam.ac.uk>
This file is part of groff.
@@ -73,6 +73,7 @@ void color::operator delete(void *p)
color::color(const color * const c)
{
+ nm = c->nm;
scheme = c->scheme;
components[0] = c->components[0];
components[1] = c->components[1];
diff --git a/src/roff/troff/symbol.cpp b/src/libs/libgroff/symbol.cpp
index 09f4c98c..b7b3b9e9 100644
--- a/src/roff/troff/symbol.cpp
+++ b/src/libs/libgroff/symbol.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -18,8 +19,10 @@ You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include "lib.h"
-#include "troff.h"
+#include "errarg.h"
+#include "error.h"
#include "symbol.h"
const char **symbol::table = 0;
@@ -152,3 +155,5 @@ symbol concat(symbol s1, symbol s2)
a_delete buf;
return res;
}
+
+symbol default_symbol("default");
diff --git a/src/roff/troff/Makefile.sub b/src/roff/troff/Makefile.sub
index 7ecf154f..54c55e18 100644
--- a/src/roff/troff/Makefile.sub
+++ b/src/roff/troff/Makefile.sub
@@ -10,8 +10,7 @@ OBJS=\
majorminor.$(OBJEXT) \
node.$(OBJEXT) \
number.$(OBJEXT) \
- reg.$(OBJEXT) \
- symbol.$(OBJEXT)
+ reg.$(OBJEXT)
CCSRCS=\
$(srcdir)/dictionary.cpp \
$(srcdir)/div.cpp \
@@ -20,8 +19,7 @@ CCSRCS=\
majorminor.cpp \
$(srcdir)/node.cpp \
$(srcdir)/number.cpp \
- $(srcdir)/reg.cpp \
- $(srcdir)/symbol.cpp
+ $(srcdir)/reg.cpp
HDRS=\
$(srcdir)/charinfo.h \
$(srcdir)/dictionary.h \
@@ -32,7 +30,6 @@ HDRS=\
$(srcdir)/node.h \
$(srcdir)/reg.h \
$(srcdir)/request.h \
- $(srcdir)/symbol.h \
$(srcdir)/token.h \
$(srcdir)/troff.h
GENSRCS=majorminor.cpp
diff --git a/src/roff/troff/dictionary.cpp b/src/roff/troff/dictionary.cpp
index a70ebb0e..e4cce22c 100644
--- a/src/roff/troff/dictionary.cpp
+++ b/src/roff/troff/dictionary.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -20,7 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
// is `p' a good size for a hash table
@@ -209,4 +209,3 @@ int object_dictionary::alias(symbol newnm, symbol oldnm)
}
return 0;
}
-
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 1bbbe450..df4df4f5 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -23,7 +23,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
// diversions
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
#include "env.h"
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 3c7ff02e..b78ebd5c 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -20,7 +20,6 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
#include "env.h"
@@ -3091,6 +3090,16 @@ const char *environment::get_font_family_string()
return family->nm.contents();
}
+const char *environment::get_glyph_color_string()
+{
+ return glyph_color->nm.contents();
+}
+
+const char *environment::get_fill_color_string()
+{
+ return fill_color->nm.contents();
+}
+
const char *environment::get_font_name_string()
{
symbol f = get_font_name(fontno, this);
@@ -3247,6 +3256,8 @@ void init_env_requests()
init_int_env_reg(".L", get_line_spacing);
init_hunits_env_reg(".l", get_line_length);
init_hunits_env_reg(".ll", get_saved_line_length);
+ init_string_env_reg(".M", get_fill_color_string);
+ init_string_env_reg(".m", get_glyph_color_string);
init_hunits_env_reg(".n", get_prev_text_length);
init_int_env_reg(".ps", get_point_size);
init_int_env_reg(".psr", get_requested_point_size);
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 43a4c97f..902ff037 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -303,6 +303,8 @@ public:
void space();
void space(hunits, hunits);
void space_newline();
+ const char *get_glyph_color_string();
+ const char *get_fill_color_string();
const char *get_font_family_string();
const char *get_font_name_string();
const char *get_name_string();
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 5ee302d0..abe54f31 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -20,7 +20,6 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
#include "env.h"
@@ -1039,7 +1038,6 @@ static node *do_suppress(symbol nm);
static void do_register();
dictionary color_dictionary(501);
-static symbol default_symbol("default");
static color *lookup_color(symbol nm)
{
@@ -1063,7 +1061,7 @@ void do_glyph_color(symbol nm)
if (tem)
curenv->set_glyph_color(tem);
else
- (void)color_dictionary.lookup(nm, new color);
+ (void)color_dictionary.lookup(nm, new color(nm));
}
}
@@ -1078,7 +1076,7 @@ void do_fill_color(symbol nm)
if (tem)
curenv->set_fill_color(tem);
else
- (void)color_dictionary.lookup(nm, new color);
+ (void)color_dictionary.lookup(nm, new color(nm));
}
}
@@ -1262,8 +1260,10 @@ static void define_color()
skip_line();
return;
}
- if (col)
+ if (col) {
+ col->nm = color_name;
(void)color_dictionary.lookup(color_name, col);
+ }
skip_line();
}
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 35f2d60c..fd263756 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -25,7 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <unistd.h>
#endif
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
#include "env.h"
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 8fed342e..8a5c7e44 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -21,7 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
-#include "symbol.h"
#include "hvunits.h"
#include "env.h"
#include "token.h"
diff --git a/src/roff/troff/reg.cpp b/src/roff/troff/reg.cpp
index 8ac20c9b..9c4b5b7c 100644
--- a/src/roff/troff/reg.cpp
+++ b/src/roff/troff/reg.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -20,7 +20,6 @@ with groff; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "token.h"
#include "request.h"