X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhp2ps%2FKey.c;h=314a682dd64efb9ec044ac59771ab8234c1769d4;hb=8e4e15d8e837b90190b6b8e7645822772cab2053;hp=8c63721c748a5f9a56b86ff4d9eba8aee3ea28c9;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/utils/hp2ps/Key.c b/utils/hp2ps/Key.c index 8c63721..314a682 100644 --- a/utils/hp2ps/Key.c +++ b/utils/hp2ps/Key.c @@ -5,6 +5,7 @@ #include "Dimensions.h" #include "HpFile.h" #include "Shade.h" +#include "PsFile.h" /* own stuff */ #include "Key.h" @@ -20,12 +21,18 @@ void Key() for (i = 0; i < nidents; i++) /* count identifiers */ ; - c = graphy0; - dc = graphheight / (floatish) (i + 1); + c = multipageflag ? 0 : graphy0; + dc = graphheight / (floatish) ((i <= 20) ? (i + 1) : 20); for (i = 0; i < nidents; i++) { c += dc; KeyEntry(c, identtable[i]->name, ShadeOf(identtable[i]->name)); + // if we have spit out 20 entries and we're going to output more + // advance the page + if (i % DEFAULT_TWENTY == (DEFAULT_TWENTY - 1) && i != nidents - 1) { + c = 0; + NextPage(); + } } } @@ -42,7 +49,7 @@ KeyEntry(centreline, name, colour) namebase = centreline - (floatish) (NORMAL_FONT / 2); keyboxbase = centreline - ((floatish) KEY_BOX_WIDTH / 2.0); - kstart = graphx0 + graphwidth; + kstart = graphx0 + (multipageflag ? 0 : graphwidth); fprintf(psfp, "%f %f moveto\n", kstart + borderspace, keyboxbase); fprintf(psfp, "0 %d rlineto\n", KEY_BOX_WIDTH);