the non-curved case.
ID="<I>value</I>"
PORT="<I>portName</I>"
ROWS="<I>value</I>"
+ SIDES="<I>value</I>"
STYLE="<I>value</I>"
TARGET="<I>value</I>"
TITLE="<I>value</I>"
ID="<I>value</I>"
PORT="<I>portName</I>"
ROWSPAN="<I>value</I>"
+ SIDES="<I>value</I>"
STYLE="<I>value</I>"
TARGET="<I>value</I>"
TITLE="<I>value</I>"
an image's <B><I>SCALE</I></B> attribute.
</BLOCKQUOTE>
+<B><I><FONT SIZE=-1>SIDES="value"</FONT></I></B>
+<BLOCKQUOTE>
+specifies which sides of a border in a cell or table should be drawn, if
+a border is drawn. By default, all sides are drawn. The <TT>"value"</TT>
+string can contain any collection of the (case-insensitive)
+characters <TT>'L'</TT>, <TT>'T'</TT>, <TT>'R'</TT>, or <TT>'B'</TT>,
+corresponding to the left, top, right and, bottom sides of the border,
+respectively. For example, <TT>SIDES="LB"</TT> would indicate only the
+left and bottom segments of the border should be drawn.
+</BLOCKQUOTE>
+
<B><I><FONT SIZE=-1>SRC="value"</FONT></I></B>
<BLOCKQUOTE>
specifies the image file to be displayed in the cell.
ID="<I>value</I>"
PORT="<I>portName</I>"
ROWS="<I>value</I>"
+ SIDES="<I>value</I>"
STYLE="<I>value</I>"
TARGET="<I>value</I>"
TITLE="<I>value</I>"
ID="<I>value</I>"
PORT="<I>portName</I>"
ROWSPAN="<I>value</I>"
+ SIDES="<I>value</I>"
STYLE="<I>value</I>"
TARGET="<I>value</I>"
TITLE="<I>value</I>"
an image's <B><I>SCALE</I></B> attribute.
</BLOCKQUOTE>
+<B><I><FONT SIZE=-1>SIDES="value"</FONT></I></B>
+<BLOCKQUOTE>
+specifies which sides of a border in a cell or table should be drawn, if
+a border is drawn. By default, all sides are drawn. The <TT>"value"</TT>
+string can contain any collection of the (case-insensitive)
+characters <TT>'L'</TT>, <TT>'T'</TT>, <TT>'R'</TT>, or <TT>'B'</TT>,
+corresponding to the left, top, right and, bottom sides of the border,
+respectively. For example, <TT>SIDES="LB"</TT> would indicate only the
+left and bottom segments of the border should be drawn.
+</BLOCKQUOTE>
+
<B><I><FONT SIZE=-1>SRC="value"</FONT></I></B>
<BLOCKQUOTE>
specifies the image file to be displayed in the cell.
return 0;
}
+static int sidesfn(htmldata_t * p, char *v)
+{
+ unsigned short flags = 0;
+ char c;
+
+ while ((c = *v++)) {
+ switch (tolower(c)) {
+ case 'l' :
+ flags |= BORDER_LEFT;
+ break;
+ case 't' :
+ flags |= BORDER_TOP;
+ break;
+ case 'r' :
+ flags |= BORDER_RIGHT;
+ break;
+ case 'b' :
+ flags |= BORDER_BOTTOM;
+ break;
+ default :
+ agerr(AGWARN, "Unrecognized character '%c' (%d) in sides attribute\n", c, c);
+ break;
+ }
+ }
+ if (flags != BORDER_MASK)
+ p->flags |= flags;
+ return 0;
+}
+
static int titlefn(htmldata_t * p, char *v)
{
p->title = strdup(v);
{"id", (attrFn) idfn},
{"port", (attrFn) portfn},
{"rows", (attrFn) rowsfn},
+ {"sides", (attrFn) sidesfn},
{"style", (attrFn) stylefn},
{"target", (attrFn) targetfn},
{"title", (attrFn) titlefn},
{"id", (attrFn) idfn},
{"port", (attrFn) portfn},
{"rowspan", (attrFn) rowspanfn},
+ {"sides", (attrFn) sidesfn},
{"style", (attrFn) stylefn},
{"target", (attrFn) targetfn},
{"title", (attrFn) titlefn},
*/
static void doBorder(GVJ_t * job, htmldata_t * dp, boxf b)
{
- pointf AF[4];
+ pointf AF[6];
char *sptr[2];
char *color = (dp->pencolor ? dp->pencolor : DEFAULT_COLOR);
+ unsigned short sides;
gvrender_set_pencolor(job, color);
if ((dp->style & (DASHED | DOTTED))) {
if (dp->style & ROUNDED)
round_corners(job, mkPts(AF, b, dp->border), 4, ROUNDED, 0);
- else {
+ else if ((sides = (dp->flags & BORDER_MASK))) {
+ mkPts (AF+1, b, dp->border); /* AF[1-4] has LL=SW,SW,UR=NE,NW */
+ switch (sides) {
+ case BORDER_BOTTOM :
+ gvrender_polyline(job, AF+1, 2);
+ break;
+ case BORDER_RIGHT :
+ gvrender_polyline(job, AF+2, 2);
+ break;
+ case BORDER_TOP :
+ gvrender_polyline(job, AF+3, 2);
+ break;
+ case BORDER_LEFT :
+ AF[0] = AF[4];
+ gvrender_polyline(job, AF, 2);
+ break;
+ case BORDER_BOTTOM|BORDER_RIGHT :
+ gvrender_polyline(job, AF+1, 3);
+ break;
+ case BORDER_RIGHT|BORDER_TOP :
+ gvrender_polyline(job, AF+2, 3);
+ break;
+ case BORDER_TOP|BORDER_LEFT :
+ AF[5] = AF[1];
+ gvrender_polyline(job, AF+3, 3);
+ break;
+ case BORDER_LEFT|BORDER_BOTTOM :
+ AF[0] = AF[4];
+ gvrender_polyline(job, AF, 3);
+ break;
+ case BORDER_BOTTOM|BORDER_RIGHT|BORDER_TOP :
+ gvrender_polyline(job, AF+1, 4);
+ break;
+ case BORDER_RIGHT|BORDER_TOP|BORDER_LEFT :
+ AF[5] = AF[1];
+ gvrender_polyline(job, AF+2, 4);
+ break;
+ case BORDER_TOP|BORDER_LEFT|BORDER_BOTTOM :
+ AF[5] = AF[1];
+ AF[6] = AF[2];
+ gvrender_polyline(job, AF+3, 4);
+ break;
+ case BORDER_LEFT|BORDER_BOTTOM|BORDER_RIGHT :
+ AF[0] = AF[4];
+ gvrender_polyline(job, AF, 4);
+ break;
+ case BORDER_TOP|BORDER_BOTTOM :
+ gvrender_polyline(job, AF+1, 2);
+ gvrender_polyline(job, AF+3, 2);
+ break;
+ case BORDER_LEFT|BORDER_RIGHT :
+ AF[0] = AF[4];
+ break;
+ }
+ } else {
if (dp->border > 1) {
double delta = ((double) dp->border) / 2.0;
b.LL.x += delta;
#define BALIGN_RIGHT (1 << 8)
#define BALIGN_LEFT (1 << 9)
#define BALIGN_MASK (BALIGN_RIGHT | BALIGN_LEFT)
+#define BORDER_LEFT (1 << 10)
+#define BORDER_TOP (1 << 11)
+#define BORDER_RIGHT (1 << 12)
+#define BORDER_BOTTOM (1 << 13)
+#define BORDER_MASK (BORDER_LEFT|BORDER_TOP|BORDER_RIGHT|BORDER_BOTTOM)
#define UNSET_ALIGN 0