]> granicus.if.org Git - graphviz/commitdiff
General cleanup:
authorellson <devnull@localhost>
Thu, 25 May 2006 00:09:14 +0000 (00:09 +0000)
committerellson <devnull@localhost>
Thu, 25 May 2006 00:09:14 +0000 (00:09 +0000)
- eliminate types.h from plugins
- newheaders: texpara.h usershape.h
- rename textline_t to textpara_t in preparation for the use of pango paragraph formatting.
- rename various related "*line*" variables to "*para*"
- remove some unused builtin.c files
- fix builtins so that dot_static always works
- change !DISABLE_CODEGENS to WITH_CODEGENS
-support configure options:
--without-codegens
--without-pangocairo
--without-libgd
(all enabled by default if requirements met)

15 files changed:
cmd/dot/Makefile.am
configure.ac
lib/common/Makefile.am
lib/common/diagen.c
lib/common/emit.c
lib/common/figgen.c
lib/common/fontmetrics.c
lib/common/gdgen.c
lib/common/globals.h
lib/common/hpglgen.c
lib/common/mapgen.c
lib/common/psgen.c
lib/common/svggen.c
lib/common/vrmlgen.c
lib/common/xdgen.c

index 03627009fb2198eb79cdaffd1dcbe4e794331e53..bcb3a647d77b190f4ac9469a06addd032e44a2d6 100644 (file)
@@ -49,12 +49,14 @@ dot_static_LDFLAGS = -export-dynamic -dlpreopen self -export-symbols-regex '.*_L
 dot_static_LDADD = \
        $(top_builddir)/lib/plugin/.libs/libgvplugin_dot_layout.a \
        $(top_builddir)/lib/plugin/.libs/libgvplugin_neato_layout.a \
+       $(top_builddir)/lib/plugin/.libs/libgvplugin_gd.a \
+       $(top_builddir)/lib/plugin/.libs/libgvplugin_pangocairo.a \
        $(top_builddir)/lib/gvc/.libs/libgvc_builtins.a \
        $(top_builddir)/lib/pathplan/.libs/libpathplan.a \
        $(top_builddir)/lib/pack/.libs/libpack.a \
        $(top_builddir)/lib/graph/.libs/libgraph.a \
        $(top_builddir)/lib/cdt/.libs/libcdt.a \
-       @GD_LIBS_STATIC@ @ICONV_LIBS@ @FC_LIBS@ @FT_LIBS@ @JPEG_LIBS@ @PNG_LIBS@ @MATH_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@ @LIBLTDL@ @SOCKET_LIBS@ @IPSEPCOLA_LIBS@
+       @PANGOCAIRO_LIBS@ @GD_LIBS_STATIC@ @ICONV_LIBS@ @FC_LIBS@ @FT_LIBS@ @JPEG_LIBS@ @PNG_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@ @LIBLTDL@ @SOCKET_LIBS@ @IPSEPCOLA_LIBS@
 
 EXTRA_DIST = Makefile.old dot.1 dot.pdf
 
index b337afc3fc03ec9f346f17f69264ebb950d17167..3976f230dadfb6dc12f51deb352d759580e9b621 100644 (file)
@@ -267,12 +267,19 @@ LIBS=$save_LIBS
 dnl -----------------------------------
 dnl old codegens
 
-AC_ARG_ENABLE(codegens,
-  [AC_HELP_STRING([--disable-codegens], [don't build old codegens])])
-if test "x$enable_codegens" = "xno"; then
-  AC_DEFINE(DISABLE_CODEGENS,1,[Define if you don't want the old codegens])
+AC_ARG_WITH(codegens,
+  [AC_HELP_STRING([--with-codegens],
+                  [use old codegens])])
+
+### default is to build with codegens
+if test "x$with_codegens" != "xno"; then
+       with_codegens=yes
+fi
+
+if test "x$with_codegens" = "xyes"; then
+  AC_DEFINE(WITH_CODEGENS,1,[Define if you want the old codegens])
 fi
-AM_CONDITIONAL(DISABLE_CODEGENS, [test "x$enable_codegens" = "xno"])
+AM_CONDITIONAL(WITH_CODEGENS, [test "x$with_codegens" = "xyes"])
 
 dnl -----------------------------------
 dnl ElectricFence support for debugging
@@ -1098,11 +1105,22 @@ AM_CONDITIONAL(WITH_IPSEPCOLA, [test "x$with_ipsepcola" = "xyes"])
 dnl -----------------------------------
 dnl INCLUDES and LIBS for PANGO, CAIRO et.al.
                                                                                 
+AC_ARG_WITH(libgd,
+  [AC_HELP_STRING([--with-pangocairo],
+                  [use pangocairo library])])
+
+### default is to build with pangocairo
+if test "x$with_pangocairo" != "xno"; then
+       with_pangocairo=yes
+fi
+
+if test "x$with_pangocairo" = "xyes"; then
 PKG_CHECK_MODULES(PANGOCAIRO, [pangocairo >= 1.0],
        [HAVE_PANGOCAIRO=1
        AC_DEFINE_UNQUOTED(HAVE_PANGOCAIRO,1,
                [Define if you have the pango library with cairo support])],
        [AC_MSG_WARN(pangocairo library not available)])
+fi
 AC_SUBST(PANGOCAIRO_CFLAGS)
 AC_SUBST(PANGOCAIRO_LIBS)
 AM_CONDITIONAL(WITH_PANGOCAIRO, [test "x$HAVE_PANGOCAIRO" != "x"])
@@ -1110,8 +1128,6 @@ AM_CONDITIONAL(WITH_PANGOCAIRO, [test "x$HAVE_PANGOCAIRO" != "x"])
 dnl -----------------------------------
 dnl INCLUDES and LIBS for GD
                                                                                 
-### default is to not build with libgd
-
 AC_ARG_WITH(libgd,
   [AC_HELP_STRING([--with-libgd],
                   [use gd library])])
@@ -1120,6 +1136,7 @@ AC_ARG_WITH(mylibgd,
   [AC_HELP_STRING([--with-mylibgd],
                   [use internal gd library in preference to any installed libgd])])
 
+### default is to build with libgd
 if test "x$with_libgd" != "xno"; then
        with_libgd=yes
 fi
index 5989ae627b6c7dae8b697f3c683dfeda7d012809..5b13576bf1672325ad7acd155e9ef4d55657c896 100644 (file)
@@ -10,20 +10,19 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/graph \
        -I$(top_srcdir)/lib/cdt @GD_INCLUDES@ @EXPAT_INCLUDES@ @Z_INCLUDES@
 
-pkginclude_HEADERS = logic.h arith.h geom.h color.h types.h globals.h
+pkginclude_HEADERS = logic.h arith.h geom.h color.h types.h globals.h textpara.h usershape.h
 noinst_HEADERS = render.h utils.h memory.h \
        geomprocs.h colorprocs.h colortbl.h entities.h \
        const.h macros.h htmllex.h htmltable.h pointset.h
 noinst_LTLIBRARIES = libcommon.la
 
-if !DISABLE_CODEGENS
 if WITH_LIBGD
-CODEGENS = diagen.c figgen.c hpglgen.c gdgen.c mapgen.c mifgen.c mpgen.c \
-       picgen.c psgen.c svggen.c vrmlgen.c vtxgen.c ps.txt xdgen.c color_names
-else
-CODEGENS = diagen.c figgen.c hpglgen.c mapgen.c mifgen.c mpgen.c \
-       picgen.c psgen.c svggen.c vtxgen.c ps.txt xdgen.c color_names
+GD_CODEGENS = gdgen.c vrmlgen.c
 endif
+
+if WITH_CODEGENS
+CODEGENS = $(GD_CODEGENS) diagen.c figgen.c hpglgen.c mapgen.c mifgen.c mpgen.c \
+       picgen.c psgen.c svggen.c vtxgen.c ps.txt xdgen.c color_names
 endif
 
 
index 8e81d46e70ad16cdd931cb80fe7bd910c07a7aec..78c26e137eedc2cdc68f947eaca283495805c1ee 100644 (file)
@@ -468,14 +468,14 @@ static void dia_set_style(char **s)
     /* if (cp->style_was_set) dia_style(cp); */
 }
 
-static void dia_textline(point p, textline_t * line)
+static void dia_textpara(point p, textpara_t * para)
 {
     int anchor;
     char *string;
     pointf mp;
     context_t *cp;
 
-    string = xml_string(line->str);
+    string = xml_string(para->str);
     if (strlen(string) == 0) {
        /* its zero length, don't draw */
        return;
@@ -485,7 +485,7 @@ static void dia_textline(point p, textline_t * line)
        /* its invisible, don't draw */
        return;
     }
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        anchor = 0;
        break;
@@ -533,8 +533,8 @@ static void dia_textline(point p, textline_t * line)
     dia_fputs("      </dia:attribute>\n");
     dia_fputs("      <dia:attribute name=\"obj_bb\">\n");
     dia_printf("        <dia:rectangle val=\"%g,%g;%g,%g\"/>\n",
-              mp.x - (Scale * (line->dimen.x) / 2.), mp.y - 0.4,
-              mp.x + (Scale * (line->dimen.x) / 2.), mp.y + 0.4);
+              mp.x - (Scale * (para->width) / 2.), mp.y - 0.4,
+              mp.x + (Scale * (para->width) / 2.), mp.y + 0.4);
     dia_fputs("      </dia:attribute>\n");
     dia_fputs("    </dia:object>\n");
 }
@@ -955,7 +955,7 @@ codegen_t DIA_CodeGen = {
     dia_begin_edge, dia_end_edge,
     dia_begin_context, dia_end_context,
     0, /* dia_begin_anchor */ 0,       /* dia_end_anchor */
-    dia_set_font, dia_textline,
+    dia_set_font, dia_textpara,
     dia_set_pencolor, dia_set_fillcolor, dia_set_style,
     dia_ellipse, dia_polygon,
     dia_bezier, dia_polyline,
index b2997adf6726ec5daa19a53bf92fb273c498777b..1e1104a38de51e4ffb12f6e858f17ace59a287ba 100644 (file)
@@ -1745,7 +1745,7 @@ static void emit_job(GVJ_t * job, graph_t * g)
        return;
     }
 
-#ifndef DISABLE_CODEGENS
+#ifdef WITH_CODEGENS
     Output_file = job->output_file;
     Output_lang = job->output_lang;
 #endif
index 085fb6e0795ba2c9269f3ad3ca7ce35d722e2a53..da5de3315338df6f9e2c148de7dbc090750b4f98 100644 (file)
@@ -375,7 +375,7 @@ static char *fig_string(char *s)
     return buf;
 }
 
-static void fig_textline(point p, textline_t * line)
+static void fig_textpara(point p, textpara_t * para)
 {
     int object_code = 4;       /* always 4 for text */
     int sub_type = 0;          /* text justification */
@@ -390,7 +390,7 @@ static void fig_textline(point p, textline_t * line)
     double length = 0.0;
     point mp;
 
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        sub_type = 0;
        break;
@@ -410,7 +410,7 @@ static void fig_textline(point p, textline_t * line)
            "%d %d %d %d %d %d %.1f %.4f %d %.1f %.1f %d %d %s\\001\n",
            object_code, sub_type, color, depth, pen_style, font,
            font_size, angle, font_flags, height, length, mp.x, mp.y,
-           fig_string(line->str));
+           fig_string(para->str));
 }
 
 static void fig_bezier(point * A, int n, int arrow_at_start,
@@ -620,7 +620,7 @@ codegen_t FIG_CodeGen = {
     0, /* fig_begin_edge */  0,        /* fig_end_edge */
     fig_begin_context, fig_end_context,
     0, /* fig_begin_anchor */ 0,       /* fig_end_anchor */
-    fig_set_font, fig_textline,
+    fig_set_font, fig_textpara,
     fig_set_pencolor, fig_set_fillcolor, fig_set_style,
     fig_ellipse, fig_polygon,
     fig_bezier, fig_polyline,
index 9d370c50df0b6fa80d169d568c22c1065c713a67..191c7d36502c690ff0a75a0a28a80edc9cf95e07 100644 (file)
@@ -121,30 +121,30 @@ static double courFontWidth[] = {
 
 /* estimate_textsize:
  * Estimate width and height of text, for given face and size, in points.
- * Value is stored textline->size.
+ * Value is stored para->width.
  * NOTE: Tables are based on a font of size 1. Need to multiply by
  * fontsize to get appropriate value.
  */
 static void
-estimate_textsize(graph_t *g, textline_t * textline, char *fontname, double fontsz, char **fontpath)
+estimate_textsize(graph_t *g, textpara_t * para, char *fontname, double fontsz, char **fontpath)
 {
     double *Fontwidth;
     char c, *p;
 
-    textline->dimen.x = 0.0;
-    textline->dimen.y = fontsz;
-    textline->xshow = NULL;
-    textline->layout = NULL;
-    textline->free_layout = NULL;
+    para->width = 0.0;
+    para->width = fontsz;
+    para->xshow = NULL;
+    para->layout = NULL;
+    para->free_layout = NULL;
 
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE) && defined(HAVE_LIBGD)
+#if defined(WITH_CODEGENS) && !defined(HAVE_GD_FREETYPE) && defined(HAVE_LIBGD)
     if (Output_codegen == &GD_CodeGen) {
-       double scale = GD_drawing(g)->dpi) / POINTS_PER_INCH;
+       double scale = GD_drawing(g)->dpi / POINTS_PER_INCH;
        double fsize = fontsz * scale;  /* in pixels */
        *fontpath = "[internal gd]";
-       if ((p = textline->str))
-           textline->dimen.x = strlen(p) * builtinFontWd(fsize) / scale;
-       textline->dimen.y = builtinFontHt(fsize) / scale;
+       if ((p = para->str))
+           para->width = strlen(p) * builtinFontWd(fsize) / scale;
+       para->height = builtinFontHt(fsize) / scale;
        return;
     }
 #endif
@@ -159,19 +159,20 @@ estimate_textsize(graph_t *g, textline_t * textline, char *fontname, double font
        *fontpath = "[internal times]";
        Fontwidth = timesFontWidth;
     }
-    if ((p = textline->str)) {
+    if ((p = para->str)) {
        while ((c = *p++))
-           textline->dimen.x += Fontwidth[(unsigned char) c];
-       textline->dimen.x *= fontsz;
+           para->width += Fontwidth[(unsigned char) c];
+       para->width *= fontsz;
     }
 }
 
-pointf textsize(graph_t *g, textline_t * textline, char *fontname, double fontsize)
+pointf textsize(graph_t *g, textpara_t * para, char *fontname, double fontsize)
 {
     char *fontpath = NULL;
+    pointf size;
 
-    if (! gvtextlayout(GD_gvc(g), textline, fontname, fontsize, &fontpath))
-       estimate_textsize(g, textline, fontname, fontsize, &fontpath);
+    if (! gvtextlayout(GD_gvc(g), para, fontname, fontsize, &fontpath))
+       estimate_textsize(g, para, fontname, fontsize, &fontpath);
 
     if (Verbose) {
        if (emit_once(fontname)) {
@@ -179,5 +180,7 @@ pointf textsize(graph_t *g, textline_t * textline, char *fontname, double fontsi
                    fontname, fontpath);
        }
     }
-    return textline->dimen;
+    size.x = para->width;
+    size.y = para->height;
+    return size;
 }
index a640a55b1abc87f6e2ab6b401755e0cbec6467b1..8fbfaeb5635c4121435660550f90346c4c0dd1b1 100644 (file)
@@ -509,7 +509,7 @@ void gd_missingfont(char *err, char *fontreq)
 extern gdFontPtr gdFontTiny, gdFontSmall, gdFontMediumBold, gdFontLarge,
     gdFontGiant;
 
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
+#if defined(WITH_CODEGENS) && !defined(HAVE_GD_FREETYPE)
 /* builtinFont:
  * Map fontsz in pixels to builtin font.
  */
@@ -540,7 +540,7 @@ int builtinFontWd(double fontsz)
 }
 #endif
 
-static void gd_textline(point p, textline_t * line)
+static void gd_textpara(point p, textpara_t * para)
 {
     char *str, *fontlist, *err;
     pointf mp, ep;
@@ -567,24 +567,24 @@ static void gd_textline(point p, textline_t * line)
     else
        strex.flags |= gdFTEX_FONTCONFIG;
 
-    str = line->str;
-    fontlist = (char *)(line->layout); /* FIXME - kluge */
+    str = para->str;
+    fontlist = (char *)(para->layout); /* FIXME - kluge */
     fontsz = cstk[SP].fontsz;
 
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        mp.x = p.x;
        break;
     case 'r':
-       mp.x = p.x - line->dimen.x;
+       mp.x = p.x - para->width;
        break;
     default:
     case 'n':
-       mp.x = p.x - line->dimen.x / 2;
+       mp.x = p.x - para->width / 2;
        break;
     }
     ep.y = mp.y = p.y;
-    ep.x = mp.x + line->dimen.x;
+    ep.x = mp.x + para->width;
 
     mp = gdpt(mp);
     if (fontsz <= FONTSIZE_MUCH_TOO_SMALL) {
@@ -605,7 +605,7 @@ static void gd_textline(point p, textline_t * line)
 #endif
 #if 0
        fprintf(stderr,
-               "textline: font=%s size=%g pos=%g,%g width=%g dpi=%d width/dpi=%g\n",
+               "textpara: font=%s size=%g pos=%g,%g width=%g dpi=%d width/dpi=%g\n",
                fontlist, fontsz, mp.x, mp.y, (double) (brect[4] - brect[0]),
                strex.hdpi,
                (((double) (brect[4] - brect[0])) / strex.hdpi));
@@ -987,7 +987,7 @@ codegen_t GD_CodeGen = {
     0, /* gd_begin_edge */ 0,  /* gd_end_edge */
     gd_begin_context, gd_end_context,
     0, /* gd_begin_anchor */ 0,        /* gd_end_anchor */
-    gd_set_font, gd_textline,
+    gd_set_font, gd_textpara,
     gd_set_pencolor, gd_set_fillcolor, gd_set_style,
     gd_ellipse, gd_polygon,
     gd_bezier, gd_polyline,
index d825915e8a0e7da4988f0bc3cf4ae52133a44d3a..200555b95a92c622a94799025a11a9e04a8e71ad 100644 (file)
@@ -58,7 +58,7 @@ extern "C" {
     EXTERN char *specificItems;
     external char *Gvfilepath; /* Path of files allowed in 'shapefile' attrib  (also ps libs) */
 
-#ifndef DISABLE_CODEGENS
+#ifdef WITH_CODEGENS
     EXTERN int Output_lang;    /* POSTSCRIPT, DOT, etc. */
     EXTERN FILE *Output_file;
     EXTERN int Obj;
index 19372981206feac35e6c01c8848e23c6dae1a909..2636592427d0a2d54af541e1978b062b6bd710ee 100644 (file)
@@ -635,32 +635,31 @@ static void hpgl_set_style(char **s)
     }
 }
 
-static void hpgl_textline(point p, textline_t * line)
+static void hpgl_textpara(point p, textpara_t * para)
 {
     char buffer[128];
-    char *str = line->str;
 
     if (isInvis())
        return;
 
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        break;
     case 'r':
-       p.x -= line->dimen.x;
+       p.x -= para->width;
        break;
     default:
     case 'n':
-       p.x -= line->dimen.x / 2;
+       p.x -= para->width / 2;
        break;
     }
 
     sprintf(buffer, "PA%d,%d%s", CX(p.x), CY(p.y), Sep);
     output(buffer);
-    output_text(str);
+    output_text(para->str);
 
 #ifdef HPDEBUG
-    fprintf(stderr, "text =%s=\n", str);
+    fprintf(stderr, "text =%s=\n", para->str);
 #endif
 }
 
@@ -847,7 +846,7 @@ codegen_t HPGL_CodeGen = {
     0, /* hpgl_begin_edge */ 0,        /* hpgl_end_edge */
     hpgl_begin_context, hpgl_end_context,
     0, /* hpgl_begin_anchor */ 0,      /* hpgl_end_anchor */
-    hpgl_set_font, hpgl_textline,
+    hpgl_set_font, hpgl_textpara,
     hpgl_set_color, hpgl_set_color, hpgl_set_style,
     hpgl_ellipse, hpgl_polygon,
     hpgl_bezier, hpgl_polyline,
index a1b1e415b54b8b349fbe50c80aaa00c7abfe7432..b1586d2dae4fbc634448e40385e105ffe7e3f24f 100644 (file)
@@ -1110,7 +1110,7 @@ codegen_t MAP_CodeGen = {
     map_begin_edge, 0,         /* map_end_edge */
     0, /* map_begin_context */ 0,      /* map_end_context */
     map_begin_anchor, map_end_anchor,
-    0, /* map_set_font */ 0,   /* map_textline */
+    0, /* map_set_font */ 0,   /* map_textpara */
     0, /* map_set_color */ 0, /* map_set_color */ 0,   /* map_set_style */
     map_ellipse, map_polygon,
     0, /* map_bezier */ 0,     /* map_polyline */
index 0a22b94afcc6e883e6a7ff5a3b91f510900f4b81..bddd3b10ff0769c2456cee5c8f727390986fa799 100644 (file)
@@ -361,7 +361,7 @@ char *ps_string(char *ins, int latin)
     return agxbuse(&xb);
 }
 
-static void ps_textline(point p, textline_t * line)
+static void ps_textpara(point p, textpara_t * para)
 {
     double adj;
 
@@ -369,22 +369,22 @@ static void ps_textline(point p, textline_t * line)
        return;
     if (*S[SP].pencolor == '\0')
        return;
-    if (line->xshow) {
-       switch (line->just) {
+    if (para->xshow) {
+       switch (para->just) {
        case 'l':
            break;
        case 'r':
-           p.x -= line->dimen.x;
+           p.x -= para->width;
            break;
        default:
        case 'n':
-           p.x -= line->dimen.x / 2;
+           p.x -= para->width / 2;
            break;
        }
        fprintf(Output_file, "%d %d moveto\n%s\n[%s]\nxshow\n",
-               p.x, p.y, ps_string(line->str,isLatin1), line->xshow);
+               p.x, p.y, ps_string(para->str,isLatin1), para->xshow);
     } else {
-       switch (line->just) {
+       switch (para->just) {
        case 'l':
            adj = 0.0;
            break;
@@ -397,7 +397,7 @@ static void ps_textline(point p, textline_t * line)
            break;
        }
        fprintf(Output_file, "%d %d moveto %.1f %.1f %s alignedtext\n",
-               p.x, p.y, line->dimen.x, adj, ps_string(line->str,isLatin1));
+               p.x, p.y, para->width, adj, ps_string(para->str,isLatin1));
     }
 }
 
@@ -698,7 +698,7 @@ codegen_t PS_CodeGen = {
     ps_begin_edge, 0,          /* ps_end_edge */
     ps_begin_context, ps_end_context,
     0, /* ps_begin_anchor */ 0,        /* ps_end_anchor */
-    ps_set_font, ps_textline,
+    ps_set_font, ps_textpara,
     ps_set_pencolor, ps_set_fillcolor, ps_set_style,
     ps_ellipse, ps_polygon,
     ps_bezier, ps_polyline,
index 761580754ac4804a6dca6804d4060a513b583bc7..c5e0e2e4212288c4e26af016e34a8f3d9f6619af 100644 (file)
@@ -735,13 +735,13 @@ static void svg_set_style(char **s)
     /* if (cp->style_was_set) svg_style(cp); */
 }
 
-static void svg_textline(point p, textline_t * line)
+static void svg_textpara(point p, textpara_t * para)
 {
     char *anchor, *string;
     point mp;
     context_t *cp;
 
-    string = xml_string(line->str);
+    string = xml_string(para->str);
     if (!string[0])
        return;
 
@@ -752,22 +752,22 @@ static void svg_textline(point p, textline_t * line)
     }
 #if 0
 /* adobe svg doesn't like the dx propert */
-    if (line->xshow) {
+    if (para->xshow) {
        anchor = "start";
-       switch (line->just) {
+       switch (para->just) {
        case 'l':
            break;
        case 'r':
-           p.x -= line->width;
+           p.x -= para->width;
            break;
        default:
        case 'n':
-           p.x -= line->width / 2;
+           p.x -= para->width / 2;
            break;
        }
     } else {
 #endif
-       switch (line->just) {
+       switch (para->just) {
        case 'l':
            anchor = "start";
            break;
@@ -795,7 +795,7 @@ static void svg_textline(point p, textline_t * line)
 /* adobe svg doesn't like the dx propert */
     if (line->xshow) {
        svg_fputs("\" dx=\"");
-       svg_fputs(line->xshow);
+       svg_fputs(para->xshow);
     }
 #endif
     svg_fputs(">");
@@ -961,7 +961,7 @@ codegen_t SVG_CodeGen = {
     svg_begin_edge, svg_end_edge,
     svg_begin_context, svg_end_context,
     svg_begin_anchor, svg_end_anchor,
-    svg_set_font, svg_textline,
+    svg_set_font, svg_textpara,
     svg_set_pencolor, svg_set_fillcolor, svg_set_style,
     svg_ellipse, svg_polygon,
     svg_bezier, svg_polyline,
index d98be9bac798895654fff79da20de29a6ee16e13..789413f0700f5f58bf83f1955794e9a1ebd9b72f 100644 (file)
@@ -439,7 +439,7 @@ static void vrml_set_style(char **s)
     }
 }
 
-static void vrml_textline(point p, textline_t * line)
+static void vrml_textpara(point p, textpara_t * para)
 {
     char *fontlist, *err;
     pointf mp;
@@ -449,17 +449,17 @@ static void vrml_textline(point p, textline_t * line)
     if (Obj != NODE)
        return;
     cstk[SP].pencolor_ix = vrml_resolve_color(cstk[SP].pencolor);
-    fontlist = (char*)(line->layout); /* FIXME - kluge */
+    fontlist = (char*)(para->layout); /* FIXME - kluge */
 
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        break;
     case 'r':
-       p.x -= line->dimen.x;
+       p.x -= para->width;
        break;
     default:
     case 'n':
-       p.x -= line->dimen.x / 2;
+       p.x -= para->width / 2;
        break;
     }
 /*     p.y += cstk[SP].fontsz*2/3; */
@@ -468,11 +468,11 @@ static void vrml_textline(point p, textline_t * line)
 
     err = gdImageStringFT(im, brect, cstk[SP].pencolor_ix, fontlist,
                          cstk[SP].fontsz, (Rot ? 90.0 : 0.0) * PI / 180.0,
-                         ROUND(mp.x), ROUND(mp.y), line->str);
+                         ROUND(mp.x), ROUND(mp.y), para->str);
     if (err) {
        /* revert to builtin fonts */
        gdImageString(im, gdFontSmall, ROUND(mp.x), ROUND(mp.y),
-                     (unsigned char *) line->str, cstk[SP].pencolor_ix);
+                     (unsigned char *) para->str, cstk[SP].pencolor_ix);
     }
 }
 
@@ -1041,7 +1041,7 @@ codegen_t VRML_CodeGen = {
     vrml_begin_edge, vrml_end_edge,
     vrml_begin_context, vrml_end_context,
     0, /* vrml_begin_anchor */ 0,      /* vrml_end_anchor */
-    vrml_set_font, vrml_textline,
+    vrml_set_font, vrml_textpara,
     vrml_set_pencolor, vrml_set_fillcolor, vrml_set_style,
     vrml_ellipse, vrml_polygon,
     vrml_bezier, vrml_polyline,
index 2417a9620ac050c726bafc7a53d52b1361f68252..3ccbc07783c0a1e8c12f6bf3ec9e1f8e601bf8fd 100644 (file)
@@ -182,12 +182,12 @@ static void xd_str (char* pfx, char* s)
     agxbputc(xbufs[gvc->emit_state], ' ');
 }
 
-static void xd_textline(point p, textline_t * line)
+static void xd_textpara(point p, textpara_t * para)
 {
     char buf[BUFSIZ];
     int j;
 
-    switch (line->just) {
+    switch (para->just) {
     case 'l':
        j = -1;
        break;
@@ -199,9 +199,9 @@ static void xd_textline(point p, textline_t * line)
        j = 0;
        break;
     }
-    sprintf(buf, "T %d %d %d %d ", p.x, YDIR(p.y), j, (int) line->dimen.x);
+    sprintf(buf, "T %d %d %d %d ", p.x, YDIR(p.y), j, (int) para->width);
     agxbput(xbufs[gvc->emit_state], buf);
-    xd_str ("", line->str);
+    xd_str ("", para->str);
 }
 
 static void xd_ellipse(point p, int rx, int ry, int filled)
@@ -328,7 +328,7 @@ codegen_t XDot_CodeGen = {
     0, /* xd_begin_edge */ 0, /* xd_end_edge */
     0, /* xd_begin_context */ 0,       /* xd_context */
     0, /* xd_begin_anchor */ 0,        /* xd_anchor */
-    xd_set_font, xd_textline,
+    xd_set_font, xd_textpara,
     xd_set_pencolor, xd_set_fillcolor, xd_set_style,
     xd_ellipse, xd_polygon,
     xd_bezier, xd_polyline,