mirror of
https://github.com/octoleo/plantuml.git
synced 2024-06-05 10:00:47 +00:00
version 1.2017.17
This commit is contained in:
parent
05c5e5d42f
commit
ce99e6f260
2
pom.xml
2
pom.xml
|
@ -35,7 +35,7 @@
|
|||
|
||||
<groupId>net.sourceforge.plantuml</groupId>
|
||||
<artifactId>plantuml</artifactId>
|
||||
<version>1.2017.15-SNAPSHOT</version>
|
||||
<version>1.2017.17-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlantUML</name>
|
||||
|
|
|
@ -241,7 +241,8 @@ try {
|
|||
rv.getStruct("disc").setPtr("mem", memdisc);
|
||||
rv.getStruct("state").setPtr("mem", memclosure);
|
||||
rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc.amp()));
|
||||
rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
|
||||
// Translation bug in next line: should be AgIoDisc and not AgIdDisc
|
||||
// rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
|
||||
rv.setBoolean("callbacks_enabled", (N(0)));
|
||||
return rv;
|
||||
} finally {
|
||||
|
|
|
@ -68,6 +68,7 @@ import smetana.core.JUtils;
|
|||
import smetana.core.MutableDouble;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -934,7 +935,7 @@ public static int arrowEndClip(Agedge_s e, __ptr__ ps, int startp, int endp, bez
|
|||
ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
|
||||
try {
|
||||
final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
|
||||
final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
double elen;
|
||||
MutableDouble elen2 = new MutableDouble(0);
|
||||
elen = arrow_length(e, eflag);
|
||||
|
@ -971,7 +972,7 @@ public static int arrowStartClip(Agedge_s e, __ptr__ ps, int startp, int endp, b
|
|||
ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip");
|
||||
try {
|
||||
final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
|
||||
final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
double slen;
|
||||
MutableDouble slen2 = new MutableDouble(0);
|
||||
slen = arrow_length(e, sflag);
|
||||
|
|
|
@ -58,6 +58,7 @@ import h.xdot;
|
|||
import smetana.core.CString;
|
||||
import smetana.core.JUtils;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -1444,8 +1445,8 @@ try {
|
|||
}
|
||||
}
|
||||
else { /* else refine the segment */
|
||||
final __array_of_struct__ left = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ right = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ left = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ right = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
Bezier (cp, 3, 0.5, left.asPtr(), right.asPtr());
|
||||
update_bb_bz(bb, left);
|
||||
update_bb_bz(bb, right);
|
||||
|
|
|
@ -80,6 +80,7 @@ import smetana.core.Memory;
|
|||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -765,8 +766,8 @@ private static pointf simpleSplineRoute_w_(final __struct__<pointf> tp, final __
|
|||
ENTERING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
|
||||
try {
|
||||
final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
|
||||
final __array_of_struct__ eps = __array_of_struct__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ evs = __array_of_struct__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
|
||||
int i;
|
||||
eps.plus(0).setDouble("x", tp.getDouble("x"));
|
||||
eps.plus(0).setDouble("y", tp.getDouble("y"));
|
||||
|
@ -857,7 +858,7 @@ ENTERING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
|
|||
try {
|
||||
int bi, si, splinepi;
|
||||
double t;
|
||||
final __array_of_struct__ sp = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
int num_div = delta * boxn;
|
||||
for (splinepi = 0; splinepi + 3 < pn; splinepi += 3) {
|
||||
for (si = 0; si <= num_div; si++) {
|
||||
|
@ -906,8 +907,8 @@ try {
|
|||
final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
|
||||
final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
|
||||
int splinepi;
|
||||
final __array_of_struct__ eps = __array_of_struct__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ evs = __array_of_struct__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
|
||||
int edgei, prev, next;
|
||||
int pi=0, bi;
|
||||
__array_of_ptr__ boxes;
|
||||
|
|
|
@ -99,6 +99,7 @@ import smetana.core.CFunction;
|
|||
import smetana.core.JUtils;
|
||||
import smetana.core.MutableDouble;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -793,8 +794,8 @@ LEAVING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
|
|||
public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, __array_of_struct__ sp, boolean left_inside) {
|
||||
ENTERING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
|
||||
try {
|
||||
final __array_of_struct__ seg = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ best = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ seg = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ best = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
final __struct__<pointf> pt = JUtils.from(pointf.class), opt = JUtils.from(pointf.class);
|
||||
__ptr__ left, right;
|
||||
final MutableDouble low = new MutableDouble(0), high = new MutableDouble(0);
|
||||
|
@ -852,7 +853,7 @@ ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0");
|
|||
try {
|
||||
int i;
|
||||
double save_real_size;
|
||||
final __array_of_struct__ c = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ c = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
save_real_size = ND_rw(n);
|
||||
for (i = 0; i < 4; i++) {
|
||||
c.plus(i).setDouble("x", curve.plus(i).getDouble("x") - ND_coord(n).getDouble("x"));
|
||||
|
@ -1001,7 +1002,7 @@ try {
|
|||
break;
|
||||
arrow_clip(fe, hn, ps, start, end, newspl, info);
|
||||
for (i = start[0]; i < end[0] + 4; ) {
|
||||
final __array_of_struct__ cp = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ cp = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
|
||||
cp.plus(0).setStruct(ps.plus(i).getStruct());
|
||||
i++;
|
||||
|
@ -1716,7 +1717,7 @@ try {
|
|||
final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(), np = new ST_pointf();
|
||||
Agnode_s n;
|
||||
Agedge_s e;
|
||||
final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 1000);
|
||||
final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 1000);
|
||||
int pointn;
|
||||
e = (Agedge_s) edges.plus(ind).getPtr();
|
||||
n = agtail(e);
|
||||
|
|
|
@ -109,6 +109,7 @@ import smetana.core.JUtils;
|
|||
import smetana.core.Memory;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -1074,12 +1075,12 @@ private static __struct__<pointf> Bezier_w_(__array_of_struct__ V, int degree, d
|
|||
ENTERING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
|
||||
try {
|
||||
int i, j; /* Index variables */
|
||||
final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct__.malloc(pointf.class, 5+1) };
|
||||
final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct_impl__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct_impl__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct_impl__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct_impl__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct_impl__.malloc(pointf.class, 5+1),
|
||||
__array_of_struct_impl__.malloc(pointf.class, 5+1) };
|
||||
/* Copy control points */
|
||||
for (j = 0; j <= degree; j++) {
|
||||
Vtemp[0].plus(j).setStruct(V.plus(j).getStruct());
|
||||
|
|
|
@ -76,6 +76,7 @@ import h.pointf;
|
|||
import smetana.core.JUtils;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
public class decomp__c {
|
||||
|
@ -790,7 +791,7 @@ public static void search_component(Agraph_s g, Agnode_s n) {
|
|||
ENTERING("c5u5lnfbu0pmlk6vsvyrdj8ep","search_component");
|
||||
try {
|
||||
int c, i;
|
||||
__array_of_struct__ vec = __array_of_struct__.malloc(elist.class, 4);
|
||||
__array_of_struct__ vec = __array_of_struct_impl__.malloc(elist.class, 4);
|
||||
Agnode_s other;
|
||||
Agedge_s e;
|
||||
add_to_component(n);
|
||||
|
|
|
@ -143,6 +143,7 @@ import smetana.core.JUtils;
|
|||
import smetana.core.Memory;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
|
||||
|
@ -1716,7 +1717,7 @@ try {
|
|||
final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
|
||||
int pn[] = new int[1];
|
||||
Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
|
||||
final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 10);
|
||||
final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
|
||||
final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
|
||||
int i, pointn;
|
||||
double leftend, rightend, ctrx=0, ctry=0, miny, maxy;
|
||||
|
@ -1865,7 +1866,7 @@ public static void makeSimpleFlat(Agnode_s tn, Agnode_s hn, __ptr__ edges, int i
|
|||
ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
|
||||
try {
|
||||
Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
|
||||
final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 10);
|
||||
final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
|
||||
final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
|
||||
int i, pointn;
|
||||
double stepy, dy;
|
||||
|
@ -2109,7 +2110,7 @@ try {
|
|||
int boxn, i, ydelta;
|
||||
int pn[] = new int[1];
|
||||
Agedge_s f;
|
||||
final __array_of_struct__ points = __array_of_struct__.malloc(pointf.class, 7);
|
||||
final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 7);
|
||||
tn = agtail(e);
|
||||
hn = aghead(e);
|
||||
for (f = ED_to_virt(e); ED_to_virt(f)!=null; f = ED_to_virt(f));
|
||||
|
|
|
@ -60,6 +60,7 @@ import smetana.core.JUtils;
|
|||
import smetana.core.Memory;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.jmp_buf;
|
||||
|
@ -271,7 +272,7 @@ return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), i
|
|||
private static int splinefits_w_(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
|
||||
ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits");
|
||||
try {
|
||||
final __array_of_struct__ sps = __array_of_struct__.malloc(pointf.class, 4);
|
||||
final __array_of_struct__ sps = __array_of_struct_impl__.malloc(pointf.class, 4);
|
||||
double a, b;
|
||||
int pi;
|
||||
int forceflag;
|
||||
|
@ -344,7 +345,7 @@ try {
|
|||
double roots[] = new double[4];
|
||||
int rooti, rootn;
|
||||
int ei;
|
||||
final __array_of_struct__ lps = __array_of_struct__.malloc(pointf.class, 2);
|
||||
final __array_of_struct__ lps = __array_of_struct_impl__.malloc(pointf.class, 2);
|
||||
final __struct__<pointf> ip = JUtils.from(pointf.class);
|
||||
double t, ta, tb, tc, td;
|
||||
for (ei = 0; ei < edgen; ei++) {
|
||||
|
|
|
@ -63,6 +63,7 @@ import smetana.core.JUtils;
|
|||
import smetana.core.Memory;
|
||||
import smetana.core.Z;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__array_of_struct_impl__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.jmp_buf;
|
||||
|
@ -121,7 +122,7 @@ try {
|
|||
final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), p3 = JUtils.from(pointf.class);
|
||||
int trii, trij, ftrii, ltrii;
|
||||
int ei;
|
||||
final __array_of_struct__ epnls = __array_of_struct__.malloc(pointnlink_t.class, 2);
|
||||
final __array_of_struct__ epnls = __array_of_struct_impl__.malloc(pointnlink_t.class, 2);
|
||||
pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
|
||||
triangle_t trip;
|
||||
int splitindex;
|
||||
|
|
156
src/h/STArray.java
Normal file
156
src/h/STArray.java
Normal file
|
@ -0,0 +1,156 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import smetana.core.UnsupportedArrayOfPtr;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.Area;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
|
||||
public class STArray<O extends UnsupportedStructAndPtr> extends UnsupportedArrayOfPtr {
|
||||
|
||||
private final int pos;
|
||||
private final List<O> list;
|
||||
private final Class clazz;
|
||||
|
||||
public STArray(int pos, List<O> list, Class clazz) {
|
||||
this.pos = pos;
|
||||
this.list = list;
|
||||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int comparePointerInternal(__array_of_ptr__ other) {
|
||||
STArray<O> other2 = (STArray<O>) other;
|
||||
if (this.list != other2.list) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
return this.pos - other2.pos;
|
||||
}
|
||||
|
||||
public STArray(int size, int pos, Class clazz) {
|
||||
this.pos = pos;
|
||||
this.list = new ArrayList<O>();
|
||||
this.clazz = clazz;
|
||||
for (int i = 0; i < size; i++) {
|
||||
try {
|
||||
this.list.add((O) clazz.newInstance());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void realloc(size_t nb) {
|
||||
realloc(nb.getInternalNb());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void realloc(int nb) {
|
||||
while (list.size() < nb) {
|
||||
try {
|
||||
this.list.add((O) clazz.newInstance());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ plus(int delta) {
|
||||
return new STArray(pos + delta, this.list, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ move(int delta) {
|
||||
return new STArray(pos + delta, this.list, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(__struct__ value) {
|
||||
list.get(pos).setStruct(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return list.get(pos).getStruct();
|
||||
// return list.get(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
return list.get(pos).getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr() {
|
||||
return list.get(pos).amp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ asPtr() {
|
||||
return new StarArrayOfPtr(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPtr(__ptr__ value) {
|
||||
list.set(pos, (O) value.getStruct());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Area getInternal(final int idx) {
|
||||
return list.get(pos + idx);
|
||||
}
|
||||
|
||||
}
|
117
src/h/STStarArrayOfPointer.java
Normal file
117
src/h/STStarArrayOfPointer.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import smetana.core.UnsupportedC;
|
||||
import smetana.core.__array_of_integer__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.Area;
|
||||
|
||||
public class STStarArrayOfPointer extends UnsupportedC {
|
||||
|
||||
private final int pos;
|
||||
private final List<__ptr__> data;
|
||||
|
||||
public void realloc(int nb) {
|
||||
while (data.size() < nb) {
|
||||
data.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static STStarArrayOfPointer malloc(int size) {
|
||||
List<__ptr__> data = new ArrayList<__ptr__>();
|
||||
for (int i = 0; i < size; i++) {
|
||||
data.add(null);
|
||||
}
|
||||
return new STStarArrayOfPointer(0, data);
|
||||
}
|
||||
|
||||
private STStarArrayOfPointer(int pos, List<__ptr__> data) {
|
||||
this.pos = pos;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int comparePointer(__ptr__ other) {
|
||||
final STStarArrayOfPointer this2 = (STStarArrayOfPointer) other;
|
||||
if (this.data != this2.data) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
return this.pos - this2.pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ plus(int pointerMove) {
|
||||
return new STStarArrayOfPointer(pos + pointerMove, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPtr(__ptr__ value) {
|
||||
data.set(pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return data.get(pos).getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr() {
|
||||
return data.get(pos);
|
||||
}
|
||||
|
||||
public void swap(int i, int j) {
|
||||
__ptr__ e1 = data.get(i);
|
||||
__ptr__ e2 = data.get(j);
|
||||
data.set(i, e2);
|
||||
data.set(j, e1);
|
||||
|
||||
}
|
||||
|
||||
}
|
125
src/h/ST_Agattr_s.java
Normal file
125
src/h/ST_Agattr_s.java
Normal file
|
@ -0,0 +1,125 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_cstring__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarArrayOfCString;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agattr_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final ST_Agrec_s h = new ST_Agrec_s(this); /* common data header */
|
||||
public ST_dt_s dict; /* shared dict to interpret attr field */
|
||||
public StarArrayOfCString str; /* the attribute string values */
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agattr_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agattr_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("dict")) {
|
||||
return dict;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("dict")) {
|
||||
this.dict = (ST_dt_s) newData;
|
||||
return dict;
|
||||
}
|
||||
if (fieldName.equals("str")) {
|
||||
this.str = (StarArrayOfCString) newData;
|
||||
return str;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_cstring__ getArrayOfCString(String fieldName) {
|
||||
if (fieldName.equals("str")) {
|
||||
return str.getInternalArray();
|
||||
}
|
||||
return super.getArrayOfCString(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agrec_s.class) {
|
||||
return h;
|
||||
// return h.amp();
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agattr_s",
|
||||
// "{",
|
||||
// "Agrec_t h",
|
||||
// "Dict_t *dict",
|
||||
// "char **str",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agattr_s { /* dynamic string attributes */
|
||||
// Agrec_t h; /* common data header */
|
||||
// Dict_t *dict; /* shared dict to interpret attr field */
|
||||
// char **str; /* the attribute string values */
|
||||
// };
|
80
src/h/ST_Agcbstack_s.java
Normal file
80
src/h/ST_Agcbstack_s.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agcbstack_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agcbstack_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agcbstack_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agcbstack_s",
|
||||
// "{",
|
||||
// "Agcbdisc_t *f",
|
||||
// "void *state",
|
||||
// "Agcbstack_t *prev",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agcbstack_s { /* object event callbacks */
|
||||
// Agcbdisc_t *f; /* methods */
|
||||
// void *state; /* closure */
|
||||
// Agcbstack_t *prev; /* kept in a stack, unlike other disciplines */
|
||||
// };
|
203
src/h/ST_Agclos_s.java
Normal file
203
src/h/ST_Agclos_s.java
Normal file
|
@ -0,0 +1,203 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import smetana.core.ArrayOfInteger;
|
||||
import smetana.core.UnsupportedArrayOfPtr;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_integer__;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agclos_s extends UnsupportedStructAndPtr {
|
||||
public final ST_Agdisc_s disc = new ST_Agdisc_s(this); /* resource discipline functions */
|
||||
public final ST_Agdstate_s state = new ST_Agdstate_s(this); /* resource closures */
|
||||
public ST_dt_s strdict;
|
||||
private final int[] seq = new int[3];
|
||||
// "unsigned long seq[3]",
|
||||
public ST_Agcbstack_s cb;
|
||||
public boolean callbacks_enabled; /* issue user callbacks or hold them? */
|
||||
|
||||
// "Dict_t *lookup_by_name[3]",
|
||||
// "Dict_t *lookup_by_id[3]",
|
||||
private final ArrayOfThreePtrDict_t lookup_by_id = new ArrayOfThreePtrDict_t();
|
||||
|
||||
static class ArrayOfThreePtrDict_t extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
|
||||
private final List<Dict_t> list;
|
||||
private final int pos;
|
||||
|
||||
private ArrayOfThreePtrDict_t(List<Dict_t> list, int pos) {
|
||||
this.list = list;
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
ArrayOfThreePtrDict_t() {
|
||||
this(new ArrayList<Dict_t>(), 0);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
list.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ plus(int delta) {
|
||||
return new ArrayOfThreePtrDict_t(list, pos + delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr() {
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agclos_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agclos_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("callbacks_enabled")) {
|
||||
return callbacks_enabled;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("strdict")) {
|
||||
return strdict;
|
||||
}
|
||||
if (fieldName.equals("cb")) {
|
||||
return cb;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("strdict")) {
|
||||
this.strdict = (ST_dt_s) newData;
|
||||
return strdict;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("disc")) {
|
||||
return disc;
|
||||
}
|
||||
if (fieldName.equals("state")) {
|
||||
return state;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("callbacks_enabled")) {
|
||||
this.callbacks_enabled = data;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_integer__ getArrayOfInteger(String fieldName) {
|
||||
if (fieldName.equals("seq")) {
|
||||
return new ArrayOfInteger(seq, 0);
|
||||
}
|
||||
return super.getArrayOfInteger(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
if (fieldName.equals("lookup_by_id")) {
|
||||
return lookup_by_id;
|
||||
}
|
||||
return super.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
// public interface ST_Agclos_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agclos_s",
|
||||
// "{",
|
||||
// "Agdisc_t disc",
|
||||
// "Agdstate_t state",
|
||||
// "Dict_t *strdict",
|
||||
// "unsigned long seq[3]",
|
||||
// "Agcbstack_t *cb",
|
||||
// "unsigned char callbacks_enabled",
|
||||
// "Dict_t *lookup_by_name[3]",
|
||||
// "Dict_t *lookup_by_id[3]",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agclos_s {
|
||||
// Agdisc_t disc; /* resource discipline functions */
|
||||
// Agdstate_t state; /* resource closures */
|
||||
// Dict_t *strdict; /* shared string dict */
|
||||
// unsigned long seq[3]; /* local object sequence number counter */
|
||||
// Agcbstack_t *cb; /* user and system callback function stacks */
|
||||
// unsigned char callbacks_enabled; /* issue user callbacks or hold them? */
|
||||
// Dict_t *lookup_by_name[3];
|
||||
// Dict_t *lookup_by_id[3];
|
||||
// };
|
139
src/h/ST_Agdatadict_s.java
Normal file
139
src/h/ST_Agdatadict_s.java
Normal file
|
@ -0,0 +1,139 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agdatadict_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */
|
||||
public ST_dt_s n;
|
||||
public ST_dt_s e;
|
||||
public ST_dt_s g;
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agdatadict_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agdatadict_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("dict.n")) {
|
||||
this.n = (ST_dt_s) newData;
|
||||
return n;
|
||||
}
|
||||
if (fieldName.equals("dict.e")) {
|
||||
this.e = (ST_dt_s) newData;
|
||||
return e;
|
||||
}
|
||||
if (fieldName.equals("dict.g")) {
|
||||
this.g = (ST_dt_s) newData;
|
||||
return g;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("dict.n")) {
|
||||
return n;
|
||||
}
|
||||
if (fieldName.equals("dict.e")) {
|
||||
return e;
|
||||
}
|
||||
if (fieldName.equals("dict.g")) {
|
||||
return g;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agrec_s.class) {
|
||||
return h.amp();
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agdatadict_s",
|
||||
// "{",
|
||||
// "Agrec_t h",
|
||||
// "struct",
|
||||
// "{",
|
||||
// "Dict_t *n, *e, *g",
|
||||
// "}",
|
||||
// "dict",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agdatadict_s { /* set of dictionaries per graph */
|
||||
// Agrec_t h; /* installed in list of graph recs */
|
||||
// struct {
|
||||
// Dict_t *n, *e, *g;
|
||||
// } dict;
|
||||
// };
|
|
@ -47,7 +47,6 @@ package h;
|
|||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.Area;
|
||||
|
|
113
src/h/ST_Agdisc_s.java
Normal file
113
src/h/ST_Agdisc_s.java
Normal file
|
@ -0,0 +1,113 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agdisc_s extends UnsupportedStructAndPtr {
|
||||
|
||||
public ST_Agmemdisc_s.Amp mem;
|
||||
public ST_Agiddisc_s.Amp id;
|
||||
public ST_Agiodisc_s.Amp io;
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agdisc_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agdisc_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("mem")) {
|
||||
this.mem = (ST_Agmemdisc_s.Amp) newData;
|
||||
return mem;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
this.id = (ST_Agiddisc_s.Amp) newData;
|
||||
return id;
|
||||
}
|
||||
// if (fieldName.equals("io")) {
|
||||
// this.io = (ST_Agiodisc_s.Amp) newData;
|
||||
// return io;
|
||||
// }
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("mem")) {
|
||||
return mem;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
return id;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agdisc_s",
|
||||
// "{",
|
||||
// "Agmemdisc_t *mem",
|
||||
// "Agiddisc_t *id",
|
||||
// "Agiodisc_t *io",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agdisc_s { /* user's discipline */
|
||||
// Agmemdisc_t *mem;
|
||||
// Agiddisc_t *id;
|
||||
// Agiodisc_t *io;
|
||||
// };
|
108
src/h/ST_Agdstate_s.java
Normal file
108
src/h/ST_Agdstate_s.java
Normal file
|
@ -0,0 +1,108 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agdstate_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public __ptr__ mem;
|
||||
public __ptr__ id;
|
||||
|
||||
public ST_Agdstate_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agdstate_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("mem")) {
|
||||
this.mem = newData;
|
||||
return mem;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
this.id = newData;
|
||||
return id;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("mem")) {
|
||||
return mem;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
return id;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agdstate_s",
|
||||
// "{",
|
||||
// "void *mem",
|
||||
// "void *id",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agdstate_s {
|
||||
// void *mem;
|
||||
// void *id;
|
||||
// /* IO must be initialized and finalized outside Cgraph,
|
||||
// * and channels (FILES) are passed as void* arguments. */
|
||||
// };
|
315
src/h/ST_Agedge_s.java
Normal file
315
src/h/ST_Agedge_s.java
Normal file
|
@ -0,0 +1,315 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import h.ST_Agrec_s.Amp;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
private final ST_Agobj_s base = new ST_Agobj_s(this);
|
||||
private final ST_dtlink_s id_link = new ST_dtlink_s(this);
|
||||
private final ST_dtlink_s seq_link = new ST_dtlink_s(this);
|
||||
private ST_Agnode_s node;
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__ptr__ arg) {
|
||||
if (arg instanceof Amp) {
|
||||
arg = ((Amp) arg).getObject();
|
||||
}
|
||||
ST_Agedge_s this2 = (ST_Agedge_s) arg;
|
||||
this.base.copyDataFrom((__struct__) this2.base);
|
||||
this.id_link.copyDataFrom((__struct__) this2.id_link);
|
||||
this.seq_link.copyDataFrom((__struct__) this2.seq_link);
|
||||
this.node = this2.node;
|
||||
}
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agedge_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agedge_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
if (other instanceof Amp) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this == other2.me;
|
||||
}
|
||||
ST_Agedge_s other2 = (ST_Agedge_s) other;
|
||||
return this == other2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agedge_s me;
|
||||
|
||||
public Amp(ST_Agedge_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
public ST_Agedge_s getObject() {
|
||||
return me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
if (other instanceof ST_Agedge_s) {
|
||||
ST_Agedge_s other2 = (ST_Agedge_s) other;
|
||||
return this.me == other2;
|
||||
}
|
||||
Amp other2 = (Amp) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
return ST_Agedge_s.this.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agedge_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
ST_Agedge_s.this.copyDataFrom(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__ptr__ other) {
|
||||
ST_Agedge_s.this.copyDataFrom(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agedge_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
return ST_Agedge_s.this.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ plus(int pointerMove) {
|
||||
ST_Agedgepair_s pair = (ST_Agedgepair_s) me.parent;
|
||||
// Order=out, in
|
||||
if (pair.out == me && pointerMove == 1) {
|
||||
return pair.in;
|
||||
}
|
||||
if (pair.in == me && pointerMove == -1) {
|
||||
return pair.out;
|
||||
}
|
||||
return super.plus(pointerMove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agedge_s::seq_link")) {
|
||||
return seq_link;
|
||||
}
|
||||
if (offset.toString().equals("h.Agedge_s::id_link")) {
|
||||
return id_link;
|
||||
}
|
||||
System.err.println("offset1=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agedge_s::seq_link")) {
|
||||
return seq_link;
|
||||
}
|
||||
if (offset.toString().equals("h.Agedge_s::id_link")) {
|
||||
return id_link;
|
||||
}
|
||||
System.err.println("offset2=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ plus(int pointerMove) {
|
||||
ST_Agedgepair_s pair = (ST_Agedgepair_s) parent;
|
||||
// Order=out, in
|
||||
if (pair.out == this && pointerMove == 1) {
|
||||
return pair.in;
|
||||
}
|
||||
if (pair.in == this && pointerMove == -1) {
|
||||
return pair.out;
|
||||
}
|
||||
return super.plus(pointerMove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agobj_s.class) {
|
||||
return base;
|
||||
}
|
||||
if (dest == Agedge_s.class) {
|
||||
return this;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("node")) {
|
||||
if (newData instanceof ST_Agnode_s.Amp) {
|
||||
this.node = ((ST_Agnode_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.node = (ST_Agnode_s) newData;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("node")) {
|
||||
return node;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("base")) {
|
||||
return base;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
public StarStruct from_seq_link(ST_dtlink_s from) {
|
||||
if (from == seq_link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public StarStruct from_id_link(ST_dtlink_s from) {
|
||||
if (from == id_link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public static size_t sizeof_starstar_empty(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return STStarArrayOfPointer.malloc(nb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
if (old instanceof STStarArrayOfPointer) {
|
||||
STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
// if (old instanceof StarArrayOfPtr) {
|
||||
// StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
// old2.realloc(nb);
|
||||
// return old2;
|
||||
// }
|
||||
return super.realloc(old);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public interface ST_Agedge_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agedge_s",
|
||||
// "{",
|
||||
// "Agobj_t base",
|
||||
// "Dtlink_t id_link",
|
||||
// "Dtlink_t seq_link",
|
||||
// "Agnode_t *node",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agedge_s {
|
||||
// Agobj_t base;
|
||||
// Dtlink_t id_link; /* main graph only */
|
||||
// Dtlink_t seq_link;
|
||||
// Agnode_t *node; /* the endpoint node */
|
||||
// };
|
364
src/h/ST_Agedgeinfo_t.java
Normal file
364
src/h/ST_Agedgeinfo_t.java
Normal file
|
@ -0,0 +1,364 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agedgeinfo_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agedgeinfo_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private final ST_Agrec_s hdr = new ST_Agrec_s(this);
|
||||
|
||||
private ST_splines spl;
|
||||
private final ST_port tail_port = new ST_port(this), head_port = new ST_port(this);
|
||||
private ST_textlabel_t label, head_label, tail_label, xlabel;
|
||||
private int edge_type;
|
||||
private int adjacent;
|
||||
private boolean label_ontop;
|
||||
// "unsigned char gui_state",
|
||||
private ST_Agedge_s to_orig;
|
||||
// "void *alg",
|
||||
// "double factor",
|
||||
private double dist;
|
||||
// "Ppolyline_t path",
|
||||
private int showboxes;
|
||||
private boolean conc_opp_flag;
|
||||
private int xpenalty;
|
||||
private int weight;
|
||||
private int cutvalue, tree_index;
|
||||
private int count;
|
||||
private int minlen;
|
||||
|
||||
private ST_Agedge_s to_virt;
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
ST_Agedgeinfo_t this2 = (ST_Agedgeinfo_t) other;
|
||||
this.hdr.copyDataFrom((__struct__) this2.hdr);
|
||||
this.spl = this2.spl;
|
||||
this.tail_port.copyDataFrom((__struct__) this2.tail_port);
|
||||
this.head_port.copyDataFrom((__struct__) this2.head_port);
|
||||
this.label = this2.label;
|
||||
this.head_label = this2.head_label;
|
||||
this.tail_label = this2.tail_label;
|
||||
this.xlabel = this2.xlabel;
|
||||
this.edge_type = this2.edge_type;
|
||||
this.adjacent = this2.adjacent;
|
||||
this.label_ontop = this2.label_ontop;
|
||||
this.to_orig = this2.to_orig;
|
||||
this.dist = this2.dist;
|
||||
this.showboxes = this2.showboxes;
|
||||
this.conc_opp_flag = this2.conc_opp_flag;
|
||||
this.xpenalty = this2.xpenalty;
|
||||
this.weight = this2.weight;
|
||||
this.cutvalue = this2.cutvalue;
|
||||
this.tree_index = this2.tree_index;
|
||||
this.count = this2.count;
|
||||
this.minlen = this2.minlen;
|
||||
this.to_virt = this2.to_virt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
return ST_Agedgeinfo_t.this.castTo(dest);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agrec_s.class) {
|
||||
return hdr;
|
||||
}
|
||||
if (dest == Agedgeinfo_t.class) {
|
||||
return this;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("tail_port")) {
|
||||
this.tail_port.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("head_port")) {
|
||||
this.head_port.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("label_ontop")) {
|
||||
this.label_ontop = data;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("dist")) {
|
||||
this.dist = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("minlen")) {
|
||||
this.minlen = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("weight")) {
|
||||
this.weight = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("cutvalue")) {
|
||||
this.cutvalue = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("tree_index")) {
|
||||
this.tree_index = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("count")) {
|
||||
this.count = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("xpenalty")) {
|
||||
this.xpenalty = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("showboxes")) {
|
||||
this.showboxes = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("edge_type")) {
|
||||
this.edge_type = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("adjacent")) {
|
||||
this.adjacent = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("dist")) {
|
||||
return this.dist;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("conc_opp_flag")) {
|
||||
return this.conc_opp_flag;
|
||||
}
|
||||
if (fieldName.equals("label_ontop")) {
|
||||
return this.label_ontop;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("minlen")) {
|
||||
return this.minlen;
|
||||
}
|
||||
if (fieldName.equals("weight")) {
|
||||
return this.weight;
|
||||
}
|
||||
if (fieldName.equals("cutvalue")) {
|
||||
return this.cutvalue;
|
||||
}
|
||||
if (fieldName.equals("tree_index")) {
|
||||
return this.tree_index;
|
||||
}
|
||||
if (fieldName.equals("count")) {
|
||||
return this.count;
|
||||
}
|
||||
if (fieldName.equals("xpenalty")) {
|
||||
return this.xpenalty;
|
||||
}
|
||||
if (fieldName.equals("showboxes")) {
|
||||
return this.showboxes;
|
||||
}
|
||||
if (fieldName.equals("edge_type")) {
|
||||
return this.edge_type;
|
||||
}
|
||||
if (fieldName.equals("adjacent")) {
|
||||
return this.adjacent;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("to_virt")) {
|
||||
return this.to_virt;
|
||||
}
|
||||
if (fieldName.equals("to_orig")) {
|
||||
return this.to_orig;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
return this.label;
|
||||
}
|
||||
if (fieldName.equals("spl")) {
|
||||
return this.spl;
|
||||
}
|
||||
if (fieldName.equals("xlabel")) {
|
||||
return this.xlabel;
|
||||
}
|
||||
if (fieldName.equals("head_label")) {
|
||||
return this.head_label;
|
||||
}
|
||||
if (fieldName.equals("tail_label")) {
|
||||
return this.tail_label;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("tail_port")) {
|
||||
return this.tail_port;
|
||||
}
|
||||
if (fieldName.equals("head_port")) {
|
||||
return this.head_port;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("to_virt")) {
|
||||
if (newData instanceof ST_Agedge_s.Amp) {
|
||||
this.to_virt = ((ST_Agedge_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.to_virt = (ST_Agedge_s) newData;
|
||||
}
|
||||
return this.to_virt;
|
||||
}
|
||||
if (fieldName.equals("to_orig")) {
|
||||
if (newData instanceof ST_Agedge_s.Amp) {
|
||||
this.to_orig = ((ST_Agedge_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.to_orig = (ST_Agedge_s) newData;
|
||||
}
|
||||
return this.to_orig;
|
||||
}
|
||||
if (fieldName.equals("spl")) {
|
||||
this.spl = (ST_splines) newData;
|
||||
return this.spl;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
this.label = (ST_textlabel_t) newData;
|
||||
return this.label;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct Agedgeinfo_t {
|
||||
// Agrec_t hdr;
|
||||
// splines *spl;
|
||||
// port tail_port, head_port;
|
||||
// textlabel_t *label, *head_label, *tail_label, *xlabel;
|
||||
// char edge_type;
|
||||
// char adjacent; /* true for flat edge with adjacent nodes */
|
||||
// char label_ontop;
|
||||
// unsigned char gui_state; /* Edge state for GUI ops */
|
||||
// edge_t *to_orig; /* for dot's shapes.c */
|
||||
// void *alg;
|
||||
//
|
||||
//
|
||||
// double factor;
|
||||
// double dist;
|
||||
// Ppolyline_t path;
|
||||
//
|
||||
//
|
||||
// unsigned char showboxes;
|
||||
// boolean conc_opp_flag;
|
||||
// short xpenalty;
|
||||
// int weight;
|
||||
// int cutvalue, tree_index;
|
||||
// short count;
|
||||
// unsigned short minlen;
|
||||
// edge_t *to_virt;
|
||||
//
|
||||
// } Agedgeinfo_t;
|
97
src/h/ST_Agedgepair_s.java
Normal file
97
src/h/ST_Agedgepair_s.java
Normal file
|
@ -0,0 +1,97 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public final ST_Agedge_s out = new ST_Agedge_s(this);
|
||||
public final ST_Agedge_s in = new ST_Agedge_s(this);
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agedgepair_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agedgepair_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("out")) {
|
||||
return out;
|
||||
}
|
||||
if (fieldName.equals("in")) {
|
||||
return in;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agedgepair_s",
|
||||
// "{",
|
||||
// "Agedge_t out, in",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agedgepair_s {
|
||||
// Agedge_t out, in;
|
||||
// };
|
|
@ -51,7 +51,6 @@ import smetana.core.UnsupportedStruct;
|
|||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
|
||||
public class ST_Agiddisc_s extends UnsupportedStruct {
|
||||
|
||||
public CFunction open;
|
||||
|
@ -64,33 +63,34 @@ public class ST_Agiddisc_s extends UnsupportedStruct {
|
|||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new UnsupportedStarStruct() {
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("open")) {
|
||||
return open.exe(args);
|
||||
}
|
||||
if (fieldName.equals("map")) {
|
||||
return map.exe(args);
|
||||
}
|
||||
if (fieldName.equals("idregister")) {
|
||||
return idregister.exe(args);
|
||||
}
|
||||
if (fieldName.equals("print")) {
|
||||
return print.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("print")) {
|
||||
return print;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("open")) {
|
||||
return open.exe(args);
|
||||
}
|
||||
if (fieldName.equals("map")) {
|
||||
return map.exe(args);
|
||||
}
|
||||
if (fieldName.equals("idregister")) {
|
||||
return idregister.exe(args);
|
||||
}
|
||||
if (fieldName.equals("print")) {
|
||||
return print.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
|
||||
};
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("print")) {
|
||||
return print;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
|
|
105
src/h/ST_Agiodisc_s.java
Normal file
105
src/h/ST_Agiodisc_s.java
Normal file
|
@ -0,0 +1,105 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStruct;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agiodisc_s extends UnsupportedStruct {
|
||||
|
||||
public CFunction afread;
|
||||
public CFunction putstr;
|
||||
public CFunction flush;
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
// @Override
|
||||
// public Object call(String fieldName, Object... args) {
|
||||
// if (fieldName.equals("open")) {
|
||||
// return open.exe(args);
|
||||
// }
|
||||
// if (fieldName.equals("map")) {
|
||||
// return map.exe(args);
|
||||
// }
|
||||
// if (fieldName.equals("idregister")) {
|
||||
// return idregister.exe(args);
|
||||
// }
|
||||
// if (fieldName.equals("print")) {
|
||||
// return print.exe(args);
|
||||
// }
|
||||
// return super.call(fieldName, args);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public __ptr__ getPtr(String fieldName) {
|
||||
// if (fieldName.equals("print")) {
|
||||
// return print;
|
||||
// }
|
||||
// return super.getPtr(fieldName);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agiodisc_s",
|
||||
// "{",
|
||||
// "int (*afread) (void *chan, char *buf, int bufsize)",
|
||||
// "int (*putstr) (void *chan, const char *str)",
|
||||
// "int (*flush) (void *chan)",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agiodisc_s {
|
||||
// int (*afread) (void *chan, char *buf, int bufsize);
|
||||
// int (*putstr) (void *chan, const char *str);
|
||||
// int (*flush) (void *chan); /* sync */
|
||||
// /* error messages? */
|
||||
// };
|
|
@ -60,19 +60,20 @@ public class ST_Agmemdisc_s extends UnsupportedStruct {
|
|||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new UnsupportedStarStruct() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("open")) {
|
||||
return open.exe(args);
|
||||
}
|
||||
if (fieldName.equals("alloc")) {
|
||||
return alloc.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("open")) {
|
||||
return open.exe(args);
|
||||
}
|
||||
};
|
||||
if (fieldName.equals("alloc")) {
|
||||
return alloc.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
|
|
231
src/h/ST_Agnode_s.java
Normal file
231
src/h/ST_Agnode_s.java
Normal file
|
@ -0,0 +1,231 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agnode_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final ST_Agobj_s base = new ST_Agobj_s(this);
|
||||
private ST_Agraph_s root;
|
||||
private ST_Agsubnode_s mainsub = new ST_Agsubnode_s(this);
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agnode_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agnode_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agnode_s me;
|
||||
|
||||
public Amp(ST_Agnode_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agobj_s.class) {
|
||||
return base.amp();
|
||||
}
|
||||
if (dest == Agnode_s.class) {
|
||||
return me;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return ST_Agnode_s.this.getStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agnode_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agnode_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
public ST_Agnode_s getObject() {
|
||||
return me;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agnode_s.class) {
|
||||
return this;
|
||||
}
|
||||
if (dest == Agobj_s.class) {
|
||||
return base;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
if (other instanceof Amp) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this == other2.me;
|
||||
}
|
||||
ST_Agnode_s other2 = (ST_Agnode_s) other;
|
||||
return this == other2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("base")) {
|
||||
return base;
|
||||
}
|
||||
if (fieldName.equals("mainsub")) {
|
||||
return mainsub;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("root")) {
|
||||
this.root = (ST_Agraph_s) newData;
|
||||
return root;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("root")) {
|
||||
return root;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public static size_t sizeof_starstar_empty(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return STStarArrayOfPointer.malloc(nb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_Agnode_s>(nb, 0, ST_Agnode_s.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
if (old instanceof STStarArrayOfPointer) {
|
||||
STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
if (old instanceof StarArrayOfPtr) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
return super.realloc(old);
|
||||
}
|
||||
};
|
||||
}
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agnode_s",
|
||||
// "{",
|
||||
// "Agobj_t base",
|
||||
// "Agraph_t *root",
|
||||
// "Agsubnode_t mainsub",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agnode_s {
|
||||
// Agobj_t base;
|
||||
// Agraph_t *root;
|
||||
// Agsubnode_t mainsub; /* embedded for main graph */
|
||||
// };
|
519
src/h/ST_Agnodeinfo_t.java
Normal file
519
src/h/ST_Agnodeinfo_t.java
Normal file
|
@ -0,0 +1,519 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agnodeinfo_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agnodeinfo_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private final ST_Agrec_s hdr = new ST_Agrec_s(this);
|
||||
|
||||
private ST_shape_desc shape;
|
||||
private ST_polygon_t shape_info;
|
||||
private final ST_pointf coord = new ST_pointf(this);
|
||||
private double width, height;
|
||||
|
||||
// "boxf bb",
|
||||
private double ht, lw, rw;
|
||||
private ST_textlabel_t label;
|
||||
private ST_textlabel_t xlabel;
|
||||
// "void *alg",
|
||||
private ST_Agedge_s alg = null;
|
||||
// "char state",
|
||||
// "unsigned char gui_state",
|
||||
// "boolean clustnode",
|
||||
// "unsigned char pinned",
|
||||
private int id, heapindex, hops;
|
||||
// "double *pos, dist",
|
||||
private int showboxes;
|
||||
|
||||
private boolean has_port;
|
||||
// "node_t* rep",
|
||||
// "node_t *set",
|
||||
private int node_type, mark, onstack;
|
||||
private int ranktype, weight_class;
|
||||
private ST_Agnode_s next;
|
||||
private ST_Agnode_s prev;
|
||||
// "elist in, out, flat_out, flat_in, other",
|
||||
private final ST_elist in = new ST_elist(this);
|
||||
private final ST_elist out = new ST_elist(this);
|
||||
private final ST_elist flat_out = new ST_elist(this);
|
||||
private final ST_elist flat_in = new ST_elist(this);
|
||||
private final ST_elist other = new ST_elist(this);
|
||||
private ST_Agraph_s.Amp clust;
|
||||
private int UF_size;
|
||||
|
||||
private ST_Agnode_s UF_parent;
|
||||
|
||||
private ST_Agnode_s inleaf, outleaf;
|
||||
private int rank, order;
|
||||
private double mval;
|
||||
private final ST_elist save_in = new ST_elist(this);
|
||||
private final ST_elist save_out = new ST_elist(this);
|
||||
private final ST_elist tree_in = new ST_elist(this);
|
||||
private final ST_elist tree_out = new ST_elist(this);
|
||||
private ST_Agedge_s par;
|
||||
private int low, lim;
|
||||
private int priority;
|
||||
|
||||
// "double pad[1]",
|
||||
// "}",
|
||||
// "Agnodeinfo_t");
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agrec_s.class) {
|
||||
return hdr;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("width")) {
|
||||
this.width = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("height")) {
|
||||
this.height = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ht")) {
|
||||
this.ht = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("lw")) {
|
||||
this.lw = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("rw")) {
|
||||
this.rw = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("mval")) {
|
||||
this.mval = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("width")) {
|
||||
return this.width;
|
||||
}
|
||||
if (fieldName.equals("height")) {
|
||||
return this.height;
|
||||
}
|
||||
if (fieldName.equals("ht")) {
|
||||
return this.ht;
|
||||
}
|
||||
if (fieldName.equals("lw")) {
|
||||
return this.lw;
|
||||
}
|
||||
if (fieldName.equals("rw")) {
|
||||
return this.rw;
|
||||
}
|
||||
if (fieldName.equals("mval")) {
|
||||
return this.mval;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("mark")) {
|
||||
this.mark = data ? 1 : 0;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("onstack")) {
|
||||
this.onstack = data ? 1 : 0;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("showboxes")) {
|
||||
this.showboxes = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("UF_size")) {
|
||||
this.UF_size = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("mark")) {
|
||||
this.mark = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("onstack")) {
|
||||
this.onstack = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("priority")) {
|
||||
this.priority = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("node_type")) {
|
||||
this.node_type = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("rank")) {
|
||||
this.rank = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("order")) {
|
||||
this.order = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ranktype")) {
|
||||
this.ranktype = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("low")) {
|
||||
this.low = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("lim")) {
|
||||
this.lim = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("weight_class")) {
|
||||
this.weight_class = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("UF_size")) {
|
||||
return this.UF_size;
|
||||
}
|
||||
if (fieldName.equals("ranktype")) {
|
||||
return this.ranktype;
|
||||
}
|
||||
if (fieldName.equals("mark")) {
|
||||
return this.mark;
|
||||
}
|
||||
if (fieldName.equals("onstack")) {
|
||||
return this.onstack;
|
||||
}
|
||||
if (fieldName.equals("priority")) {
|
||||
return this.priority;
|
||||
}
|
||||
if (fieldName.equals("node_type")) {
|
||||
return this.node_type;
|
||||
}
|
||||
if (fieldName.equals("rank")) {
|
||||
return this.rank;
|
||||
}
|
||||
if (fieldName.equals("order")) {
|
||||
return this.order;
|
||||
}
|
||||
if (fieldName.equals("ranktype")) {
|
||||
return this.ranktype;
|
||||
}
|
||||
if (fieldName.equals("low")) {
|
||||
return this.low;
|
||||
}
|
||||
if (fieldName.equals("lim")) {
|
||||
return this.lim;
|
||||
}
|
||||
if (fieldName.equals("weight_class")) {
|
||||
return this.weight_class;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
return this.id;
|
||||
}
|
||||
if (fieldName.equals("heapindex")) {
|
||||
return this.heapindex;
|
||||
}
|
||||
if (fieldName.equals("hops")) {
|
||||
return this.hops;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("onstack")) {
|
||||
return this.onstack != 0;
|
||||
}
|
||||
if (fieldName.equals("has_port")) {
|
||||
return this.has_port;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("shape")) {
|
||||
this.shape = (ST_shape_desc) newData;
|
||||
return shape;
|
||||
}
|
||||
if (fieldName.equals("shape_info")) {
|
||||
this.shape_info = (ST_polygon_t) newData;
|
||||
return shape_info;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
this.label = (ST_textlabel_t) newData;
|
||||
return label;
|
||||
}
|
||||
if (fieldName.equals("clust")) {
|
||||
if (newData instanceof ST_Agraph_s) {
|
||||
this.clust = (h.ST_Agraph_s.Amp) ((ST_Agraph_s) newData).amp();
|
||||
} else {
|
||||
this.clust = (ST_Agraph_s.Amp) newData;
|
||||
}
|
||||
return clust;
|
||||
}
|
||||
if (fieldName.equals("next")) {
|
||||
this.next = (ST_Agnode_s) newData;
|
||||
return next;
|
||||
}
|
||||
if (fieldName.equals("prev")) {
|
||||
if (newData instanceof ST_Agnode_s.Amp) {
|
||||
this.prev = ((ST_Agnode_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.prev = (ST_Agnode_s) newData;
|
||||
}
|
||||
return prev;
|
||||
}
|
||||
if (fieldName.equals("UF_parent")) {
|
||||
this.UF_parent = (ST_Agnode_s) newData;
|
||||
return UF_parent;
|
||||
}
|
||||
if (fieldName.equals("par")) {
|
||||
if (newData instanceof ST_Agedge_s.Amp) {
|
||||
this.par = ((ST_Agedge_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.par = (ST_Agedge_s) newData;
|
||||
}
|
||||
return par;
|
||||
}
|
||||
if (fieldName.equals("alg")) {
|
||||
this.alg = (ST_Agedge_s) alg;
|
||||
return alg;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("shape")) {
|
||||
return shape;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
return label;
|
||||
}
|
||||
if (fieldName.equals("UF_parent")) {
|
||||
return UF_parent;
|
||||
}
|
||||
if (fieldName.equals("next")) {
|
||||
return next;
|
||||
}
|
||||
if (fieldName.equals("prev")) {
|
||||
return prev;
|
||||
}
|
||||
if (fieldName.equals("clust")) {
|
||||
return clust;
|
||||
}
|
||||
if (fieldName.equals("inleaf")) {
|
||||
return inleaf;
|
||||
}
|
||||
if (fieldName.equals("outleaf")) {
|
||||
return outleaf;
|
||||
}
|
||||
if (fieldName.equals("alg")) {
|
||||
return alg;
|
||||
}
|
||||
if (fieldName.equals("par")) {
|
||||
return par;
|
||||
}
|
||||
if (fieldName.equals("xlabel")) {
|
||||
return xlabel;
|
||||
}
|
||||
if (fieldName.equals("shape_info")) {
|
||||
return shape_info;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("in")) {
|
||||
return in;
|
||||
}
|
||||
if (fieldName.equals("out")) {
|
||||
return out;
|
||||
}
|
||||
if (fieldName.equals("flat_out")) {
|
||||
return flat_out;
|
||||
}
|
||||
if (fieldName.equals("flat_in")) {
|
||||
return flat_in;
|
||||
}
|
||||
if (fieldName.equals("other")) {
|
||||
return other;
|
||||
}
|
||||
if (fieldName.equals("save_in")) {
|
||||
return save_in;
|
||||
}
|
||||
if (fieldName.equals("save_out")) {
|
||||
return save_out;
|
||||
}
|
||||
if (fieldName.equals("tree_in")) {
|
||||
return tree_in;
|
||||
}
|
||||
if (fieldName.equals("tree_out")) {
|
||||
return tree_out;
|
||||
}
|
||||
if (fieldName.equals("coord")) {
|
||||
return coord;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("save_in")) {
|
||||
save_in.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("save_out")) {
|
||||
save_out.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("out")) {
|
||||
out.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("in")) {
|
||||
in.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct Agnodeinfo_t {
|
||||
// Agrec_t hdr;
|
||||
// shape_desc *shape;
|
||||
// void *shape_info;
|
||||
// pointf coord;
|
||||
// double width, height; /* inches */
|
||||
// boxf bb;
|
||||
// double ht, lw, rw;
|
||||
// textlabel_t *label;
|
||||
// textlabel_t *xlabel;
|
||||
// void *alg;
|
||||
// char state;
|
||||
// unsigned char gui_state; /* Node state for GUI ops */
|
||||
// boolean clustnode;
|
||||
//
|
||||
//
|
||||
// unsigned char pinned;
|
||||
// int id, heapindex, hops;
|
||||
// double *pos, dist;
|
||||
//
|
||||
//
|
||||
// unsigned char showboxes;
|
||||
// boolean has_port;
|
||||
// node_t* rep;
|
||||
// node_t *set;
|
||||
//
|
||||
// /* fast graph */
|
||||
// char node_type, mark, onstack;
|
||||
// char ranktype, weight_class;
|
||||
// node_t *next, *prev;
|
||||
// elist in, out, flat_out, flat_in, other;
|
||||
// graph_t *clust;
|
||||
//
|
||||
// /* for union-find and collapsing nodes */
|
||||
// int UF_size;
|
||||
// node_t *UF_parent;
|
||||
// node_t *inleaf, *outleaf;
|
||||
//
|
||||
// /* for placing nodes */
|
||||
// int rank, order; /* initially, order = 1 for ordered edges */
|
||||
// double mval;
|
||||
// elist save_in, save_out;
|
||||
//
|
||||
// /* for network-simplex */
|
||||
// elist tree_in, tree_out;
|
||||
// edge_t *par;
|
||||
// int low, lim;
|
||||
// int priority;
|
||||
//
|
||||
// double pad[1];
|
||||
//
|
||||
//
|
||||
// } Agnodeinfo_t;
|
187
src/h/ST_Agobj_s.java
Normal file
187
src/h/ST_Agobj_s.java
Normal file
|
@ -0,0 +1,187 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agobj_s extends UnsupportedStructAndPtr implements WithParent, HardcodedStruct {
|
||||
|
||||
public final ST_Agtag_s tag = new ST_Agtag_s(this);
|
||||
public ST_Agrec_s.Amp data;
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
ST_Agobj_s this2 = (ST_Agobj_s) other;
|
||||
this.tag.copyDataFrom((__struct__) this2.tag);
|
||||
this.data = this2.data;
|
||||
|
||||
}
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_Agobj_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agobj_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
return ST_Agobj_s.this.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agobj_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agobj_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
return ST_Agobj_s.this.castTo(dest);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agobj_s.class) {
|
||||
return this;
|
||||
}
|
||||
if (dest == Agraph_s.class && parent instanceof ST_Agraph_s) {
|
||||
return (ST_Agraph_s) parent;
|
||||
}
|
||||
if (dest == Agnode_s.class && parent instanceof ST_Agnode_s) {
|
||||
return (ST_Agnode_s) parent;
|
||||
}
|
||||
if (dest == Agedge_s.class && parent instanceof ST_Agedge_s) {
|
||||
return (ST_Agedge_s) parent;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("data")) {
|
||||
if (newData instanceof ST_Agnodeinfo_t) {
|
||||
ST_Agnodeinfo_t info = (ST_Agnodeinfo_t) newData;
|
||||
newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
|
||||
} else if (newData instanceof ST_Agedgeinfo_t) {
|
||||
ST_Agedgeinfo_t info = (ST_Agedgeinfo_t) newData;
|
||||
newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
|
||||
} else if (newData instanceof ST_Agedgeinfo_t.Amp) {
|
||||
ST_Agedgeinfo_t.Amp info = (ST_Agedgeinfo_t.Amp) newData;
|
||||
newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
|
||||
}
|
||||
if (newData instanceof ST_Agrec_s) {
|
||||
this.data = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
|
||||
} else {
|
||||
this.data = (ST_Agrec_s.Amp) newData;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("data")) {
|
||||
return data;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("tag")) {
|
||||
return tag;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("tag")) {
|
||||
this.tag.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
// public interface ST_Agobj_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agobj_s",
|
||||
// "{",
|
||||
// "Agtag_t tag",
|
||||
// "Agrec_t *data",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agobj_s {
|
||||
// Agtag_t tag;
|
||||
// Agrec_t *data;
|
||||
// };
|
341
src/h/ST_Agraph_s.java
Normal file
341
src/h/ST_Agraph_s.java
Normal file
|
@ -0,0 +1,341 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agraph_s extends UnsupportedStructAndPtr {
|
||||
|
||||
public final ST_Agobj_s base = new ST_Agobj_s(this);
|
||||
public final ST_Agdesc_s desc = new ST_Agdesc_s(this);
|
||||
public final ST_dtlink_s link = new ST_dtlink_s(this);
|
||||
|
||||
public ST_dt_s n_seq; /* the node set in sequence */
|
||||
public ST_dt_s n_id; /* the node set indexed by ID */
|
||||
public ST_dt_s e_seq; /* holders for edge sets */
|
||||
public ST_dt_s e_id; /* holders for edge sets */
|
||||
public ST_dt_s g_dict; /* subgraphs - descendants */
|
||||
public ST_Agraph_s parent; /* subgraphs - ancestors */
|
||||
// Agraph_t *parent, *root; /* subgraphs - ancestors */
|
||||
public ST_Agraph_s root; /* subgraphs - ancestors */
|
||||
public ST_Agclos_s clos; /* shared resources */
|
||||
|
||||
private final StarStruct _parent;
|
||||
|
||||
public ST_Agraph_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agraph_s(StarStruct parent) {
|
||||
this._parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return _parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("desc")) {
|
||||
desc.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agraph_s me;
|
||||
|
||||
public Amp(ST_Agraph_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agraph_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return ST_Agraph_s.this.getStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
return ST_Agraph_s.this.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
if (other instanceof Amp) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
if (other instanceof ST_Agraph_s) {
|
||||
ST_Agraph_s other2 = (ST_Agraph_s) other;
|
||||
return this.me == other2;
|
||||
}
|
||||
return super.isSameThan(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agobj_s.class) {
|
||||
return base.amp();
|
||||
}
|
||||
if (dest == Agraph_s.class) {
|
||||
return ST_Agraph_s.this;
|
||||
}
|
||||
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
// if (offset.toString().equals("h.Agedge_s::seq_link")) {
|
||||
// return seq_link;
|
||||
// }
|
||||
if (offset.toString().equals("h.Agraph_s::link")) {
|
||||
return link;
|
||||
}
|
||||
System.err.println("offset176=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
public ST_Agraph_s getObject() {
|
||||
return me;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
// if (offset.toString().equals("h.Agedge_s::seq_link")) {
|
||||
// return seq_link;
|
||||
// }
|
||||
if (offset.toString().equals("h.Agraph_s::link")) {
|
||||
return link;
|
||||
}
|
||||
System.err.println("offset156=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("desc")) {
|
||||
return desc;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("clos")) {
|
||||
this.clos = (ST_Agclos_s) newData;
|
||||
return clos;
|
||||
}
|
||||
if (fieldName.equals("root")) {
|
||||
this.root = (ST_Agraph_s) newData;
|
||||
return root;
|
||||
}
|
||||
if (fieldName.equals("n_seq")) {
|
||||
this.n_seq = (ST_dt_s) newData;
|
||||
return n_seq;
|
||||
}
|
||||
if (fieldName.equals("n_id")) {
|
||||
this.n_id = (ST_dt_s) newData;
|
||||
return n_id;
|
||||
}
|
||||
if (fieldName.equals("e_seq")) {
|
||||
this.e_seq = (ST_dt_s) newData;
|
||||
return e_seq;
|
||||
}
|
||||
if (fieldName.equals("e_id")) {
|
||||
this.e_id = (ST_dt_s) newData;
|
||||
return e_id;
|
||||
}
|
||||
if (fieldName.equals("g_dict")) {
|
||||
this.g_dict = (ST_dt_s) newData;
|
||||
return g_dict;
|
||||
}
|
||||
if (fieldName.equals("parent")) {
|
||||
this.parent = (ST_Agraph_s) newData;
|
||||
return parent;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("clos")) {
|
||||
return clos;
|
||||
}
|
||||
if (fieldName.equals("root")) {
|
||||
return root;
|
||||
}
|
||||
if (fieldName.equals("parent")) {
|
||||
return parent;
|
||||
}
|
||||
if (fieldName.equals("n_id")) {
|
||||
return n_id;
|
||||
}
|
||||
if (fieldName.equals("n_seq")) {
|
||||
return n_seq;
|
||||
}
|
||||
if (fieldName.equals("e_id")) {
|
||||
return e_id;
|
||||
}
|
||||
if (fieldName.equals("e_seq")) {
|
||||
return e_seq;
|
||||
}
|
||||
if (fieldName.equals("g_dict")) {
|
||||
return g_dict;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agobj_s.class) {
|
||||
return base;
|
||||
}
|
||||
if (dest == Agraph_s.class) {
|
||||
return this;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
ST_Agraph_s other2 = (ST_Agraph_s) other;
|
||||
return this == other2;
|
||||
}
|
||||
|
||||
public StarStruct from_link(ST_dtlink_s from) {
|
||||
if (from == link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_Agraph_s>(nb, 0, ST_Agraph_s.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// public interface ST_Agraph_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agraph_s",
|
||||
// "{",
|
||||
// "Agobj_t base",
|
||||
// "Agdesc_t desc",
|
||||
// "Dtlink_t link",
|
||||
// "Dict_t *n_seq",
|
||||
// "Dict_t *n_id",
|
||||
// "Dict_t *e_seq, *e_id",
|
||||
// "Dict_t *g_dict",
|
||||
// "Agraph_t *parent, *root",
|
||||
// "Agclos_t *clos",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agraph_s {
|
||||
// Agobj_t base;
|
||||
// Agdesc_t desc;
|
||||
// Dtlink_t link;
|
||||
// Dict_t *n_seq; /* the node set in sequence */
|
||||
// Dict_t *n_id; /* the node set indexed by ID */
|
||||
// Dict_t *e_seq, *e_id; /* holders for edge sets */
|
||||
// Dict_t *g_dict; /* subgraphs - descendants */
|
||||
// Agraph_t *parent, *root; /* subgraphs - ancestors */
|
||||
// Agclos_t *clos; /* shared resources */
|
||||
// };
|
592
src/h/ST_Agraphinfo_t.java
Normal file
592
src/h/ST_Agraphinfo_t.java
Normal file
|
@ -0,0 +1,592 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedArrayOfStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
private final ST_Agrec_s hdr = new ST_Agrec_s(this);
|
||||
// /* to generate code */
|
||||
private ST_layout_t drawing;
|
||||
private ST_textlabel_t label; /* if the cluster has a title */
|
||||
private final ST_boxf bb = new ST_boxf(this); /* bounding box */
|
||||
// pointf border[4]; /* sizes of margins for graph labels */
|
||||
private final ST_pointf border[] = new ST_pointf[] { new ST_pointf(), new ST_pointf(), new ST_pointf(),
|
||||
new ST_pointf() };
|
||||
// unsigned char gui_state; /* Graph state for GUI ops */
|
||||
private int has_labels;
|
||||
// boolean has_images;
|
||||
private int charset; /* input character set */
|
||||
private int rankdir;
|
||||
private double ht1, ht2; /* below and above extremal ranks */
|
||||
private int flags;
|
||||
// void *alg;
|
||||
private ST_GVC_s gvc; /* context for "globals" over multiple graphs */
|
||||
private CFunction cleanup;
|
||||
// void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
|
||||
//
|
||||
//
|
||||
// /* to place nodes */
|
||||
// node_t **neato_nlist;
|
||||
// int move;
|
||||
// double **dist, **spring, **sum_t, ***t;
|
||||
// unsigned short ndim;
|
||||
// unsigned short odim;
|
||||
//
|
||||
//
|
||||
// /* to have subgraphs */
|
||||
private int n_cluster;
|
||||
// graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
|
||||
private StarArrayOfPtr clust;
|
||||
private ST_Agraph_s dotroot;
|
||||
private ST_Agnode_s nlist;
|
||||
private StarArrayOfPtr rank;
|
||||
private ST_Agraph_s parent; /* containing cluster (not parent subgraph) */
|
||||
// int level; /* cluster nesting level (not node level!) */
|
||||
// node_t *minrep, *maxrep; /* set leaders for min and max rank */
|
||||
//
|
||||
// /* fast graph node list */
|
||||
private final ST_nlist_t comp = new ST_nlist_t(this);
|
||||
// /* connected components */
|
||||
private ST_Agnode_s minset, maxset; /* set leaders */
|
||||
private int n_nodes;
|
||||
// /* includes virtual */
|
||||
private int minrank, maxrank;
|
||||
//
|
||||
// /* various flags */
|
||||
private int has_flat_edges;
|
||||
// boolean has_sourcerank;
|
||||
// boolean has_sinkrank;
|
||||
private int showboxes;
|
||||
private int fontnames; /* to override mangling in SVG */
|
||||
//
|
||||
private int nodesep, ranksep;
|
||||
private ST_Agnode_s ln, rn; /* left, right nodes of bounding box */
|
||||
//
|
||||
// /* for clusters */
|
||||
// node_t *leader, **rankleader;
|
||||
private ST_Agnode_s leader;
|
||||
private STStarArrayOfPointer rankleader;
|
||||
private boolean expanded;
|
||||
private int installed;
|
||||
// char set_type;
|
||||
private int label_pos;
|
||||
private int exact_ranksep;
|
||||
|
||||
private final StarStruct parent_;
|
||||
|
||||
public ST_Agraphinfo_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agraphinfo_t(StarStruct parent) {
|
||||
this.parent_ = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
class ArrayOfFour extends UnsupportedArrayOfStruct {
|
||||
|
||||
final private int pos;
|
||||
|
||||
public ArrayOfFour(int pos) {
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_struct__ plus(int delta) {
|
||||
return new ArrayOfFour(pos + delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return border[pos];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(__struct__ value) {
|
||||
border[pos].copyDataFrom(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
return getStruct().getDouble(fieldName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_struct__ getArrayOfStruct(String fieldName) {
|
||||
if (fieldName.equals("border")) {
|
||||
return new ArrayOfFour(0);
|
||||
}
|
||||
return super.getArrayOfStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("comp")) {
|
||||
return this.comp;
|
||||
}
|
||||
if (fieldName.equals("bb")) {
|
||||
return this.bb;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agrec_s.class) {
|
||||
return hdr.amp();
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("gvc")) {
|
||||
this.gvc = (ST_GVC_s) newData;
|
||||
return gvc;
|
||||
}
|
||||
if (fieldName.equals("drawing")) {
|
||||
this.drawing = (ST_layout_t) newData;
|
||||
return drawing;
|
||||
}
|
||||
if (fieldName.equals("dotroot")) {
|
||||
this.dotroot = (ST_Agraph_s) newData;
|
||||
return dotroot;
|
||||
}
|
||||
if (fieldName.equals("parent")) {
|
||||
if (newData instanceof ST_Agraph_s.Amp) {
|
||||
this.parent = ((ST_Agraph_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.parent = (ST_Agraph_s) newData;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
if (fieldName.equals("clust")) {
|
||||
this.clust = (StarArrayOfPtr) newData;
|
||||
return clust;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
this.label = (ST_textlabel_t) newData;
|
||||
return label;
|
||||
}
|
||||
if (fieldName.equals("maxset")) {
|
||||
this.maxset = (ST_Agnode_s) newData;
|
||||
return maxset;
|
||||
}
|
||||
if (fieldName.equals("minset")) {
|
||||
this.minset = (ST_Agnode_s) newData;
|
||||
return minset;
|
||||
}
|
||||
if (fieldName.equals("nlist")) {
|
||||
if (newData instanceof ST_Agnode_s.Amp) {
|
||||
this.nlist = ((ST_Agnode_s.Amp) newData).getObject();
|
||||
} else {
|
||||
this.nlist = (ST_Agnode_s) newData;
|
||||
}
|
||||
return nlist;
|
||||
}
|
||||
if (fieldName.equals("leader")) {
|
||||
this.leader = (ST_Agnode_s) newData;
|
||||
return leader;
|
||||
}
|
||||
if (fieldName.equals("rankleader")) {
|
||||
this.rankleader = (STStarArrayOfPointer) newData;
|
||||
return rankleader;
|
||||
}
|
||||
if (fieldName.equals("rank")) {
|
||||
this.rank = (StarArrayOfPtr) newData;
|
||||
return rank;
|
||||
}
|
||||
if (fieldName.equals("ln")) {
|
||||
this.ln = (ST_Agnode_s) newData;
|
||||
return ln;
|
||||
}
|
||||
if (fieldName.equals("rn")) {
|
||||
this.rn = (ST_Agnode_s) newData;
|
||||
return rn;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("drawing")) {
|
||||
return drawing;
|
||||
}
|
||||
if (fieldName.equals("gvc")) {
|
||||
return gvc;
|
||||
}
|
||||
if (fieldName.equals("parent")) {
|
||||
return parent;
|
||||
}
|
||||
if (fieldName.equals("dotroot")) {
|
||||
return dotroot;
|
||||
}
|
||||
if (fieldName.equals("clust")) {
|
||||
return clust;
|
||||
}
|
||||
if (fieldName.equals("label")) {
|
||||
return label;
|
||||
}
|
||||
if (fieldName.equals("maxset")) {
|
||||
return maxset;
|
||||
}
|
||||
if (fieldName.equals("minset")) {
|
||||
return minset;
|
||||
}
|
||||
if (fieldName.equals("nlist")) {
|
||||
return nlist;
|
||||
}
|
||||
if (fieldName.equals("leader")) {
|
||||
return leader;
|
||||
}
|
||||
if (fieldName.equals("rankleader")) {
|
||||
return rankleader;
|
||||
}
|
||||
if (fieldName.equals("rank")) {
|
||||
return rank;
|
||||
}
|
||||
if (fieldName.equals("ln")) {
|
||||
return ln;
|
||||
}
|
||||
if (fieldName.equals("rn")) {
|
||||
return rn;
|
||||
}
|
||||
if (fieldName.equals("cleanup")) {
|
||||
return cleanup;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("expanded")) {
|
||||
this.expanded = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("has_flat_edges")) {
|
||||
this.has_flat_edges = data ? 1 : 0;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("charset")) {
|
||||
this.charset = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("rankdir")) {
|
||||
this.rankdir = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("nodesep")) {
|
||||
this.nodesep = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ranksep")) {
|
||||
this.ranksep = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("showboxes")) {
|
||||
this.showboxes = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("fontnames")) {
|
||||
this.fontnames = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("flags")) {
|
||||
this.flags = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("has_labels")) {
|
||||
this.has_labels = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("n_cluster")) {
|
||||
this.n_cluster = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("label_pos")) {
|
||||
this.label_pos = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("n_nodes")) {
|
||||
this.n_nodes = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("maxrank")) {
|
||||
this.maxrank = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("minrank")) {
|
||||
this.minrank = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("installed")) {
|
||||
this.installed = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("expanded")) {
|
||||
return expanded;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("flags")) {
|
||||
return flags;
|
||||
}
|
||||
if (fieldName.equals("charset")) {
|
||||
return charset;
|
||||
}
|
||||
if (fieldName.equals("rankdir")) {
|
||||
return rankdir;
|
||||
}
|
||||
if (fieldName.equals("has_labels")) {
|
||||
return has_labels;
|
||||
}
|
||||
if (fieldName.equals("n_cluster")) {
|
||||
return n_cluster;
|
||||
}
|
||||
if (fieldName.equals("label_pos")) {
|
||||
return label_pos;
|
||||
}
|
||||
if (fieldName.equals("n_nodes")) {
|
||||
return n_nodes;
|
||||
}
|
||||
if (fieldName.equals("maxrank")) {
|
||||
return maxrank;
|
||||
}
|
||||
if (fieldName.equals("minrank")) {
|
||||
return minrank;
|
||||
}
|
||||
if (fieldName.equals("has_flat_edges")) {
|
||||
return has_flat_edges;
|
||||
}
|
||||
if (fieldName.equals("installed")) {
|
||||
return installed;
|
||||
}
|
||||
if (fieldName.equals("exact_ranksep")) {
|
||||
return exact_ranksep;
|
||||
}
|
||||
if (fieldName.equals("nodesep")) {
|
||||
return nodesep;
|
||||
}
|
||||
if (fieldName.equals("ranksep")) {
|
||||
return ranksep;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("ht1")) {
|
||||
return ht1;
|
||||
}
|
||||
if (fieldName.equals("ht2")) {
|
||||
return ht2;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("ht1")) {
|
||||
this.ht1 = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ht2")) {
|
||||
this.ht2 = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct Agraphinfo_t",
|
||||
// "{",
|
||||
// "Agrec_t hdr",
|
||||
// "layout_t *drawing",
|
||||
// "textlabel_t *label",
|
||||
// "boxf bb",
|
||||
// "pointf border[4]",
|
||||
// "unsigned char gui_state",
|
||||
// "unsigned char has_labels",
|
||||
// "boolean has_images",
|
||||
// "unsigned char charset",
|
||||
// "int rankdir",
|
||||
// "double ht1, ht2",
|
||||
// "unsigned short flags",
|
||||
// "void *alg",
|
||||
// "GVC_t *gvc",
|
||||
// "void (*cleanup) (graph_t * g)",
|
||||
// "node_t **neato_nlist",
|
||||
// "int move",
|
||||
// "double **dist, **spring, **sum_t, ***t",
|
||||
// "unsigned short ndim",
|
||||
// "unsigned short odim",
|
||||
// "int n_cluster",
|
||||
// "graph_t **clust",
|
||||
// "graph_t *dotroot",
|
||||
// "node_t *nlist",
|
||||
// "rank_t *rank",
|
||||
// "graph_t *parent",
|
||||
// "int level",
|
||||
// "node_t *minrep, *maxrep",
|
||||
// "nlist_t comp",
|
||||
// "node_t *minset, *maxset",
|
||||
// "long n_nodes",
|
||||
// "short minrank, maxrank",
|
||||
// "boolean has_flat_edges",
|
||||
// "boolean has_sourcerank",
|
||||
// "boolean has_sinkrank",
|
||||
// "unsigned char showboxes",
|
||||
// "fontname_kind fontnames",
|
||||
// "int nodesep, ranksep",
|
||||
// "node_t *ln, *rn",
|
||||
// "node_t *leader, **rankleader",
|
||||
// "boolean expanded",
|
||||
// "char installed",
|
||||
// "char set_type",
|
||||
// "char label_pos",
|
||||
// "boolean exact_ranksep",
|
||||
// "}",
|
||||
// "Agraphinfo_t");
|
||||
}
|
||||
|
||||
// typedef struct Agraphinfo_t {
|
||||
// Agrec_t hdr;
|
||||
// /* to generate code */
|
||||
// layout_t *drawing;
|
||||
// textlabel_t *label; /* if the cluster has a title */
|
||||
// boxf bb; /* bounding box */
|
||||
// pointf border[4]; /* sizes of margins for graph labels */
|
||||
// unsigned char gui_state; /* Graph state for GUI ops */
|
||||
// unsigned char has_labels;
|
||||
// boolean has_images;
|
||||
// unsigned char charset; /* input character set */
|
||||
// int rankdir;
|
||||
// double ht1, ht2; /* below and above extremal ranks */
|
||||
// unsigned short flags;
|
||||
// void *alg;
|
||||
// GVC_t *gvc; /* context for "globals" over multiple graphs */
|
||||
// void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
|
||||
//
|
||||
//
|
||||
// /* to place nodes */
|
||||
// node_t **neato_nlist;
|
||||
// int move;
|
||||
// double **dist, **spring, **sum_t, ***t;
|
||||
// unsigned short ndim;
|
||||
// unsigned short odim;
|
||||
//
|
||||
//
|
||||
// /* to have subgraphs */
|
||||
// int n_cluster;
|
||||
// graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
|
||||
// graph_t *dotroot;
|
||||
// node_t *nlist;
|
||||
// rank_t *rank;
|
||||
// graph_t *parent; /* containing cluster (not parent subgraph) */
|
||||
// int level; /* cluster nesting level (not node level!) */
|
||||
// node_t *minrep, *maxrep; /* set leaders for min and max rank */
|
||||
//
|
||||
// /* fast graph node list */
|
||||
// nlist_t comp;
|
||||
// /* connected components */
|
||||
// node_t *minset, *maxset; /* set leaders */
|
||||
// long n_nodes;
|
||||
// /* includes virtual */
|
||||
// short minrank, maxrank;
|
||||
//
|
||||
// /* various flags */
|
||||
// boolean has_flat_edges;
|
||||
// boolean has_sourcerank;
|
||||
// boolean has_sinkrank;
|
||||
// unsigned char showboxes;
|
||||
// fontname_kind fontnames; /* to override mangling in SVG */
|
||||
//
|
||||
// int nodesep, ranksep;
|
||||
// node_t *ln, *rn; /* left, right nodes of bounding box */
|
||||
//
|
||||
// /* for clusters */
|
||||
// node_t *leader, **rankleader;
|
||||
// boolean expanded;
|
||||
// char installed;
|
||||
// char set_type;
|
||||
// char label_pos;
|
||||
// boolean exact_ranksep;
|
||||
//
|
||||
//
|
||||
// } Agraphinfo_t;
|
197
src/h/ST_Agrec_s.java
Normal file
197
src/h/ST_Agrec_s.java
Normal file
|
@ -0,0 +1,197 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent {
|
||||
|
||||
public CString name;
|
||||
public ST_Agrec_s.Amp next;
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
if (other instanceof ST_Agedgeinfo_t && parent instanceof ST_Agedgeinfo_t) {
|
||||
parent.copyDataFrom(other);
|
||||
return;
|
||||
}
|
||||
ST_Agrec_s this2 = (ST_Agrec_s) other;
|
||||
this.name = this2.name;
|
||||
this.next = this2.next;
|
||||
}
|
||||
|
||||
public ST_Agrec_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agrec_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agrec_s me;
|
||||
|
||||
public Amp(ST_Agrec_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agrec_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agrec_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
return ST_Agrec_s.this.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
return ST_Agrec_s.this.getCString(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
ST_Agrec_s.this.copyDataFrom(other);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
if (fieldName.equals("name")) {
|
||||
return name;
|
||||
}
|
||||
return super.getCString(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) {
|
||||
return (ST_Agdatadict_s) getParent();
|
||||
}
|
||||
if (dest == Agattr_s.class && getParent() instanceof ST_Agattr_s) {
|
||||
return (ST_Agattr_s) getParent();
|
||||
}
|
||||
if (dest == Agraphinfo_t.class && getParent() instanceof ST_Agraphinfo_t) {
|
||||
return (ST_Agraphinfo_t) getParent();
|
||||
}
|
||||
if (dest == Agnodeinfo_t.class && getParent() instanceof ST_Agnodeinfo_t) {
|
||||
return (ST_Agnodeinfo_t) getParent();
|
||||
}
|
||||
if (dest == Agedgeinfo_t.class && getParent() instanceof ST_Agedgeinfo_t) {
|
||||
return (ST_Agedgeinfo_t) getParent();
|
||||
}
|
||||
System.err.println("dest=" + dest);
|
||||
System.err.println("getParent=" + getParent().getClass());
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("name")) {
|
||||
this.name = (CString) newData;
|
||||
return name;
|
||||
}
|
||||
if (fieldName.equals("next")) {
|
||||
if (newData instanceof ST_Agrec_s) {
|
||||
this.next = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
|
||||
} else {
|
||||
this.next = (ST_Agrec_s.Amp) newData;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("next")) {
|
||||
return next;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agrec_s",
|
||||
// "{",
|
||||
// "char *name",
|
||||
// "Agrec_t *next",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agrec_s {
|
||||
// char *name;
|
||||
// Agrec_t *next;
|
||||
// /* following this would be any programmer-defined data */
|
||||
// };
|
238
src/h/ST_Agsubnode_s.java
Normal file
238
src/h/ST_Agsubnode_s.java
Normal file
|
@ -0,0 +1,238 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import h.ST_splineInfo.Amp;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Agsubnode_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public final ST_dtlink_s seq_link = new ST_dtlink_s(this);
|
||||
public final ST_dtlink_s id_link = new ST_dtlink_s(this);
|
||||
public Agnode_s node;
|
||||
public ST_dtlink_s.Amp in_id;
|
||||
public ST_dtlink_s.Amp out_id;
|
||||
public ST_dtlink_s.Amp in_seq;
|
||||
public ST_dtlink_s.Amp out_seq;
|
||||
|
||||
public ST_Agsubnode_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Agsubnode_s(StarStruct parent) {
|
||||
}
|
||||
|
||||
public StarStruct from_id_link(ST_dtlink_s from) {
|
||||
if (from == id_link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public StarStruct from_seq_link(ST_dtlink_s from) {
|
||||
if (from == seq_link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agsubnode_s me;
|
||||
|
||||
public Amp(ST_Agsubnode_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agsubnode_s::id_link")) {
|
||||
return id_link.amp();
|
||||
}
|
||||
if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
|
||||
return seq_link.amp();
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agsubnode_s.class) {
|
||||
return this;
|
||||
}
|
||||
System.err.println("dest=" + dest);
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agsubnode_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_Agsubnode_s.this.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agsubnode_s::id_link")) {
|
||||
return id_link.amp();
|
||||
}
|
||||
if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
|
||||
return seq_link.amp();
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == Agsubnode_s.class) {
|
||||
return this;
|
||||
}
|
||||
System.err.println("dest=" + dest);
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("node")) {
|
||||
this.node = (Agnode_s) newData;
|
||||
return node;
|
||||
}
|
||||
if (fieldName.equals("in_id")) {
|
||||
this.in_id = (h.ST_dtlink_s.Amp) newData;
|
||||
return in_id;
|
||||
}
|
||||
if (fieldName.equals("out_seq")) {
|
||||
this.out_seq = (h.ST_dtlink_s.Amp) newData;
|
||||
return out_seq;
|
||||
}
|
||||
if (fieldName.equals("out_id")) {
|
||||
this.out_id = (h.ST_dtlink_s.Amp) newData;
|
||||
return out_id;
|
||||
}
|
||||
if (fieldName.equals("seq_link")) {
|
||||
this.seq_link.copyDataFrom(newData);
|
||||
return seq_link;
|
||||
}
|
||||
if (fieldName.equals("in_seq")) {
|
||||
this.in_seq = (h.ST_dtlink_s.Amp) newData;
|
||||
return in_seq;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("node")) {
|
||||
return node;
|
||||
}
|
||||
if (fieldName.equals("in_id")) {
|
||||
return in_id;
|
||||
}
|
||||
if (fieldName.equals("out_seq")) {
|
||||
return out_seq;
|
||||
}
|
||||
if (fieldName.equals("out_id")) {
|
||||
return out_id;
|
||||
}
|
||||
if (fieldName.equals("in_seq")) {
|
||||
return in_seq;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
|
||||
// public interface ST_Agsubnode_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agsubnode_s",
|
||||
// "{",
|
||||
// "Dtlink_t seq_link",
|
||||
// "Dtlink_t id_link",
|
||||
// "Agnode_t *node",
|
||||
// "Dtlink_t *in_id, *out_id",
|
||||
// "Dtlink_t *in_seq, *out_seq",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agsubnode_s { /* the node-per-graph-or-subgraph record */
|
||||
// Dtlink_t seq_link; /* must be first */
|
||||
// Dtlink_t id_link;
|
||||
// Agnode_t *node; /* the object */
|
||||
// Dtlink_t *in_id, *out_id; /* by node/ID for random access */
|
||||
// Dtlink_t *in_seq, *out_seq; /* by node/sequence for serial access */
|
||||
// };
|
218
src/h/ST_Agsym_s.java
Normal file
218
src/h/ST_Agsym_s.java
Normal file
|
@ -0,0 +1,218 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
//2 38c2s12koxcpi2c7vwl72qrsp
|
||||
|
||||
public class ST_Agsym_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
public final ST_dtlink_s link = new ST_dtlink_s(this);
|
||||
|
||||
public CString name; /* attribute's name */
|
||||
public CString defval; /* its default value for initialization */
|
||||
|
||||
public int id; /* its index in attr[] */
|
||||
public int kind; /* referent object type */
|
||||
public int fixed; /* immutable value */
|
||||
public int print; /* always print */
|
||||
|
||||
public ST_Agsym_s(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agsym_s::name")) {
|
||||
return name;
|
||||
}
|
||||
if (offset.toString().equals("h.Agsym_s::link")) {
|
||||
return link;
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
public ST_Agsym_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
private final ST_Agsym_s me;
|
||||
|
||||
public Amp(ST_Agsym_s me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
Amp other2 = (Amp) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.Agsym_s::name")) {
|
||||
return name;
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
return ST_Agsym_s.this.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_Agsym_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
return ST_Agsym_s.this.getCString(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("name")) {
|
||||
this.name = (CString) newData;
|
||||
return name;
|
||||
}
|
||||
if (fieldName.equals("defval")) {
|
||||
this.defval = (CString) newData;
|
||||
return defval;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("kind")) {
|
||||
this.kind = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
this.id = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("kind")) {
|
||||
return kind;
|
||||
}
|
||||
if (fieldName.equals("id")) {
|
||||
return id;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
if (fieldName.equals("defval")) {
|
||||
return defval;
|
||||
}
|
||||
if (fieldName.equals("name")) {
|
||||
return name;
|
||||
}
|
||||
return super.getCString(fieldName);
|
||||
}
|
||||
|
||||
public StarStruct from_link(ST_dtlink_s from) {
|
||||
if (from == link) {
|
||||
return amp();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct Agsym_s",
|
||||
// "{",
|
||||
// "Dtlink_t link",
|
||||
// "char *name",
|
||||
// "char *defval",
|
||||
// "int id",
|
||||
// "unsigned char kind",
|
||||
// "unsigned char fixed",
|
||||
// "unsigned char print",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct Agsym_s { /* symbol in one of the above dictionaries */
|
||||
// Dtlink_t link;
|
||||
// char *name; /* attribute's name */
|
||||
// char *defval; /* its default value for initialization */
|
||||
// int id; /* its index in attr[] */
|
||||
// unsigned char kind; /* referent object type */
|
||||
// unsigned char fixed; /* immutable value */
|
||||
// unsigned char print; /* always print */
|
||||
// };
|
73
src/h/ST_EMPTY.java
Normal file
73
src/h/ST_EMPTY.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_EMPTY extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_EMPTY() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_EMPTY(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
}
|
142
src/h/ST_GVCOMMON_t.java
Normal file
142
src/h/ST_GVCOMMON_t.java
Normal file
|
@ -0,0 +1,142 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_GVCOMMON_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
// "typedef struct GVCOMMON_s",
|
||||
// "{",
|
||||
private __ptr__ info;
|
||||
// "char *cmdname",
|
||||
// "int verbose",
|
||||
// "boolean config, auto_outfile_names",
|
||||
// "void (*errorfn) (const char *fmt, ...)",
|
||||
private CFunction errorfn;
|
||||
// "const char **show_boxes",
|
||||
// "const char **lib",
|
||||
// "int viewNum",
|
||||
// "const lt_symlist_t *builtins",
|
||||
private __ptr__ builtins;
|
||||
private boolean demand_loading;
|
||||
// "}",
|
||||
// "GVCOMMON_t");
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_GVCOMMON_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_GVCOMMON_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("info")) {
|
||||
this.info = newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("errorfn")) {
|
||||
this.errorfn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("builtins")) {
|
||||
this.builtins = newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("builtins") && builtins == null) {
|
||||
return builtins;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("demand_loading")) {
|
||||
this.demand_loading = data;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct GVCOMMON_s {
|
||||
// char **info;
|
||||
// char *cmdname;
|
||||
// int verbose;
|
||||
// boolean config, auto_outfile_names;
|
||||
// void (*errorfn) (const char *fmt, ...);
|
||||
// const char **show_boxes; /* emit code for correct box coordinates */
|
||||
// const char **lib;
|
||||
//
|
||||
// /* rendering state */
|
||||
// int viewNum; /* current view - 1 based count of views,
|
||||
// all pages in all layers */
|
||||
// const lt_symlist_t *builtins;
|
||||
// int demand_loading;
|
||||
// } GVCOMMON_t;
|
212
src/h/ST_GVC_s.java
Normal file
212
src/h/ST_GVC_s.java
Normal file
|
@ -0,0 +1,212 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_GVC_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
// "struct GVC_s",
|
||||
// "{",
|
||||
private final ST_GVCOMMON_t common = new ST_GVCOMMON_t(this);
|
||||
// "char *config_path",
|
||||
private int config_found;
|
||||
// "char **input_filenames",
|
||||
// "GVG_t *gvgs",
|
||||
// "GVG_t *gvg",
|
||||
// "gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]",
|
||||
// "gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]",
|
||||
// "gvplugin_package_t *packages",
|
||||
// "size_t (*write_fn) (GVJ_t *job, const char *s, size_t len)",
|
||||
// "Dtdisc_t textfont_disc",
|
||||
// "Dt_t *textfont_dt",
|
||||
// "gvplugin_active_textlayout_t textlayout",
|
||||
// "GVJ_t *jobs",
|
||||
// "GVJ_t *job",
|
||||
// "graph_t *g",
|
||||
private final ST_gvplugin_active_layout_t layout = new ST_gvplugin_active_layout_t();
|
||||
// "char *graphname",
|
||||
// "GVJ_t *active_jobs",
|
||||
// "char *pagedir",
|
||||
// "pointf margin",
|
||||
// "pointf pad",
|
||||
// "pointf pageSize",
|
||||
// "point pb",
|
||||
// "boxf bb",
|
||||
// "int rotation",
|
||||
// "boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation",
|
||||
// "char *layerDelims",
|
||||
// "char *layerListDelims",
|
||||
// "char *layers",
|
||||
// "char **layerIDs",
|
||||
// "int numLayers",
|
||||
// "int *layerlist",
|
||||
// "char *defaultfontname",
|
||||
// "double defaultfontsize",
|
||||
// "char **defaultlinestyle",
|
||||
// "gvcolor_t bgcolor",
|
||||
// "int fontrenaming",
|
||||
// "}");
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_GVC_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_GVC_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("common")) {
|
||||
return common;
|
||||
}
|
||||
if (fieldName.equals("layout")) {
|
||||
return layout;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("config_found")) {
|
||||
this.config_found = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// struct GVC_s {
|
||||
// GVCOMMON_t common;
|
||||
//
|
||||
// char *config_path;
|
||||
// boolean config_found;
|
||||
//
|
||||
// /* gvParseArgs */
|
||||
// char **input_filenames; /* null terminated array of input filenames */
|
||||
//
|
||||
// /* gvNextInputGraph() */
|
||||
// GVG_t *gvgs; /* linked list of graphs */
|
||||
// GVG_t *gvg; /* current graph */
|
||||
//
|
||||
// /* plugins */
|
||||
//
|
||||
// /* APIS expands to "+1 +1 ... +1" to give the number of APIs */
|
||||
// gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]; /* array of linked-list of plugins per api */
|
||||
// gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]; /* array of current plugins per api */
|
||||
//
|
||||
// gvplugin_package_t *packages; /* list of available packages */
|
||||
//
|
||||
// /* externally provided write() displine */
|
||||
// size_t (*write_fn) (GVJ_t *job, const char *s, size_t len);
|
||||
//
|
||||
// /* fonts and textlayout */
|
||||
// Dtdisc_t textfont_disc;
|
||||
// Dt_t *textfont_dt;
|
||||
// gvplugin_active_textlayout_t textlayout; /* always use best avail for all jobs */
|
||||
// // void (*free_layout) (void *layout); /* function for freeing layouts (mostly used by pango) */
|
||||
//
|
||||
// /* FIXME - everything below should probably move to GVG_t */
|
||||
//
|
||||
// /* gvrender_config() */
|
||||
// GVJ_t *jobs; /* linked list of jobs */
|
||||
// GVJ_t *job; /* current job */
|
||||
//
|
||||
// graph_t *g; /* current graph */
|
||||
//
|
||||
// /* gvrender_begin_job() */
|
||||
// gvplugin_active_layout_t layout;
|
||||
//
|
||||
// char *graphname; /* name from graph */
|
||||
// GVJ_t *active_jobs; /* linked list of active jobs */
|
||||
//
|
||||
// /* pagination */
|
||||
// char *pagedir; /* pagination order */
|
||||
// pointf margin; /* margins in graph units */
|
||||
// pointf pad; /* pad in graph units */
|
||||
// pointf pageSize; /* pageSize in graph units, not including margins */
|
||||
// point pb; /* page size - including margins (inches) */
|
||||
// boxf bb; /* graph bb in graph units, not including margins */
|
||||
// int rotation; /* rotation - 0 = portrait, 90 = landscape */
|
||||
// boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
|
||||
//
|
||||
// /* layers */
|
||||
// char *layerDelims; /* delimiters in layer names */
|
||||
// char *layerListDelims; /* delimiters between layer ranges */
|
||||
// char *layers; /* null delimited list of layer names */
|
||||
// char **layerIDs; /* array of layer names */
|
||||
// int numLayers; /* number of layers */
|
||||
// int *layerlist;
|
||||
//
|
||||
// /* default font */
|
||||
// char *defaultfontname;
|
||||
// double defaultfontsize;
|
||||
//
|
||||
// /* default line style */
|
||||
// char **defaultlinestyle;
|
||||
//
|
||||
// /* render defaults set from graph */
|
||||
// gvcolor_t bgcolor; /* background color */
|
||||
//
|
||||
// /* whether to mangle font names (at least in SVG), usually false */
|
||||
// int fontrenaming;
|
||||
// };
|
258
src/h/ST_Ppoly_t.java
Normal file
258
src/h/ST_Ppoly_t.java
Normal file
|
@ -0,0 +1,258 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedArrayOfPtr;
|
||||
import smetana.core.UnsupportedArrayOfStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__array_of_struct__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.Area;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarArrayOfStruct;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_Ppoly_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
// public List ps1;
|
||||
public StarArrayOfPtr ps2;
|
||||
public int pn;
|
||||
|
||||
public ST_Ppoly_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_Ppoly_t(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ copy() {
|
||||
ST_Ppoly_t result = new ST_Ppoly_t();
|
||||
result.ps2 = this.ps2;
|
||||
result.pn = this.pn;
|
||||
return result;
|
||||
}
|
||||
|
||||
class Adaptor extends UnsupportedArrayOfPtr {
|
||||
|
||||
final private StarArrayOfStruct newData2;
|
||||
final private int pos;
|
||||
|
||||
public Adaptor(StarArrayOfStruct newData2, int pos) {
|
||||
this.newData2 = newData2;
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ move(int delta) {
|
||||
return new Adaptor(newData2, pos + delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Area getInternal(int idx) {
|
||||
return newData2.getInternalArray().getInternal(pos + idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr() {
|
||||
return newData2.plus(pos).getPtr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return newData2.plus(pos).getStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int comparePointerInternal(__array_of_ptr__ other) {
|
||||
return super.comparePointerInternal(other);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Adaptor2 extends UnsupportedArrayOfStruct {
|
||||
|
||||
final private int pos;
|
||||
|
||||
public Adaptor2(int pos) {
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_struct__ plus(int delta) {
|
||||
return new Adaptor2(pos + delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return ps2.plus(pos).getStruct();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("ps")) {
|
||||
if (newData instanceof StarArrayOfStruct) {
|
||||
StarArrayOfStruct newData2 = (StarArrayOfStruct) newData;
|
||||
System.err.println("newData2=" + newData2);
|
||||
this.ps2 = new StarArrayOfPtr(new Adaptor(newData2, 0));
|
||||
return ps2;
|
||||
}
|
||||
this.ps2 = (StarArrayOfPtr) newData;
|
||||
return ps2;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("ps")) {
|
||||
return ps2;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_struct__ getArrayOfStruct(String fieldName) {
|
||||
if (fieldName.equals("ps")) {
|
||||
return new Adaptor2(0);
|
||||
// return ps2.getArrayOfStruct("ps");
|
||||
}
|
||||
return super.getArrayOfStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
if (fieldName.equals("ps")) {
|
||||
return ps2.getInternalArray();
|
||||
}
|
||||
return super.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void memcopyFrom(Area source) {
|
||||
ST_Ppoly_t source2 = (ST_Ppoly_t) source;
|
||||
this.ps2 = source2.ps2;
|
||||
this.pn = source2.pn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("pn")) {
|
||||
this.pn = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("pn")) {
|
||||
return pn;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("pn")) {
|
||||
return pn;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("pn")) {
|
||||
pn = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("ps")) {
|
||||
return ps2;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("ps")) {
|
||||
ps2 = (StarArrayOfPtr) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct Ppoly_t",
|
||||
// "{",
|
||||
// "Ppoint_t *ps",
|
||||
// "int pn",
|
||||
// "}",
|
||||
// "Ppoly_t");
|
||||
}
|
||||
|
||||
// typedef struct Ppoly_t {
|
||||
// Ppoint_t *ps;
|
||||
// int pn;
|
||||
// } Ppoly_t;
|
139
src/h/ST_adjmatrix_t.java
Normal file
139
src/h/ST_adjmatrix_t.java
Normal file
|
@ -0,0 +1,139 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_integer__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarArrayOfInteger;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_adjmatrix_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_adjmatrix_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_adjmatrix_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
// "typedef struct adjmatrix_t",
|
||||
// "{",
|
||||
private int nrows, ncols;
|
||||
|
||||
// "char *data",
|
||||
private StarArrayOfInteger data;
|
||||
|
||||
// "}",
|
||||
// "adjmatrix_t");
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("ncols")) {
|
||||
this.ncols = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("nrows")) {
|
||||
this.nrows = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("nrows")) {
|
||||
return this.nrows;
|
||||
}
|
||||
if (fieldName.equals("ncols")) {
|
||||
return this.ncols;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("data")) {
|
||||
this.data = (StarArrayOfInteger) newData;
|
||||
return data;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_integer__ getArrayOfInteger(String fieldName) {
|
||||
if (fieldName.equals("data")) {
|
||||
return data.getInternalArray();
|
||||
}
|
||||
return super.getArrayOfInteger(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("data")) {
|
||||
return data;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct adjmatrix_t {
|
||||
// int nrows, ncols;
|
||||
// char *data;
|
||||
// } adjmatrix_t;
|
241
src/h/ST_bezier.java
Normal file
241
src/h/ST_bezier.java
Normal file
|
@ -0,0 +1,241 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_bezier extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_bezier() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_bezier(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
// "{",
|
||||
// "pointf *list",
|
||||
private StarArrayOfPtr list;
|
||||
|
||||
private int size;
|
||||
private int sflag, eflag;
|
||||
|
||||
private final ST_pointf sp = new ST_pointf(this), ep = new ST_pointf(this);
|
||||
|
||||
// "}",
|
||||
// "bezier");
|
||||
|
||||
@Override
|
||||
public void ___(__struct__ other) {
|
||||
ST_bezier this2 = (ST_bezier) other;
|
||||
this.list = this2.list;
|
||||
this.size = this2.size;
|
||||
this.sflag = this2.sflag;
|
||||
this.eflag = this2.eflag;
|
||||
this.sp.copyDataFrom((__struct__) this2.sp);
|
||||
this.ep.copyDataFrom((__struct__) this2.ep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_bezier.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
return ST_bezier.this.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
return ST_bezier.this.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("sflag")) {
|
||||
return this.sflag != 0;
|
||||
}
|
||||
if (fieldName.equals("eflag")) {
|
||||
return this.eflag != 0;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("list")) {
|
||||
return list;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("list")) {
|
||||
this.list = (StarArrayOfPtr) newData;
|
||||
return list;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("sp")) {
|
||||
this.sp.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ep")) {
|
||||
this.ep.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("size")) {
|
||||
this.size = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("sflag")) {
|
||||
this.sflag = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("eflag")) {
|
||||
this.eflag = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("size")) {
|
||||
return this.size;
|
||||
}
|
||||
if (fieldName.equals("sflag")) {
|
||||
return this.sflag;
|
||||
}
|
||||
if (fieldName.equals("eflag")) {
|
||||
return this.eflag;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("sp")) {
|
||||
return this.sp;
|
||||
}
|
||||
if (fieldName.equals("ep")) {
|
||||
return this.ep;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
if (fieldName.equals("list")) {
|
||||
return this.list.getInternalArray();
|
||||
}
|
||||
return super.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_bezier>(nb, 0, ST_bezier.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct bezier {
|
||||
// pointf *list;
|
||||
// int size;
|
||||
// int sflag, eflag;
|
||||
// pointf sp, ep;
|
||||
// } bezier;
|
|
@ -46,10 +46,12 @@
|
|||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
@ -70,14 +72,24 @@ public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct
|
|||
// this.UR.setStruct(other.UR);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(__struct__ value) {
|
||||
copyDataFrom(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
// if (fieldName.equals("LL")) {
|
||||
// return LL;
|
||||
// }
|
||||
// if (fieldName.equals("UR")) {
|
||||
// return UR;
|
||||
// }
|
||||
if (fieldName.equals("LL")) {
|
||||
return LL;
|
||||
}
|
||||
if (fieldName.equals("UR")) {
|
||||
return UR;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
|
@ -158,6 +170,15 @@ public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct
|
|||
return new Amp();
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_boxf>(nb, 0, ST_boxf.class));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public interface ST_boxf extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct",
|
||||
|
|
133
src/h/ST_deque_t.java
Normal file
133
src/h/ST_deque_t.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_deque_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
// "pointnlink_t **pnlps",
|
||||
public __ptr__ pnlps;
|
||||
public int pnlpn, fpnlpi, lpnlpi, apex;
|
||||
|
||||
public ST_deque_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_deque_t(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("pnlps")) {
|
||||
return pnlps;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("pnlps")) {
|
||||
pnlps = newData;
|
||||
return pnlps;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("pnlpn")) {
|
||||
return pnlpn;
|
||||
}
|
||||
if (fieldName.equals("fpnlpi")) {
|
||||
return fpnlpi;
|
||||
}
|
||||
if (fieldName.equals("lpnlpi")) {
|
||||
return lpnlpi;
|
||||
}
|
||||
if (fieldName.equals("apex")) {
|
||||
return apex;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("pnlpn")) {
|
||||
pnlpn = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("fpnlpi")) {
|
||||
fpnlpi = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("lpnlpi")) {
|
||||
lpnlpi = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("apex")) {
|
||||
apex = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct deque_t",
|
||||
// "{",
|
||||
// "pointnlink_t **pnlps",
|
||||
// "int pnlpn, fpnlpi, lpnlpi, apex",
|
||||
// "}",
|
||||
// "deque_t");
|
||||
}
|
||||
|
||||
// typedef struct deque_t {
|
||||
// pointnlink_t **pnlps;
|
||||
// int pnlpn, fpnlpi, lpnlpi, apex;
|
||||
// } deque_t;
|
206
src/h/ST_dt_s.java
Normal file
206
src/h/ST_dt_s.java
Normal file
|
@ -0,0 +1,206 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_dt_s extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public CFunction searchf;/* search function */
|
||||
|
||||
public ST_dtdisc_s.Amp disc; /* method to manipulate objs */
|
||||
public ST_dtdata_s data; /* sharable data */
|
||||
public CFunction memoryf;/* function to alloc/free memory */
|
||||
public ST_dtmethod_s.Amp meth; /* dictionary method */
|
||||
|
||||
public int type; /* type information */
|
||||
public int nview; /* number of parent view dictionaries */
|
||||
public ST_dt_s view; /* next on viewpath */
|
||||
public ST_dt_s walk; /* dictionary being walked */
|
||||
public __ptr__ user; /* for user's usage */
|
||||
|
||||
public ST_dt_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_dt_s(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("searchf")) {
|
||||
this.searchf = (CFunction) newData;
|
||||
return searchf;
|
||||
}
|
||||
if (fieldName.equals("meth")) {
|
||||
this.meth = (ST_dtmethod_s.Amp) newData;
|
||||
return meth;
|
||||
}
|
||||
if (fieldName.equals("disc")) {
|
||||
this.disc = (ST_dtdisc_s.Amp) newData;
|
||||
return disc;
|
||||
}
|
||||
if (fieldName.equals("memoryf")) {
|
||||
this.memoryf = (CFunction) newData;
|
||||
return memoryf;
|
||||
}
|
||||
if (fieldName.equals("view")) {
|
||||
this.view = (ST_dt_s) newData;
|
||||
return view;
|
||||
}
|
||||
if (fieldName.equals("walk")) {
|
||||
this.walk = (ST_dt_s) newData;
|
||||
return walk;
|
||||
}
|
||||
if (fieldName.equals("user")) {
|
||||
this.user = newData;
|
||||
return user;
|
||||
}
|
||||
if (fieldName.equals("data")) {
|
||||
this.data = (ST_dtdata_s) newData;
|
||||
return data;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("disc")) {
|
||||
return disc;
|
||||
}
|
||||
if (fieldName.equals("data")) {
|
||||
return data;
|
||||
}
|
||||
if (fieldName.equals("meth")) {
|
||||
return meth;
|
||||
}
|
||||
if (fieldName.equals("view")) {
|
||||
return view;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("memoryf")) {
|
||||
return this.memoryf.exe(args);
|
||||
}
|
||||
if (fieldName.equals("searchf")) {
|
||||
return this.searchf.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == _dt_s.class) {
|
||||
return this;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("type")) {
|
||||
this.type = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("nview")) {
|
||||
this.nview = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("type")) {
|
||||
return type;
|
||||
}
|
||||
if (fieldName.equals("nview")) {
|
||||
return nview;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
ST_dt_s other2 = (ST_dt_s) other;
|
||||
return this == other2;
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct _dt_s",
|
||||
// "{",
|
||||
// "Dtsearch_f searchf",
|
||||
// "Dtdisc_t* disc",
|
||||
// "Dtdata_t* data",
|
||||
// "Dtmemory_f memoryf",
|
||||
// "Dtmethod_t* meth",
|
||||
// "int type",
|
||||
// "int nview",
|
||||
// "Dt_t* view",
|
||||
// "Dt_t* walk",
|
||||
// "void* user",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct _dt_s
|
||||
// { Dtsearch_f searchf;/* search function */
|
||||
// Dtdisc_t* disc; /* method to manipulate objs */
|
||||
// Dtdata_t* data; /* sharable data */
|
||||
// Dtmemory_f memoryf;/* function to alloc/free memory */
|
||||
// Dtmethod_t* meth; /* dictionary method */
|
||||
// int type; /* type information */
|
||||
// int nview; /* number of parent view dictionaries */
|
||||
// Dt_t* view; /* next on viewpath */
|
||||
// Dt_t* walk; /* dictionary being walked */
|
||||
// void* user; /* for user's usage */
|
||||
// };
|
183
src/h/ST_dtdata_s.java
Normal file
183
src/h/ST_dtdata_s.java
Normal file
|
@ -0,0 +1,183 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import h.ST_dtdisc_s.Amp;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_dtdata_s extends UnsupportedStructAndPtr {
|
||||
|
||||
public int type; /* type of dictionary */
|
||||
public ST_dtlink_s.Amp here; /* finger to last search element */
|
||||
private __ptr__ _htab; /* hash table */
|
||||
// Dtlink_t* _head; /* linked list */
|
||||
// } hh;
|
||||
public int ntab; /* number of hash slots */
|
||||
public int size; /* number of objects */
|
||||
public int loop; /* number of nested loops */
|
||||
public int minp; /* min path before splay, always even */
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_dtdata_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_dtdata_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("here")) {
|
||||
if (newData instanceof ST_dtlink_s) {
|
||||
this.here = (ST_dtlink_s.Amp) ((ST_dtlink_s) newData).amp();
|
||||
} else {
|
||||
this.here = (ST_dtlink_s.Amp) newData;
|
||||
}
|
||||
return here;
|
||||
}
|
||||
if (fieldName.equals("hh._htab")) {
|
||||
this._htab = newData;
|
||||
return _htab;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("here")) {
|
||||
return here;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("type")) {
|
||||
this.type = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ntab")) {
|
||||
this.ntab = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("size")) {
|
||||
this.size = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("loop")) {
|
||||
this.loop = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("minp")) {
|
||||
this.minp = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("type")) {
|
||||
return type;
|
||||
}
|
||||
if (fieldName.equals("size")) {
|
||||
return size;
|
||||
}
|
||||
if (fieldName.equals("minp")) {
|
||||
return minp;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
// public interface ST_dtdata_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct _dtdata_s",
|
||||
// "{",
|
||||
// "int type",
|
||||
// "Dtlink_t* here",
|
||||
// "union",
|
||||
// "{",
|
||||
// "Dtlink_t** _htab",
|
||||
// "Dtlink_t* _head",
|
||||
// "}",
|
||||
// "hh",
|
||||
// "int ntab",
|
||||
// "int size",
|
||||
// "int loop",
|
||||
// "int minp",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct _dtdata_s
|
||||
// { int type; /* type of dictionary */
|
||||
// Dtlink_t* here; /* finger to last search element */
|
||||
// union
|
||||
// { Dtlink_t** _htab; /* hash table */
|
||||
// Dtlink_t* _head; /* linked list */
|
||||
// } hh;
|
||||
// int ntab; /* number of hash slots */
|
||||
// int size; /* number of objects */
|
||||
// int loop; /* number of nested loops */
|
||||
// int minp; /* min path before splay, always even */
|
||||
// /* for hash dt, > 0: fixed table size */
|
||||
// };
|
|
@ -45,6 +45,7 @@
|
|||
*/
|
||||
package h;
|
||||
|
||||
import h.ST_dtmethod_s.Amp;
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
|
@ -70,8 +71,12 @@ public class ST_dtdisc_s extends UnsupportedStructAndPtr {
|
|||
this(null);
|
||||
}
|
||||
|
||||
class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
private final ST_dtdisc_s parent;
|
||||
|
||||
public Amp(ST_dtdisc_s me) {
|
||||
|
@ -123,12 +128,6 @@ public class ST_dtdisc_s extends UnsupportedStructAndPtr {
|
|||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
115
src/h/ST_dthold_s.java
Normal file
115
src/h/ST_dthold_s.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_dthold_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_dthold_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_dthold_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
// "struct _dthold_s",
|
||||
// "{",
|
||||
// "Dtlink_t hdr",
|
||||
// "void* obj",
|
||||
private final ST_dtlink_s hdr = new ST_dtlink_s(this);
|
||||
private __ptr__ obj;
|
||||
|
||||
// "}");
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == _dthold_s.class) {
|
||||
return this;
|
||||
}
|
||||
if (dest == _dtlink_s.class) {
|
||||
return hdr;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("obj")) {
|
||||
this.obj = newData;
|
||||
return this.obj;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("obj")) {
|
||||
return this.obj;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// struct _dthold_s
|
||||
// { Dtlink_t hdr; /* header */
|
||||
// void* obj; /* user object */
|
||||
// };
|
227
src/h/ST_dtlink_s.java
Normal file
227
src/h/ST_dtlink_s.java
Normal file
|
@ -0,0 +1,227 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedC;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent {
|
||||
|
||||
public ST_dtlink_s.Amp right;
|
||||
public ST_dtlink_s.Amp _left;
|
||||
private final StarStruct parent;
|
||||
|
||||
@Override
|
||||
public void copyDataFrom(__struct__ other) {
|
||||
ST_dtlink_s this2 = (ST_dtlink_s) other;
|
||||
this.right = this2.right;
|
||||
this._left = this2._left;
|
||||
}
|
||||
|
||||
public ST_dtlink_s() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_dtlink_s(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public StarStruct getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == _dtlink_s.class) {
|
||||
return amp();
|
||||
// return this;
|
||||
}
|
||||
if (dest == _dthold_s.class) {
|
||||
return new LinkTo_dthold_s();
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
class LinkTo_dthold_s extends UnsupportedStructAndPtr {
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("obj")) {
|
||||
return new LinkTo_Obj();
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class LinkTo_Obj extends UnsupportedStructAndPtr {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
if (dest == _dtlink_s.class) {
|
||||
return this;
|
||||
}
|
||||
if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) {
|
||||
return (ST_refstr_t) getParent();
|
||||
}
|
||||
if (dest == _dthold_s.class && getParent() instanceof ST_dthold_s) {
|
||||
// System.err.println("ITSME");
|
||||
// System.err.println("getParent()=" + getParent());
|
||||
return (ST_dthold_s) getParent();
|
||||
|
||||
}
|
||||
System.err.println("dest=" + dest);
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
if (virtualBytes < 0) {
|
||||
final OFFSET offset = OFFSET.fromInt(-virtualBytes);
|
||||
if (offset.toString().equals("h.Agsubnode_s::id_link")) {
|
||||
return ((ST_Agsubnode_s) parent).from_id_link(ST_dtlink_s.this);
|
||||
}
|
||||
if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
|
||||
return ((ST_Agsubnode_s) parent).from_seq_link(ST_dtlink_s.this);
|
||||
}
|
||||
if (offset.toString().equals("h.Agsym_s::link")) {
|
||||
return ((ST_Agsym_s) parent).from_link(ST_dtlink_s.this);
|
||||
}
|
||||
if (offset.toString().equals("h.Agedge_s::seq_link")) {
|
||||
return ((ST_Agedge_s) parent).from_seq_link(ST_dtlink_s.this);
|
||||
}
|
||||
if (offset.toString().equals("h.Agedge_s::id_link")) {
|
||||
return ((ST_Agedge_s) parent).from_id_link(ST_dtlink_s.this);
|
||||
}
|
||||
if (offset.toString().equals("h.Agraph_s::link")) {
|
||||
return ((ST_Agraph_s) parent).from_link(ST_dtlink_s.this);
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.refstr_t::s") && parent instanceof ST_refstr_t) {
|
||||
return ((ST_refstr_t) parent).to_s(ST_dtlink_s.this);
|
||||
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_dtlink_s.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_dtlink_s.this.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("hl._left")) {
|
||||
this._left = (ST_dtlink_s.Amp) newData;
|
||||
return _left;
|
||||
}
|
||||
if (fieldName.equals("right")) {
|
||||
this.right = (ST_dtlink_s.Amp) newData;
|
||||
return right;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("hl._left")) {
|
||||
return _left;
|
||||
}
|
||||
if (fieldName.equals("right")) {
|
||||
return right;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
// public interface ST_dtlink_s extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "struct _dtlink_s",
|
||||
// "{",
|
||||
// "Dtlink_t* right",
|
||||
// "union",
|
||||
// "{",
|
||||
// "unsigned int _hash",
|
||||
// "Dtlink_t* _left",
|
||||
// "}",
|
||||
// "hl",
|
||||
// "}");
|
||||
}
|
||||
|
||||
// struct _dtlink_s
|
||||
// { Dtlink_t* right; /* right child */
|
||||
// union
|
||||
// { unsigned int _hash; /* hash value */
|
||||
// Dtlink_t* _left; /* left child */
|
||||
// } hl;
|
||||
// };
|
|
@ -47,11 +47,11 @@ package h;
|
|||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_dtmethod_s extends UnsupportedStruct {
|
||||
public class ST_dtmethod_s extends UnsupportedStructAndPtr {
|
||||
|
||||
public CFunction searchf;
|
||||
public int type;
|
||||
|
@ -72,30 +72,33 @@ public class ST_dtmethod_s extends UnsupportedStruct {
|
|||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new UnsupportedStarStruct() {
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("type")) {
|
||||
return type;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("searchf")) {
|
||||
return searchf;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("searchf")) {
|
||||
return searchf.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
};
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("type")) {
|
||||
return type;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("searchf")) {
|
||||
return searchf;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("searchf")) {
|
||||
return searchf.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
117
src/h/ST_gvlayout_engine_s.java
Normal file
117
src/h/ST_gvlayout_engine_s.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_gvlayout_engine_s extends UnsupportedStructAndPtr {
|
||||
|
||||
private CFunction layout;
|
||||
private CFunction cleanup;
|
||||
|
||||
// "struct gvlayout_engine_s",
|
||||
// "{",
|
||||
// "void (*layout) (graph_t * g)",
|
||||
// "void (*cleanup) (graph_t * g)",
|
||||
// "}");
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("layout")) {
|
||||
this.layout = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("cleanup")) {
|
||||
this.cleanup = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("layout")) {
|
||||
return layout;
|
||||
}
|
||||
if (fieldName.equals("cleanup")) {
|
||||
return cleanup;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_gvlayout_engine_s.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("layout")) {
|
||||
return layout.exe(args);
|
||||
}
|
||||
if (fieldName.equals("cleanup")) {
|
||||
return cleanup.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// struct gvlayout_engine_s {
|
||||
// void (*layout) (graph_t * g);
|
||||
// void (*cleanup) (graph_t * g);
|
||||
// };
|
90
src/h/ST_gvlayout_features_t.java
Normal file
90
src/h/ST_gvlayout_features_t.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_gvlayout_features_t extends UnsupportedStructAndPtr {
|
||||
|
||||
// "typedef struct",
|
||||
// "{",
|
||||
private int flags;
|
||||
|
||||
// "}",
|
||||
// "gvlayout_features_t");
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("flags")) {
|
||||
this.flags = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("flags")) {
|
||||
return flags;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// int flags;
|
||||
// } gvlayout_features_t;
|
104
src/h/ST_gvplugin_active_layout_t.java
Normal file
104
src/h/ST_gvplugin_active_layout_t.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
|
||||
public class ST_gvplugin_active_layout_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private ST_gvlayout_engine_s.Amp engine;
|
||||
private int id;
|
||||
private ST_gvlayout_features_t.Amp features;
|
||||
private CString type;
|
||||
|
||||
// "}",
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("type")) {
|
||||
this.type = (CString) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("engine")) {
|
||||
this.engine = (ST_gvlayout_engine_s.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("features")) {
|
||||
this.features = (ST_gvlayout_features_t.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("engine")) {
|
||||
return engine;
|
||||
}
|
||||
if (fieldName.equals("features")) {
|
||||
return features;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("id")) {
|
||||
this.id = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct gvplugin_active_layout_s {
|
||||
// gvlayout_engine_t *engine;
|
||||
// int id;
|
||||
// gvlayout_features_t *features;
|
||||
// const char *type;
|
||||
// } gvplugin_active_layout_t;
|
140
src/h/ST_gvplugin_installed_t.java
Normal file
140
src/h/ST_gvplugin_installed_t.java
Normal file
|
@ -0,0 +1,140 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_gvplugin_installed_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_gvplugin_installed_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_gvplugin_installed_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private int id;
|
||||
private CString type;
|
||||
private int quality;
|
||||
|
||||
private ST_gvlayout_engine_s.Amp engine;
|
||||
private ST_gvlayout_features_t.Amp features;
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("id")) {
|
||||
this.id = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("quality")) {
|
||||
this.quality = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("id")) {
|
||||
return this.id;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("type")) {
|
||||
this.type = (CString) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("engine")) {
|
||||
this.engine = (ST_gvlayout_engine_s.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("features")) {
|
||||
this.features = (ST_gvlayout_features_t.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("type")) {
|
||||
return type;
|
||||
}
|
||||
if (fieldName.equals("engine")) {
|
||||
return engine;
|
||||
}
|
||||
if (fieldName.equals("features")) {
|
||||
return features;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// int id; /* an id that is only unique within a package
|
||||
// of plugins of the same api.
|
||||
// A renderer-type such as "png" in the cairo package
|
||||
// has an id that is different from the "ps" type
|
||||
// in the same package */
|
||||
// const char *type; /* a string name, such as "png" or "ps" that
|
||||
// distinguishes different types withing the same
|
||||
// (renderer in this case) */
|
||||
// int quality; /* an arbitrary integer used for ordering plugins of
|
||||
// the same type from different packages */
|
||||
// void *engine; /* pointer to the jump table for the plugin */
|
||||
// void *features; /* pointer to the feature description
|
||||
// void* because type varies by api */
|
||||
// } gvplugin_installed_t;
|
192
src/h/ST_layout_t.java
Normal file
192
src/h/ST_layout_t.java
Normal file
|
@ -0,0 +1,192 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_layout_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_layout_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_layout_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
}
|
||||
|
||||
private double quantum;
|
||||
private double scale;
|
||||
private double ratio;
|
||||
private double dpi;
|
||||
|
||||
private ST_pointf margin = new ST_pointf(this);
|
||||
private ST_pointf page = new ST_pointf(this);
|
||||
private ST_pointf size = new ST_pointf(this);
|
||||
|
||||
private boolean filled;
|
||||
private boolean landscape;
|
||||
private boolean centered;
|
||||
|
||||
// "ratio_t ratio_kind",
|
||||
private int ratio_kind;
|
||||
// "void* xdots",
|
||||
// "char* id",
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("xdots") && newData == null) {
|
||||
return null;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("margin")) {
|
||||
return margin;
|
||||
}
|
||||
if (fieldName.equals("page")) {
|
||||
return page;
|
||||
}
|
||||
if (fieldName.equals("size")) {
|
||||
return size;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("filled")) {
|
||||
this.filled = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("landscape")) {
|
||||
this.landscape = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("centered")) {
|
||||
this.centered = data;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("quantum")) {
|
||||
return this.quantum;
|
||||
}
|
||||
if (fieldName.equals("scale")) {
|
||||
return this.scale;
|
||||
}
|
||||
if (fieldName.equals("ratio")) {
|
||||
return this.ratio;
|
||||
}
|
||||
if (fieldName.equals("dpi")) {
|
||||
return this.dpi;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("quantum")) {
|
||||
this.quantum = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("scale")) {
|
||||
this.scale = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ratio")) {
|
||||
this.ratio = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("dpi")) {
|
||||
this.dpi = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("ratio_kind")) {
|
||||
return this.ratio_kind;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct layout_t {
|
||||
// double quantum;
|
||||
// double scale;
|
||||
// double ratio; /* set only if ratio_kind == R_VALUE */
|
||||
// double dpi;
|
||||
// pointf margin;
|
||||
// pointf page;
|
||||
// pointf size;
|
||||
// boolean filled;
|
||||
// boolean landscape;
|
||||
// boolean centered;
|
||||
// ratio_t ratio_kind;
|
||||
// void* xdots;
|
||||
// char* id;
|
||||
// } layout_t;
|
|
@ -46,11 +46,13 @@
|
|||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.Area;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarArrayOfStruct;
|
||||
|
@ -97,6 +99,12 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
|
|||
public void setStruct(__struct__ value) {
|
||||
ST_pointf.this.setStruct(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
ST_pointf.Amp other2 = (Amp) other;
|
||||
return this.getStruct() == other2.getStruct();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -113,6 +121,11 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
|
|||
this.x = other2.x;
|
||||
this.y = other2.y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void memcopyFrom(Area source) {
|
||||
|
@ -199,6 +212,27 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
|
|||
public ST_pointf(StarStruct parent) {
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_pointf>(nb, 0, ST_pointf.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public interface ST_pointf extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct pointf_s",
|
||||
|
|
233
src/h/ST_pointnlink_t.java
Normal file
233
src/h/ST_pointnlink_t.java
Normal file
|
@ -0,0 +1,233 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarArrayOfStruct;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_pointnlink_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public ST_pointf.Amp pp;
|
||||
public ST_pointnlink_t.Amp link;
|
||||
|
||||
public ST_pointnlink_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_pointnlink_t(StarStruct parent) {
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("pp")) {
|
||||
return pp;
|
||||
}
|
||||
if (fieldName.equals("link")) {
|
||||
return link;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return ST_pointnlink_t.this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_pointnlink_t.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
ST_pointnlink_t.Amp other2 = (Amp) other;
|
||||
return this.getStruct() == other2.getStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getRealClass() {
|
||||
return ST_pointnlink_t.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("pp")) {
|
||||
return pp;
|
||||
}
|
||||
if (fieldName.equals("link")) {
|
||||
return link;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("pp")) {
|
||||
if (newData instanceof StarArrayOfPtr) {
|
||||
StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
|
||||
ST_pointf data = (ST_pointf) tmp.getStruct();
|
||||
pp = (ST_pointf.Amp) data.amp();
|
||||
return pp;
|
||||
}
|
||||
if (newData instanceof StarArrayOfStruct) {
|
||||
StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
|
||||
ST_pointf data = (ST_pointf) tmp.getStruct();
|
||||
pp = (ST_pointf.Amp) data.amp();
|
||||
return pp;
|
||||
}
|
||||
System.err.println("newData1=" + newData.getClass());
|
||||
pp = (ST_pointf.Amp) newData;
|
||||
return pp;
|
||||
}
|
||||
if (fieldName.equals("link")) {
|
||||
if (newData == null) {
|
||||
link = null;
|
||||
return link;
|
||||
}
|
||||
if (newData instanceof StarArrayOfPtr) {
|
||||
StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
|
||||
ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
|
||||
link = (ST_pointnlink_t.Amp) data.amp();
|
||||
return link;
|
||||
}
|
||||
if (newData instanceof StarArrayOfStruct) {
|
||||
StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
|
||||
ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
|
||||
link = (ST_pointnlink_t.Amp) data.amp();
|
||||
return link;
|
||||
}
|
||||
if (newData instanceof ST_pointnlink_t.Amp) {
|
||||
ST_pointnlink_t.Amp tmp = (ST_pointnlink_t.Amp) newData;
|
||||
link = tmp;
|
||||
return link;
|
||||
}
|
||||
System.err.println("newData2=" + newData.getClass());
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_pointnlink_t>(nb, 0, ST_pointnlink_t.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
class StarStructAdaptor extends UnsupportedStarStruct {
|
||||
private final ST_pointnlink_t me;
|
||||
|
||||
public StarStructAdaptor(ST_pointnlink_t me) {
|
||||
this.me = me;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
StarStructAdaptor other2 = (StarStructAdaptor) other;
|
||||
return this.me == other2.me;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct getInternalData() {
|
||||
return new StarStructAdaptor(this);
|
||||
}
|
||||
|
||||
public static size_t sizeof_starstar_empty(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return STStarArrayOfPointer.malloc(nb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct pointnlink_t",
|
||||
// "{",
|
||||
// "Ppoint_t *pp",
|
||||
// "struct pointnlink_t *link",
|
||||
// "}",
|
||||
// "pointnlink_t");
|
||||
}
|
||||
|
||||
// typedef struct pointnlink_t {
|
||||
// Ppoint_t *pp;
|
||||
// struct pointnlink_t *link;
|
||||
// } pointnlink_t;
|
221
src/h/ST_polygon_t.java
Normal file
221
src/h/ST_polygon_t.java
Normal file
|
@ -0,0 +1,221 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_polygon_t extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public int regular;
|
||||
public int peripheries;
|
||||
public int sides;
|
||||
public double orientation;
|
||||
public double distortion;
|
||||
public double skew;
|
||||
public int option;
|
||||
private StarArrayOfPtr vertices;
|
||||
|
||||
// "pointf *vertices",
|
||||
|
||||
public ST_polygon_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_polygon_t(StarStruct parent) {
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("regular")) {
|
||||
return regular != 0;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("peripheries")) {
|
||||
return peripheries;
|
||||
}
|
||||
if (fieldName.equals("sides")) {
|
||||
return sides;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("orientation")) {
|
||||
return orientation;
|
||||
}
|
||||
if (fieldName.equals("skew")) {
|
||||
return skew;
|
||||
}
|
||||
if (fieldName.equals("distortion")) {
|
||||
return distortion;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_polygon_t.this.getPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("regular")) {
|
||||
this.regular = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("peripheries")) {
|
||||
this.peripheries = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("sides")) {
|
||||
this.sides = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("option")) {
|
||||
return option;
|
||||
}
|
||||
if (fieldName.equals("sides")) {
|
||||
return sides;
|
||||
}
|
||||
if (fieldName.equals("peripheries")) {
|
||||
return peripheries;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("orientation")) {
|
||||
this.orientation = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("distortion")) {
|
||||
this.distortion = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("skew")) {
|
||||
this.skew = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
private __ptr__ getVertices() {
|
||||
if (vertices == null) {
|
||||
return null;
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("vertices")) {
|
||||
return vertices;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("vertices") && newData == null) {
|
||||
this.vertices = null;
|
||||
return null;
|
||||
}
|
||||
if (fieldName.equals("vertices") && newData instanceof StarArrayOfPtr) {
|
||||
this.vertices = (StarArrayOfPtr) newData;
|
||||
return null;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct polygon_t",
|
||||
// "{",
|
||||
// "int regular",
|
||||
// "int peripheries",
|
||||
// "int sides",
|
||||
// "double orientation",
|
||||
// "double distortion",
|
||||
// "double skew",
|
||||
// "int option",
|
||||
// "pointf *vertices",
|
||||
// "}",
|
||||
// "polygon_t");
|
||||
}
|
||||
|
||||
// typedef struct polygon_t { /* mutable shape information for a node */
|
||||
// int regular; /* true for symmetric shapes */
|
||||
// int peripheries; /* number of periphery lines */
|
||||
// int sides; /* number of sides */
|
||||
// double orientation; /* orientation of shape (+ve degrees) */
|
||||
// double distortion; /* distortion factor - as in trapezium */
|
||||
// double skew; /* skew factor - as in parallelogram */
|
||||
// int option; /* ROUNDED, DIAGONAL corners, etc. */
|
||||
// pointf *vertices; /* array of vertex points */
|
||||
// } polygon_t;
|
|
@ -45,8 +45,6 @@
|
|||
*/
|
||||
package h;
|
||||
|
||||
import javax.swing.text.html.CSS;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
|
|
375
src/h/ST_rank_t.java
Normal file
375
src/h/ST_rank_t.java
Normal file
|
@ -0,0 +1,375 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedArrayOfPtr;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_rank_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_rank_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_rank_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private int n;
|
||||
|
||||
// "node_t **v",
|
||||
private STStarArrayOfPointer v;
|
||||
private int an;
|
||||
// "node_t **av",
|
||||
private STStarArrayOfPointer av;
|
||||
|
||||
private double ht1, ht2;
|
||||
private double pht1, pht2;
|
||||
private boolean candidate;
|
||||
private int valid;
|
||||
|
||||
private int cache_nc;
|
||||
private ST_adjmatrix_t flat;
|
||||
|
||||
// "}",
|
||||
// "rank_t");
|
||||
|
||||
@Override
|
||||
public void setStruct(__struct__ value) {
|
||||
ST_rank_t this2 = (ST_rank_t) value;
|
||||
this.n = this2.n;
|
||||
this.v = this2.v;
|
||||
this.an = this2.an;
|
||||
this.av = this2.av;
|
||||
this.ht1 = this2.ht1;
|
||||
this.ht2 = this2.ht2;
|
||||
this.pht1 = this2.pht1;
|
||||
this.pht2 = this2.pht2;
|
||||
this.candidate = this2.candidate;
|
||||
this.valid = this2.valid;
|
||||
this.cache_nc = this2.cache_nc;
|
||||
this.flat = this2.flat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
return ST_rank_t.this.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
return ST_rank_t.this.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_rank_t.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return ST_rank_t.this.getStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
return ST_rank_t.this.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
ST_rank_t.this.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
return ST_rank_t.this.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
ST_rank_t.this.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
return ST_rank_t.this.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(__struct__ value) {
|
||||
ST_rank_t.this.setStruct(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
if (fieldName.equals("v")) {
|
||||
return new ArrayOfPtr(v, 0);
|
||||
}
|
||||
return super.getArrayOfPtr(fieldName);
|
||||
}
|
||||
|
||||
static class ArrayOfPtr extends UnsupportedArrayOfPtr {
|
||||
|
||||
private final int pos;
|
||||
private final STStarArrayOfPointer tab;
|
||||
|
||||
private ArrayOfPtr(STStarArrayOfPointer tab, int pos) {
|
||||
this.pos = pos;
|
||||
this.tab = tab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ plus(int delta) {
|
||||
return new ArrayOfPtr(tab, pos + delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPtr(__ptr__ value) {
|
||||
tab.plus(pos).setPtr(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr() {
|
||||
return tab.plus(pos).getPtr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ asPtr() {
|
||||
if (pos == 0) {
|
||||
return tab;
|
||||
}
|
||||
return super.asPtr();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("n")) {
|
||||
return n;
|
||||
}
|
||||
if (fieldName.equals("an")) {
|
||||
return an;
|
||||
}
|
||||
if (fieldName.equals("cache_nc")) {
|
||||
return cache_nc;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("v")) {
|
||||
return v;
|
||||
}
|
||||
if (fieldName.equals("av")) {
|
||||
return av;
|
||||
}
|
||||
if (fieldName.equals("flat")) {
|
||||
return flat;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("candidate")) {
|
||||
this.candidate = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("valid")) {
|
||||
this.valid = data ? 1 : 0;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("n")) {
|
||||
this.n = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("an")) {
|
||||
this.an = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("valid")) {
|
||||
this.valid = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("cache_nc")) {
|
||||
this.cache_nc = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("valid")) {
|
||||
return valid != 0;
|
||||
}
|
||||
if (fieldName.equals("candidate")) {
|
||||
return candidate;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("pht1")) {
|
||||
return pht1;
|
||||
}
|
||||
if (fieldName.equals("pht2")) {
|
||||
return pht2;
|
||||
}
|
||||
if (fieldName.equals("ht1")) {
|
||||
return ht1;
|
||||
}
|
||||
if (fieldName.equals("ht2")) {
|
||||
return ht2;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("pht1")) {
|
||||
this.pht1 = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("pht2")) {
|
||||
this.pht2 = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ht1")) {
|
||||
this.ht1 = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("ht2")) {
|
||||
this.ht2 = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("v")) {
|
||||
this.v = (STStarArrayOfPointer) newData;
|
||||
return v;
|
||||
}
|
||||
if (fieldName.equals("av")) {
|
||||
this.av = (STStarArrayOfPointer) newData;
|
||||
return av;
|
||||
}
|
||||
if (fieldName.equals("flat")) {
|
||||
this.flat = (ST_adjmatrix_t) newData;
|
||||
return flat;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_rank_t>(nb, 0, ST_rank_t.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct rank_t {
|
||||
// int n; /* number of nodes in this rank */
|
||||
// node_t **v; /* ordered list of nodes in rank */
|
||||
// int an; /* globally allocated number of nodes */
|
||||
// node_t **av; /* allocated list of nodes in rank */
|
||||
// double ht1, ht2; /* height below/above centerline */
|
||||
// double pht1, pht2; /* as above, but only primitive nodes */
|
||||
// boolean candidate; /* for transpose () */
|
||||
// boolean valid;
|
||||
// int cache_nc; /* caches number of crossings */
|
||||
// adjmatrix_t *flat;
|
||||
// } rank_t;
|
190
src/h/ST_refstr_t.java
Normal file
190
src/h/ST_refstr_t.java
Normal file
|
@ -0,0 +1,190 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.OFFSET;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_refstr_t extends UnsupportedStructAndPtr /* implements WithParent */{
|
||||
|
||||
public final ST_dtlink_s link = new ST_dtlink_s(this);
|
||||
public int refcnt;
|
||||
public CString s;
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_refstr_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_refstr_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("refcnt")) {
|
||||
this.refcnt = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("refcnt")) {
|
||||
return refcnt;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("s")) {
|
||||
return s;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.refstr_t::s")) {
|
||||
return s;
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object addVirtualBytes(int virtualBytes) {
|
||||
if (virtualBytes == 0) {
|
||||
return this;
|
||||
}
|
||||
final OFFSET offset = OFFSET.fromInt(virtualBytes);
|
||||
if (offset.toString().equals("h.refstr_t::s")) {
|
||||
return s;
|
||||
}
|
||||
System.err.println("virtualBytes=" + virtualBytes);
|
||||
System.err.println("offset=" + offset);
|
||||
return super.addVirtualBytes(virtualBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ castTo(Class dest) {
|
||||
// if (dest == refstr_t.class) {
|
||||
// return this;
|
||||
// }
|
||||
if (dest == _dtlink_s.class) {
|
||||
return link;
|
||||
}
|
||||
return super.castTo(dest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("s")) {
|
||||
this.s = (CString) newData;
|
||||
this.s.setMyFather(this);
|
||||
return s;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
if (fieldName.equals("s")) {
|
||||
return s;
|
||||
}
|
||||
return super.getCString(fieldName);
|
||||
}
|
||||
|
||||
public CString to_s(ST_dtlink_s from) {
|
||||
if (from == link) {
|
||||
return s;
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getRealClass() {
|
||||
return refstr_t.class;
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct refstr_t",
|
||||
// "{",
|
||||
// "Dtlink_t link",
|
||||
// "unsigned long refcnt",
|
||||
// "char *s",
|
||||
// "char store[1]",
|
||||
// "}",
|
||||
// "refstr_t");
|
||||
}
|
||||
|
||||
// typedef struct refstr_t {
|
||||
// Dtlink_t link;
|
||||
// unsigned long refcnt;
|
||||
// char *s;
|
||||
// char store[1]; /* this is actually a dynamic array */
|
||||
// } refstr_t;
|
128
src/h/ST_shape_desc.java
Normal file
128
src/h/ST_shape_desc.java
Normal file
|
@ -0,0 +1,128 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.HardcodedStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_shape_desc extends UnsupportedStructAndPtr implements HardcodedStruct {
|
||||
|
||||
public ST_shape_desc(StarStruct parent) {
|
||||
}
|
||||
|
||||
public ST_shape_desc() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public CString name;
|
||||
public ST_shape_functions.Amp fns;
|
||||
public ST_polygon_t.Amp polygon;
|
||||
public boolean usershape;
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("name")) {
|
||||
this.name = (CString) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("fns")) {
|
||||
this.fns = (ST_shape_functions.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("polygon")) {
|
||||
this.polygon = (ST_polygon_t.Amp) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
if (fieldName.equals("name")) {
|
||||
return name;
|
||||
}
|
||||
return super.getCString(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("fns")) {
|
||||
return fns;
|
||||
}
|
||||
if (fieldName.equals("polygon")) {
|
||||
return polygon;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("usershape")) {
|
||||
return usershape;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct shape_desc",
|
||||
// "{",
|
||||
// "char *name",
|
||||
// "shape_functions *fns",
|
||||
// "polygon_t *polygon",
|
||||
// "boolean usershape",
|
||||
// "}",
|
||||
// "shape_desc");
|
||||
}
|
||||
|
||||
// typedef struct shape_desc { /* read-only shape descriptor */
|
||||
// char *name; /* as read from graph file */
|
||||
// shape_functions *fns;
|
||||
// polygon_t *polygon; /* base polygon info */
|
||||
// boolean usershape;
|
||||
// } shape_desc;
|
160
src/h/ST_shape_functions.java
Normal file
160
src/h/ST_shape_functions.java
Normal file
|
@ -0,0 +1,160 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_shape_functions extends UnsupportedStructAndPtr {
|
||||
|
||||
public CFunction initfn;
|
||||
public CFunction freefn;
|
||||
public CFunction portfn;
|
||||
public CFunction insidefn;
|
||||
public CFunction pboxfn;
|
||||
public CFunction codefn;
|
||||
|
||||
public ST_shape_functions() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_shape_functions(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
return ST_shape_functions.this.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
return ((CFunction) getPtr(fieldName)).exe(args);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("initfn")) {
|
||||
return initfn;
|
||||
}
|
||||
if (fieldName.equals("freefn")) {
|
||||
return freefn;
|
||||
}
|
||||
if (fieldName.equals("portfn")) {
|
||||
return portfn;
|
||||
}
|
||||
if (fieldName.equals("insidefn")) {
|
||||
return insidefn;
|
||||
}
|
||||
if (fieldName.equals("pboxfn")) {
|
||||
return pboxfn;
|
||||
}
|
||||
if (fieldName.equals("codefn")) {
|
||||
return codefn;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("initfn")) {
|
||||
this.initfn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("freefn")) {
|
||||
this.freefn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("portfn")) {
|
||||
this.portfn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("insidefn")) {
|
||||
this.insidefn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("pboxfn")) {
|
||||
this.pboxfn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
if (fieldName.equals("codefn")) {
|
||||
this.codefn = (CFunction) newData;
|
||||
return newData;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct shape_functions",
|
||||
// "{",
|
||||
// "void (*initfn) (node_t *)",
|
||||
// "void (*freefn) (node_t *)",
|
||||
// "port(*portfn) (node_t *, char *, char *)",
|
||||
// "boolean(*insidefn) (inside_t * inside_context, pointf)",
|
||||
// "int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr)",
|
||||
// "void (*codefn) (GVJ_t * job, node_t * n)",
|
||||
// "}",
|
||||
// "shape_functions");
|
||||
}
|
||||
|
||||
// typedef struct shape_functions { /* read-only shape functions */
|
||||
// void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */
|
||||
// void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */
|
||||
// port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */
|
||||
// boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
|
||||
// int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */
|
||||
// void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */
|
||||
// } shape_functions;
|
138
src/h/ST_splineInfo.java
Normal file
138
src/h/ST_splineInfo.java
Normal file
|
@ -0,0 +1,138 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CFunction;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_splineInfo extends UnsupportedStructAndPtr {
|
||||
|
||||
public CFunction swapEnds;
|
||||
public CFunction splineMerge;
|
||||
public boolean ignoreSwap;
|
||||
public boolean isOrtho;
|
||||
|
||||
public ST_splineInfo() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_splineInfo(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
return ST_splineInfo.this.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
return ST_splineInfo.this.call(fieldName, args);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("swapEnds")) {
|
||||
this.swapEnds = (CFunction) newData;
|
||||
return swapEnds;
|
||||
}
|
||||
if (fieldName.equals("splineMerge")) {
|
||||
this.splineMerge = (CFunction) newData;
|
||||
return splineMerge;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call(String fieldName, Object... args) {
|
||||
if (fieldName.equals("swapEnds")) {
|
||||
return swapEnds.exe(args);
|
||||
}
|
||||
if (fieldName.equals("splineMerge")) {
|
||||
return splineMerge.exe(args);
|
||||
}
|
||||
return super.call(fieldName, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("ignoreSwap")) {
|
||||
return ignoreSwap;
|
||||
}
|
||||
if (fieldName.equals("isOrtho")) {
|
||||
return isOrtho;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
// public interface ST_splineInfo extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct",
|
||||
// "{",
|
||||
// "boolean(*swapEnds) (edge_t * e)",
|
||||
// "boolean(*splineMerge) (node_t * n)",
|
||||
// "boolean ignoreSwap",
|
||||
// "boolean isOrtho",
|
||||
// "}",
|
||||
// "splineInfo");
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
|
||||
// boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
|
||||
// boolean ignoreSwap; /* Test for swapped edges if false */
|
||||
// boolean isOrtho; /* Orthogonal routing used */
|
||||
// } splineInfo;
|
133
src/h/ST_splines.java
Normal file
133
src/h/ST_splines.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__array_of_ptr__;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_splines extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_splines() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_splines(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
// "typedef struct splines",
|
||||
// "{",
|
||||
// bezier *list;
|
||||
private StarArrayOfPtr list;
|
||||
private int size;
|
||||
|
||||
// "boxf bb",
|
||||
// "}",
|
||||
// "splines");
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("size")) {
|
||||
this.size = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("size")) {
|
||||
return this.size;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("list")) {
|
||||
this.list = (StarArrayOfPtr) newData;
|
||||
return list;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("list")) {
|
||||
return this.list;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
|
||||
if (fieldName.equals("list")) {
|
||||
return this.list.getInternalArray();
|
||||
}
|
||||
return super.getArrayOfPtr(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct splines {
|
||||
// bezier *list;
|
||||
// int size;
|
||||
// boxf bb;
|
||||
// } splines;
|
104
src/h/ST_textfont_t.java
Normal file
104
src/h/ST_textfont_t.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_textfont_t extends UnsupportedStructAndPtr {
|
||||
|
||||
public CString name;
|
||||
public double size;
|
||||
|
||||
public ST_textfont_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_textfont_t(StarStruct parent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("name")) {
|
||||
this.name = (CString) newData;
|
||||
return name;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("size")) {
|
||||
this.size = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
// public interface ST_textfont_t extends __ptr__ {
|
||||
// public static List<String> DEFINITION = Arrays.asList(
|
||||
// "typedef struct",
|
||||
// "{",
|
||||
// "char* name",
|
||||
// "char* color",
|
||||
// "PostscriptAlias *postscript_alias",
|
||||
// "double size",
|
||||
// "unsigned int flags:7",
|
||||
// "unsigned int cnt:(sizeof(unsigned int) * 8 - 7)",
|
||||
// "}",
|
||||
// "textfont_t");
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// char* name;
|
||||
// char* color;
|
||||
// PostscriptAlias *postscript_alias;
|
||||
// double size;
|
||||
// unsigned int flags:7; /* HTML_UL, HTML_IF, HTML_BF, etc. */
|
||||
// unsigned int cnt:(sizeof(unsigned int) * 8 - 7); /* reference count */
|
||||
// } textfont_t;
|
271
src/h/ST_textlabel_t.java
Normal file
271
src/h/ST_textlabel_t.java
Normal file
|
@ -0,0 +1,271 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_textlabel_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_textlabel_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_textlabel_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private CString text, fontname, fontcolor;
|
||||
private int charset;
|
||||
private double fontsize;
|
||||
|
||||
private final ST_pointf dimen = new ST_pointf(this);
|
||||
private final ST_pointf space = new ST_pointf(this);
|
||||
private final ST_pointf pos = new ST_pointf(this);
|
||||
|
||||
// "union",
|
||||
// "{",
|
||||
// "struct",
|
||||
// "{",
|
||||
// private ST_textspan_t span;
|
||||
private __ptr__ span;
|
||||
private int nspans;
|
||||
|
||||
// "}",
|
||||
// "txt",
|
||||
// "htmllabel_t *html",
|
||||
private final __ptr__ html = null;
|
||||
// "}",
|
||||
// "u",
|
||||
private int valign;
|
||||
|
||||
private int set;
|
||||
|
||||
// "boolean html",
|
||||
// "}",
|
||||
// "textlabel_t");
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("dimen")) {
|
||||
return dimen;
|
||||
}
|
||||
if (fieldName.equals("space")) {
|
||||
return space;
|
||||
}
|
||||
if (fieldName.equals("pos")) {
|
||||
return pos;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStruct(String fieldName, __struct__ newData) {
|
||||
if (fieldName.equals("space")) {
|
||||
space.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("pos")) {
|
||||
pos.copyDataFrom(newData);
|
||||
return;
|
||||
}
|
||||
super.setStruct(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("text")) {
|
||||
this.text = (CString) newData;
|
||||
return text;
|
||||
}
|
||||
if (fieldName.equals("fontname")) {
|
||||
this.fontname = (CString) newData;
|
||||
return fontname;
|
||||
}
|
||||
if (fieldName.equals("fontcolor")) {
|
||||
this.fontcolor = (CString) newData;
|
||||
return fontcolor;
|
||||
}
|
||||
if (fieldName.equals("u.txt.span")) {
|
||||
this.span = newData;
|
||||
return span;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CString getCString(String fieldName) {
|
||||
if (fieldName.equals("text")) {
|
||||
return text;
|
||||
}
|
||||
return super.getCString(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ getPtr(String fieldName) {
|
||||
if (fieldName.equals("text")) {
|
||||
return text;
|
||||
}
|
||||
if (fieldName.equals("u.txt.span")) {
|
||||
return span;
|
||||
}
|
||||
if (fieldName.equals("fontname")) {
|
||||
return fontname;
|
||||
}
|
||||
return super.getPtr(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(String fieldName) {
|
||||
if (fieldName.equals("html")) {
|
||||
return html != null;
|
||||
}
|
||||
return super.getBoolean(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(String fieldName, double data) {
|
||||
if (fieldName.equals("fontsize")) {
|
||||
this.fontsize = data;
|
||||
return;
|
||||
}
|
||||
super.setDouble(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(String fieldName) {
|
||||
if (fieldName.equals("fontsize")) {
|
||||
return this.fontsize;
|
||||
}
|
||||
return super.getDouble(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("charset")) {
|
||||
this.charset = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("valign")) {
|
||||
this.valign = data;
|
||||
return;
|
||||
}
|
||||
if (fieldName.equals("u.txt.nspans")) {
|
||||
this.nspans = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(String fieldName, boolean data) {
|
||||
if (fieldName.equals("set")) {
|
||||
this.set = data ? 1 : 0;
|
||||
return;
|
||||
}
|
||||
super.setBoolean(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameThan(StarStruct other) {
|
||||
ST_textlabel_t other2 = (ST_textlabel_t) other;
|
||||
return this == other2;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("charset")) {
|
||||
return this.charset;
|
||||
}
|
||||
if (fieldName.equals("valign")) {
|
||||
return this.valign;
|
||||
}
|
||||
if (fieldName.equals("u.txt.nspans")) {
|
||||
return this.nspans;
|
||||
}
|
||||
if (fieldName.equals("set")) {
|
||||
return this.set;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct textlabel_t {
|
||||
// char *text, *fontname, *fontcolor;
|
||||
// int charset;
|
||||
// double fontsize;
|
||||
// pointf dimen; /* the diagonal size of the label (estimated by layout) */
|
||||
// pointf space; /* the diagonal size of the space for the label */
|
||||
// /* the rendered label is aligned in this box */
|
||||
// /* space does not include pad or margin */
|
||||
// pointf pos; /* the center of the space for the label */
|
||||
// union {
|
||||
// struct {
|
||||
// textspan_t *span;
|
||||
// short nspans;
|
||||
// } txt;
|
||||
// htmllabel_t *html;
|
||||
// } u;
|
||||
// char valign; /* 't' 'c' 'b' */
|
||||
// boolean set; /* true if position is set */
|
||||
// boolean html; /* true if html label */
|
||||
// } textlabel_t;
|
153
src/h/ST_textspan_t.java
Normal file
153
src/h/ST_textspan_t.java
Normal file
|
@ -0,0 +1,153 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.CString;
|
||||
import smetana.core.UnsupportedSize_t;
|
||||
import smetana.core.UnsupportedStarStruct;
|
||||
import smetana.core.UnsupportedStructAndPtr;
|
||||
import smetana.core.__ptr__;
|
||||
import smetana.core.__struct__;
|
||||
import smetana.core.size_t;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public class ST_textspan_t extends UnsupportedStructAndPtr {
|
||||
|
||||
private final StarStruct parent;
|
||||
|
||||
public ST_textspan_t() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public ST_textspan_t(StarStruct parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private CString str;
|
||||
|
||||
// "textfont_t *font",
|
||||
// "void *layout",
|
||||
// "void (*free_layout) (void *layout)",
|
||||
// "double yoffset_layout, yoffset_centerline",
|
||||
private final ST_pointf size = new ST_pointf(this);
|
||||
private int just;
|
||||
|
||||
@Override
|
||||
public StarStruct amp() {
|
||||
return new Amp();
|
||||
}
|
||||
|
||||
public class Amp extends UnsupportedStarStruct {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
if (fieldName.equals("size")) {
|
||||
return size;
|
||||
}
|
||||
return super.getStruct(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(String fieldName, int data) {
|
||||
if (fieldName.equals("just")) {
|
||||
this.just = data;
|
||||
return;
|
||||
}
|
||||
super.setInt(fieldName, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String fieldName) {
|
||||
if (fieldName.equals("just")) {
|
||||
return this.just;
|
||||
}
|
||||
return super.getInt(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
|
||||
if (fieldName.equals("str")) {
|
||||
this.str = (CString) newData;
|
||||
return str;
|
||||
}
|
||||
return super.setPtr(fieldName, newData);
|
||||
}
|
||||
|
||||
public static size_t sizeof(final int nb) {
|
||||
return new UnsupportedSize_t(nb) {
|
||||
@Override
|
||||
public Object malloc() {
|
||||
return new StarArrayOfPtr(new STArray<ST_textspan_t>(nb, 0, ST_textspan_t.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalNb() {
|
||||
return nb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object realloc(Object old) {
|
||||
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
|
||||
old2.realloc(nb);
|
||||
return old2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// char *str; /* stored in utf-8 */
|
||||
// textfont_t *font;
|
||||
// void *layout;
|
||||
// void (*free_layout) (void *layout); /* FIXME - this is ugly */
|
||||
// double yoffset_layout, yoffset_centerline;
|
||||
// pointf size;
|
||||
// char just; /* 'l' 'n' 'r' */ /* FIXME */
|
||||
// } textspan_t;
|
54
src/h/WithParent.java
Normal file
54
src/h/WithParent.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program:
|
||||
*
|
||||
*************************************************************************
|
||||
* Copyright (c) 2011 AT&T Intellectual Property
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors: See CVS logs. Details at http://www.graphviz.org/
|
||||
*************************************************************************
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
package h;
|
||||
|
||||
import smetana.core.amiga.StarStruct;
|
||||
|
||||
public interface WithParent {
|
||||
|
||||
public StarStruct getParent();
|
||||
|
||||
}
|
|
@ -142,5 +142,7 @@ public interface ISkinParam extends ISkinSimple {
|
|||
public double getPadding(PaddingParam param);
|
||||
|
||||
public boolean useRankSame();
|
||||
|
||||
public boolean displayGenericWithOldFashion();
|
||||
|
||||
}
|
|
@ -854,4 +854,12 @@ public class SkinParam implements ISkinParam {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean displayGenericWithOldFashion() {
|
||||
final String value = getValue("genericDisplay");
|
||||
if ("old".equalsIgnoreCase(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -267,4 +267,8 @@ public class SkinParamDelegator implements ISkinParam {
|
|||
return skinParam.useRankSame();
|
||||
}
|
||||
|
||||
public boolean displayGenericWithOldFashion() {
|
||||
return skinParam.displayGenericWithOldFashion();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
|
|||
public void setUseJDot(boolean useJDot) {
|
||||
this.useJDot = useJDot;
|
||||
}
|
||||
|
||||
|
||||
public boolean isUseJDot() {
|
||||
return useJDot;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
|
|||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
|
@ -140,10 +141,14 @@ public class Snake implements UShape {
|
|||
}
|
||||
|
||||
private void drawRainbow(UGraphic ug) {
|
||||
final List<HtmlColorAndStyle> colors = color.getColors();
|
||||
List<HtmlColorAndStyle> colors = color.getColors();
|
||||
final int colorArrowSeparationSpace = color.getColorArrowSeparationSpace();
|
||||
final double move = 2 + colorArrowSeparationSpace;
|
||||
final WormMutation mutation = WormMutation.create(worm, move);
|
||||
if (mutation.isDxNegative()) {
|
||||
colors = new ArrayList<HtmlColorAndStyle>(colors);
|
||||
Collections.reverse(colors);
|
||||
}
|
||||
final double globalMove = -1.0 * (colors.size() - 1) / 2.0;
|
||||
Worm current = worm.moveFirstPoint(mutation.getFirst().multiplyBy(globalMove));
|
||||
if (mutation.size() > 2) {
|
||||
|
|
|
@ -91,7 +91,7 @@ public class WormMutation {
|
|||
public UTranslate getFirst() {
|
||||
return translations.get(0);
|
||||
}
|
||||
|
||||
|
||||
public int size() {
|
||||
return translations.size();
|
||||
}
|
||||
|
@ -187,6 +187,10 @@ public class WormMutation {
|
|||
return new UTranslate(result.getExtreme() * (size - 1), 0);
|
||||
}
|
||||
|
||||
public boolean isDxNegative() {
|
||||
return translations.get(0).getDx() < 0;
|
||||
}
|
||||
|
||||
public Worm mute(Worm original) {
|
||||
final Worm result = new Worm();
|
||||
for (int i = 0; i < original.size(); i++) {
|
||||
|
|
|
@ -144,6 +144,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||
|
||||
Code ent1 = Code.of(arg.get("ENT1", 0));
|
||||
Code ent2 = Code.of(arg.get("ENT2", 0));
|
||||
if (ent1 == null && ent2 == null) {
|
||||
return executeArgSpecial3(diagram, arg);
|
||||
}
|
||||
|
||||
if (ent1 == null) {
|
||||
return executeArgSpecial1(diagram, arg);
|
||||
|
@ -350,13 +353,13 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||
}
|
||||
|
||||
private CommandExecutionResult executeArgSpecial1(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
|
||||
final Code clName1 = Code.of(arg.get("COUPLE1", 0));
|
||||
final Code clName2 = Code.of(arg.get("COUPLE1", 1));
|
||||
if (diagram.leafExist(clName1) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1);
|
||||
final Code clName1A = Code.of(arg.get("COUPLE1", 0));
|
||||
final Code clName1B = Code.of(arg.get("COUPLE1", 1));
|
||||
if (diagram.leafExist(clName1A) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1A);
|
||||
}
|
||||
if (diagram.leafExist(clName2) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2);
|
||||
if (diagram.leafExist(clName1B) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1B);
|
||||
}
|
||||
|
||||
final Code ent2 = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""));
|
||||
|
@ -364,25 +367,49 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||
|
||||
final LinkType linkType = getLinkType(arg);
|
||||
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
|
||||
// final int length = getQueueLength(arg);
|
||||
// final String weight = arg.get("HEADER").get(0);
|
||||
|
||||
final boolean result = diagram.associationClass(1, clName1, clName2, cl2, linkType, label);
|
||||
final boolean result = diagram.associationClass(1, clName1A, clName1B, cl2, linkType, label);
|
||||
if (result == false) {
|
||||
return CommandExecutionResult.error("Cannot have more than 2 assocications");
|
||||
}
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
private CommandExecutionResult executeArgSpecial3(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
|
||||
final Code clName1A = Code.of(arg.get("COUPLE1", 0));
|
||||
final Code clName1B = Code.of(arg.get("COUPLE1", 1));
|
||||
final Code clName2A = Code.of(arg.get("COUPLE2", 0));
|
||||
final Code clName2B = Code.of(arg.get("COUPLE2", 1));
|
||||
if (diagram.leafExist(clName1A) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1A);
|
||||
}
|
||||
if (diagram.leafExist(clName1B) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1B);
|
||||
}
|
||||
if (diagram.leafExist(clName2A) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2A);
|
||||
}
|
||||
if (diagram.leafExist(clName2B) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2B);
|
||||
}
|
||||
|
||||
final LinkType linkType = getLinkType(arg);
|
||||
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
|
||||
|
||||
return diagram.associationClass(clName1A, clName1B, clName2A, clName2B, linkType, label);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private CommandExecutionResult executeArgSpecial2(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
|
||||
final Code clName1 = Code.of(arg.get("COUPLE2", 0));
|
||||
final Code clName2 = Code.of(arg.get("COUPLE2", 1));
|
||||
if (diagram.leafExist(clName1) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName1);
|
||||
final Code clName2A = Code.of(arg.get("COUPLE2", 0));
|
||||
final Code clName2B = Code.of(arg.get("COUPLE2", 1));
|
||||
if (diagram.leafExist(clName2A) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2A);
|
||||
}
|
||||
if (diagram.leafExist(clName2) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2);
|
||||
if (diagram.leafExist(clName2B) == false) {
|
||||
return CommandExecutionResult.error("No class " + clName2B);
|
||||
}
|
||||
|
||||
final Code ent1 = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""));
|
||||
|
@ -390,10 +417,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||
|
||||
final LinkType linkType = getLinkType(arg);
|
||||
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
|
||||
// final int length = getQueueLength(arg);
|
||||
// final String weight = arg.get("HEADER").get(0);
|
||||
|
||||
final boolean result = diagram.associationClass(2, clName1, clName2, cl1, linkType, label);
|
||||
final boolean result = diagram.associationClass(2, clName2A, clName2B, cl1, linkType, label);
|
||||
if (result == false) {
|
||||
return CommandExecutionResult.error("Cannot have more than 2 assocications");
|
||||
}
|
||||
|
|
|
@ -50,11 +50,13 @@ import net.sourceforge.plantuml.Dimension2DDouble;
|
|||
import net.sourceforge.plantuml.EmbededDiagram;
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.FileFormatOption;
|
||||
import net.sourceforge.plantuml.SvgString;
|
||||
import net.sourceforge.plantuml.core.Diagram;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.preproc.Defines;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UImage;
|
||||
import net.sourceforge.plantuml.ugraphic.UImageSvg;
|
||||
import net.sourceforge.plantuml.ugraphic.UShape;
|
||||
|
||||
class AtomEmbededSystem implements Atom {
|
||||
|
@ -83,6 +85,13 @@ class AtomEmbededSystem implements Atom {
|
|||
|
||||
public void drawU(UGraphic ug) {
|
||||
try {
|
||||
final boolean isSvg = ug.matchesProperty("SVG");
|
||||
if (isSvg) {
|
||||
final String imageSvg = getImageSvg();
|
||||
final SvgString svg = new SvgString(imageSvg, 1);
|
||||
ug.draw(new UImageSvg(svg));
|
||||
return;
|
||||
}
|
||||
final BufferedImage im = getImage();
|
||||
final UShape image = new UImage(im);
|
||||
ug.draw(image);
|
||||
|
@ -94,6 +103,14 @@ class AtomEmbededSystem implements Atom {
|
|||
|
||||
}
|
||||
|
||||
private String getImageSvg() throws IOException, InterruptedException {
|
||||
final Diagram system = getSystem();
|
||||
final ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG));
|
||||
os.close();
|
||||
return new String(os.toByteArray());
|
||||
}
|
||||
|
||||
private BufferedImage getImage() throws IOException, InterruptedException {
|
||||
final Diagram system = getSystem();
|
||||
final ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
|
@ -113,5 +130,5 @@ class AtomEmbededSystem implements Atom {
|
|||
final BlockUml blockUml = new BlockUml(lines2, 0, Defines.createEmpty());
|
||||
return blockUml.getDiagram();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ public class Bodier {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<String> rawBodyWithoutHidden() {
|
||||
|
|
|
@ -268,6 +268,17 @@ public class Display implements Iterable<CharSequence> {
|
|||
return result;
|
||||
}
|
||||
|
||||
public Display addGeneric(CharSequence s) {
|
||||
final Display result = new Display(this, this.defaultCreoleMode);
|
||||
final int size = display.size();
|
||||
if (size == 0) {
|
||||
result.display.add("<" + s + ">");
|
||||
} else {
|
||||
result.display.set(size - 1, display.get(size - 1) + "<" + s + ">");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
if (isNull) {
|
||||
return 0;
|
||||
|
|
|
@ -117,7 +117,21 @@ public class GraphvizUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
private static final ThreadLocal<Integer> limitSize = new ThreadLocal<Integer>();
|
||||
|
||||
public static void removeLocalLimitSize() {
|
||||
limitSize.remove();
|
||||
}
|
||||
|
||||
public static void setLocalImageLimit(int value) {
|
||||
limitSize.set(value);
|
||||
}
|
||||
|
||||
public static int getenvImageLimit() {
|
||||
final Integer local = limitSize.get();
|
||||
if (local != null) {
|
||||
return local;
|
||||
}
|
||||
final String env = System.getProperty("PLANTUML_LIMIT_SIZE");
|
||||
if (StringUtils.isNotEmpty(env) && env.matches("\\d+")) {
|
||||
return Integer.parseInt(env);
|
||||
|
|
BIN
src/net/sourceforge/plantuml/dedication/1.png
Normal file
BIN
src/net/sourceforge/plantuml/dedication/1.png
Normal file
Binary file not shown.
|
@ -51,6 +51,7 @@ public class Dedications {
|
|||
addNormal("Write your own dedication!", "dedication");
|
||||
addNormal("linux_china", "linux_china");
|
||||
addCrypted("0", "pOhci6rKgPXw32AeYXhOpSY0suoauHq5VUSwFqHLHsLYgSO6WaJ7BW5vtHBAoU6ePbcW7d8Flx99MWjPSKQTDm00");
|
||||
addCrypted("1", "LTxN3hdnhSJ515qcA7IQ841axt4GXfUd3n2wgNirYCdLnyX2360Gv1OEOnJ1-gwFzRW5B3HAqLBkR6Ge0WW_Z000");
|
||||
}
|
||||
|
||||
private static void addNormal(String sentence, String name) {
|
||||
|
|
|
@ -119,7 +119,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
|
|||
final IEntity p = diagram.getOrCreateGroup(code, Display.getWithNewlines(display), GroupType.PACKAGE,
|
||||
currentPackage);
|
||||
p.setUSymbol(USymbol.getFromString(arg.get("SYMBOL", 0)));
|
||||
final String stereotype = arg.get("STEREOTYPE", 0);
|
||||
final String stereotype = arg.getLazzy("STEREOTYPE", 0);
|
||||
if (stereotype != null) {
|
||||
p.setStereotype(new Stereotype(stereotype, false));
|
||||
}
|
||||
|
|
|
@ -66,17 +66,18 @@ import net.sourceforge.plantuml.version.PSystemVersion;
|
|||
public class PSystemDonors extends AbstractPSystem {
|
||||
|
||||
public static final String DONORS = "UDfbL4jksp0GtSyfk1RIGoXsujI_17QQ0jcDvR75c29Tad8ghuBUe421hdk3eaKMHOjiUW7bHXsvbKcb"
|
||||
+ "10oOud3clPdtcAhato8BL-J9YbHxeoLcS4r9MAQ0iGbRwo1jh-821ZOSKGLpMg3p4hMOcbn3gfV6Ye4X"
|
||||
+ "lwVcxsh54MquQXXZL4XxwCjs8nMa8RNPmRmC42eOoAIxj85XYx9qCFUqpKcBdZ5RvjTlwv23KV7Ygh7G"
|
||||
+ "CqfgCJEb8nYMBywJEyD4sirMmYH2ZKMyvLAfelUebzpENYuvwnfjnKndHzfw3TCOlT_3fP8xlj2NsOQH"
|
||||
+ "7q-aXZDtJAqZ40djeBylfBUL66DkbWZ3fkctENBwA2uX5SR5QrDncpHwZcDyZ6lu5pnjEgpqahSsuvwS"
|
||||
+ "uy9M6tFlDf8JARvsQRtSmqM8NXgOo2md9KvHgYfceFOn6ETWIAXV3J5xLv8J_N9XaMUf0jyRS-SfoyN8"
|
||||
+ "eiC0QKqiqMXYzusoE4ICp4x6GZb8vKqWB15caNYR4Z7Fv8vlRoDPcKtJcLDZKQFQdeXRycYs3cPC4ErI"
|
||||
+ "Z6GpMZXNnZRzdlp-fTHXw44GAX8dosbyb9F5jjlDrFCk8mTNsCfZ9Zk0KoN57779rh5h4cz9hycUY4bw"
|
||||
+ "_NgU1cadHiE0EfQ9cUkC9LA86qRTPz6EGgIbPh9ibZ4HdErYvUyGfY495It89A8nA2NheYn8d9kIVEXl"
|
||||
+ "vk0ydio1Ir23tiTjOxXJkMODpMKHBCY0sCchfjF8hev09qf1_Qb-ZDBNZ_KFwEKTQrTil79nU0YiPYzS"
|
||||
+ "c0wS0PdLob8bfhBWmGtn_rTbXYjKOb8vnHwflzIFpm_rzwQKg3_NJ_NF-kdv0_yU-DCtEBEq5oDK1Jlh"
|
||||
+ "8fvr8rTYlPwIQWvrD3Qk8gDNCKduaUooO87TqCj7AIaLlnij5G_pGqBdeVvOVpssX86nvqAUQxEG3AEF" + "jeXzoY8my0TY-gPS";
|
||||
+ "10oOud3utinxawhato8BL-J9YbHxeoLcS4r9MAQ0iGbRwo1jh-821ZOSKGLpMg3p4hMOcbn3gfV6Ye4X"
|
||||
+ "lwVcxsh54MquQXXZz93sq9VjHYf8GsgpWtaP85Gma4btQGF35cNfOEvfcvCMFMEspA_VlaCEHiMBgyP2"
|
||||
+ "poYfnSoKZc1OlZXFxWmJQJTR2PC8DHRnbfzA5Rr7lUHozdB9MTTeAsOwEzBMQvZ6wFqUBfNSyOM-p3QC"
|
||||
+ "_7WYDPovOseTWKXe1_rz8Rsjn1XpiqGODaM_pP7JHt49gT0kNfkAowJHSnpZOrp3l-1fqs6bbxor6TVa"
|
||||
+ "71UssfXxjv6SIF6rI-lb7Yv2zDB0H6OvAN6AKbKn0xMFmJW7GqBzQeZPkvASw9SBYznB5VZUc3jFMIv6"
|
||||
+ "5Xq6I6jYYKOTks-KnI5YP7Oo5if1Acy2OOamYyJRF17pJExuzZQIbTaqbJar5ZMgxOcu9Ozcws361D4k"
|
||||
+ "nKWshOLpPMnJxydlNqeTcXu4eI9nifp6HpbPRAlTT3tlCd9mXQqyPh83E5LIp16NR1sx9l6Mz9hiYPYa"
|
||||
+ "rw_dQP1sOZGCg6EPcBdEM2A5k67KVHRjA4HQQZhBPXaJmTakLluEOHgIKD62J28QWrAoBig2nBafoOVw"
|
||||
+ "PWxEuyuSk0Grw7rSDeOxbMlMq5mMmO8CY9syQYgDxEe8TA8Kr9_gnoXz_LZ_W5xUiNR5nYiNXq5WDNlX"
|
||||
+ "mdJW3CYiLfOgCPK5Dsw8_q-L6QvGYKdb57ka_b8_FZ_KtvkdHFsvVgf_ra_F7_Ztm9--mPcblHYXAjXP"
|
||||
+ "5t6l6xaIw_MKL7EeexRnApAQYad2GxBBWWLsGo-7Kb8gdXij5G_pGqBdeVvOVpsMX86nvqAUQxEG3AEF"
|
||||
+ "jeXzoY8mdS6dU8G65Qwugt7XDl07r_Qm0000";
|
||||
|
||||
@Override
|
||||
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
|
||||
|
|
|
@ -231,10 +231,18 @@ public class QuoteUtils {
|
|||
"Vtabenapr oevatf punbf, abg xabjyrqtr.", "Yrneavat vf nyjnlf n cnvashy cebprff.",
|
||||
"V'z fbeel, ner lbh sebz gur cnfg ?", "Unir lbh gevrq gheavat vg bss naq ba ntnva ?",
|
||||
"Vs lbh qba'g xabj jurer lbh ner tbvat nal ebnq pna gnxr lbh gurer",
|
||||
"Ortva ng gur ortvaavat, naq tb ba gvyy lbh pbzr gb gur raq: gura fgbc",
|
||||
"Xrrc pnyz naq cerff Pgey-Nyg-Qry", "Vs lbh glcr Tbbtyr vagb Tbbtyr, lbh pna oernx gur Vagrearg.",
|
||||
"V unir cneg bs n cyna.", "V'z cerggl fher gur nafjre vf: V nz Tebbg.",
|
||||
"Nalguvat gung pna cbffvoyl tb jebat, qbrf", "Cyhf pn engr, cyhf ba n qr punapr dhr pn znepur");
|
||||
"Nalguvat gung pna cbffvoyl tb jebat, qbrf", "Cyhf pn engr, cyhf ba n qr punapr dhr pn znepur",
|
||||
"Fb V thrff gur sbeghar gryyre'f evtug...", "Jura rirelguvat'f tbar jebat fbzrubj...",
|
||||
"V qba'g jnag gb yvir ba guvf cynarg nalzber",
|
||||
"Oba, p'rfg y'urher bh yrf fbhiravef fr enzrarag...",
|
||||
"Fhpprff pbafvfgf bs tbvat sebz snvyher gb snvyher jvgubhg ybff bs raguhfvnfz",
|
||||
"Vs lbh'er tbvat guebhtu uryy, xrrc tbvat",
|
||||
"Jre xnzcsg, xnaa ireyvrera. Jre avpug xnzcsg, ung fpuba ireybera.",
|
||||
"P'rfg nh cvrq qh zhe dhr y'ba ibvg yr zvrhk yr zhe."
|
||||
|
||||
);
|
||||
|
||||
private QuoteUtils() {
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Code;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.cucadiagram.IEntity;
|
||||
|
@ -93,16 +94,71 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
|
|||
|
||||
private final List<Association> associations = new ArrayList<Association>();
|
||||
|
||||
public CommandExecutionResult associationClass(Code clName1A, Code clName1B, Code clName2A, Code clName2B,
|
||||
LinkType linkType, Display label) {
|
||||
final IEntity entity1A = getOrCreateLeaf(clName1A, null, null);
|
||||
final IEntity entity1B = getOrCreateLeaf(clName1B, null, null);
|
||||
final IEntity entity2A = getOrCreateLeaf(clName2A, null, null);
|
||||
final IEntity entity2B = getOrCreateLeaf(clName2B, null, null);
|
||||
final List<Association> same1 = getExistingAssociatedPoints(entity1A, entity1B);
|
||||
final List<Association> same2 = getExistingAssociatedPoints(entity2A, entity2B);
|
||||
if (same1.size() == 0 && same2.size() == 0) {
|
||||
|
||||
final IEntity point1 = getOrCreateLeaf(UniqueSequence.getCode("apoint"), LeafType.POINT_FOR_ASSOCIATION,
|
||||
null);
|
||||
final IEntity point2 = getOrCreateLeaf(UniqueSequence.getCode("apoint"), LeafType.POINT_FOR_ASSOCIATION,
|
||||
null);
|
||||
|
||||
insertPointBetween(entity1A, entity1B, point1);
|
||||
insertPointBetween(entity2A, entity2B, point2);
|
||||
|
||||
final int length = 1;
|
||||
final Link point1ToPoint2 = new Link(point1, point2, linkType, label, length);
|
||||
addLink(point1ToPoint2);
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Cannot link two associations points");
|
||||
}
|
||||
|
||||
private void insertPointBetween(final IEntity entity1A, final IEntity entity1B, final IEntity point1) {
|
||||
Link existingLink1 = foundLink(entity1A, entity1B);
|
||||
if (existingLink1 == null) {
|
||||
existingLink1 = new Link(entity1A, entity1B, new LinkType(LinkDecor.NONE, LinkDecor.NONE), Display.NULL, 2);
|
||||
} else {
|
||||
removeLink(existingLink1);
|
||||
}
|
||||
|
||||
final IEntity entity1real = existingLink1.isInverted() ? existingLink1.getEntity2() : existingLink1
|
||||
.getEntity1();
|
||||
final IEntity entity2real = existingLink1.isInverted() ? existingLink1.getEntity1() : existingLink1
|
||||
.getEntity2();
|
||||
|
||||
final Link entity1ToPoint = new Link(entity1real, point1, existingLink1.getType().getPart2(),
|
||||
existingLink1.getLabel(), existingLink1.getLength(), existingLink1.getQualifier1(), null,
|
||||
existingLink1.getLabeldistance(), existingLink1.getLabelangle());
|
||||
entity1ToPoint.setLinkArrow(existingLink1.getLinkArrow());
|
||||
final Link pointToEntity2 = new Link(point1, entity2real, existingLink1.getType().getPart1(), Display.NULL,
|
||||
existingLink1.getLength(), null, existingLink1.getQualifier2(), existingLink1.getLabeldistance(),
|
||||
existingLink1.getLabelangle());
|
||||
|
||||
// int length = 1;
|
||||
// if (existingLink.getLength() == 1 && entity1A != entity1B) {
|
||||
// length = 2;
|
||||
// }
|
||||
// if (existingLink.getLength() == 2 && entity1A == entity1B) {
|
||||
// length = 2;
|
||||
// }
|
||||
|
||||
addLink(entity1ToPoint);
|
||||
addLink(pointToEntity2);
|
||||
}
|
||||
|
||||
public boolean associationClass(int mode, Code clName1, Code clName2, IEntity associed, LinkType linkType,
|
||||
Display label) {
|
||||
final IEntity entity1 = getOrCreateLeaf(clName1, null, null);
|
||||
final IEntity entity2 = getOrCreateLeaf(clName2, null, null);
|
||||
final List<Association> same = new ArrayList<Association>();
|
||||
for (Association existing : associations) {
|
||||
if (existing.sameCouple(entity1, entity2)) {
|
||||
same.add(existing);
|
||||
}
|
||||
}
|
||||
final List<Association> same = getExistingAssociatedPoints(entity1, entity2);
|
||||
if (same.size() > 1) {
|
||||
return false;
|
||||
} else if (same.size() == 0) {
|
||||
|
@ -120,6 +176,16 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
|
|||
return true;
|
||||
}
|
||||
|
||||
private List<Association> getExistingAssociatedPoints(final IEntity entity1, final IEntity entity2) {
|
||||
final List<Association> same = new ArrayList<Association>();
|
||||
for (Association existing : associations) {
|
||||
if (existing.sameCouple(entity1, entity2)) {
|
||||
same.add(existing);
|
||||
}
|
||||
}
|
||||
return same;
|
||||
}
|
||||
|
||||
class Association {
|
||||
private IEntity entity1;
|
||||
private IEntity entity2;
|
||||
|
|
90
src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java
Normal file
90
src/net/sourceforge/plantuml/sequencediagram/AutoNumber.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of PlantUML.
|
||||
*
|
||||
* PlantUML is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlantUML distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class AutoNumber {
|
||||
|
||||
private boolean running = false;
|
||||
private DottedNumber current;
|
||||
private int increment;
|
||||
|
||||
private DecimalFormat format;
|
||||
|
||||
public final void go(DottedNumber startingNumber, int increment, DecimalFormat format) {
|
||||
this.running = true;
|
||||
this.current = startingNumber;
|
||||
this.increment = increment;
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public final void stop() {
|
||||
this.running = false;
|
||||
}
|
||||
|
||||
public final void resume(DecimalFormat format) {
|
||||
this.running = true;
|
||||
if (format != null) {
|
||||
this.format = format;
|
||||
}
|
||||
}
|
||||
|
||||
public final void resume(int increment, DecimalFormat format) {
|
||||
this.running = true;
|
||||
this.increment = increment;
|
||||
if (format != null) {
|
||||
this.format = format;
|
||||
}
|
||||
}
|
||||
|
||||
public void incrementIntermediate() {
|
||||
current.incrementIntermediate();
|
||||
}
|
||||
|
||||
public void incrementIntermediate(int position) {
|
||||
current.incrementIntermediate(position);
|
||||
}
|
||||
|
||||
public String getNextMessageNumber() {
|
||||
if (running == false) {
|
||||
return null;
|
||||
}
|
||||
final String result = current.format(format);
|
||||
current.incrementMinor(increment);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
112
src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java
Normal file
112
src/net/sourceforge/plantuml/sequencediagram/DottedNumber.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of PlantUML.
|
||||
*
|
||||
* PlantUML is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlantUML distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class DottedNumber {
|
||||
|
||||
private final List<Integer> nums;
|
||||
private final List<String> separators;
|
||||
|
||||
private DottedNumber(List<Integer> nums, List<String> separators) {
|
||||
this.nums = nums;
|
||||
this.separators = separators;
|
||||
}
|
||||
|
||||
public static DottedNumber create(String value) {
|
||||
final Pattern p = Pattern.compile("(\\d+)|(\\D+)");
|
||||
final Matcher m = p.matcher(value);
|
||||
final List<Integer> nums = new ArrayList<Integer>();
|
||||
final List<String> separators = new ArrayList<String>();
|
||||
while (m.find()) {
|
||||
final String part = m.group();
|
||||
if (isDigit(part.charAt(0))) {
|
||||
nums.add(Integer.parseInt(part));
|
||||
} else {
|
||||
separators.add(part);
|
||||
}
|
||||
}
|
||||
return new DottedNumber(nums, separators);
|
||||
}
|
||||
|
||||
private static boolean isDigit(final char c) {
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
sb.append(nums.get(i));
|
||||
if (i < separators.size()) {
|
||||
sb.append(separators.get(i));
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void incrementMinor(int step) {
|
||||
final int last = nums.size() - 1;
|
||||
final int newValue = nums.get(last) + step;
|
||||
nums.set(last, newValue);
|
||||
}
|
||||
|
||||
public void incrementIntermediate() {
|
||||
final int intermediate = nums.size() == 1 ? 0 : nums.size() - 2;
|
||||
incrementIntermediate(intermediate);
|
||||
}
|
||||
|
||||
public void incrementIntermediate(int position) {
|
||||
final int intermediate = position;
|
||||
final int newValue = nums.get(intermediate) + 1;
|
||||
for (int i = intermediate + 1; i < nums.size(); i++) {
|
||||
nums.set(i, 1);
|
||||
}
|
||||
nums.set(intermediate, newValue);
|
||||
}
|
||||
|
||||
public String format(DecimalFormat format) {
|
||||
if (nums.size() == 1 && separators.size() == 0) {
|
||||
return format.format(nums.get(0));
|
||||
}
|
||||
return "<b>" + toString() + "</b>";
|
||||
}
|
||||
|
||||
}
|
|
@ -322,45 +322,30 @@ public class SequenceDiagram extends UmlDiagram {
|
|||
return skin2;
|
||||
}
|
||||
|
||||
private boolean autonumber = false;
|
||||
private int messageNumber;
|
||||
private int incrementMessageNumber;
|
||||
private final AutoNumber autoNumber = new AutoNumber();
|
||||
|
||||
private DecimalFormat decimalFormat;
|
||||
|
||||
public final void autonumberGo(int startingNumber, int increment, DecimalFormat decimalFormat) {
|
||||
this.autonumber = true;
|
||||
this.messageNumber = startingNumber;
|
||||
this.incrementMessageNumber = increment;
|
||||
this.decimalFormat = decimalFormat;
|
||||
public final void autonumberGo(DottedNumber startingNumber, int increment, DecimalFormat decimalFormat) {
|
||||
autoNumber.go(startingNumber, increment, decimalFormat);
|
||||
}
|
||||
|
||||
public final void autonumberStop() {
|
||||
this.autonumber = false;
|
||||
autoNumber.stop();
|
||||
}
|
||||
|
||||
public final void autonumberResume(DecimalFormat decimalFormat) {
|
||||
this.autonumber = true;
|
||||
if (decimalFormat != null) {
|
||||
this.decimalFormat = decimalFormat;
|
||||
}
|
||||
public final AutoNumber getAutoNumber() {
|
||||
return autoNumber;
|
||||
}
|
||||
|
||||
public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
|
||||
this.autonumber = true;
|
||||
this.incrementMessageNumber = increment;
|
||||
if (decimalFormat != null) {
|
||||
this.decimalFormat = decimalFormat;
|
||||
}
|
||||
}
|
||||
// public final void autonumberResume(DecimalFormat decimalFormat) {
|
||||
// autoNumber.resume(decimalFormat);
|
||||
// }
|
||||
//
|
||||
// public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
|
||||
// autoNumber.resume(increment, decimalFormat);
|
||||
// }
|
||||
|
||||
public String getNextMessageNumber() {
|
||||
if (autonumber == false) {
|
||||
return null;
|
||||
}
|
||||
final int result = messageNumber;
|
||||
messageNumber += incrementMessageNumber;
|
||||
return decimalFormat.format(result);
|
||||
return autoNumber.getNextMessageNumber();
|
||||
}
|
||||
|
||||
public boolean isShowFootbox() {
|
||||
|
|
|
@ -49,6 +49,7 @@ import net.sourceforge.plantuml.sequencediagram.command.CommandArrow;
|
|||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoNewpage;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoactivate;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumber;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberIncrement;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberResume;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberStop;
|
||||
import net.sourceforge.plantuml.sequencediagram.command.CommandBoxEnd;
|
||||
|
@ -129,6 +130,7 @@ public class SequenceDiagramFactory extends UmlDiagramFactory {
|
|||
cmds.add(new CommandAutonumber());
|
||||
cmds.add(new CommandAutonumberStop());
|
||||
cmds.add(new CommandAutonumberResume());
|
||||
cmds.add(new CommandAutonumberIncrement());
|
||||
cmds.add(new CommandAutoactivate());
|
||||
cmds.add(new CommandFootbox());
|
||||
cmds.add(new CommandDelay());
|
||||
|
|
|
@ -36,30 +36,49 @@
|
|||
package net.sourceforge.plantuml.sequencediagram.command;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.command.SingleLineCommand;
|
||||
import net.sourceforge.plantuml.command.SingleLineCommand2;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.sequencediagram.DottedNumber;
|
||||
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
|
||||
|
||||
public class CommandAutonumber extends SingleLineCommand<SequenceDiagram> {
|
||||
public class CommandAutonumber extends SingleLineCommand2<SequenceDiagram> {
|
||||
|
||||
public CommandAutonumber() {
|
||||
super("(?i)^autonumber[%s]*(\\d+)?(?:[%s]+(\\d+))?(?:[%s]+[%g]([^%g]+)[%g])?[%s]*$");
|
||||
super(getConcat());
|
||||
}
|
||||
|
||||
private static RegexConcat getConcat() {
|
||||
return new RegexConcat(new RegexLeaf("^"), //
|
||||
new RegexLeaf("autonumber"), //
|
||||
new RegexLeaf("[%s]*"), //
|
||||
new RegexLeaf("START", "(\\d(?:(?:[^\\p{L}0-9%s]+|\\d+)*\\d)?)?"), //
|
||||
new RegexLeaf("STEP", "(?:[%s]+(\\d+))?"), //
|
||||
new RegexLeaf("FORMAT", "(?:[%s]+[%g]([^%g]+)[%g])?"), //
|
||||
new RegexLeaf("[%s]*"), //
|
||||
new RegexLeaf("$"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
|
||||
int start = 1;
|
||||
if (arg.get(0) != null) {
|
||||
start = Integer.parseInt(arg.get(0));
|
||||
protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
|
||||
DottedNumber start = DottedNumber.create("1");
|
||||
final String arg0 = arg.get("START", 0);
|
||||
// System.err.println("arg0=" + arg0);
|
||||
if (arg0 != null) {
|
||||
start = DottedNumber.create(arg0);
|
||||
}
|
||||
// System.err.println("start=" + start);
|
||||
int inc = 1;
|
||||
if (arg.get(1) != null) {
|
||||
inc = Integer.parseInt(arg.get(1));
|
||||
final String arg1 = arg.get("STEP", 0);
|
||||
if (arg1 != null) {
|
||||
inc = Integer.parseInt(arg1);
|
||||
}
|
||||
|
||||
final String df = arg.get(2) == null ? "<b>0</b>" : arg.get(2);
|
||||
final String arg2 = arg.get("FORMAT", 0);
|
||||
final String df = arg2 == null ? "<b>0</b>" : arg2;
|
||||
final DecimalFormat decimalFormat;
|
||||
try {
|
||||
decimalFormat = new DecimalFormat(df);
|
||||
|
@ -67,7 +86,8 @@ public class CommandAutonumber extends SingleLineCommand<SequenceDiagram> {
|
|||
return CommandExecutionResult.error("Error in pattern : " + df);
|
||||
}
|
||||
|
||||
sequenceDiagram.autonumberGo(start, inc, decimalFormat);
|
||||
diagram.autonumberGo(start, inc, decimalFormat);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of PlantUML.
|
||||
*
|
||||
* PlantUML is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlantUML distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.command;
|
||||
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.command.SingleLineCommand2;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
|
||||
|
||||
public class CommandAutonumberIncrement extends SingleLineCommand2<SequenceDiagram> {
|
||||
|
||||
public CommandAutonumberIncrement() {
|
||||
super(getConcat());
|
||||
}
|
||||
|
||||
private static RegexConcat getConcat() {
|
||||
return new RegexConcat(new RegexLeaf("^"), //
|
||||
new RegexLeaf("autonumber"), //
|
||||
new RegexLeaf("[%s]+"), //
|
||||
new RegexLeaf("inc"), //
|
||||
new RegexLeaf("POS", "(?:[%s]+([A-Za-z]))?"), //
|
||||
new RegexLeaf("[%s]*"), //
|
||||
new RegexLeaf("$"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
|
||||
final String position = arg.get("POS", 0);
|
||||
if (position == null) {
|
||||
diagram.getAutoNumber().incrementIntermediate();
|
||||
} else {
|
||||
final int pos = StringUtils.goLowerCase(position.charAt(0)) - 'a';
|
||||
diagram.getAutoNumber().incrementIntermediate(pos);
|
||||
}
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
}
|
|
@ -36,21 +36,35 @@
|
|||
package net.sourceforge.plantuml.sequencediagram.command;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.command.SingleLineCommand;
|
||||
import net.sourceforge.plantuml.command.SingleLineCommand2;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
|
||||
|
||||
public class CommandAutonumberResume extends SingleLineCommand<SequenceDiagram> {
|
||||
public class CommandAutonumberResume extends SingleLineCommand2<SequenceDiagram> {
|
||||
|
||||
public CommandAutonumberResume() {
|
||||
super("(?i)^autonumber[%s]*resume(?:[%s]+(\\d+))?(?:[%s]+[%g]([^%g]+)[%g])?[%s]*$");
|
||||
super(getConcat());
|
||||
}
|
||||
|
||||
private static RegexConcat getConcat() {
|
||||
return new RegexConcat(new RegexLeaf("^"), //
|
||||
new RegexLeaf("autonumber"), //
|
||||
new RegexLeaf("[%s]+"), //
|
||||
new RegexLeaf("resume"), //
|
||||
new RegexLeaf("[%s]*"), //
|
||||
new RegexLeaf("INC", "(?:[%s]+(\\d+))?"), //
|
||||
new RegexLeaf("DF", "(?:[%s]+[%g]([^%g]+)[%g])?"), //
|
||||
new RegexLeaf("$"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
|
||||
final String df = arg.get(1);
|
||||
protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
|
||||
final String df = arg.get("DF", 0);
|
||||
|
||||
DecimalFormat decimalFormat = null;
|
||||
if (df != null) {
|
||||
try {
|
||||
|
@ -60,13 +74,13 @@ public class CommandAutonumberResume extends SingleLineCommand<SequenceDiagram>
|
|||
}
|
||||
}
|
||||
|
||||
final String inc = arg.get(0);
|
||||
final String inc = arg.get("INC", 0);
|
||||
if (inc == null) {
|
||||
sequenceDiagram.autonumberResume(decimalFormat);
|
||||
diagram.getAutoNumber().resume(decimalFormat);
|
||||
} else {
|
||||
sequenceDiagram.autonumberResume(Integer.parseInt(arg.get(0)), decimalFormat);
|
||||
diagram.getAutoNumber().resume(Integer.parseInt(inc), decimalFormat);
|
||||
}
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
|
|||
public class CommandAutonumberStop extends SingleLineCommand<SequenceDiagram> {
|
||||
|
||||
public CommandAutonumberStop() {
|
||||
super("(?i)^autonumber[%s]*stop$");
|
||||
super("(?i)^autonumber[%s]+stop[%s]*$");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -74,15 +74,18 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
|
|||
final boolean italic = entity.getLeafType() == LeafType.ABSTRACT_CLASS
|
||||
|| entity.getLeafType() == LeafType.INTERFACE;
|
||||
|
||||
// final HtmlColor color = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS, getStereo());
|
||||
final Stereotype stereotype = entity.getStereotype();
|
||||
final String generic = entity.getGeneric();
|
||||
final boolean displayGenericWithOldFashion = skinParam.displayGenericWithOldFashion();
|
||||
final String generic = displayGenericWithOldFashion ? null : entity.getGeneric();
|
||||
FontConfiguration fontConfigurationName = new FontConfiguration(getSkinParam(), FontParam.CLASS, stereotype);
|
||||
if (italic) {
|
||||
fontConfigurationName = fontConfigurationName.italic();
|
||||
}
|
||||
TextBlock name = entity.getDisplay().createWithNiceCreoleMode(fontConfigurationName,
|
||||
HorizontalAlignment.CENTER, skinParam);
|
||||
Display display = entity.getDisplay();
|
||||
if (displayGenericWithOldFashion && entity.getGeneric() != null) {
|
||||
display = display.addGeneric(entity.getGeneric());
|
||||
}
|
||||
TextBlock name = display.createWithNiceCreoleMode(fontConfigurationName, HorizontalAlignment.CENTER, skinParam);
|
||||
final VisibilityModifier modifier = entity.getVisibilityModifier();
|
||||
if (modifier == null) {
|
||||
name = TextBlockUtils.withMargin(name, 3, 3, 0, 0);
|
||||
|
@ -117,7 +120,7 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
|
|||
genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1);
|
||||
final HtmlColor classBackground = SkinParamUtils
|
||||
.getColor(getSkinParam(), ColorParam.background, stereotype);
|
||||
// final HtmlColor classBorder = getColor(ColorParam.classBorder, stereotype);
|
||||
|
||||
final HtmlColor classBorder = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS_STEREOTYPE,
|
||||
stereotype);
|
||||
genericBlock = new TextBlockGeneric(genericBlock, classBackground, classBorder);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class Version {
|
|||
private static final int MAJOR_SEPARATOR = 1000000;
|
||||
|
||||
public static int version() {
|
||||
return 1201715;
|
||||
return 1201716;
|
||||
}
|
||||
|
||||
public static int versionPatched() {
|
||||
|
@ -88,7 +88,7 @@ public class Version {
|
|||
}
|
||||
|
||||
public static long compileTime() {
|
||||
return 1499100334843L;
|
||||
return 1504436017935L;
|
||||
}
|
||||
|
||||
public static String compileTimeString() {
|
||||
|
|
92
src/smetana/core/ArrayOfInteger.java
Normal file
92
src/smetana/core/ArrayOfInteger.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program.
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package smetana.core;
|
||||
|
||||
import smetana.core.amiga.Area;
|
||||
|
||||
public class ArrayOfInteger implements __array_of_integer__ {
|
||||
|
||||
private final int[] data;
|
||||
private final int position;
|
||||
|
||||
public ArrayOfInteger(int[] data, int position) {
|
||||
this.data = data;
|
||||
this.position = position;
|
||||
|
||||
}
|
||||
|
||||
public String getUID36() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void swap(int i, int j) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void realloc(int nb) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public int comparePointerInternal(__array_of_integer__ other) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public final __array_of_integer__ move(int delta) {
|
||||
return plus(delta);
|
||||
}
|
||||
|
||||
public __array_of_integer__ plus(int delta) {
|
||||
return new ArrayOfInteger(data, position + delta);
|
||||
}
|
||||
|
||||
public Area getInternal(int idx) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void memcopyFrom(Area source) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public int getInt() {
|
||||
return data[position];
|
||||
}
|
||||
|
||||
public void setInt(int value) {
|
||||
data[position] = value;
|
||||
}
|
||||
|
||||
}
|
|
@ -36,36 +36,11 @@
|
|||
|
||||
package smetana.core;
|
||||
|
||||
import h.Agdesc_s;
|
||||
import h.Agedge_s;
|
||||
import h.Agedgeinfo_t;
|
||||
import h.Agiddisc_s;
|
||||
import h.Agmemdisc_s;
|
||||
import h.Agtag_s;
|
||||
import h.ST_Agdesc_s;
|
||||
import h.ST_Agiddisc_s;
|
||||
import h.ST_Agmemdisc_s;
|
||||
import h.ST_Agtag_s;
|
||||
import h.ST_arrowname_t;
|
||||
import h.ST_arrowtype_t;
|
||||
import h.ST_boxf;
|
||||
import h.ST_dtdisc_s;
|
||||
import h.ST_dtmethod_s;
|
||||
import h.ST_elist;
|
||||
import h.ST_nlist_t;
|
||||
import h.ST_pointf;
|
||||
import h.ST_port;
|
||||
import h._dtdisc_s;
|
||||
import h._dtmethod_s;
|
||||
import h.arrowname_t;
|
||||
import h.arrowtype_t;
|
||||
import h.bezier;
|
||||
import h.boxf;
|
||||
import h.elist;
|
||||
import h.nlist_t;
|
||||
import h.pointf;
|
||||
import h.port;
|
||||
import h.splines;
|
||||
import h.*;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import smetana.core.amiga.StarArrayOfInteger;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarArrayOfStruct;
|
||||
|
@ -96,6 +71,35 @@ public class JUtils {
|
|||
}
|
||||
|
||||
public static size_t sizeof(Class cl, int nb) {
|
||||
if (cl == pointf.class) {
|
||||
return ST_pointf.sizeof(nb);
|
||||
}
|
||||
if (cl == boxf.class) {
|
||||
return ST_boxf.sizeof(nb);
|
||||
}
|
||||
if (cl == pointnlink_t.class) {
|
||||
return ST_pointnlink_t.sizeof(nb);
|
||||
}
|
||||
if (cl == textspan_t.class) {
|
||||
return ST_textspan_t.sizeof(nb);
|
||||
}
|
||||
// if (UmlDiagram.SMETANA_BETA) {
|
||||
if (cl == Agraph_s.class) {
|
||||
return ST_Agraph_s.sizeof(nb);
|
||||
}
|
||||
if (cl == rank_t.class) {
|
||||
return ST_rank_t.sizeof(nb);
|
||||
}
|
||||
if (cl == Agnode_s.class) {
|
||||
return ST_Agnode_s.sizeof(nb);
|
||||
}
|
||||
if (cl == bezier.class) {
|
||||
return ST_bezier.sizeof(nb);
|
||||
}
|
||||
// }
|
||||
if (from(cl) instanceof __struct_impl__ == false) {
|
||||
throw new IllegalArgumentException(cl.getName());
|
||||
}
|
||||
return new size_t_array_of_something(cl, nb);
|
||||
}
|
||||
|
||||
|
@ -104,6 +108,18 @@ public class JUtils {
|
|||
}
|
||||
|
||||
public static size_t sizeof_starstar_empty(Class cl, int nb) {
|
||||
if (cl == Agedge_s.class) {
|
||||
return ST_Agedge_s.sizeof_starstar_empty(nb);
|
||||
}
|
||||
if (cl == Agnode_s.class) {
|
||||
return ST_Agnode_s.sizeof_starstar_empty(nb);
|
||||
}
|
||||
if (cl == pointnlink_t.class) {
|
||||
return ST_pointnlink_t.sizeof_starstar_empty(nb);
|
||||
}
|
||||
if (from(cl) instanceof __struct_impl__ == false) {
|
||||
throw new IllegalArgumentException(cl.getName());
|
||||
}
|
||||
return new size_t_array_of_array_of_something_empty(cl, nb);
|
||||
}
|
||||
|
||||
|
@ -312,6 +328,8 @@ public class JUtils {
|
|||
change = true;
|
||||
if (array instanceof StarArrayOfInteger) {
|
||||
((StarArrayOfInteger) array).swap(i, i + 1);
|
||||
} else if (array instanceof STStarArrayOfPointer) {
|
||||
((STStarArrayOfPointer) array).swap(i, i + 1);
|
||||
} else {
|
||||
((StarStar) array).swap(i, i + 1);
|
||||
}
|
||||
|
@ -426,6 +444,142 @@ public class JUtils {
|
|||
if (theClass == port.class) {
|
||||
return new ST_port();
|
||||
}
|
||||
if (theClass == polygon_t.class) {
|
||||
return new ST_polygon_t();
|
||||
}
|
||||
if (theClass == shape_functions.class) {
|
||||
return new ST_shape_functions();
|
||||
}
|
||||
if (theClass == shape_desc.class) {
|
||||
return new ST_shape_desc();
|
||||
}
|
||||
if (theClass == deque_t.class) {
|
||||
return new ST_deque_t();
|
||||
}
|
||||
if (theClass == pointnlink_t.class) {
|
||||
return new ST_pointnlink_t();
|
||||
}
|
||||
if (theClass == Ppoly_t.class) {
|
||||
return new ST_Ppoly_t();
|
||||
}
|
||||
if (theClass == splineInfo.class) {
|
||||
return new ST_splineInfo();
|
||||
}
|
||||
if (theClass == textfont_t.class) {
|
||||
return new ST_textfont_t();
|
||||
}
|
||||
//
|
||||
// if (UmlDiagram.SMETANA_BETA) {
|
||||
if (theClass == Agsubnode_s.class) {
|
||||
return new ST_Agsubnode_s();
|
||||
}
|
||||
if (theClass == _dtlink_s.class) {
|
||||
return new ST_dtlink_s();
|
||||
}
|
||||
if (theClass == refstr_t.class) {
|
||||
return new ST_refstr_t();
|
||||
}
|
||||
if (theClass == Agsym_s.class) {
|
||||
return new ST_Agsym_s();
|
||||
}
|
||||
if (theClass == Agedge_s.class) {
|
||||
return new ST_Agedge_s();
|
||||
}
|
||||
if (theClass == Agobj_s.class) {
|
||||
return new ST_Agobj_s();
|
||||
}
|
||||
if (theClass == Agrec_s.class) {
|
||||
return new ST_Agrec_s();
|
||||
}
|
||||
if (theClass == Agraph_s.class) {
|
||||
return new ST_Agraph_s();
|
||||
}
|
||||
if (theClass == Agclos_s.class) {
|
||||
return new ST_Agclos_s();
|
||||
}
|
||||
if (theClass == Agdisc_s.class) {
|
||||
return new ST_Agdisc_s();
|
||||
}
|
||||
if (theClass == Agdstate_s.class) {
|
||||
return new ST_Agdstate_s();
|
||||
}
|
||||
if (theClass == Agiodisc_s.class) {
|
||||
return new ST_Agiodisc_s();
|
||||
}
|
||||
if (theClass == _dt_s.class) {
|
||||
return new ST_dt_s();
|
||||
}
|
||||
if (theClass == _dtdata_s.class) {
|
||||
return new ST_dtdata_s();
|
||||
}
|
||||
if (theClass == Agdatadict_s.class) {
|
||||
return new ST_Agdatadict_s();
|
||||
}
|
||||
if (theClass == Agattr_s.class) {
|
||||
return new ST_Agattr_s();
|
||||
}
|
||||
if (theClass == Agcbstack_s.class) {
|
||||
return new ST_Agcbstack_s();
|
||||
}
|
||||
if (theClass == Agnode_s.class) {
|
||||
return new ST_Agnode_s();
|
||||
}
|
||||
if (theClass == Agedgepair_s.class) {
|
||||
return new ST_Agedgepair_s();
|
||||
}
|
||||
if (theClass == Agraphinfo_t.class) {
|
||||
return new ST_Agraphinfo_t();
|
||||
}
|
||||
if (theClass == GVC_s.class) {
|
||||
return new ST_GVC_s();
|
||||
}
|
||||
if (theClass == GVCOMMON_t.class) {
|
||||
return new ST_GVCOMMON_t();
|
||||
}
|
||||
if (theClass == gvlayout_engine_s.class) {
|
||||
return new ST_gvlayout_engine_s();
|
||||
}
|
||||
if (theClass == gvlayout_features_t.class) {
|
||||
return new ST_gvlayout_features_t();
|
||||
}
|
||||
if (theClass == gvplugin_active_layout_t.class) {
|
||||
return new ST_gvplugin_active_layout_t();
|
||||
}
|
||||
if (theClass == gvplugin_installed_t.class) {
|
||||
return new ST_gvplugin_installed_t();
|
||||
}
|
||||
if (theClass == layout_t.class) {
|
||||
return new ST_layout_t();
|
||||
}
|
||||
if (theClass == Agnodeinfo_t.class) {
|
||||
return new ST_Agnodeinfo_t();
|
||||
}
|
||||
if (theClass == textlabel_t.class) {
|
||||
return new ST_textlabel_t();
|
||||
}
|
||||
if (theClass == textspan_t.class) {
|
||||
return new ST_textspan_t();
|
||||
}
|
||||
if (theClass == rank_t.class) {
|
||||
return new ST_rank_t();
|
||||
}
|
||||
if (theClass == adjmatrix_t.class) {
|
||||
return new ST_adjmatrix_t();
|
||||
}
|
||||
if (theClass == Agedgeinfo_t.class) {
|
||||
return new ST_Agedgeinfo_t();
|
||||
}
|
||||
if (theClass == splines.class) {
|
||||
return new ST_splines();
|
||||
}
|
||||
if (theClass == bezier.class) {
|
||||
return new ST_bezier();
|
||||
}
|
||||
if (theClass == _dthold_s.class) {
|
||||
return new ST_dthold_s();
|
||||
}
|
||||
// }
|
||||
notFound(theClass);
|
||||
return new __struct_impl__<C>(theClass);
|
||||
}
|
||||
|
||||
|
@ -469,7 +623,151 @@ public class JUtils {
|
|||
if (theClass == port.class) {
|
||||
return new ST_port(parent);
|
||||
}
|
||||
if (theClass == polygon_t.class) {
|
||||
return new ST_polygon_t(parent);
|
||||
}
|
||||
if (theClass == shape_functions.class) {
|
||||
return new ST_shape_functions(parent);
|
||||
}
|
||||
if (theClass == shape_desc.class) {
|
||||
return new ST_shape_desc(parent);
|
||||
}
|
||||
if (theClass == deque_t.class) {
|
||||
return new ST_deque_t(parent);
|
||||
}
|
||||
if (theClass == pointnlink_t.class) {
|
||||
return new ST_pointnlink_t(parent);
|
||||
}
|
||||
if (theClass == Ppoly_t.class) {
|
||||
return new ST_Ppoly_t(parent);
|
||||
}
|
||||
if (theClass == splineInfo.class) {
|
||||
return new ST_splineInfo(parent);
|
||||
}
|
||||
if (theClass == textfont_t.class) {
|
||||
return new ST_textfont_t(parent);
|
||||
}
|
||||
//
|
||||
// if (UmlDiagram.SMETANA_BETA) {
|
||||
if (theClass == Agsubnode_s.class) {
|
||||
return new ST_Agsubnode_s(parent);
|
||||
}
|
||||
if (theClass == _dtlink_s.class) {
|
||||
return new ST_dtlink_s(parent);
|
||||
}
|
||||
if (theClass == refstr_t.class) {
|
||||
return new ST_refstr_t(parent);
|
||||
}
|
||||
if (theClass == Agsym_s.class) {
|
||||
return new ST_Agsym_s(parent);
|
||||
}
|
||||
if (theClass == Agedge_s.class) {
|
||||
return new ST_Agedge_s(parent);
|
||||
}
|
||||
if (theClass == Agobj_s.class) {
|
||||
return new ST_Agobj_s(parent);
|
||||
}
|
||||
if (theClass == Agrec_s.class) {
|
||||
return new ST_Agrec_s(parent);
|
||||
}
|
||||
if (theClass == Agraph_s.class) {
|
||||
return new ST_Agraph_s(parent);
|
||||
}
|
||||
if (theClass == Agclos_s.class) {
|
||||
return new ST_Agclos_s(parent);
|
||||
}
|
||||
if (theClass == Agdisc_s.class) {
|
||||
return new ST_Agdisc_s(parent);
|
||||
}
|
||||
if (theClass == Agdstate_s.class) {
|
||||
return new ST_Agdstate_s(parent);
|
||||
}
|
||||
if (theClass == _dt_s.class) {
|
||||
return new ST_dt_s(parent);
|
||||
}
|
||||
if (theClass == _dtdata_s.class) {
|
||||
return new ST_dtdata_s(parent);
|
||||
}
|
||||
if (theClass == Agdatadict_s.class) {
|
||||
return new ST_Agdatadict_s(parent);
|
||||
}
|
||||
if (theClass == Agattr_s.class) {
|
||||
return new ST_Agattr_s(parent);
|
||||
}
|
||||
if (theClass == Agcbstack_s.class) {
|
||||
return new ST_Agcbstack_s(parent);
|
||||
}
|
||||
if (theClass == Agnode_s.class) {
|
||||
return new ST_Agnode_s(parent);
|
||||
}
|
||||
if (theClass == Agedgepair_s.class) {
|
||||
return new ST_Agedgepair_s(parent);
|
||||
}
|
||||
if (theClass == Agraphinfo_t.class) {
|
||||
return new ST_Agraphinfo_t(parent);
|
||||
}
|
||||
if (theClass == GVC_s.class) {
|
||||
return new ST_GVC_s(parent);
|
||||
}
|
||||
if (theClass == GVCOMMON_t.class) {
|
||||
return new ST_GVCOMMON_t(parent);
|
||||
}
|
||||
if (theClass == gvlayout_engine_s.class) {
|
||||
throw new UnsupportedOperationException();
|
||||
// return new ST_gvlayout_engine_s(parent);
|
||||
}
|
||||
if (theClass == gvlayout_features_t.class) {
|
||||
throw new UnsupportedOperationException();
|
||||
// return new ST_gvlayout_features_t(parent);
|
||||
}
|
||||
if (theClass == gvplugin_active_layout_t.class) {
|
||||
throw new UnsupportedOperationException();
|
||||
// return new ST_gvplugin_active_layout_t(parent);
|
||||
}
|
||||
if (theClass == gvplugin_installed_t.class) {
|
||||
return new ST_gvplugin_installed_t(parent);
|
||||
}
|
||||
if (theClass == layout_t.class) {
|
||||
return new ST_layout_t(parent);
|
||||
}
|
||||
if (theClass == Agnodeinfo_t.class) {
|
||||
return new ST_Agnodeinfo_t(parent);
|
||||
}
|
||||
if (theClass == textlabel_t.class) {
|
||||
return new ST_textlabel_t(parent);
|
||||
}
|
||||
if (theClass == textspan_t.class) {
|
||||
return new ST_textspan_t(parent);
|
||||
}
|
||||
if (theClass == rank_t.class) {
|
||||
return new ST_rank_t(parent);
|
||||
}
|
||||
if (theClass == adjmatrix_t.class) {
|
||||
return new ST_adjmatrix_t(parent);
|
||||
}
|
||||
if (theClass == Agedgeinfo_t.class) {
|
||||
return new ST_Agedgeinfo_t(parent);
|
||||
}
|
||||
if (theClass == splines.class) {
|
||||
return new ST_splines(parent);
|
||||
}
|
||||
if (theClass == bezier.class) {
|
||||
return new ST_bezier(parent);
|
||||
}
|
||||
if (theClass == _dthold_s.class) {
|
||||
return new ST_dthold_s(parent);
|
||||
}
|
||||
|
||||
// }
|
||||
notFound(theClass);
|
||||
return new StarStructImpl(theClass, parent);
|
||||
}
|
||||
|
||||
private static final Set<String> todo = new TreeSet<String>();
|
||||
|
||||
private static void notFound(Class theClass) {
|
||||
// todo.add(theClass.getName());
|
||||
// System.err.println("todo=" + todo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
652
src/smetana/core/JUtilsOk1.java
Normal file
652
src/smetana/core/JUtilsOk1.java
Normal file
|
@ -0,0 +1,652 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program.
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package smetana.core;
|
||||
|
||||
import h.Agclos_s;
|
||||
import h.Agdesc_s;
|
||||
import h.Agdisc_s;
|
||||
import h.Agdstate_s;
|
||||
import h.Agedge_s;
|
||||
import h.Agedgeinfo_t;
|
||||
import h.Agiddisc_s;
|
||||
import h.Agiodisc_s;
|
||||
import h.Agmemdisc_s;
|
||||
import h.Agobj_s;
|
||||
import h.Agraph_s;
|
||||
import h.Agrec_s;
|
||||
import h.Agsubnode_s;
|
||||
import h.Agsym_s;
|
||||
import h.Agtag_s;
|
||||
import h.Ppoly_t;
|
||||
import h.ST_Agclos_s;
|
||||
import h.ST_Agdesc_s;
|
||||
import h.ST_Agdisc_s;
|
||||
import h.ST_Agdstate_s;
|
||||
import h.ST_Agedge_s;
|
||||
import h.ST_Agiddisc_s;
|
||||
import h.ST_Agiodisc_s;
|
||||
import h.ST_Agmemdisc_s;
|
||||
import h.ST_Agobj_s;
|
||||
import h.ST_Agraph_s;
|
||||
import h.ST_Agrec_s;
|
||||
import h.ST_Agsubnode_s;
|
||||
import h.ST_Agsym_s;
|
||||
import h.ST_Agtag_s;
|
||||
import h.ST_Ppoly_t;
|
||||
import h.ST_arrowname_t;
|
||||
import h.ST_arrowtype_t;
|
||||
import h.ST_boxf;
|
||||
import h.ST_deque_t;
|
||||
import h.ST_dtdisc_s;
|
||||
import h.ST_dtlink_s;
|
||||
import h.ST_dtmethod_s;
|
||||
import h.ST_elist;
|
||||
import h.ST_nlist_t;
|
||||
import h.ST_pointf;
|
||||
import h.ST_pointnlink_t;
|
||||
import h.ST_polygon_t;
|
||||
import h.ST_port;
|
||||
import h.ST_refstr_t;
|
||||
import h.ST_shape_desc;
|
||||
import h.ST_shape_functions;
|
||||
import h.ST_splineInfo;
|
||||
import h.ST_textfont_t;
|
||||
import h._dtdisc_s;
|
||||
import h._dtlink_s;
|
||||
import h._dtmethod_s;
|
||||
import h.arrowname_t;
|
||||
import h.arrowtype_t;
|
||||
import h.bezier;
|
||||
import h.boxf;
|
||||
import h.deque_t;
|
||||
import h.elist;
|
||||
import h.nlist_t;
|
||||
import h.pointf;
|
||||
import h.pointnlink_t;
|
||||
import h.polygon_t;
|
||||
import h.port;
|
||||
import h.refstr_t;
|
||||
import h.shape_desc;
|
||||
import h.shape_functions;
|
||||
import h.splineInfo;
|
||||
import h.splines;
|
||||
import h.textfont_t;
|
||||
import smetana.core.amiga.StarArrayOfInteger;
|
||||
import smetana.core.amiga.StarArrayOfPtr;
|
||||
import smetana.core.amiga.StarArrayOfStruct;
|
||||
import smetana.core.amiga.StarStar;
|
||||
import smetana.core.amiga.StarStruct;
|
||||
import smetana.core.amiga.StarStructImpl;
|
||||
|
||||
// http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.7.4
|
||||
// http://www.jbox.dk/sanos/source/lib/string.c.html
|
||||
|
||||
public class JUtilsOk1 {
|
||||
|
||||
public static int USHRT_MAX = 65535;
|
||||
|
||||
public static size_t sizeof(Class cl) {
|
||||
return new size_t_struct(cl);
|
||||
}
|
||||
|
||||
public static size_t sizeof(__ptr__ element) {
|
||||
return new size_t_of_element(element);
|
||||
}
|
||||
|
||||
public static size_t sizeof(String name, int sz) {
|
||||
if (name.equals("char*")) {
|
||||
return new size_t_array_of_charstars(sz);
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static size_t sizeof(Class cl, int nb) {
|
||||
if (cl == pointf.class) {
|
||||
return ST_pointf.sizeof(nb);
|
||||
}
|
||||
if (cl == boxf.class) {
|
||||
return ST_boxf.sizeof(nb);
|
||||
}
|
||||
if (cl == pointnlink_t.class) {
|
||||
return ST_pointnlink_t.sizeof(nb);
|
||||
}
|
||||
if (from(cl) instanceof __struct_impl__ == false) {
|
||||
throw new IllegalArgumentException(cl.getName());
|
||||
}
|
||||
return new size_t_array_of_something(cl, nb);
|
||||
}
|
||||
|
||||
public static size_t size_t_array_of_integer(int nb) {
|
||||
return new size_t_array_of_integer(nb);
|
||||
}
|
||||
|
||||
public static size_t sizeof_starstar_empty(Class cl, int nb) {
|
||||
if (cl == pointnlink_t.class) {
|
||||
return ST_pointnlink_t.sizeof_starstar_empty(nb);
|
||||
}
|
||||
if (from(cl) instanceof __struct_impl__ == false) {
|
||||
throw new IllegalArgumentException(cl.getName());
|
||||
}
|
||||
return new size_t_array_of_array_of_something_empty(cl, nb);
|
||||
}
|
||||
|
||||
public static int strcmp(CString s1, CString s2) {
|
||||
return s1.compareTo(s2);
|
||||
}
|
||||
|
||||
public static int strncmp(CString s1, CString s2, int n) {
|
||||
return s1.compareTo(s2, n);
|
||||
}
|
||||
|
||||
public static CString strstr(CString s1, CString s2) {
|
||||
throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2);
|
||||
}
|
||||
|
||||
public static void strncpy(CString destination, CString source, int nb) {
|
||||
destination.copyFrom(source, nb);
|
||||
}
|
||||
|
||||
public static CString strchr(CString str, char c) {
|
||||
return str.strchr(c);
|
||||
}
|
||||
|
||||
public static int strtol(CString str, CString[] endptr, int base) {
|
||||
if (base != 10) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
CString end = str;
|
||||
int result = Integer.parseInt(end.getContent());
|
||||
endptr[0] = end.plus(("" + result).length());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static double strtod(CString str, CString[] endptr) {
|
||||
final double result = Double.parseDouble(str.getContent());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static double atof(CString str) {
|
||||
return Double.parseDouble(str.getContent());
|
||||
}
|
||||
|
||||
public static int memcmp(__ptr__ s1, __ptr__ s2, int sz) {
|
||||
throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2 + " sz=" + sz);
|
||||
}
|
||||
|
||||
public static void memset(__ptr__ obj, int value, size_t nbytes) {
|
||||
if (value != 0) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public static int strlen(CString s) {
|
||||
return s.length();
|
||||
}
|
||||
|
||||
public static double abs(double x) {
|
||||
return Math.abs(x);
|
||||
}
|
||||
|
||||
public static double cos(double x) {
|
||||
return Math.cos(x);
|
||||
}
|
||||
|
||||
public static double sin(double x) {
|
||||
return Math.sin(x);
|
||||
}
|
||||
|
||||
public static double sqrt(double x) {
|
||||
return Math.sqrt(x);
|
||||
}
|
||||
|
||||
public static double atan2(double a, double b) {
|
||||
return Math.atan2(a, b);
|
||||
}
|
||||
|
||||
public static double pow(double a, double b) {
|
||||
return Math.pow(a, b);
|
||||
}
|
||||
|
||||
public static boolean isdigit(char c) {
|
||||
return Character.isDigit(c);
|
||||
}
|
||||
|
||||
public static int atoi(CString s) {
|
||||
return Integer.parseInt(s.getContent());
|
||||
}
|
||||
|
||||
public static char tolower(char c) {
|
||||
return Character.toLowerCase(c);
|
||||
}
|
||||
|
||||
public static CFunction function(Class codingClass, String name) {
|
||||
return CFunctionImpl.create(codingClass, name);
|
||||
}
|
||||
|
||||
public static int enumAsInt(Class enumClass, String name) {
|
||||
CEnumInterpretor interpretor = new CEnumInterpretor(enumClass);
|
||||
final int result = interpretor.valueOf(name);
|
||||
JUtilsOk1.LOG("result for " + name + " is " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static CString getenv(CString var) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void LOG(String s) {
|
||||
// System.err.println(s);
|
||||
}
|
||||
|
||||
public static void LOG2(String s) {
|
||||
// System.err.println(s);
|
||||
}
|
||||
|
||||
public static boolean EQ(Object o1, Object o2) {
|
||||
if (o1 == o2) {
|
||||
return true;
|
||||
}
|
||||
if (o1 == null && o2 != null) {
|
||||
return false;
|
||||
}
|
||||
if (o2 == null && o1 != null) {
|
||||
return false;
|
||||
}
|
||||
// if (o1 instanceof AreaArray && o2 instanceof AreaArray) {
|
||||
// return ((AreaArray) o1).isSameThan((AreaArray) o2);
|
||||
// }
|
||||
if (o1 instanceof StarStruct && o2 instanceof StarStruct) {
|
||||
return ((StarStruct) o1).isSameThan((StarStruct) o2);
|
||||
}
|
||||
if (o1 instanceof CString && o2 instanceof CString) {
|
||||
return ((CString) o1).isSameThan((CString) o2);
|
||||
}
|
||||
if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfPtr) {
|
||||
return ((StarArrayOfPtr) o1).isSameThan((StarArrayOfPtr) o2);
|
||||
}
|
||||
if (o1 instanceof StarStar && o2 instanceof StarStruct) {
|
||||
__ptr__ o1b = ((StarStar) o1).getPtr();
|
||||
if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2).getRealClass()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return EQ(o1b, o2);
|
||||
}
|
||||
if (o1 instanceof StarStruct && o2 instanceof StarArrayOfPtr) {
|
||||
__ptr__ o2b = ((StarArrayOfPtr) o2).getPtrForEquality();
|
||||
if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return EQ(o1, o2b);
|
||||
}
|
||||
if (o1 instanceof StarStruct && o2 instanceof StarArrayOfStruct) {
|
||||
__ptr__ o2b = ((StarArrayOfStruct) o2).getPtrForEquality();
|
||||
if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return EQ(o1, o2b);
|
||||
}
|
||||
if (o1 instanceof StarStar && o2 instanceof StarArrayOfPtr) {
|
||||
__ptr__ o1b = ((StarStar) o1).getPtr();
|
||||
__ptr__ o2b = ((StarArrayOfPtr) o2).getPtr();
|
||||
if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2b).getRealClass()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return EQ(o1b, o2b);
|
||||
}
|
||||
if (o1 instanceof StarArrayOfStruct && o2 instanceof StarArrayOfStruct) {
|
||||
StarArrayOfStruct oo1 = (StarArrayOfStruct) o1;
|
||||
StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
|
||||
return oo1.isSameThan(oo2);
|
||||
}
|
||||
if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfStruct) {
|
||||
StarArrayOfPtr oo1 = (StarArrayOfPtr) o1;
|
||||
StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
|
||||
__struct__ s1 = oo1.getStruct();
|
||||
__struct__ s2 = oo2.getStruct();
|
||||
boolean result = s1.getInternalData().isSameThan(s2.getInternalData());
|
||||
return result;
|
||||
}
|
||||
System.err.println("o1=" + o1.getClass() + " " + o1);
|
||||
System.err.println("o2=" + o2.getClass() + " " + o2);
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static boolean NEQ(Object o1, Object o2) {
|
||||
return EQ(o1, o2) == false;
|
||||
}
|
||||
|
||||
public static void qsort(__ptr__ array, int nb, size_t size, CFunction compare) {
|
||||
if (nb <= 1) {
|
||||
return;
|
||||
}
|
||||
JUtilsOk1.LOG("array=" + array);
|
||||
JUtilsOk1.LOG("nb=" + nb);
|
||||
JUtilsOk1.LOG("size=" + size);
|
||||
JUtilsOk1.LOG("compare=" + compare);
|
||||
boolean change;
|
||||
do {
|
||||
change = false;
|
||||
for (int i = 0; i < nb - 1; i++) {
|
||||
__ptr__ element1 = array.plus(i);
|
||||
__ptr__ element2 = array.plus(i + 1);
|
||||
Integer cmp = (Integer) compare.exe(element1, element2);
|
||||
JUtilsOk1.LOG("cmp=" + cmp);
|
||||
if (cmp.intValue() > 0) {
|
||||
change = true;
|
||||
if (array instanceof StarArrayOfInteger) {
|
||||
((StarArrayOfInteger) array).swap(i, i + 1);
|
||||
} else {
|
||||
((StarStar) array).swap(i, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (change);
|
||||
for (int i = 0; i < nb - 1; i++) {
|
||||
__ptr__ element1 = array.plus(i);
|
||||
__ptr__ element2 = array.plus(i + 1);
|
||||
JUtilsOk1.LOG("element1=" + element1);
|
||||
JUtilsOk1.LOG("element2=" + element2);
|
||||
Integer cmp = (Integer) compare.exe(element1, element2);
|
||||
JUtilsOk1.LOG("cmp=" + cmp);
|
||||
if (cmp.intValue() > 0) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public int setjmp(jmp_buf jmp) {
|
||||
// if (jmp.hasBeenCalled()) {
|
||||
// throw new UnsupportedOperationException();
|
||||
// }
|
||||
jmp.saveCallingEnvironment();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
public static void printDebugEdge(Agedge_s e) {
|
||||
System.err.println("*********** PRINT EDGE ********** ");
|
||||
final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
|
||||
final splines splines = (splines) data.getPtr("spl");
|
||||
__struct__<boxf> bb = splines.getStruct("bb");
|
||||
final bezier list = (bezier) splines.getPtr("list");
|
||||
System.err.println("splines.size=" + splines.getInt("size"));
|
||||
System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
|
||||
System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
|
||||
printDebugBezier((bezier) splines.getPtr("list").getPtr());
|
||||
|
||||
}
|
||||
|
||||
private static String pointftoString(__struct__<pointf> point) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("(");
|
||||
sb.append(point.getDouble("x"));
|
||||
sb.append(" ; ");
|
||||
sb.append(point.getDouble("y"));
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static void printDebugBezier(bezier bezier) {
|
||||
System.err.println("bezier.size=" + bezier.getInt("size"));
|
||||
System.err.println("bezier.sflag=" + bezier.getInt("sflag"));
|
||||
System.err.println("splines.eflag=" + bezier.getInt("eflag"));
|
||||
System.err.println("bezier.sp=" + pointftoString(bezier.getStruct("sp")));
|
||||
System.err.println("bezier.ep=" + pointftoString(bezier.getStruct("ep")));
|
||||
for (int i = 0; i < bezier.getInt("size"); i++) {
|
||||
final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr();
|
||||
System.err.println("pt=" + pointftoString(pt));
|
||||
}
|
||||
}
|
||||
|
||||
private static String pointftoString(__ptr__ point) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("(");
|
||||
sb.append(point.getDouble("x"));
|
||||
sb.append(" ; ");
|
||||
sb.append(point.getDouble("y"));
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static <C extends __ptr__> __struct__<C> from(Class<C> theClass) {
|
||||
if (theClass == _dtmethod_s.class) {
|
||||
return new ST_dtmethod_s();
|
||||
}
|
||||
if (theClass == _dtdisc_s.class) {
|
||||
return new ST_dtdisc_s();
|
||||
}
|
||||
if (theClass == Agdesc_s.class) {
|
||||
return new ST_Agdesc_s();
|
||||
}
|
||||
if (theClass == Agtag_s.class) {
|
||||
return new ST_Agtag_s();
|
||||
}
|
||||
if (theClass == Agiddisc_s.class) {
|
||||
return new ST_Agiddisc_s();
|
||||
}
|
||||
if (theClass == Agmemdisc_s.class) {
|
||||
return new ST_Agmemdisc_s();
|
||||
}
|
||||
if (theClass == nlist_t.class) {
|
||||
return new ST_nlist_t();
|
||||
}
|
||||
if (theClass == arrowname_t.class) {
|
||||
return new ST_arrowname_t();
|
||||
}
|
||||
if (theClass == arrowtype_t.class) {
|
||||
return new ST_arrowtype_t();
|
||||
}
|
||||
if (theClass == elist.class) {
|
||||
return new ST_elist();
|
||||
}
|
||||
if (theClass == pointf.class) {
|
||||
return new ST_pointf();
|
||||
}
|
||||
if (theClass == boxf.class) {
|
||||
return new ST_boxf();
|
||||
}
|
||||
if (theClass == port.class) {
|
||||
return new ST_port();
|
||||
}
|
||||
if (theClass == polygon_t.class) {
|
||||
return new ST_polygon_t();
|
||||
}
|
||||
if (theClass == shape_functions.class) {
|
||||
return new ST_shape_functions();
|
||||
}
|
||||
if (theClass == shape_desc.class) {
|
||||
return new ST_shape_desc();
|
||||
}
|
||||
if (theClass == deque_t.class) {
|
||||
return new ST_deque_t();
|
||||
}
|
||||
if (theClass == pointnlink_t.class) {
|
||||
return new ST_pointnlink_t();
|
||||
}
|
||||
if (theClass == Ppoly_t.class) {
|
||||
return new ST_Ppoly_t();
|
||||
}
|
||||
if (theClass == splineInfo.class) {
|
||||
return new ST_splineInfo();
|
||||
}
|
||||
if (theClass == textfont_t.class) {
|
||||
return new ST_textfont_t();
|
||||
}
|
||||
//
|
||||
// if (theClass == Agsubnode_s.class) {
|
||||
// return new ST_Agsubnode_s();
|
||||
// }
|
||||
// if (theClass == _dtlink_s.class) {
|
||||
// return new ST_dtlink_s();
|
||||
// }
|
||||
// if (theClass == refstr_t.class) {
|
||||
// return new ST_refstr_t();
|
||||
// }
|
||||
// if (theClass == Agsym_s.class) {
|
||||
// return new ST_Agsym_s();
|
||||
// }
|
||||
// if (theClass == Agedge_s.class) {
|
||||
// return new ST_Agedge_s();
|
||||
// }
|
||||
// if (theClass == Agobj_s.class) {
|
||||
// return new ST_Agobj_s();
|
||||
// }
|
||||
// if (theClass == Agrec_s.class) {
|
||||
// return new ST_Agrec_s();
|
||||
// }
|
||||
// if (theClass == Agraph_s.class) {
|
||||
// return new ST_Agraph_s();
|
||||
// }
|
||||
// if (theClass == Agclos_s.class) {
|
||||
// return new ST_Agclos_s();
|
||||
// }
|
||||
// if (theClass == Agdisc_s.class) {
|
||||
// return new ST_Agdisc_s();
|
||||
// }
|
||||
// if (theClass == Agdstate_s.class) {
|
||||
// return new ST_Agdstate_s();
|
||||
// }
|
||||
// if (theClass == Agiodisc_s.class) {
|
||||
// return new ST_Agiodisc_s();
|
||||
// }
|
||||
|
||||
return new __struct_impl__<C>(theClass);
|
||||
}
|
||||
|
||||
public static StarStruct create(Class theClass, StarStruct parent) {
|
||||
if (theClass == _dtmethod_s.class) {
|
||||
throw new IllegalArgumentException(theClass.toString());
|
||||
}
|
||||
if (theClass == _dtdisc_s.class) {
|
||||
return new ST_dtdisc_s(parent);
|
||||
}
|
||||
if (theClass == Agdesc_s.class) {
|
||||
return new ST_Agdesc_s(parent);
|
||||
}
|
||||
if (theClass == Agtag_s.class) {
|
||||
return new ST_Agtag_s(parent);
|
||||
}
|
||||
if (theClass == Agiddisc_s.class) {
|
||||
throw new IllegalArgumentException(theClass.toString());
|
||||
}
|
||||
if (theClass == Agmemdisc_s.class) {
|
||||
throw new IllegalArgumentException(theClass.toString());
|
||||
}
|
||||
if (theClass == nlist_t.class) {
|
||||
return new ST_nlist_t(parent);
|
||||
}
|
||||
if (theClass == arrowname_t.class) {
|
||||
throw new IllegalArgumentException(theClass.toString());
|
||||
}
|
||||
if (theClass == arrowtype_t.class) {
|
||||
throw new IllegalArgumentException(theClass.toString());
|
||||
}
|
||||
if (theClass == elist.class) {
|
||||
return new ST_elist(parent);
|
||||
}
|
||||
if (theClass == pointf.class) {
|
||||
return new ST_pointf(parent);
|
||||
}
|
||||
if (theClass == boxf.class) {
|
||||
return new ST_boxf(parent);
|
||||
}
|
||||
if (theClass == port.class) {
|
||||
return new ST_port(parent);
|
||||
}
|
||||
if (theClass == polygon_t.class) {
|
||||
return new ST_polygon_t(parent);
|
||||
}
|
||||
if (theClass == shape_functions.class) {
|
||||
return new ST_shape_functions(parent);
|
||||
}
|
||||
if (theClass == shape_desc.class) {
|
||||
return new ST_shape_desc(parent);
|
||||
}
|
||||
if (theClass == deque_t.class) {
|
||||
return new ST_deque_t(parent);
|
||||
}
|
||||
if (theClass == pointnlink_t.class) {
|
||||
return new ST_pointnlink_t(parent);
|
||||
}
|
||||
if (theClass == Ppoly_t.class) {
|
||||
return new ST_Ppoly_t(parent);
|
||||
}
|
||||
if (theClass == splineInfo.class) {
|
||||
return new ST_splineInfo(parent);
|
||||
}
|
||||
if (theClass == textfont_t.class) {
|
||||
return new ST_textfont_t(parent);
|
||||
}
|
||||
//
|
||||
// if (theClass == Agsubnode_s.class) {
|
||||
// return new ST_Agsubnode_s(parent);
|
||||
// }
|
||||
// if (theClass == _dtlink_s.class) {
|
||||
// return new ST_dtlink_s(parent);
|
||||
// }
|
||||
// if (theClass == refstr_t.class) {
|
||||
// return new ST_refstr_t(parent);
|
||||
// }
|
||||
// if (theClass == Agsym_s.class) {
|
||||
// return new ST_Agsym_s(parent);
|
||||
// }
|
||||
// if (theClass == Agedge_s.class) {
|
||||
// return new ST_Agedge_s(parent);
|
||||
// }
|
||||
// if (theClass == Agobj_s.class) {
|
||||
// return new ST_Agobj_s(parent);
|
||||
// }
|
||||
// if (theClass == Agrec_s.class) {
|
||||
// return new ST_Agrec_s(parent);
|
||||
// }
|
||||
// if (theClass == Agraph_s.class) {
|
||||
// return new ST_Agraph_s(parent);
|
||||
// }
|
||||
// if (theClass == Agclos_s.class) {
|
||||
// return new ST_Agclos_s(parent);
|
||||
// }
|
||||
// if (theClass == Agdisc_s.class) {
|
||||
// return new ST_Agdisc_s(parent);
|
||||
// }
|
||||
// if (theClass == Agdstate_s.class) {
|
||||
// return new ST_Agdstate_s(parent);
|
||||
// }
|
||||
return new StarStructImpl(theClass, parent);
|
||||
}
|
||||
|
||||
}
|
|
@ -39,6 +39,7 @@ import h.Agdesc_s;
|
|||
import h.Agiddisc_s;
|
||||
import h.Agmemdisc_s;
|
||||
import h.Agtag_s;
|
||||
import h.STStarArrayOfPointer;
|
||||
import h.ST_Agtag_s;
|
||||
import h._dtdisc_s;
|
||||
import h._dtmethod_s;
|
||||
|
@ -59,14 +60,20 @@ public class Memory {
|
|||
|
||||
public static __ptr__ realloc(__ptr__ old, size_t size) {
|
||||
if (old instanceof StarArrayOfPtr) {
|
||||
((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
|
||||
// System.err.println("size="+size);
|
||||
// ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
|
||||
((StarArrayOfPtr) old).realloc(size);
|
||||
return old;
|
||||
}
|
||||
if (old instanceof StarStar) {
|
||||
((StarStar) old).realloc(((size_t_array_of_array_of_something_empty) size).getNb());
|
||||
return old;
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
if (old instanceof STStarArrayOfPointer) {
|
||||
((STStarArrayOfPointer) old).realloc(size.getInternalNb());
|
||||
return old;
|
||||
}
|
||||
throw new UnsupportedOperationException("" + old.getClass());
|
||||
}
|
||||
|
||||
public static void free(Object arg) {
|
||||
|
|
|
@ -200,6 +200,10 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ {
|
|||
public void realloc(int nb) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void realloc(size_t nb) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __ptr__ asPtr() {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
|
@ -233,4 +237,5 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ {
|
|||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
107
src/smetana/core/UnsupportedArrayOfStruct.java
Normal file
107
src/smetana/core/UnsupportedArrayOfStruct.java
Normal file
|
@ -0,0 +1,107 @@
|
|||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* If you like this project or if you find it useful, you can support us at:
|
||||
*
|
||||
* http://plantuml.com/patreon (only 1$ per month!)
|
||||
* http://plantuml.com/paypal
|
||||
*
|
||||
* This file is part of Smetana.
|
||||
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* This translation is distributed under the same Licence as the original C program.
|
||||
*
|
||||
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
|
||||
*
|
||||
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
|
||||
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package smetana.core;
|
||||
|
||||
import smetana.core.amiga.Area;
|
||||
|
||||
public class UnsupportedArrayOfStruct implements __array_of_struct__ {
|
||||
|
||||
public String getUID36() {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void swap(int i, int j) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void realloc(int nb) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __ptr__ asPtr() {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public int comparePointerInternal(__array_of_struct__ other) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __array_of_struct__ move(int delta) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __array_of_struct__ plus(int delta) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public Area getInternal(int idx) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void setInternalByIndex(int idx, Area value) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void memcopyFrom(Area source) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __ptr__ getPtr() {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __struct__ getStruct() {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void setStruct(__struct__ value) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public double getDouble(String fieldName) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public void setDouble(String fieldName, double value) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
public __struct__ getStruct(String fieldName) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user