static void figptarray(GVJ_t *job, pointf * A, int n, int close) { int i; point p; for (i = 0; i < n; i++) { PF2P(A[i],p); core_printf(job, " %d %d", p.x, p.y); } if (close) { PF2P(A[0],p); core_printf(job, " %d %d", p.x, p.y); } core_fputs(job, "\n"); }
static void map_begin_cluster(GVJ_t * job) { obj_state_t *obj = job->obj; core_printf(job, "%% %s\n", obj->u.sg->name); map_output_shape(job, obj->url_map_shape, obj->url_map_p, obj->url_map_n, obj->url, obj->tooltip, obj->target); }
/* The core program expands the knot by one unit. */ void the_core() { knot_t* knot0; core_printf("\ncore begin: \n"); core_runs ++; knot0 = knot; knot = alloc(knot_t); core_printf("created %p\n", knot); if( knot0 ) { knot->ptr = knot0->ptr; knot0->ptr = knot; } else knot->ptr = knot; core_printf("core done.\n"); }
static void core_loadimage_fig(GVJ_t * job, usershape_t *us, boxf bf, bool filled) { int object_code = 2; /* always 2 for polyline */ int sub_type = 5; /* always 5 for image */ int line_style = 0; /* solid, dotted, dashed */ int thickness = 0; int pen_color = 0; int fill_color = -1; int depth = 1; int pen_style = -1; /* not used */ int area_fill = 0; double style_val = 0.0; int join_style = 0; int cap_style = 0; int radius = 0; int forward_arrow = 0; int backward_arrow = 0; int npoints = 5; int flipped = 0; box b; assert(job); assert(us); assert(us->name); assert(us->f); BF2B(bf, b); core_printf(job, "%d %d %d %d %d %d %d %d %d %.1f %d %d %d %d %d %d\n %d %s\n", object_code, sub_type, line_style, thickness, pen_color, fill_color, depth, pen_style, area_fill, style_val, join_style, cap_style, radius, forward_arrow, backward_arrow, npoints, flipped, us->name); core_printf(job," %d %d %d %d %d %d %d %d %d %d\n", b.LL.x, b.LL.y, b.LL.x, b.UR.y, b.UR.x, b.UR.y, b.UR.x, b.LL.y, b.LL.x, b.LL.y); }
static void core_loadimage_svg(GVJ_t * job, usershape_t *us, boxf b, bool filled) { assert(job); assert(us); assert(us->name); assert(us->f); core_fputs(job, "<image xlink:href=\""); core_fputs(job, us->name); if (job->rotation) { core_printf (job, "\" width=\"%gpx\" height=\"%gpx\" preserveAspectRatio=\"xMidYMid meet\" x=\"%g\" y=\"%g\"", b.UR.y - b.LL.y, b.UR.x - b.LL.x, b.LL.x, b.UR.y); core_printf (job, " transform=\"rotate(%d %g %g)\"", job->rotation, b.LL.x, b.UR.y); } else { core_printf (job, "\" width=\"%gpx\" height=\"%gpx\" preserveAspectRatio=\"xMidYMid meet\" x=\"%g\" y=\"%g\"", b.UR.x - b.LL.x, b.UR.y - b.LL.y, b.LL.x, b.LL.y); } core_fputs(job, "/>\n"); }
static void map_output_shape (GVJ_t *job, map_shape_t map_shape, pointf * AF, int nump, char* url, char *tooltip, char *target) { int i; static point *A; static int size_A; if (!AF || !nump) return; if (size_A < nump) { size_A = nump + 10; A = realloc(A, size_A * sizeof(point)); } for (i = 0; i < nump; i++) PF2P(AF[i], A[i]); if (job->render.id == FORMAT_IMAP && url && url[0]) { switch (map_shape) { case MAP_RECTANGLE: /* Y_GOES_DOWN so need UL to LR */ core_printf(job, "rect %s %d,%d %d,%d\n", url, A[0].x, A[1].y, A[1].x, A[0].y); break; case MAP_CIRCLE: core_printf(job, "circle %s %d,%d,%d\n", url, A[0].x, A[0].y, A[1].x-A[0].x); break; case MAP_POLYGON: core_printf(job, "poly %s", url); for (i = 0; i < nump; i++) core_printf(job, " %d,%d", A[i].x, A[i].y); core_fputs(job, "\n"); break; default: assert(0); break; } } else if (job->render.id == FORMAT_ISMAP && url && url[0]) { switch (map_shape) { case MAP_RECTANGLE: /* Y_GOES_DOWN so need UL to LR */ core_printf(job, "rectangle (%d,%d) (%d,%d) %s %s\n", A[0].x, A[1].y, A[1].x, A[0].y, url, tooltip); break; default: assert(0); break; } } else if (job->render.id == FORMAT_CMAP || job->render.id == FORMAT_CMAPX) { switch (map_shape) { case MAP_CIRCLE: core_fputs(job, "<area shape=\"circle\""); break; case MAP_RECTANGLE: core_fputs(job, "<area shape=\"rect\""); break; case MAP_POLYGON: core_fputs(job, "<area shape=\"poly\""); break; default: assert(0); break; } if (url && url[0]) { core_fputs(job, " href=\""); core_fputs(job, xml_string(url)); core_fputs(job, "\""); } if (target && target[0]) { core_fputs(job, " target=\""); core_fputs(job, xml_string(target)); core_fputs(job, "\""); } if (tooltip && tooltip[0]) { core_fputs(job, " title=\""); core_fputs(job, xml_string(tooltip)); core_fputs(job, "\""); } /* * alt text is intended for the visually impaired, but such * folk are not likely to be clicking around on a graph anyway. * IE on the PC platform (but not on Macs) incorrectly * uses (non-empty) alt strings instead of title strings for tooltips. * To make tooltips work and avoid this IE issue, * while still satisfying usability guidelines * that require that there is always an alt string, * we generate just an empty alt string. */ core_fputs(job, " alt=\"\""); core_fputs(job, " coords=\""); switch (map_shape) { case MAP_CIRCLE: core_printf(job, "%d,%d,%d", A[0].x, A[0].y, A[1].x); break; case MAP_RECTANGLE: /* Y_GOES_DOWN so need UL to LR */ core_printf(job, "%d,%d,%d,%d", A[0].x, A[1].y, A[1].x, A[0].y); break; case MAP_POLYGON: core_printf(job, "%d,%d", A[0].x, A[0].y); for (i = 1; i < nump; i++) core_printf(job, " %d,%d", A[i].x, A[i].y); break; default: break; } if (job->render.id == FORMAT_CMAPX) core_fputs(job, "\"/>\n"); else core_fputs(job, "\">\n"); } }