Debian Codegraph @

src/h/ST_textlabel_t.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package h;
47
48 import smetana.core.CString;
49 import smetana.core.UnsupportedStructAndPtr;
50 import smetana.core.__ptr__;
51 import smetana.core.__struct__;
52 import smetana.core.amiga.StarStruct;
53
54 public class ST_textlabel_t extends UnsupportedStructAndPtr {
55
56 private final StarStruct parent;
57
58 public ST_textlabel_t() {
59 this(null);
60 }
61
62 public ST_textlabel_t(StarStruct parent) {
63 this.parent = parent;
64 }
65
66 public CString text, fontname, fontcolor;
67 public int charset;
68 public double fontsize;
69
70 public final ST_pointf dimen = new ST_pointf(this);
71 public final ST_pointf space = new ST_pointf(this);
72 public final ST_pointf pos = new ST_pointf(this);
73
74 // "union",
75 // "{",
76 // "struct",
77 // "{",
78 // private ST_textspan_t span;
79 public ST_textspan_t.Array span;
80 public int nspans;
81
82 // "}",
83 // "txt",
84 // "htmllabel_t *html",
85 public final __ptr__ html__ = null;
86 // "}",
87 // "u",
88 public int valign;
89
90 public int set;
91
92 public boolean html;
93 // "boolean html",
94 // "}",
95 // "textlabel_t");
96
97 @Override
98 public void setStruct(String fieldName, __struct__ newData) {
99 if (fieldName.equals("space")) {
100 space.copyDataFrom(newData);
101 return;
102 }
103 if (fieldName.equals("pos")) {
104 pos.copyDataFrom(newData);
105 return;
106 }
107 super.setStruct(fieldName, newData);
108 }
109
110 @Override
111 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
112 if (fieldName.equals("text")) {
113 this.text = (CString) newData;
114 return text;
115 }
116 if (fieldName.equals("fontname")) {
117 this.fontname = (CString) newData;
118 return fontname;
119 }
120 if (fieldName.equals("fontcolor")) {
121 this.fontcolor = (CString) newData;
122 return fontcolor;
123 }
124 if (fieldName.equals("u.txt.span")) {
125 this.span = (ST_textspan_t.Array) newData;
126 return span;
127 }
128 return super.setPtr(fieldName, newData);
129 }
130
131 @Override
132 public void setDouble(String fieldName, double data) {
133 if (fieldName.equals("fontsize")) {
134 this.fontsize = data;
135 return;
136 }
137 super.setDouble(fieldName, data);
138 }
139
140 @Override
141 public void setInt(String fieldName, int data) {
142 if (fieldName.equals("charset")) {
143 this.charset = data;
144 return;
145 }
146 if (fieldName.equals("valign")) {
147 this.valign = data;
148 return;
149 }
150 if (fieldName.equals("u.txt.nspans")) {
151 this.nspans = data;
152 return;
153 }
154 if (fieldName.equals("set")) {
155 this.set = data;
156 return;
157 }
158 super.setInt(fieldName, data);
159 }
160
161 @Override
162 public boolean isSameThan(StarStruct other) {
163 ST_textlabel_t other2 = (ST_textlabel_t) other;
164 return this == other2;
165 }
166
167
168 }
169
170 // typedef struct textlabel_t {
171 // char *text, *fontname, *fontcolor;
172 // int charset;
173 // double fontsize;
174 // pointf dimen; /* the diagonal size of the label (estimated by layout) */
175 // pointf space; /* the diagonal size of the space for the label */
176 // /* the rendered label is aligned in this box */
177 // /* space does not include pad or margin */
178 // pointf pos; /* the center of the space for the label */
179 // union {
180 // struct {
181 // textspan_t *span;
182 // short nspans;
183 // } txt;
184 // htmllabel_t *html;
185 // } u;
186 // char valign; /* 't' 'c' 'b' */
187 // boolean set; /* true if position is set */
188 // boolean html; /* true if html label */
189 // } textlabel_t;