]> granicus.if.org Git - graphviz/commitdiff
const'ify ps_txt
authorellson <devnull@localhost>
Tue, 2 Sep 2008 18:06:41 +0000 (18:06 +0000)
committerellson <devnull@localhost>
Tue, 2 Sep 2008 18:06:41 +0000 (18:06 +0000)
move ps.txt and generated ps.h into core plugin, and initially copy to lasi plugin

lib/common/Makefile.am
lib/common/ps.txt [deleted file]
lib/common/utils.c
plugin/core/Makefile.am
plugin/core/gvrender_core_ps.c

index b8f5fd1bf498543561a08fb12fd16b0d8dc8aefc..94efda8691d2abffc1ab2af4da170740bbb2db27 100644 (file)
@@ -39,11 +39,6 @@ ps_font_equiv.h: $(srcdir)/ps_font_equiv.txt $(srcdir)/fontmap.cfg $(srcdir)/ps_
        cp ps_fontmap.txt ps_font_equiv.h
        ./mksvgfonts.pl fontmap.cfg ps_font_equiv.txt | LC_ALL=C $(SORT) >>ps_font_equiv.h
 
-utils.o utils.lo : ps.h
-
-ps.h : $(srcdir)/ps.txt
-       $(AWK) -f $(top_srcdir)/awk/stringize.awk $(srcdir)/ps.txt > ps.h
-
 colxlate.o colxlate.lo : colortbl.h
 
 colortbl.h : color_lib
@@ -68,10 +63,10 @@ htmlparse.c: y.output
 htmlparse.h: y.output
        @SED@ "s/yy/html/g" < y.tab.h > htmlparse.h
 
-DISTCLEANFILES = brewer_lib color_lib colortbl.h ps_font_equiv.h ps.h \
+DISTCLEANFILES = brewer_lib color_lib colortbl.h ps_font_equiv.h \
        y.output y.tab.[ch] htmlparse.[ch]
 
-EXTRA_DIST = Makefile.old README.imap chars.tcl ps.h ps_font_equiv.h \
+EXTRA_DIST = Makefile.old README.imap chars.tcl ps_font_equiv.h \
        strcasecmp.c strncasecmp.c htmlparse.c htmlparse.h \
        y.tab.c y.tab.h y.output entities.html entities.tcl \
        brewer_colors brewer_lib color_names color_lib colortbl.h
diff --git a/lib/common/ps.txt b/lib/common/ps.txt
deleted file mode 100644 (file)
index f10f3e4..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-%%BeginProlog
-/DotDict 200 dict def
-DotDict begin
-
-/setupLatin1 {
-mark
-/EncodingVector 256 array def
- EncodingVector 0
-
-ISOLatin1Encoding 0 255 getinterval putinterval
-EncodingVector 45 /hyphen put
-
-% Set up ISO Latin 1 character encoding
-/starnetISO {
-        dup dup findfont dup length dict begin
-        { 1 index /FID ne { def }{ pop pop } ifelse
-        } forall
-        /Encoding EncodingVector def
-        currentdict end definefont
-} def
-/Times-Roman starnetISO def
-/Times-Italic starnetISO def
-/Times-Bold starnetISO def
-/Times-BoldItalic starnetISO def
-/Helvetica starnetISO def
-/Helvetica-Oblique starnetISO def
-/Helvetica-Bold starnetISO def
-/Helvetica-BoldOblique starnetISO def
-/Courier starnetISO def
-/Courier-Oblique starnetISO def
-/Courier-Bold starnetISO def
-/Courier-BoldOblique starnetISO def
-cleartomark
-} bind def
-
-%%BeginResource: procset graphviz 0 0
-/coord-font-family /Times-Roman def
-/default-font-family /Times-Roman def
-/coordfont coord-font-family findfont 8 scalefont def
-
-/InvScaleFactor 1.0 def
-/set_scale {
-       dup 1 exch div /InvScaleFactor exch def
-       scale
-} bind def
-
-% styles
-/solid { [] 0 setdash } bind def
-/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
-/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
-/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
-/bold { 2 setlinewidth } bind def
-/filled { } bind def
-/unfilled { } bind def
-/rounded { } bind def
-/diagonals { } bind def
-
-% hooks for setting color 
-/nodecolor { sethsbcolor } bind def
-/edgecolor { sethsbcolor } bind def
-/graphcolor { sethsbcolor } bind def
-/nopcolor {pop pop pop} bind def
-
-/beginpage {   % i j npages
-       /npages exch def
-       /j exch def
-       /i exch def
-       /str 10 string def
-       npages 1 gt {
-               gsave
-                       coordfont setfont
-                       0 0 moveto
-                       (\() show i str cvs show (,) show j str cvs show (\)) show
-               grestore
-       } if
-} bind def
-
-/set_font {
-       findfont exch
-       scalefont setfont
-} def
-
-% draw text fitted to its expected width
-/alignedtext {                 % width text
-       /text exch def
-       /width exch def
-       gsave
-               width 0 gt {
-                       [] 0 setdash
-                       text stringwidth pop width exch sub text length div 0 text ashow
-               } if
-       grestore
-} def
-
-/boxprim {                             % xcorner ycorner xsize ysize
-               4 2 roll
-               moveto
-               2 copy
-               exch 0 rlineto
-               0 exch rlineto
-               pop neg 0 rlineto
-               closepath
-} bind def
-
-/ellipse_path {
-       /ry exch def
-       /rx exch def
-       /y exch def
-       /x exch def
-       matrix currentmatrix
-       newpath
-       x y translate
-       rx ry scale
-       0 0 1 0 360 arc
-       setmatrix
-} bind def
-
-/endpage { showpage } bind def
-/showpage { } def
-
-/layercolorseq
-       [       % layer color sequence - darkest to lightest
-               [0 0 0]
-               [.2 .8 .8]
-               [.4 .8 .8]
-               [.6 .8 .8]
-               [.8 .8 .8]
-       ]
-def
-
-/layerlen layercolorseq length def
-
-/setlayer {/maxlayer exch def /curlayer exch def
-       layercolorseq curlayer 1 sub layerlen mod get
-       aload pop sethsbcolor
-       /nodecolor {nopcolor} def
-       /edgecolor {nopcolor} def
-       /graphcolor {nopcolor} def
-} bind def
-
-/onlayer { curlayer ne {invis} if } def
-
-/onlayers {
-       /myupper exch def
-       /mylower exch def
-       curlayer mylower lt
-       curlayer myupper gt
-       or
-       {invis} if
-} def
-
-/curlayer 0 def
-
-%%EndResource
-%%EndProlog
-%%BeginSetup
-14 default-font-family set_font
-1 setmiterlimit
-% /arrowlength 10 def
-% /arrowwidth 5 def
-
-% make sure pdfmark is harmless for PS-interpreters other than Distiller
-/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
-% make '<<' and '>>' safe on PS Level 1 devices
-/languagelevel where {pop languagelevel}{1} ifelse
-2 lt {
-    userdict (<<) cvn ([) cvn load put
-    userdict (>>) cvn ([) cvn load put
-} if
-
-%%EndSetup
index 8d003b5267534776d8b42ed49a6ca541e9a83675..03f50065032d7ca52cb4689c6c1485a320d47e13 100644 (file)
@@ -18,7 +18,6 @@
 #include "agxbuf.h"
 #include "htmltable.h"
 #include "entities.h"
-#include "ps.h"
 #include "logic.h"
 
 #ifndef WIN32
@@ -435,11 +434,6 @@ void cat_libfile(FILE * ofp, char **arglib, char **stdlib)
     }
 }
 
-void cat_preamble(GVJ_t *job, char **arglib)
-{
-    cat_libfile(job->output_file, arglib, ps_txt);
-}
-
 int maptoken(char *p, char **name, int *val)
 {
     int i;
index 0dcb5df4f06a52227163adcf04be5acbb728c92b..0618c3930f489843dd2c9152b13d1bdbb4843b2f 100644 (file)
@@ -34,6 +34,11 @@ libgvplugin_core_la_LIBADD = $(top_builddir)/lib/gvc/libgvc.la \
                                $(top_builddir)/lib/graph/libgraph.la \
                                $(top_builddir)/lib/cdt/libcdt.la
 
+gvrender_core_ps.o gvrender_core_ps.lo: ps.h
+
+ps.h : $(srcdir)/ps.txt
+       $(AWK) -f $(top_srcdir)/awk/stringize.awk $(srcdir)/ps.txt > ps.h
+
 if WITH_WIN32
 libgvplugin_core_la_LDFLAGS += -no-undefined
 libgvplugin_core_la_LIBADD += $(top_builddir)/lib/graph/libgraph.la
@@ -43,5 +48,7 @@ if WITH_DARWIN9
 libgvplugin_core_la_LDFLAGS += -Wl,-exported_symbol,_gvplugin_core_LTX_library
 endif
 
-EXTRA_DIST = Makefile.old
+EXTRA_DIST = ps.h Makefile.old
+
+DISTCLEANFILES = ps.h
 
index 282e0b9a4c50aa54c11877a32103013fb5460254..9ce778029762c73082c2f4c8ebb04fe50cf06271 100644 (file)
@@ -25,6 +25,7 @@
 #include "graph.h"
 #include "agxbuf.h"
 #include "utils.h"
+#include "ps.h"
 
 /* for CHAR_LATIN1  */
 #include "const.h"
@@ -88,7 +89,7 @@ static void psgen_begin_graph(GVJ_t * job)
        }
         gvdevice_fputs(job, "%%EndComments\nsave\n");
         /* include shape library */
-        cat_preamble(job, job->common->lib);
+        cat_libfile(job->output_file, job->common->lib, ps_txt);
        /* include epsf */
         epsf_define(job->output_file);
         if (job->common->show_boxes) {