| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
package gen.lib.gvc; |
| 47 |
import static gen.lib.cgraph.obj__c.agroot; |
| 48 |
import static gen.lib.cgraph.rec__c.agbindrec; |
| 49 |
import static gen.lib.common.emit__c.gv_fixLocale; |
| 50 |
import static gen.lib.common.input__c.graph_init; |
| 51 |
import static smetana.core.JUtils.LOG2; |
| 52 |
import static smetana.core.JUtils.NEQ; |
| 53 |
import static smetana.core.JUtils.enumAsInt; |
| 54 |
import static smetana.core.JUtils.function; |
| 55 |
import static smetana.core.JUtils.sizeof; |
| 56 |
import static smetana.core.JUtilsDebug.ENTERING; |
| 57 |
import static smetana.core.JUtilsDebug.LEAVING; |
| 58 |
import static smetana.core.Macro.GD_cleanup; |
| 59 |
import static smetana.core.Macro.GD_drawing; |
| 60 |
import static smetana.core.Macro.GD_gvc; |
| 61 |
import static smetana.core.Macro.N; |
| 62 |
import static smetana.core.Macro.UNSUPPORTED; |
| 63 |
import h.ST_Agraph_s; |
| 64 |
import h.ST_Agraphinfo_t; |
| 65 |
import h.ST_GVC_s; |
| 66 |
import h.ST_gvlayout_engine_s; |
| 67 |
import h.ST_gvlayout_features_t; |
| 68 |
import h.ST_gvplugin_installed_t; |
| 69 |
import h.layout_type; |
| 70 |
import smetana.core.CString; |
| 71 |
|
| 72 |
public class gvlayout__c { |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
private final static ST_gvlayout_features_t dotgen_features = new ST_gvlayout_features_t(); |
| 176 |
private final static ST_gvlayout_engine_s dotgen_engine = new ST_gvlayout_engine_s(); |
| 177 |
static { |
| 178 |
dotgen_features.setInt("flags", 1<<0); |
| 179 |
dotgen_engine.setPtr("layout", function(gen.lib.dotgen.dotinit__c.class, "dot_layout")); |
| 180 |
dotgen_engine.setPtr("cleanup", function(gen.lib.dotgen.dotinit__c.class, "dot_cleanup")); |
| 181 |
} |
| 182 |
|
| 183 |
|
| 184 |
public static int gvlayout_select(ST_GVC_s gvc, CString layout) { |
| 185 |
ENTERING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select"); |
| 186 |
try { |
| 187 |
ST_gvplugin_installed_t gvlayout_dot_layout = new ST_gvplugin_installed_t(); |
| 188 |
gvlayout_dot_layout.setInt("id", enumAsInt(layout_type.class, "LAYOUT_DOT")); |
| 189 |
gvlayout_dot_layout.setPtr("type", new CString("dot")); |
| 190 |
gvlayout_dot_layout.setInt("quality", 0); |
| 191 |
gvlayout_dot_layout.setPtr("engine", dotgen_engine); |
| 192 |
gvlayout_dot_layout.setPtr("features", dotgen_features); |
| 193 |
|
| 194 |
|
| 195 |
ST_gvplugin_installed_t typeptr = gvlayout_dot_layout; |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
gvc.layout.setPtr("type", typeptr.type); |
| 200 |
gvc.layout.setPtr("engine", typeptr.engine); |
| 201 |
gvc.layout.setInt("id", typeptr.id); |
| 202 |
gvc.layout.setPtr("features", typeptr.features); |
| 203 |
return 300; |
| 204 |
|
| 205 |
|
| 206 |
} finally { |
| 207 |
LEAVING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select"); |
| 208 |
} |
| 209 |
} |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
public static int gvLayoutJobs(ST_GVC_s gvc, ST_Agraph_s g) { |
| 217 |
ENTERING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs"); |
| 218 |
try { |
| 219 |
ST_gvlayout_engine_s gvle; |
| 220 |
CString p = null; |
| 221 |
int rc; |
| 222 |
agbindrec(g, new CString("Agraphinfo_t"), sizeof(ST_Agraphinfo_t.class), (N(0))); |
| 223 |
GD_gvc(g, gvc); |
| 224 |
if (NEQ(g, agroot(g))) |
| 225 |
UNSUPPORTED("ah9ygbaap1fyxr97z734juk0j"); |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
rc = gvlayout_select(gvc, p); |
| 237 |
|
| 238 |
gvle = (ST_gvlayout_engine_s) gvc.layout.engine; |
| 239 |
if (N(gvle)) |
| 240 |
UNSUPPORTED("return -1;"); |
| 241 |
gv_fixLocale (1); |
| 242 |
graph_init(g, (gvc.layout.features.flags & (1<<0))!=0); |
| 243 |
GD_drawing(agroot(g), GD_drawing(g)); |
| 244 |
if (gvle!=null && gvle.layout!=null) { |
| 245 |
gvle.layout.exe(g); |
| 246 |
if (gvle.cleanup!=null) |
| 247 |
if (GD_cleanup(g)==null) |
| 248 |
LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else |
| 249 |
GD_cleanup(g).setPtr(gvle.cleanup); |
| 250 |
} |
| 251 |
gv_fixLocale (0); |
| 252 |
return 0; |
| 253 |
} finally { |
| 254 |
LEAVING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs"); |
| 255 |
} |
| 256 |
} |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
public static Object gvFreeLayout(Object... arg) { |
| 264 |
UNSUPPORTED("miztaqpyzsrx0tzflsbk18df"); |
| 265 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 266 |
UNSUPPORTED("an78d0x2t0pcnm5p7x0nsyl8o"); |
| 267 |
UNSUPPORTED("y9n04abevv5wkts4l75cl1au"); |
| 268 |
UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); |
| 269 |
UNSUPPORTED("3tq49gfbuixakj7ae5tf9mzxz"); |
| 270 |
UNSUPPORTED("66fe8hcy8mktqozsl94u84wy4"); |
| 271 |
UNSUPPORTED("9otfc4inu4hywb5uzke8hroh8"); |
| 272 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 273 |
UNSUPPORTED("6o4u7hjlds1wsu4tuaotw2xvr"); |
| 274 |
UNSUPPORTED("614pp135h9hyyoa6quv172ent"); |
| 275 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 276 |
UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); |
| 277 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 278 |
|
| 279 |
throw new UnsupportedOperationException(); |
| 280 |
} |
| 281 |
|
| 282 |
|
| 283 |
} |