return TRUE;
}
-void emit_background(GVJ_t * job, graph_t *g)
+static void emit_background(GVJ_t * job, graph_t *g)
{
char *str;
- if (! ((str = agget(g, "bgcolor")) && str[0])) {
- if (job->flags & GVRENDER_NO_BG)
- str = "transparent";
- else
- str = "white";
- }
-
- gvrender_set_fillcolor(job, str);
- gvrender_set_pencolor(job, str);
- if (!(job->flags & GVRENDER_NO_BG))
+ /* if no bgcolor specified - first assume default of "transparent" */
+ if (! ((str = agget(g, "bgcolor")) && str[0]))
+ str = "transparent";
+
+ /* if device has no truecolor support, change "transparent" (default or given) to "white" */
+ if (! (job->flags & GVDEVICE_DOES_TRUECOLOR) && (streq(str, "transparent")))
+ str = "white";
+
+ /* except for "tranparent" on truecolor, or "white" on (assumed) white paper, paint background */
+ if (!( ((job->flags & GVDEVICE_DOES_TRUECOLOR) && streq(str, "transparent"))
+ || ((job->flags & GVRENDER_NO_WHITE_BG) && streq(str, "white")))) {
+ gvrender_set_fillcolor(job, str);
+ gvrender_set_pencolor(job, str);
gvrender_box(job, job->clip, TRUE); /* filled */
+ }
}
static void setup_page(GVJ_t * job, graph_t * g)
extern void dotneato_write(GVC_t * gvc, graph_t *g);
extern void dotneato_write_one(GVC_t * gvc, graph_t *g);
extern double elapsed_sec(void);
- extern void emit_background(GVJ_t * job, graph_t *g);
extern void emit_clusters(GVJ_t * job, Agraph_t * g, int flags);
/* extern void emit_begin_edge(GVJ_t * job, edge_t * e, char**); */
/* extern void emit_end_edge(GVJ_t * job); */
GVDEVICE_DOES_PAGES provides pagination support -Tps
GVDEVICE_DOES_LAYERS provides support for layers -Tps
GVDEVICE_EVENTS supports mouse events -Tgtk, -Txlib
- GVDEVICE_DOES_TRUECOLOR supports alph channel -Tpng, -Tgtk, -Txlib
+ GVDEVICE_DOES_TRUECOLOR supports alpha channel -Tpng, -Tgtk, -Txlib
GVDEVICE_BINARY_FORMAT Suppresses \r\n substitution for linends
GVDEVICE_COMPRESSED_FORMAT controls libz compression
GVDEVICE_NO_WRITER used when gvdevice is not used because device uses its own writer, -Tming, devil outputs (FIXME seems to overlap OUTPUT_NOT_REQUIRED)
GVRENDER_DOES_TOOLTIPS can represent tooltip info -Tcmapx, -Tsvg
GVRENDER_DOES_TARGETS can represent target info (open link in a new tab or window)
GVRENDER_DOES_Z render support 2.5D representation -Tvrml
- GVRENDER_NO_BG don't paint white background, assumes white paper -Tps
+ GVRENDER_NO_WHITE_BG don't paint white background, assumes white paper -Tps
LAYOUT_NOT_REQUIRED don't perform layout -Tcanon
OUTPUT_NOT_REQUIRED don't use gvdevice for output (basically when agwrite() used instead) -Tcanon, -Txdot
*/
#define GVRENDER_DOES_TOOLTIPS (1<<22)
#define GVRENDER_DOES_TARGETS (1<<23)
#define GVRENDER_DOES_Z (1<<24)
-#define GVRENDER_NO_BG (1<<25)
+#define GVRENDER_NO_WHITE_BG (1<<25)
#define LAYOUT_NOT_REQUIRED (1<<26)
#define OUTPUT_NOT_REQUIRED (1<<27)
static gvrender_features_t render_features_ps = {
GVRENDER_DOES_TRANSFORM
| GVRENDER_DOES_MAPS
- | GVRENDER_NO_BG
+ | GVRENDER_NO_WHITE_BG
| GVRENDER_DOES_MAP_RECTANGLE,
4., /* default pad - graph units */
NULL, /* knowncolors */
gvrender_features_t render_features_tk = {
GVRENDER_Y_GOES_DOWN
- | GVRENDER_NO_BG, /* flags */
+ | GVRENDER_NO_WHITE_BG, /* flags */
4., /* default pad - graph units */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
static gvrender_features_t render_features_lasi = {
GVRENDER_DOES_TRANSFORM
| GVRENDER_DOES_MAPS
- | GVRENDER_NO_BG
+ | GVRENDER_NO_WHITE_BG
| GVRENDER_DOES_MAP_RECTANGLE,
4., /* default pad - graph units */
NULL, /* knowncolors */
GVDEVICE_DOES_PAGES
| GVDEVICE_BINARY_FORMAT
| GVDEVICE_DOES_TRUECOLOR
- | GVRENDER_NO_BG, /* flags */
+ | GVRENDER_NO_WHITE_BG, /* flags */
{36.,36.}, /* default margin - points */
{0.,0.}, /* default page width, height - points */
{72.,72.} /* dpi */