| 1 |
/// @file |
| 2 |
/// @ingroup common_utils |
| 3 |
/************************************************************************* |
| 4 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 5 |
* All rights reserved. This program and the accompanying materials |
| 6 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 7 |
* which accompanies this distribution, and is available at |
| 8 |
* https://www.eclipse.org/legal/epl-v10.html |
| 9 |
* |
| 10 |
* Contributors: Details at https://graphviz.org |
| 11 |
*************************************************************************/ |
| 12 |
|
| 13 |
#pragma once |
| 14 |
|
| 15 |
#define LPAREN '(' |
| 16 |
#define RPAREN ')' |
| 17 |
#define LBRACE '{' |
| 18 |
#define RBRACE '}' |
| 19 |
|
| 20 |
/* node,edge types */ |
| 21 |
#ifdef NORMAL |
| 22 |
#undef NORMAL |
| 23 |
#endif |
| 24 |
#define NORMAL 0 /* an original input node */ |
| 25 |
#define VIRTUAL 1 /* virtual nodes in long edge chains */ |
| 26 |
#define SLACKNODE 2 /* encode edges in node position phase */ |
| 27 |
#define REVERSED 3 /* reverse of an original edge */ |
| 28 |
#define FLATORDER 4 /* for ordered edges */ |
| 29 |
#define CLUSTER_EDGE 5 /* for ranking clusters */ |
| 30 |
#define IGNORED 6 /* concentrated multi-edges */ |
| 31 |
|
| 32 |
/* collapsed node classifications */ |
| 33 |
#define NOCMD 0 /* default */ |
| 34 |
#define SAMERANK 1 /* place on same rank */ |
| 35 |
#define MINRANK 2 /* place on "least" rank */ |
| 36 |
#define SOURCERANK 3 /* strict version of MINRANK */ |
| 37 |
#define MAXRANK 4 /* place on "greatest" rank */ |
| 38 |
#define SINKRANK 5 /* strict version of MAXRANK */ |
| 39 |
#define LEAFSET 6 /* set of collapsed leaf nodes */ |
| 40 |
#define CLUSTER 7 /* set of clustered nodes */ |
| 41 |
|
| 42 |
/* type of cluster rank assignment */ |
| 43 |
#define LOCAL 100 |
| 44 |
#define GLOBAL 101 |
| 45 |
#define NOCLUST 102 |
| 46 |
|
| 47 |
/* default attributes */ |
| 48 |
#define DEFAULT_COLOR "black" |
| 49 |
#define DEFAULT_ACTIVEPENCOLOR "#808080" |
| 50 |
#define DEFAULT_ACTIVEFILLCOLOR "#fcfcfc" |
| 51 |
#define DEFAULT_ACTIVEFONTCOLOR "black" |
| 52 |
#define DEFAULT_SELECTEDPENCOLOR "#303030" |
| 53 |
#define DEFAULT_SELECTEDFILLCOLOR "#e8e8e8" |
| 54 |
#define DEFAULT_SELECTEDFONTCOLOR "black" |
| 55 |
#define DEFAULT_DELETEDPENCOLOR "#e0e0e0" |
| 56 |
#define DEFAULT_DELETEDFILLCOLOR "#f0f0f0" |
| 57 |
#define DEFAULT_DELETEDFONTCOLOR "darkgrey" |
| 58 |
#define DEFAULT_VISITEDPENCOLOR "#101010" |
| 59 |
#define DEFAULT_VISITEDFILLCOLOR "#f8f8f8" |
| 60 |
#define DEFAULT_VISITEDFONTCOLOR "black" |
| 61 |
#define DEFAULT_FONTSIZE 14.0 |
| 62 |
#define DEFAULT_LABEL_FONTSIZE 11.0 /* for head/taillabel */ |
| 63 |
#define MIN_FONTSIZE 1.0 |
| 64 |
#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED) |
| 65 |
#define DEFAULT_FONTNAME "TimesNewRomanPSMT" |
| 66 |
#else |
| 67 |
#define DEFAULT_FONTNAME "Times-Roman" |
| 68 |
#endif |
| 69 |
#define DEFAULT_FILL "lightgrey" |
| 70 |
#define LINESPACING 1.20 |
| 71 |
|
| 72 |
#define DEFAULT_NODEHEIGHT 0.5 |
| 73 |
#define MIN_NODEHEIGHT 0.02 |
| 74 |
#define DEFAULT_NODEWIDTH 0.75 |
| 75 |
#define MIN_NODEWIDTH 0.01 |
| 76 |
#define DEFAULT_NODESHAPE "ellipse" |
| 77 |
#define DEFAULT_NODEPENWIDTH 1.0 |
| 78 |
#define MIN_NODEPENWIDTH 0.0 |
| 79 |
|
| 80 |
#define NODENAME_ESC "\\N" |
| 81 |
|
| 82 |
#define DEFAULT_LAYERSEP ":\t " |
| 83 |
#define DEFAULT_LAYERLISTSEP "," |
| 84 |
|
| 85 |
#define DEFAULT_NODESEP 0.25 |
| 86 |
#define MIN_NODESEP 0.02 |
| 87 |
#define DEFAULT_RANKSEP 0.5 |
| 88 |
#define MIN_RANKSEP 0.02 |
| 89 |
|
| 90 |
|
| 91 |
/* default margin for paged formats such as PostScript - in points = 0.5in */ |
| 92 |
#define DEFAULT_PRINT_MARGIN 36 |
| 93 |
/* default margin for embedded formats such as PNG - in points */ |
| 94 |
#define DEFAULT_EMBED_MARGIN 0 |
| 95 |
/* default padding around graph - in points */ |
| 96 |
#define DEFAULT_GRAPH_PAD 4 |
| 97 |
|
| 98 |
#define SELF_EDGE_SIZE 18 |
| 99 |
#define MC_SCALE 256 /* for mincross */ |
| 100 |
|
| 101 |
#define PORT_LABEL_DISTANCE 10 |
| 102 |
#define PORT_LABEL_ANGLE -25 /* degrees; pos is CCW, neg is CW */ |
| 103 |
|
| 104 |
/* default polygon sample size for overlap removal and maps */ |
| 105 |
#define DFLT_SAMPLE 20 |
| 106 |
|
| 107 |
/* arrow types */ |
| 108 |
#define ARR_NONE 0 |
| 109 |
|
| 110 |
/* sides (e.g. of cluster margins) */ |
| 111 |
#define BOTTOM_IX 0 |
| 112 |
#define RIGHT_IX 1 |
| 113 |
#define TOP_IX 2 |
| 114 |
#define LEFT_IX 3 |
| 115 |
|
| 116 |
/* sides of boxes for SHAPE_path */ |
| 117 |
#define BOTTOM (1<<BOTTOM_IX) |
| 118 |
#define RIGHT (1<<RIGHT_IX) |
| 119 |
#define TOP (1<<TOP_IX) |
| 120 |
#define LEFT (1<<LEFT_IX) |
| 121 |
|
| 122 |
/* Obj types for renderers */ |
| 123 |
#define NONE 0 |
| 124 |
#define NODE 1 |
| 125 |
#define EDGE 2 |
| 126 |
#define CLST 3 |
| 127 |
|
| 128 |
/* output languages */ |
| 129 |
#define PCL 3 /* Printer Control Language */ |
| 130 |
#define MIF 4 /* Adobe FrameMaker */ |
| 131 |
|
| 132 |
#define VTX 21 /* visual thought */ |
| 133 |
#define METAPOST 22 |
| 134 |
|
| 135 |
#define QPDF 30 /* Quartz paged PDF */ |
| 136 |
|
| 137 |
#define GVRENDER_PLUGIN 300 /* a plugin supported language */ |
| 138 |
#define NO_SUPPORT 999 /* no support */ |
| 139 |
|
| 140 |
/* for clusters */ |
| 141 |
#define CL_BACK 10 /* cost of backward pointing edge */ |
| 142 |
#define CL_OFFSET 8 /* margin of cluster box in PS points */ |
| 143 |
#ifndef _WIN32 |
| 144 |
#define CL_CROSS 1000 /* cost of cluster skeleton edge crossing */ |
| 145 |
#else |
| 146 |
#define CL_CROSS 100 /* avoid 16 bit overflow */ |
| 147 |
#endif |
| 148 |
|
| 149 |
/* edge types */ |
| 150 |
#define REGULAREDGE 1 |
| 151 |
#define FLATEDGE 2 |
| 152 |
#define SELFWPEDGE 4 |
| 153 |
#define SELFNPEDGE 8 |
| 154 |
#define SELFEDGE 8 |
| 155 |
#define EDGETYPEMASK 15 /* the OR of the above */ |
| 156 |
|
| 157 |
/* for neato */ |
| 158 |
#define Spring_coeff 1.0 |
| 159 |
#define MYHUGE (1.0e+37) |
| 160 |
#define MAXDIM 10 |
| 161 |
|
| 162 |
/* drawing phases */ |
| 163 |
#define GVBEGIN 0 |
| 164 |
#define GVSPLINES 1 |
| 165 |
|
| 166 |
/* existence of labels */ |
| 167 |
#define EDGE_LABEL (1 << 0) |
| 168 |
#define HEAD_LABEL (1 << 1) |
| 169 |
#define TAIL_LABEL (1 << 2) |
| 170 |
#define GRAPH_LABEL (1 << 3) |
| 171 |
#define NODE_XLABEL (1 << 4) |
| 172 |
#define EDGE_XLABEL (1 << 5) |
| 173 |
|
| 174 |
/* type of graph label: GD_label_pos */ |
| 175 |
#define LABEL_AT_BOTTOM 0 |
| 176 |
#define LABEL_AT_TOP 1 |
| 177 |
#define LABEL_AT_LEFT 2 |
| 178 |
#define LABEL_AT_RIGHT 4 |
| 179 |
|
| 180 |
/* values specifying rankdir */ |
| 181 |
#define RANKDIR_TB 0 |
| 182 |
#define RANKDIR_LR 1 |
| 183 |
#define RANKDIR_BT 2 |
| 184 |
#define RANKDIR_RL 3 |
| 185 |
|
| 186 |
/* allowed charsets */ |
| 187 |
#define CHAR_UTF8 0 |
| 188 |
#define CHAR_LATIN1 1 |
| 189 |
#define CHAR_BIG5 2 |
| 190 |
|
| 191 |
/// shape values, for `graphviz_polygon_style_t.shape` |
| 192 |
enum { |
| 193 |
DOGEAR = 1, |
| 194 |
TAB = 2, |
| 195 |
FOLDER = 3, |
| 196 |
BOX3D = 4, |
| 197 |
COMPONENT = 5, |
| 198 |
PROMOTER = 6, |
| 199 |
CDS = 7, |
| 200 |
TERMINATOR = 8, |
| 201 |
UTR = 9, |
| 202 |
PRIMERSITE = 10, |
| 203 |
RESTRICTIONSITE = 11, |
| 204 |
FIVEPOVERHANG = 12, |
| 205 |
THREEPOVERHANG = 13, |
| 206 |
NOVERHANG = 14, |
| 207 |
ASSEMBLY = 15, |
| 208 |
SIGNATURE = 16, |
| 209 |
INSULATOR = 17, |
| 210 |
RIBOSITE = 18, |
| 211 |
RNASTAB = 19, |
| 212 |
PROTEASESITE = 20, |
| 213 |
PROTEINSTAB = 21, |
| 214 |
RPROMOTER = 22, |
| 215 |
RARROW = 23, |
| 216 |
LARROW = 24, |
| 217 |
LPROMOTER = 25, |
| 218 |
CYLINDER = 26, |
| 219 |
}; |
| 220 |
|
| 221 |
/* fill types */ |
| 222 |
#define FILL 1 |
| 223 |
#define GRADIENT 2 |
| 224 |
#define RGRADIENT 3 |
| 225 |
#define NO_POLY 4 /* bit flag: if set, do fill only */ |
| 226 |
|
| 227 |
/* Flags stored in GD_flags |
| 228 |
* Bit(s): 0 unused |
| 229 |
* 1-3 EDGETYPE_ |
| 230 |
* 4 NEW_RANK |
| 231 |
*/ |
| 232 |
|
| 233 |
/* edge types */ |
| 234 |
#define EDGETYPE_NONE (0 << 1) |
| 235 |
#define EDGETYPE_LINE (1 << 1) |
| 236 |
#define EDGETYPE_CURVED (2 << 1) |
| 237 |
#define EDGETYPE_PLINE (3 << 1) |
| 238 |
#define EDGETYPE_ORTHO (4 << 1) |
| 239 |
#define EDGETYPE_SPLINE (5 << 1) |
| 240 |
#define EDGETYPE_COMPOUND (6 << 1) |
| 241 |
|
| 242 |
/* New ranking is used */ |
| 243 |
#define NEW_RANK (1 << 4) |
| 244 |
/******/ |
| 245 |
|
| 246 |
/* user-specified node position: ND_pinned */ |
| 247 |
#define P_SET 1 /* position supplied by user */ |
| 248 |
#define P_FIX 2 /* position fixed during topological layout */ |
| 249 |
#define P_PIN 3 /* position fixed */ |
| 250 |
|
| 251 |
#define GAP 4 /* whitespace in POINTS around labels and between peripheries */ |
| 252 |
|
| 253 |
/* fontsize at which text is omitted entirely */ |
| 254 |
#define FONTSIZE_MUCH_TOO_SMALL 0.15 |
| 255 |
/* fontsize at which text is rendered by a simple line */ |
| 256 |
#define FONTSIZE_TOO_SMALL 1.5 |