Graphviz-specific `boolean`s. Similarly the `ignoreSwap` and `isOrtho` members
of this struct must now be C99 `bool`s instead of a Graphviz-specific
`boolean`s.
+- **Breaking**: The `defined`, `constrained`, `clip`, and `dyna` fields of the
+ `port` struct are now C99 `bool`s instead of Graphviz-specific `boolean`s.
- **Breaking**: Graphviz headers no longer define the constant `MAXSHORT`. A
drop-in replacement is `SHRT_MAX` in the C standard library’s limits.h.
- **Breaking**: Graphviz headers no lnger define `NIL` macros. A drop-in
void (*vertex_gen) (pointf*, pointf*);
} poly_desc_t;
-static port Center = {.theta = -1, .clip = 1};
+static port Center = {.theta = -1, .clip = true};
#define ATTR_SET(a,n) ((a) && (*(agxget(n,a->index)) != '\0'))
/* Default point size = 0.05 inches or 3.6 points */
angle -= 2 * M_PI;
pp->order = (int) (MC_SCALE * angle / (2 * M_PI));
}
- pp->constrained = constrain ? TRUE : FALSE;
- pp->defined = defined ? TRUE : FALSE;
- pp->clip = clip ? TRUE : FALSE;
- pp->dyna = dyna ? TRUE : FALSE;
+ pp->constrained = constrain;
+ pp->defined = defined;
+ pp->clip = clip;
+ pp->dyna = dyna;
return rv;
}
if (merge) {
/*P->start.theta = - M_PI / 2; */
P->start.theta = conc_slope(agtail(e));
- P->start.constrained = TRUE;
+ P->start.constrained = true;
} else {
if (ED_tail_port(e).constrained) {
P->start.theta = ED_tail_port(e).theta;
- P->start.constrained = TRUE;
+ P->start.constrained = true;
} else
- P->start.constrained = FALSE;
+ P->start.constrained = false;
}
P->nbox = 0;
P->data = (void *) e;
}
for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
if (n == agtail(orig))
- ED_tail_port(orig).clip = FALSE;
+ ED_tail_port(orig).clip = false;
else
- ED_head_port(orig).clip = FALSE;
+ ED_head_port(orig).clip = false;
return;
}
if (et == FLATEDGE && (side = ED_tail_port(e).side)) {
}
for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
if (n == agtail(orig))
- ED_tail_port(orig).clip = FALSE;
+ ED_tail_port(orig).clip = false;
else
- ED_head_port(orig).clip = FALSE;
+ ED_head_port(orig).clip = false;
endp->sidemask = side;
return;
}
/*P->end.theta = M_PI / 2; */
P->end.theta = conc_slope(aghead(e)) + M_PI;
assert(P->end.theta < 2 * M_PI);
- P->end.constrained = TRUE;
+ P->end.constrained = true;
} else {
if (ED_head_port(e).constrained) {
P->end.theta = ED_head_port(e).theta;
- P->end.constrained = TRUE;
+ P->end.constrained = true;
} else
- P->end.constrained = FALSE;
+ P->end.constrained = false;
}
endp->np = P->end.p;
if (et == REGULAREDGE && ND_node_type(n) == NORMAL && (side = ED_head_port(e).side)) {
}
for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
if (n == aghead(orig))
- ED_head_port(orig).clip = FALSE;
+ ED_head_port(orig).clip = false;
else
- ED_tail_port(orig).clip = FALSE;
+ ED_tail_port(orig).clip = false;
endp->sidemask = side;
return;
}
}
for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
if (n == aghead(orig))
- ED_head_port(orig).clip = FALSE;
+ ED_head_port(orig).clip = false;
else
- ED_tail_port(orig).clip = FALSE;
+ ED_tail_port(orig).clip = false;
endp->sidemask = side;
return;
}
boxf *bp; /* if not null, points to bbox of
* rectangular area that is port target
*/
- boolean defined; /* if true, edge has port info at this end */
- boolean constrained; /* if true, constraints such as theta are set */
- boolean clip; /* if true, clip end to node/port shape */
- boolean dyna; /* if true, assign compass point dynamically */
+ bool defined; /* if true, edge has port info at this end */
+ bool constrained; /* if true, constraints such as theta are set */
+ bool clip; /* if true, clip end to node/port shape */
+ bool dyna; /* if true, assign compass point dynamically */
unsigned char order; /* for mincross */
unsigned char side; /* if port is on perimeter of node, this
* contains the bitwise OR of the sides (TOP,
ND_has_port(agtail(e)) = TRUE;
ED_tail_port(e) = chkPort (ND_shape(agtail(e))->fns->portfn, agtail(e), str);
if (noClip(e, E_tailclip))
- ED_tail_port(e).clip = FALSE;
+ ED_tail_port(e).clip = false;
str = agget(e, HEAD_ID);
/* libgraph always defines tailport/headport; libcgraph doesn't */
if (!str) str = "";
ND_has_port(aghead(e)) = TRUE;
ED_head_port(e) = chkPort(ND_shape(aghead(e))->fns->portfn, aghead(e), str);
if (noClip(e, E_headclip))
- ED_head_port(e).clip = FALSE;
+ ED_head_port(e).clip = false;
return r;
}
int portcmp(port p0, port p1)
{
- if (p1.defined == FALSE)
+ if (!p1.defined)
return p0.defined ? 1 : 0;
- if (p0.defined == FALSE)
+ if (!p0.defined)
return -1;
if (p0.p.x < p1.p.x)
return -1;
while (ED_to_virt(le))
le = ED_to_virt(le);
aghead(&fwdedgea.out) = aghead(le);
- ED_head_port(&fwdedgea.out).defined = FALSE;
+ ED_head_port(&fwdedgea.out).defined = false;
ED_edge_type(&fwdedgea.out) = VIRTUAL;
ED_head_port(&fwdedgea.out).p.x = ED_head_port(&fwdedgea.out).p.y = 0;
ED_to_orig(&fwdedgea.out) = e;
ND_coord(hn).y + GD_rank(g)[ND_rank(hn)].ht2);
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
hend.boxes[hend.boxn++] = b;
- P->end.theta = M_PI / 2, P->end.constrained = TRUE;
+ P->end.theta = M_PI / 2, P->end.constrained = true;
assert(boxes.size <= (size_t)INT_MAX && "integer overflow");
completeregularpath(P, segfirst, e, &tend, &hend, boxes.data,
(int)boxes.size, 1);
ND_coord(tn).y - GD_rank(g)[ND_rank(tn)].ht1);
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
tend.boxes[tend.boxn++] = b;
- P->start.theta = -M_PI / 2, P->start.constrained = TRUE;
+ P->start.theta = -M_PI / 2, P->start.constrained = true;
smode = FALSE;
}
boxes_append(&boxes, rank_box(sp, g, ND_rank(tn)));
return ((ED_head_port(e).defined == ED_head_port(f).defined)
&& (((ED_head_port(e).p.x == ED_head_port(f).p.x) &&
(ED_head_port(e).p.y == ED_head_port(f).p.y))
- || (ED_head_port(e).defined == FALSE))
+ || !ED_head_port(e).defined)
&& (((ED_tail_port(e).p.x == ED_tail_port(f).p.x) &&
(ED_tail_port(e).p.y == ED_tail_port(f).p.y))
- || (ED_tail_port(e).defined == FALSE))
+ || !ED_tail_port(e).defined)
);
}
#include <math.h>
#include <dotgen/dot.h>
+#include <stdbool.h>
#include <stddef.h>
#define MAXSAME 5 /* max no of same{head,tail} groups on a node */
prt.bp = 0;
prt.order =
(MC_SCALE * (ND_lw(u) + prt.p.x)) / (ND_lw(u) + ND_rw(u));
- prt.constrained = FALSE;
- prt.defined = TRUE;
- prt.clip = FALSE;
- prt.dyna = FALSE;
+ prt.constrained = false;
+ prt.defined = true;
+ prt.clip = false;
+ prt.dyna = false;
prt.theta = 0;
prt.side = 0;
prt.name = NULL;