const.h 7.4 KB

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