作図ソフト dia の改良版
修訂 | c50dd864e789dc6aad63f7d7439e8b4e86fcc126 (tree) |
---|---|
時間 | 2006-03-13 05:02:18 |
作者 | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
UML fixes, autogaps, security fixes, dia.spec move...
@@ -0,0 +1,340 @@ | ||
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 2, June 1991 | |
3 | + | |
4 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
5 | + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
6 | + Everyone is permitted to copy and distribute verbatim copies | |
7 | + of this license document, but changing it is not allowed. | |
8 | + | |
9 | + Preamble | |
10 | + | |
11 | + The licenses for most software are designed to take away your | |
12 | +freedom to share and change it. By contrast, the GNU General Public | |
13 | +License is intended to guarantee your freedom to share and change free | |
14 | +software--to make sure the software is free for all its users. This | |
15 | +General Public License applies to most of the Free Software | |
16 | +Foundation's software and to any other program whose authors commit to | |
17 | +using it. (Some other Free Software Foundation software is covered by | |
18 | +the GNU Library General Public License instead.) You can apply it to | |
19 | +your programs, too. | |
20 | + | |
21 | + When we speak of free software, we are referring to freedom, not | |
22 | +price. Our General Public Licenses are designed to make sure that you | |
23 | +have the freedom to distribute copies of free software (and charge for | |
24 | +this service if you wish), that you receive source code or can get it | |
25 | +if you want it, that you can change the software or use pieces of it | |
26 | +in new free programs; and that you know you can do these things. | |
27 | + | |
28 | + To protect your rights, we need to make restrictions that forbid | |
29 | +anyone to deny you these rights or to ask you to surrender the rights. | |
30 | +These restrictions translate to certain responsibilities for you if you | |
31 | +distribute copies of the software, or if you modify it. | |
32 | + | |
33 | + For example, if you distribute copies of such a program, whether | |
34 | +gratis or for a fee, you must give the recipients all the rights that | |
35 | +you have. You must make sure that they, too, receive or can get the | |
36 | +source code. And you must show them these terms so they know their | |
37 | +rights. | |
38 | + | |
39 | + We protect your rights with two steps: (1) copyright the software, and | |
40 | +(2) offer you this license which gives you legal permission to copy, | |
41 | +distribute and/or modify the software. | |
42 | + | |
43 | + Also, for each author's protection and ours, we want to make certain | |
44 | +that everyone understands that there is no warranty for this free | |
45 | +software. If the software is modified by someone else and passed on, we | |
46 | +want its recipients to know that what they have is not the original, so | |
47 | +that any problems introduced by others will not reflect on the original | |
48 | +authors' reputations. | |
49 | + | |
50 | + Finally, any free program is threatened constantly by software | |
51 | +patents. We wish to avoid the danger that redistributors of a free | |
52 | +program will individually obtain patent licenses, in effect making the | |
53 | +program proprietary. To prevent this, we have made it clear that any | |
54 | +patent must be licensed for everyone's free use or not licensed at all. | |
55 | + | |
56 | + The precise terms and conditions for copying, distribution and | |
57 | +modification follow. | |
58 | + | |
59 | + GNU GENERAL PUBLIC LICENSE | |
60 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
61 | + | |
62 | + 0. This License applies to any program or other work which contains | |
63 | +a notice placed by the copyright holder saying it may be distributed | |
64 | +under the terms of this General Public License. The "Program", below, | |
65 | +refers to any such program or work, and a "work based on the Program" | |
66 | +means either the Program or any derivative work under copyright law: | |
67 | +that is to say, a work containing the Program or a portion of it, | |
68 | +either verbatim or with modifications and/or translated into another | |
69 | +language. (Hereinafter, translation is included without limitation in | |
70 | +the term "modification".) Each licensee is addressed as "you". | |
71 | + | |
72 | +Activities other than copying, distribution and modification are not | |
73 | +covered by this License; they are outside its scope. The act of | |
74 | +running the Program is not restricted, and the output from the Program | |
75 | +is covered only if its contents constitute a work based on the | |
76 | +Program (independent of having been made by running the Program). | |
77 | +Whether that is true depends on what the Program does. | |
78 | + | |
79 | + 1. You may copy and distribute verbatim copies of the Program's | |
80 | +source code as you receive it, in any medium, provided that you | |
81 | +conspicuously and appropriately publish on each copy an appropriate | |
82 | +copyright notice and disclaimer of warranty; keep intact all the | |
83 | +notices that refer to this License and to the absence of any warranty; | |
84 | +and give any other recipients of the Program a copy of this License | |
85 | +along with the Program. | |
86 | + | |
87 | +You may charge a fee for the physical act of transferring a copy, and | |
88 | +you may at your option offer warranty protection in exchange for a fee. | |
89 | + | |
90 | + 2. You may modify your copy or copies of the Program or any portion | |
91 | +of it, thus forming a work based on the Program, and copy and | |
92 | +distribute such modifications or work under the terms of Section 1 | |
93 | +above, provided that you also meet all of these conditions: | |
94 | + | |
95 | + a) You must cause the modified files to carry prominent notices | |
96 | + stating that you changed the files and the date of any change. | |
97 | + | |
98 | + b) You must cause any work that you distribute or publish, that in | |
99 | + whole or in part contains or is derived from the Program or any | |
100 | + part thereof, to be licensed as a whole at no charge to all third | |
101 | + parties under the terms of this License. | |
102 | + | |
103 | + c) If the modified program normally reads commands interactively | |
104 | + when run, you must cause it, when started running for such | |
105 | + interactive use in the most ordinary way, to print or display an | |
106 | + announcement including an appropriate copyright notice and a | |
107 | + notice that there is no warranty (or else, saying that you provide | |
108 | + a warranty) and that users may redistribute the program under | |
109 | + these conditions, and telling the user how to view a copy of this | |
110 | + License. (Exception: if the Program itself is interactive but | |
111 | + does not normally print such an announcement, your work based on | |
112 | + the Program is not required to print an announcement.) | |
113 | + | |
114 | +These requirements apply to the modified work as a whole. If | |
115 | +identifiable sections of that work are not derived from the Program, | |
116 | +and can be reasonably considered independent and separate works in | |
117 | +themselves, then this License, and its terms, do not apply to those | |
118 | +sections when you distribute them as separate works. But when you | |
119 | +distribute the same sections as part of a whole which is a work based | |
120 | +on the Program, the distribution of the whole must be on the terms of | |
121 | +this License, whose permissions for other licensees extend to the | |
122 | +entire whole, and thus to each and every part regardless of who wrote it. | |
123 | + | |
124 | +Thus, it is not the intent of this section to claim rights or contest | |
125 | +your rights to work written entirely by you; rather, the intent is to | |
126 | +exercise the right to control the distribution of derivative or | |
127 | +collective works based on the Program. | |
128 | + | |
129 | +In addition, mere aggregation of another work not based on the Program | |
130 | +with the Program (or with a work based on the Program) on a volume of | |
131 | +a storage or distribution medium does not bring the other work under | |
132 | +the scope of this License. | |
133 | + | |
134 | + 3. You may copy and distribute the Program (or a work based on it, | |
135 | +under Section 2) in object code or executable form under the terms of | |
136 | +Sections 1 and 2 above provided that you also do one of the following: | |
137 | + | |
138 | + a) Accompany it with the complete corresponding machine-readable | |
139 | + source code, which must be distributed under the terms of Sections | |
140 | + 1 and 2 above on a medium customarily used for software interchange; or, | |
141 | + | |
142 | + b) Accompany it with a written offer, valid for at least three | |
143 | + years, to give any third party, for a charge no more than your | |
144 | + cost of physically performing source distribution, a complete | |
145 | + machine-readable copy of the corresponding source code, to be | |
146 | + distributed under the terms of Sections 1 and 2 above on a medium | |
147 | + customarily used for software interchange; or, | |
148 | + | |
149 | + c) Accompany it with the information you received as to the offer | |
150 | + to distribute corresponding source code. (This alternative is | |
151 | + allowed only for noncommercial distribution and only if you | |
152 | + received the program in object code or executable form with such | |
153 | + an offer, in accord with Subsection b above.) | |
154 | + | |
155 | +The source code for a work means the preferred form of the work for | |
156 | +making modifications to it. For an executable work, complete source | |
157 | +code means all the source code for all modules it contains, plus any | |
158 | +associated interface definition files, plus the scripts used to | |
159 | +control compilation and installation of the executable. However, as a | |
160 | +special exception, the source code distributed need not include | |
161 | +anything that is normally distributed (in either source or binary | |
162 | +form) with the major components (compiler, kernel, and so on) of the | |
163 | +operating system on which the executable runs, unless that component | |
164 | +itself accompanies the executable. | |
165 | + | |
166 | +If distribution of executable or object code is made by offering | |
167 | +access to copy from a designated place, then offering equivalent | |
168 | +access to copy the source code from the same place counts as | |
169 | +distribution of the source code, even though third parties are not | |
170 | +compelled to copy the source along with the object code. | |
171 | + | |
172 | + 4. You may not copy, modify, sublicense, or distribute the Program | |
173 | +except as expressly provided under this License. Any attempt | |
174 | +otherwise to copy, modify, sublicense or distribute the Program is | |
175 | +void, and will automatically terminate your rights under this License. | |
176 | +However, parties who have received copies, or rights, from you under | |
177 | +this License will not have their licenses terminated so long as such | |
178 | +parties remain in full compliance. | |
179 | + | |
180 | + 5. You are not required to accept this License, since you have not | |
181 | +signed it. However, nothing else grants you permission to modify or | |
182 | +distribute the Program or its derivative works. These actions are | |
183 | +prohibited by law if you do not accept this License. Therefore, by | |
184 | +modifying or distributing the Program (or any work based on the | |
185 | +Program), you indicate your acceptance of this License to do so, and | |
186 | +all its terms and conditions for copying, distributing or modifying | |
187 | +the Program or works based on it. | |
188 | + | |
189 | + 6. Each time you redistribute the Program (or any work based on the | |
190 | +Program), the recipient automatically receives a license from the | |
191 | +original licensor to copy, distribute or modify the Program subject to | |
192 | +these terms and conditions. You may not impose any further | |
193 | +restrictions on the recipients' exercise of the rights granted herein. | |
194 | +You are not responsible for enforcing compliance by third parties to | |
195 | +this License. | |
196 | + | |
197 | + 7. If, as a consequence of a court judgment or allegation of patent | |
198 | +infringement or for any other reason (not limited to patent issues), | |
199 | +conditions are imposed on you (whether by court order, agreement or | |
200 | +otherwise) that contradict the conditions of this License, they do not | |
201 | +excuse you from the conditions of this License. If you cannot | |
202 | +distribute so as to satisfy simultaneously your obligations under this | |
203 | +License and any other pertinent obligations, then as a consequence you | |
204 | +may not distribute the Program at all. For example, if a patent | |
205 | +license would not permit royalty-free redistribution of the Program by | |
206 | +all those who receive copies directly or indirectly through you, then | |
207 | +the only way you could satisfy both it and this License would be to | |
208 | +refrain entirely from distribution of the Program. | |
209 | + | |
210 | +If any portion of this section is held invalid or unenforceable under | |
211 | +any particular circumstance, the balance of the section is intended to | |
212 | +apply and the section as a whole is intended to apply in other | |
213 | +circumstances. | |
214 | + | |
215 | +It is not the purpose of this section to induce you to infringe any | |
216 | +patents or other property right claims or to contest validity of any | |
217 | +such claims; this section has the sole purpose of protecting the | |
218 | +integrity of the free software distribution system, which is | |
219 | +implemented by public license practices. Many people have made | |
220 | +generous contributions to the wide range of software distributed | |
221 | +through that system in reliance on consistent application of that | |
222 | +system; it is up to the author/donor to decide if he or she is willing | |
223 | +to distribute software through any other system and a licensee cannot | |
224 | +impose that choice. | |
225 | + | |
226 | +This section is intended to make thoroughly clear what is believed to | |
227 | +be a consequence of the rest of this License. | |
228 | + | |
229 | + 8. If the distribution and/or use of the Program is restricted in | |
230 | +certain countries either by patents or by copyrighted interfaces, the | |
231 | +original copyright holder who places the Program under this License | |
232 | +may add an explicit geographical distribution limitation excluding | |
233 | +those countries, so that distribution is permitted only in or among | |
234 | +countries not thus excluded. In such case, this License incorporates | |
235 | +the limitation as if written in the body of this License. | |
236 | + | |
237 | + 9. The Free Software Foundation may publish revised and/or new versions | |
238 | +of the General Public License from time to time. Such new versions will | |
239 | +be similar in spirit to the present version, but may differ in detail to | |
240 | +address new problems or concerns. | |
241 | + | |
242 | +Each version is given a distinguishing version number. If the Program | |
243 | +specifies a version number of this License which applies to it and "any | |
244 | +later version", you have the option of following the terms and conditions | |
245 | +either of that version or of any later version published by the Free | |
246 | +Software Foundation. If the Program does not specify a version number of | |
247 | +this License, you may choose any version ever published by the Free Software | |
248 | +Foundation. | |
249 | + | |
250 | + 10. If you wish to incorporate parts of the Program into other free | |
251 | +programs whose distribution conditions are different, write to the author | |
252 | +to ask for permission. For software which is copyrighted by the Free | |
253 | +Software Foundation, write to the Free Software Foundation; we sometimes | |
254 | +make exceptions for this. Our decision will be guided by the two goals | |
255 | +of preserving the free status of all derivatives of our free software and | |
256 | +of promoting the sharing and reuse of software generally. | |
257 | + | |
258 | + NO WARRANTY | |
259 | + | |
260 | + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
261 | +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
262 | +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
263 | +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
264 | +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
265 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
266 | +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
267 | +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
268 | +REPAIR OR CORRECTION. | |
269 | + | |
270 | + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
271 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
272 | +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
273 | +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
274 | +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
275 | +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
276 | +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
277 | +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
278 | +POSSIBILITY OF SUCH DAMAGES. | |
279 | + | |
280 | + END OF TERMS AND CONDITIONS | |
281 | + | |
282 | + How to Apply These Terms to Your New Programs | |
283 | + | |
284 | + If you develop a new program, and you want it to be of the greatest | |
285 | +possible use to the public, the best way to achieve this is to make it | |
286 | +free software which everyone can redistribute and change under these terms. | |
287 | + | |
288 | + To do so, attach the following notices to the program. It is safest | |
289 | +to attach them to the start of each source file to most effectively | |
290 | +convey the exclusion of warranty; and each file should have at least | |
291 | +the "copyright" line and a pointer to where the full notice is found. | |
292 | + | |
293 | + <one line to give the program's name and a brief idea of what it does.> | |
294 | + Copyright (C) <year> <name of author> | |
295 | + | |
296 | + This program is free software; you can redistribute it and/or modify | |
297 | + it under the terms of the GNU General Public License as published by | |
298 | + the Free Software Foundation; either version 2 of the License, or | |
299 | + (at your option) any later version. | |
300 | + | |
301 | + This program is distributed in the hope that it will be useful, | |
302 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
303 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
304 | + GNU General Public License for more details. | |
305 | + | |
306 | + You should have received a copy of the GNU General Public License | |
307 | + along with this program; if not, write to the Free Software | |
308 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
309 | + | |
310 | + | |
311 | +Also add information on how to contact you by electronic and paper mail. | |
312 | + | |
313 | +If the program is interactive, make it output a short notice like this | |
314 | +when it starts in an interactive mode: | |
315 | + | |
316 | + Gnomovision version 69, Copyright (C) year name of author | |
317 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
318 | + This is free software, and you are welcome to redistribute it | |
319 | + under certain conditions; type `show c' for details. | |
320 | + | |
321 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
322 | +parts of the General Public License. Of course, the commands you use may | |
323 | +be called something other than `show w' and `show c'; they could even be | |
324 | +mouse-clicks or menu items--whatever suits your program. | |
325 | + | |
326 | +You should also get your employer (if you work as a programmer) or your | |
327 | +school, if any, to sign a "copyright disclaimer" for the program, if | |
328 | +necessary. Here is a sample; alter the names: | |
329 | + | |
330 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
331 | + `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
332 | + | |
333 | + <signature of Ty Coon>, 1 April 1989 | |
334 | + Ty Coon, President of Vice | |
335 | + | |
336 | +This General Public License does not permit incorporating your program into | |
337 | +proprietary programs. If your program is a subroutine library, you may | |
338 | +consider it more useful to permit linking proprietary applications with the | |
339 | +library. If this is what you want to do, use the GNU Library General | |
340 | +Public License instead of this License. |
@@ -1,3 +1,55 @@ | ||
1 | +2006-03-12 Lars Clausen <lars@raeder.dk> | |
2 | + | |
3 | + * installer/win32/dia.nsi: | |
4 | + * doc/en/dia.xml: | |
5 | + * doc/eu/dia.xml: | |
6 | + * doc/pl/dia.xml: | |
7 | + * config.h.win32: | |
8 | + * configure.in: | |
9 | + * NEWS: -pre5 | |
10 | + | |
11 | + * objects/UML/constraint.c (constraint_update_data): | |
12 | + * objects/UML/message.c (message_update_data): | |
13 | + * objects/UML/implements.c (implements_update_data): | |
14 | + * objects/SADT/annotation.c (annotation_update_data): | |
15 | + * objects/Jackson/phenomenon.c (message_update_data): | |
16 | + * objects/network/wanlink.c (wanlink_update_data): | |
17 | + * objects/FS/flow.c (flow_update_data): Added autogap adjustment. | |
18 | + | |
19 | + * objects/standard/line.c: | |
20 | + * lib/connection.[ch] (connection_adjust_for_autogap): Moved autogap | |
21 | + functionality for connections. | |
22 | + | |
23 | +2006-03-11 Lars Clausen <lars@raeder.dk> | |
24 | + | |
25 | + * lib/diagdkrenderer.c (draw_object): | |
26 | + * lib/dialibartrenderer.c (draw_object): Don't draw highlighting | |
27 | + in the non-interactive rendering. | |
28 | + | |
29 | + * dia.spec: | |
30 | + * installer/rpm/dia.spec: | |
31 | + * installer/rpm/README: | |
32 | + Moving dia.spec to installer directory, where distribution | |
33 | + maintainers can keep their own copies. | |
34 | + | |
35 | + * objects/UML/uml.h: | |
36 | + * objects/UML/class.h: | |
37 | + * objects/UML/umloperation.c: | |
38 | + * objects/UML/class.c: | |
39 | + Preparations to fix bug #334037: Clean away the Lisp-like | |
40 | + constructs confusing the issue. | |
41 | + | |
42 | +2006-03-10 Lars Clausen <lars@raeder.dk> | |
43 | + | |
44 | + * lib/object.c: Don't compare floats with ==, even in sanity checks. | |
45 | + | |
46 | +2006-03-09 Lars Clausen <lars@raeder.dk> | |
47 | + | |
48 | + * plug-ins/xfig/xfig-import.c: Fix three buffer overflows in color | |
49 | + reading, depth reading, and points reading. Thanks to | |
50 | + | |
51 | + * COPYING: Added copyright info again. | |
52 | + | |
1 | 53 | 2006-03-09 Steffen Macke <sdteffen@gmail.com> |
2 | 54 | |
3 | 55 | * installer/win32/dia.nsi: don't uninstall old version; overwrite |
@@ -49,7 +49,7 @@ distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollke | ||
49 | 49 | # @: |
50 | 50 | |
51 | 51 | EXTRA_DIST = dia.xpm dia_gnome_icon.png dia_gnome_menu_icon.png \ |
52 | - dia.desktop.in dia.spec KNOWN_BUGS $(pkgdata_DATA) \ | |
52 | + dia.desktop.in KNOWN_BUGS $(pkgdata_DATA) \ | |
53 | 53 | dia-diagram.png dia.mime dia.keys.in \ |
54 | 54 | po-checktrans.py po-checktrans \ |
55 | 55 | intltool-extract.in intltool-merge.in intltool-update.in \ |
@@ -1,3 +1,11 @@ | ||
1 | +dia-0.95-pre5: 12-Mar-2006 | |
2 | + | |
3 | +* Fixed positioning and height of UML operations when wrapped. | |
4 | + | |
5 | +* Three security holes in the XFig importer fixed after review. | |
6 | + | |
7 | +* COPYING file readded. | |
8 | + | |
1 | 9 | dia-0.95-pre4: 6-Mar-2006 |
2 | 10 | |
3 | 11 | * Fixed Fig import locale issues, TeX export escape issues. |
@@ -98,7 +98,7 @@ How to make a tarball | ||
98 | 98 | |
99 | 99 | Script to update version: |
100 | 100 | |
101 | -find . -name configure.in -o -name config.h.win32 -o -name dia.xml -o -name dia.dbk | xargs sed -i 's/0\.95-pre[0-9]*/0.95-pre5/;' | |
101 | +find . -name configure.in -o -name config.h.win32 -o -name dia.xml | xargs sed -i 's/0\.95-pre[0-9]*/0.95-pre5/;' | |
102 | 102 | |
103 | 103 | Issues to solve |
104 | 104 | --------------- |
@@ -18,7 +18,7 @@ | ||
18 | 18 | #undef LOCALEDIR /* needs to be calculated at runtime */ |
19 | 19 | /* NOT: #define LOCALEDIR "../lib/locale" */ |
20 | 20 | |
21 | -#define VERSION "0.95-pre4" | |
21 | +#define VERSION "0.95-pre5" | |
22 | 22 | |
23 | 23 | /* |
24 | 24 | * We are linking libxml as DLL with either msvc or mingw, but this |
@@ -1,6 +1,6 @@ | ||
1 | 1 | dnl Process this -*- autoconf -*- file with autoconf to produce a |
2 | 2 | dnl configure script. |
3 | -AC_INIT(dia, 0.95-pre4, http://bugzilla.gnome.org/enter_bug.cgi?product=dia) | |
3 | +AC_INIT(dia, 0.95-pre5, http://bugzilla.gnome.org/enter_bug.cgi?product=dia) | |
4 | 4 | AC_CONFIG_SRCDIR(app/diagram.c) |
5 | 5 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION) |
6 | 6 |
@@ -1,189 +1,197 @@ | ||
1 | -.\"Generated by db2man.xsl. Don't modify this, modify the source. | |
2 | -.de Sh \" Subsection | |
3 | -.br | |
4 | -.if t .Sp | |
5 | -.ne 5 | |
6 | -.PP | |
7 | -\fB\\$1\fR | |
8 | -.PP | |
9 | -.. | |
10 | -.de Sp \" Vertical space (when we can't use .PP) | |
11 | -.if t .sp .5v | |
12 | -.if n .sp | |
13 | -.. | |
14 | -.de Ip \" List item | |
15 | -.br | |
16 | -.ie \\n(.$>=3 .ne \\$3 | |
17 | -.el .ne 3 | |
18 | -.IP "\\$1" \\$2 | |
19 | -.. | |
20 | -.TH "DIA" 1 "2004-11-26" "" "" | |
21 | -.SH NAME | |
1 | +.\" ** You probably do not want to edit this file directly ** | |
2 | +.\" It was generated using the DocBook XSL Stylesheets (version 1.69.0). | |
3 | +.\" Instead of manually editing it, you probably should edit the DocBook XML | |
4 | +.\" source for it and then use the DocBook XSL Stylesheets to regenerate it. | |
5 | +.TH "DIA" "1" "2004\-11\-26" "" "" | |
6 | +.\" disable hyphenation | |
7 | +.nh | |
8 | +.\" disable justification (adjust text to left margin only) | |
9 | +.ad l | |
10 | +.SH "NAME" | |
22 | 11 | dia \- a diagram drawing program |
23 | 12 | .SH "SYNOPSIS" |
24 | -.ad l | |
25 | -.hy 0 | |
26 | 13 | .HP 4 |
27 | -\fBdia\fR [\fB\-c\fR] [\fB\-\-credits\fR] [\fB\-e\ \fIOUTPUT\fR\fR] [\fB\-\-export=\fIOUTPUT\fR\fR] [\fB\-L\ \fILAYER,LAYER,\&.\&.\&.\fR\fR] [\fB\-\-show\-layers=\fILAYER,LAYER,\&.\&.\&.\fR\fR] [\fB\-h\fR] [\fB\-\-help\fR] [\fB\-n\fR] [\fB\-\-nosplash\fR] [\fB\-s\ \fIWxH\fR\fR] [\fB\-\-size=\fIWxH\fR\fR] [\fB\-t\ \fIFORMAT\fR\fR] [\fB\-\-export\-to\-format=\fIFORMAT\fR\fR] [\fB\-v\fR] [\fB\-\-version\fR] [file\ \&.\&.\&.] | |
28 | -.ad | |
29 | -.hy | |
30 | - | |
14 | +\fBdia\fR [\fB\-c\fR] [\fB\-\-credits\fR] [\fB\-e\ \fR\fB\fIOUTPUT\fR\fR] [\fB\-\-export=\fR\fB\fIOUTPUT\fR\fR] [\fB\-L\ \fR\fB\fILAYER,LAYER,...\fR\fR] [\fB\-\-show\-layers=\fR\fB\fILAYER,LAYER,...\fR\fR] [\fB\-h\fR] [\fB\-\-help\fR] [\fB\-n\fR] [\fB\-\-nosplash\fR] [\fB\-s\ \fR\fB\fIWxH\fR\fR] [\fB\-\-size=\fR\fB\fIWxH\fR\fR] [\fB\-t\ \fR\fB\fIFORMAT\fR\fR] [\fB\-\-export\-to\-format=\fR\fB\fIFORMAT\fR\fR] [\fB\-v\fR] [\fB\-\-version\fR] [file\ ...] | |
31 | 15 | .SH "DESCRIPTION" |
32 | - | |
33 | 16 | .PP |
34 | -\fBDia\fR is used to create diagrams\&. Dia has a number of basic tools, like lines and boxes but can also dynamically load sheets\&. A sheet is a collection of tools that are used in a certain type of diagram\&. | |
35 | - | |
17 | +\fBDia\fR | |
18 | +is used to create diagrams. Dia has a number of basic tools, like lines and boxes but can also dynamically load | |
19 | +\fIsheets\fR. A sheet is a collection of tools that are used in a certain type of diagram. | |
36 | 20 | .PP |
37 | -Most diagram objects in \fBDia\fR have handles\&. Lines can be connected to these handles and this way graph structures can be formed\&. When objects are moved or resized the connections will follow the objects\&. | |
38 | - | |
21 | +Most diagram objects in | |
22 | +\fBDia\fR | |
23 | +have | |
24 | +\fIhandles\fR. Lines can be connected to these handles and this way graph structures can be formed. When objects are moved or resized the connections will follow the objects. | |
39 | 25 | .PP |
40 | -Diagrams drawn in \fBDia\fR can be exported PostScript\&. | |
41 | - | |
26 | +Diagrams drawn in | |
27 | +\fBDia\fR | |
28 | +can be exported PostScript. | |
42 | 29 | .SH "OPTIONS" |
43 | - | |
44 | 30 | .PP |
45 | -\fBDia\fR accepts the following options: | |
46 | - | |
31 | +\fBDia\fR | |
32 | +accepts the following options: | |
47 | 33 | .TP |
48 | 34 | \fB\-c\fR \fB\-\-credits\fR |
49 | -Display credits list and exit\&. | |
50 | - | |
35 | +Display credits list and exit. | |
51 | 36 | .TP |
52 | -\fB\-e \fIOUTPUT\fR\fR \fB\-\-export=\fIOUTPUT\fR\fR | |
53 | -Export loaded file to OUTPUT and exit\&. | |
54 | - | |
37 | +\fB\-e \fR\fB\fIOUTPUT\fR\fR \fB\-\-export=\fR\fB\fIOUTPUT\fR\fR | |
38 | +Export loaded file to OUTPUT and exit. | |
55 | 39 | .TP |
56 | 40 | \fB\-h\fR \fB\-\-help\fR |
57 | -Display a list of all commandline options\&. | |
58 | - | |
41 | +Display a list of all commandline options. | |
59 | 42 | .TP |
60 | 43 | \fB\-n\fR \fB\-\-nosplash\fR |
61 | -Do not show the splash screen\&. | |
62 | - | |
44 | +Do not show the splash screen. | |
45 | +.TP | |
46 | +\fB\-s \fR\fB\fIWxH\fR\fR \fB\-\-size=\fR\fB\fIWxH\fR\fR | |
47 | +Export loaded file in decimal given width and/or height. It is allowed to only select width or height. E.g. | |
48 | +\fB\-\-size=\fR\fB\fI520x\fR\fR | |
49 | +exports an image that is 520 pixels wide, while | |
50 | +\fB\-\-size=\fR\fB\fIx900\fR\fR | |
51 | +exports an image of 900 pixels height. | |
52 | +.sp | |
53 | +.it 1 an-trap | |
54 | +.nr an-no-space-flag 1 | |
55 | +.nr an-break-flag 1 | |
56 | +.br | |
57 | +\fBNote\fR | |
58 | +This option is currently only implemented for the PNG export filter. | |
63 | 59 | .TP |
64 | -\fB\-s \fIWxH\fR\fR \fB\-\-size=\fIWxH\fR\fR | |
65 | -Export loaded file in decimal given width and/or height\&. It is allowed to only select width or height\&. E\&.g\&. \fB\-\-size=\fI520x\fR\fR exports an image that is 520 pixels wide, while \fB\-\-size=\fIx900\fR\fR exports an image of 900 pixels height\&. | |
66 | - | |
67 | -.RS | |
68 | -.Sh "Note" | |
69 | -This option is currently only implemented for the PNG export filter\&. | |
70 | - | |
71 | -.RE | |
72 | - | |
60 | +\fB\-L \fR\fB\fILAYER,LAYER,...\fR\fR \fB\-\-show\-layers=\fR\fB\fILAYER,LAYER,...\fR\fR | |
61 | +Only include specified layers when exporting. Layers can be specified either as a layer name, the layer number or a numeric range X\-Y of layers. \-\-show\-layers=background,2\-5 shows the layer named background and layers 2\-5, \-\-show\-layers=2\- shows layers 2 and up. | |
73 | 62 | .TP |
74 | -\fB\-L \fILAYER,LAYER,\&.\&.\&.\fR\fR \fB\-\-show\-layers=\fILAYER,LAYER,\&.\&.\&.\fR\fR | |
75 | -Only include specified layers when exporting\&. Layers can be specified either as a layer name, the layer number or a numeric range X\-Y of layers\&. \-\-show\-layers=background,2\-5 shows the layer named background and layers 2\-5, \-\-show\-layers=2\- shows layers 2 and up\&. | |
76 | - | |
77 | -.TP | |
78 | -\fB\-t \fIFORMAT\fR\fR \fB\-\-export\-to\-format=\fIFORMAT\fR\fR | |
79 | -Export loaded file in FORMAT and exit\&. Format are described below\&. | |
80 | - | |
63 | +\fB\-t \fR\fB\fIFORMAT\fR\fR \fB\-\-export\-to\-format=\fR\fB\fIFORMAT\fR\fR | |
64 | +Export loaded file in FORMAT and exit. Format are described below. | |
81 | 65 | .TP |
82 | 66 | \fB\-v\fR \fB\-\-version\fR |
83 | -Display \fBdia\fR version and exit\&. | |
84 | - | |
67 | +Display | |
68 | +\fBdia\fR | |
69 | +version and exit. | |
85 | 70 | .SH "EXPORT FORMATS" |
86 | - | |
87 | 71 | .PP |
88 | -The following export formats are supported by \fBdia\fR\&. | |
89 | - | |
72 | +The following export formats are supported by | |
73 | +\fBdia\fR. | |
90 | 74 | .TP 3 |
91 | 75 | \(bu |
92 | -cgm (Computer Graphics Metafile, ISO 8632) | |
76 | +cgm | |
77 | +(Computer Graphics Metafile, ISO 8632) | |
93 | 78 | .TP |
94 | 79 | \(bu |
95 | -dia (Native dia diagram) | |
80 | +dia | |
81 | +(Native dia diagram) | |
96 | 82 | .TP |
97 | 83 | \(bu |
98 | -dxf (Drawing Interchange File) | |
84 | +dxf | |
85 | +(Drawing Interchange File) | |
99 | 86 | .TP |
100 | 87 | \(bu |
101 | -eps or epsi oreps\-builtin or eps\-pango (Encapsulated PostScript) | |
88 | +eps | |
89 | +or | |
90 | +epsi | |
91 | +or | |
92 | +eps\-builtin | |
93 | +or | |
94 | +eps\-pango | |
95 | +(Encapsulated PostScript) | |
102 | 96 | |
103 | -The format specifications eps,epsi, and eps\-pango all use the font renderer of the Pango library, whileeps\-builtin uses a dia specific font renderer\&. If you have problems with Pango rendering, e\&.g\&. Unicode, try eps\-builtin instead\&. | |
97 | +The format specifications | |
98 | +eps, | |
99 | +epsi, and | |
100 | +eps\-pango | |
101 | +all use the font renderer of the Pango library, while | |
102 | +eps\-builtin | |
103 | +uses a dia specific font renderer. If you have problems with Pango rendering, e.g. Unicode, try | |
104 | +eps\-builtin | |
105 | +instead. | |
104 | 106 | .TP |
105 | 107 | \(bu |
106 | -fig (XFig format) | |
108 | +fig | |
109 | +(XFig format) | |
107 | 110 | .TP |
108 | 111 | \(bu |
109 | -mp (TeX MetaPost macros) | |
112 | +mp | |
113 | +(TeX MetaPost macros) | |
110 | 114 | .TP |
111 | 115 | \(bu |
112 | -plt or hpgl (HP Graphics Language) | |
116 | +plt | |
117 | +or | |
118 | +hpgl | |
119 | +(HP Graphics Language) | |
113 | 120 | .TP |
114 | 121 | \(bu |
115 | -png (Portable Network Graphics) | |
122 | +png | |
123 | +(Portable Network Graphics) | |
116 | 124 | .TP |
117 | 125 | \(bu |
118 | -shape (Dia Shape File) | |
126 | +shape | |
127 | +(Dia Shape File) | |
119 | 128 | .TP |
120 | 129 | \(bu |
121 | -svg (Scalable Vector Graphics) | |
130 | +svg | |
131 | +(Scalable Vector Graphics) | |
122 | 132 | .TP |
123 | 133 | \(bu |
124 | -tex (TeX PSTricks macros) | |
134 | +tex | |
135 | +(TeX PSTricks macros) | |
125 | 136 | .TP |
126 | 137 | \(bu |
127 | -wpg (WordPerfect Graphics) | |
138 | +wpg | |
139 | +(WordPerfect Graphics) | |
128 | 140 | .TP |
129 | 141 | \(bu |
130 | -wmf (Windows MetaFile) | |
131 | -.LP | |
132 | - | |
142 | +wmf | |
143 | +(Windows MetaFile) | |
133 | 144 | .SH "FILES" |
134 | - | |
135 | 145 | .PP |
136 | -\fBdia\fR creates a directory \fI\&.dia\fR in the user's home, which contains different files to store user preferences\&. To reset \fBdia\fR to it's default behaviour, just remove the respective file: | |
137 | - | |
146 | +\fBdia\fR | |
147 | +creates a directory | |
148 | +\fI.dia\fR | |
149 | +in the user's home, which contains different files to store user preferences. To reset | |
150 | +\fBdia\fR | |
151 | +to it's default behaviour, just remove the respective file: | |
138 | 152 | .TP 3 |
139 | 153 | \(bu |
140 | -\fIdefaults\&.dia\fR: contains default values for elements (XML format)\&. | |
154 | +\fIdefaults.dia\fR: contains default values for elements (XML format). | |
141 | 155 | .TP |
142 | 156 | \(bu |
143 | -\fIdiarc\fR: keeps\fBdia\fR preferences (ASCII)\&. | |
157 | +\fIdiarc\fR: keeps | |
158 | +\fBdia\fR | |
159 | +preferences (ASCII). | |
144 | 160 | .TP |
145 | 161 | \(bu |
146 | -\fIhistory\fR: keeps the list of last edited diagrams (ASCII)\&. | |
162 | +\fIhistory\fR: keeps the list of last edited diagrams (ASCII). | |
147 | 163 | .TP |
148 | 164 | \(bu |
149 | -\fImenurc\fR: contains an automated accelerator map dump (Lisp)\&. | |
165 | +\fImenurc\fR: contains an automated accelerator map dump (Lisp). | |
150 | 166 | .TP |
151 | 167 | \(bu |
152 | -\fIpersistence\fR: contains GUI information, e\&.g\&. open windows (XML)\&. | |
168 | +\fIpersistence\fR: contains GUI information, e.g. open windows (XML). | |
153 | 169 | .TP |
154 | 170 | \(bu |
155 | -\fIpluginrc\fR: the list of loaded plugins (XML)\&. | |
156 | -.LP | |
157 | - | |
171 | +\fIpluginrc\fR: the list of loaded plugins (XML). | |
158 | 172 | .SH "SEE ALSO" |
159 | - | |
160 | 173 | .PP |
161 | -Pango: \fIhttp://www.pango.org/\fR | |
162 | - | |
174 | +[1]\&\fIPango\fR | |
163 | 175 | .PP |
164 | 176 | X (1) |
165 | - | |
166 | 177 | .PP |
167 | 178 | xfig (1) |
168 | - | |
169 | 179 | .PP |
170 | 180 | inkscape (1) |
171 | - | |
172 | 181 | .SH "COPYRIGHT" |
173 | - | |
174 | 182 | .PP |
175 | -Copyright 1999 Alexander Larsson\&. | |
176 | - | |
183 | +Copyright 1999 Alexander Larsson. | |
177 | 184 | .PP |
178 | -Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation\&. | |
179 | - | |
185 | +Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. | |
180 | 186 | .SH "AUTHORS" |
181 | - | |
182 | 187 | .PP |
183 | 188 | Alexander Larsson |
184 | - | |
185 | 189 | .PP |
186 | -This manual was written by Fredrik Hallenberg\&. | |
187 | - | |
188 | -.SH AUTHORS | |
189 | -Fredrik Hallenberg, W\&. Borgert, Alan Horkan. | |
190 | +This manual was written by | |
191 | +Fredrik Hallenberg. | |
192 | +.SH "AUTHOR" | |
193 | +Fredrik Hallenberg <hallon@lysator.liu.se>, W. Borgert <debacle@debian.org>, Alan Horkan <horkana@tcd.ie>. | |
194 | +.SH "REFERENCES" | |
195 | +.TP 3 | |
196 | +1.\ Pango | |
197 | +\%http://www.pango.org/ |
@@ -8,7 +8,7 @@ | ||
8 | 8 | |
9 | 9 | [ |
10 | 10 | |
11 | - <!ENTITY VERSION "0.95-pre4"> | |
11 | + <!ENTITY VERSION "0.95-pre5"> | |
12 | 12 | |
13 | 13 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
14 | 14 |
@@ -1,51 +1,190 @@ | ||
1 | -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>dia</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="id2750613"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>dia — a diagram drawing program</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt>dia</tt> [<tt>-c</tt>] [<tt>--credits</tt>] [<tt>-e <i><tt>OUTPUT</tt></i></tt>] [<tt>--export=<i><tt>OUTPUT</tt></i></tt>] [<tt>-h</tt>] [<tt>--help</tt>] [<tt>-n</tt>] [<tt>--nosplash</tt>] [<tt>-s <i><tt>WxH</tt></i></tt>] [<tt>--size=<i><tt>WxH</tt></i></tt>] [<tt>-t <i><tt>FORMAT</tt></i></tt>] [<tt>--export-to-format=<i><tt>FORMAT</tt></i></tt>] [<tt>-v</tt>] [<tt>--version</tt>] [file ...]</p></div></div><div class="refsect1"><h2>Description</h2><p><b>Dia</b> is used to create diagrams. Dia has | |
2 | - a number of basic tools, like lines and boxes but can also | |
3 | - dynamically load <span class="emphasis"><i>sheets</i></span>. A sheet is a | |
4 | - collection of tools that are used in a certain type of | |
5 | - diagram.</p><p>Most diagram objects in <b>Dia</b> has | |
6 | - <span class="emphasis"><i>handles</i></span>. Lines can be connected to these | |
7 | - handles and this way graph structures can be formed. When objects | |
8 | - are moved or resized the connections will follow the | |
9 | - objects.</p><p>Diagrams drawn in <b>Dia</b> can be exported | |
10 | - PostScript.</p></div><div class="refsect1"><h2>Options</h2><p><b>Dia</b> accepts the following options:</p><div class="variablelist"><dl><dt><span class="term"><tt>-c</tt> | |
11 | - <tt>--credits</tt></span></dt><dd><p>Display credits list and exit.</p></dd><dt><span class="term"><tt>-e <i><tt>OUTPUT</tt></i></tt> | |
12 | - <tt>--export=<i><tt>OUTPUT</tt></i></tt></span></dt><dd><p>Export loaded file to OUTPUT and exit.</p></dd><dt><span class="term"><tt>-h</tt> | |
13 | - <tt>--help</tt></span></dt><dd><p>Display a list of all commandline options.</p></dd><dt><span class="term"><tt>-n</tt> | |
14 | - <tt>--nosplash</tt></span></dt><dd><p>Do not show the splash screen.</p></dd><dt><span class="term"><tt>-s <i><tt>WxH</tt></i></tt> | |
15 | - <tt>--size=<i><tt>WxH</tt></i></tt></span></dt><dd><p>Export loaded file in decimal given width and/or | |
16 | - height. It is allowed to only select width or height. | |
17 | - E.g. <tt>--size=<i><tt>520x</tt></i></tt> | |
18 | - exports an image that is 520 pixels wide, while | |
19 | - <tt>--size=<i><tt>x900</tt></i></tt> | |
20 | - exports an image of 900 pixels height.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This option is currently only implemented for the | |
21 | - PNG export filter.</p></div></dd><dt><span class="term"><tt>-t <i><tt>FORMAT</tt></i></tt> | |
22 | - <tt>--export-to-format=<i><tt>FORMAT</tt></i></tt></span></dt><dd><p>Export loaded file in FORMAT and exit. Format are | |
23 | - described below.</p></dd><dt><span class="term"><tt>-v</tt> | |
24 | - <tt>--version</tt></span></dt><dd><p>Display <b>dia</b> version and exit.</p></dd></dl></div></div><div class="refsect1"><h2>Export Formats</h2><p>The following export formats are supported by | |
25 | - <b>dia</b>.</p><div class="itemizedlist"><ul type="disc"><li><p><tt>cgm</tt> (Computer Graphics Metafile, ISO | |
26 | - 8632)</p></li><li><p><tt>dia</tt> (Native dia diagram)</p></li><li><p><tt>dxf</tt> (Drawing Interchange File)</p></li><li><p><tt>eps</tt> or <tt>epsi</tt> or | |
27 | - <tt>eps-builtin</tt> or <tt>eps-pango</tt> | |
28 | - (Encapsulated PostScript)</p><p>The format specifications <tt>eps</tt>, | |
29 | - <tt>epsi</tt>, and <tt>eps-pango</tt> all | |
30 | - use the font renderer of the Pango library, while | |
31 | - <tt>eps-builtin</tt> uses a dia specific font | |
32 | - renderer. If you have problems with Pango rendering, | |
33 | - e.g. Unicode, try <tt>eps-builtin</tt> | |
34 | - instead.</p></li><li><p><tt>fig</tt> (XFig format)</p></li><li><p><tt>mp</tt> (TeX MetaPost macros)</p></li><li><p><tt>plt</tt> or <tt>hpgl</tt> (HP | |
35 | - Graphics Language)</p></li><li><p><tt>png</tt> (Portable Network | |
36 | - Graphics)</p></li><li><p><tt>shape</tt> (Dia shape file)</p></li><li><p><tt>svg</tt> (Scalable Vector Graphics)</p></li><li><p><tt>tex</tt> (TeX PSTricks macros)</p></li><li><p><tt>wpg</tt> (WordPerfect Graphics)</p></li><li><p><tt>wmf</tt> (Windows MetaFile)</p></li></ul></div></div><div class="refsect1"><h2>Files</h2><p><b>dia</b> creates a directory | |
37 | - <tt>.dia</tt> in the user's home, which contains | |
38 | - different files to store user preferences. To reset | |
39 | - <b>dia</b> to it's default behaviour, just remove | |
40 | - the respective file:</p><div class="itemizedlist"><ul type="disc"><li><p><tt>defaults.dia</tt>: contains default | |
41 | - values for elements (XML format).</p></li><li><p><tt>diarc</tt>: keeps | |
42 | - <b>dia</b> preferences (ASCII).</p></li><li><p><tt>history</tt>: keeps the list of last | |
43 | - edited diagrams (ASCII).</p></li><li><p><tt>menurc</tt>: contains an automated | |
44 | - accelerator map dump (Lisp).</p></li><li><p><tt>persistence</tt>: contains GUI | |
45 | - information, e.g. open windows (XML).</p></li><li><p><tt>pluginrc</tt>: the list of loaded | |
46 | - plugins (XML).</p></li></ul></div></div><div class="refsect1"><h2>See Also</h2><p><a href="http://www.pango.org/" target="_top">Pango</a></p><p>X (1)</p></div><div class="refsect1"><h2>Copyright</h2><p>Copyright 1999 Alexander Larsson.</p><p>Permission to use, copy, modify, and distribute this | |
47 | - software and its documentation for any purpose and without fee is | |
48 | - hereby granted, provided that the above copyright notice appear in | |
49 | - all copies and that both that copyright notice and this permission | |
50 | - notice appear in supporting documentation.</p></div><div class="refsect1"><h2>Authors</h2><p><span class="author">Alexander Larsson</span></p><p>This manual was written by | |
51 | - <span class="author">Fredrik Hallenberg</span>.</p></div></div></body></html> | |
1 | +.\" ** You probably do not want to edit this file directly ** | |
2 | +.\" It was generated using the DocBook XSL Stylesheets (version 1.69.0). | |
3 | +.\" Instead of manually editing it, you probably should edit the DocBook XML | |
4 | +.\" source for it and then use the DocBook XSL Stylesheets to regenerate it. | |
5 | +.TH "DIA" "1" "1999\-07\-03" "" "" | |
6 | +.\" disable hyphenation | |
7 | +.nh | |
8 | +.\" disable justification (adjust text to left margin only) | |
9 | +.ad l | |
10 | +.SH "NAME" | |
11 | +dia \- a diagram drawing program | |
12 | +.SH "SYNOPSIS" | |
13 | +.HP 4 | |
14 | +\fBdia\fR [\fB\-c\fR] [\fB\-\-credits\fR] [\fB\-e\ \fR\fB\fIOUTPUT\fR\fR] [\fB\-\-export=\fR\fB\fIOUTPUT\fR\fR] [\fB\-h\fR] [\fB\-\-help\fR] [\fB\-n\fR] [\fB\-\-nosplash\fR] [\fB\-s\ \fR\fB\fIWxH\fR\fR] [\fB\-\-size=\fR\fB\fIWxH\fR\fR] [\fB\-t\ \fR\fB\fIFORMAT\fR\fR] [\fB\-\-export\-to\-format=\fR\fB\fIFORMAT\fR\fR] [\fB\-v\fR] [\fB\-\-version\fR] [file\ ...] | |
15 | +.SH "DESCRIPTION" | |
16 | +.PP | |
17 | +\fBDia\fR | |
18 | +is used to create diagrams. Dia has a number of basic tools, like lines and boxes but can also dynamically load | |
19 | +\fIsheets\fR. A sheet is a collection of tools that are used in a certain type of diagram. | |
20 | +.PP | |
21 | +Most diagram objects in | |
22 | +\fBDia\fR | |
23 | +has | |
24 | +\fIhandles\fR. Lines can be connected to these handles and this way graph structures can be formed. When objects are moved or resized the connections will follow the objects. | |
25 | +.PP | |
26 | +Diagrams drawn in | |
27 | +\fBDia\fR | |
28 | +can be exported PostScript. | |
29 | +.SH "OPTIONS" | |
30 | +.PP | |
31 | +\fBDia\fR | |
32 | +accepts the following options: | |
33 | +.TP | |
34 | +\fB\-c\fR \fB\-\-credits\fR | |
35 | +Display credits list and exit. | |
36 | +.TP | |
37 | +\fB\-e \fR\fB\fIOUTPUT\fR\fR \fB\-\-export=\fR\fB\fIOUTPUT\fR\fR | |
38 | +Export loaded file to OUTPUT and exit. | |
39 | +.TP | |
40 | +\fB\-h\fR \fB\-\-help\fR | |
41 | +Display a list of all commandline options. | |
42 | +.TP | |
43 | +\fB\-n\fR \fB\-\-nosplash\fR | |
44 | +Do not show the splash screen. | |
45 | +.TP | |
46 | +\fB\-s \fR\fB\fIWxH\fR\fR \fB\-\-size=\fR\fB\fIWxH\fR\fR | |
47 | +Export loaded file in decimal given width and/or height. It is allowed to only select width or height. E.g. | |
48 | +\fB\-\-size=\fR\fB\fI520x\fR\fR | |
49 | +exports an image that is 520 pixels wide, while | |
50 | +\fB\-\-size=\fR\fB\fIx900\fR\fR | |
51 | +exports an image of 900 pixels height. | |
52 | +.sp | |
53 | +.it 1 an-trap | |
54 | +.nr an-no-space-flag 1 | |
55 | +.nr an-break-flag 1 | |
56 | +.br | |
57 | +\fBNote\fR | |
58 | +This option is currently only implemented for the PNG export filter. | |
59 | +.TP | |
60 | +\fB\-t \fR\fB\fIFORMAT\fR\fR \fB\-\-export\-to\-format=\fR\fB\fIFORMAT\fR\fR | |
61 | +Export loaded file in FORMAT and exit. Format are described below. | |
62 | +.TP | |
63 | +\fB\-v\fR \fB\-\-version\fR | |
64 | +Display | |
65 | +\fBdia\fR | |
66 | +version and exit. | |
67 | +.SH "EXPORT FORMATS" | |
68 | +.PP | |
69 | +The following export formats are supported by | |
70 | +\fBdia\fR. | |
71 | +.TP 3 | |
72 | +\(bu | |
73 | +cgm | |
74 | +(Computer Graphics Metafile, ISO 8632) | |
75 | +.TP | |
76 | +\(bu | |
77 | +dia | |
78 | +(Native dia diagram) | |
79 | +.TP | |
80 | +\(bu | |
81 | +dxf | |
82 | +(Drawing Interchange File) | |
83 | +.TP | |
84 | +\(bu | |
85 | +eps | |
86 | +or | |
87 | +epsi | |
88 | +or | |
89 | +eps\-builtin | |
90 | +or | |
91 | +eps\-pango | |
92 | +(Encapsulated PostScript) | |
93 | + | |
94 | +The format specifications | |
95 | +eps, | |
96 | +epsi, and | |
97 | +eps\-pango | |
98 | +all use the font renderer of the Pango library, while | |
99 | +eps\-builtin | |
100 | +uses a dia specific font renderer. If you have problems with Pango rendering, e.g. Unicode, try | |
101 | +eps\-builtin | |
102 | +instead. | |
103 | +.TP | |
104 | +\(bu | |
105 | +fig | |
106 | +(XFig format) | |
107 | +.TP | |
108 | +\(bu | |
109 | +mp | |
110 | +(TeX MetaPost macros) | |
111 | +.TP | |
112 | +\(bu | |
113 | +plt | |
114 | +or | |
115 | +hpgl | |
116 | +(HP Graphics Language) | |
117 | +.TP | |
118 | +\(bu | |
119 | +png | |
120 | +(Portable Network Graphics) | |
121 | +.TP | |
122 | +\(bu | |
123 | +shape | |
124 | +(Dia shape file) | |
125 | +.TP | |
126 | +\(bu | |
127 | +svg | |
128 | +(Scalable Vector Graphics) | |
129 | +.TP | |
130 | +\(bu | |
131 | +tex | |
132 | +(TeX PSTricks macros) | |
133 | +.TP | |
134 | +\(bu | |
135 | +wpg | |
136 | +(WordPerfect Graphics) | |
137 | +.TP | |
138 | +\(bu | |
139 | +wmf | |
140 | +(Windows MetaFile) | |
141 | +.SH "FILES" | |
142 | +.PP | |
143 | +\fBdia\fR | |
144 | +creates a directory | |
145 | +\fI.dia\fR | |
146 | +in the user's home, which contains different files to store user preferences. To reset | |
147 | +\fBdia\fR | |
148 | +to it's default behaviour, just remove the respective file: | |
149 | +.TP 3 | |
150 | +\(bu | |
151 | +\fIdefaults.dia\fR: contains default values for elements (XML format). | |
152 | +.TP | |
153 | +\(bu | |
154 | +\fIdiarc\fR: keeps | |
155 | +\fBdia\fR | |
156 | +preferences (ASCII). | |
157 | +.TP | |
158 | +\(bu | |
159 | +\fIhistory\fR: keeps the list of last edited diagrams (ASCII). | |
160 | +.TP | |
161 | +\(bu | |
162 | +\fImenurc\fR: contains an automated accelerator map dump (Lisp). | |
163 | +.TP | |
164 | +\(bu | |
165 | +\fIpersistence\fR: contains GUI information, e.g. open windows (XML). | |
166 | +.TP | |
167 | +\(bu | |
168 | +\fIpluginrc\fR: the list of loaded plugins (XML). | |
169 | +.SH "SEE ALSO" | |
170 | +.PP | |
171 | +[1]\&\fIPango\fR | |
172 | +.PP | |
173 | +X (1) | |
174 | +.SH "COPYRIGHT" | |
175 | +.PP | |
176 | +Copyright 1999 Alexander Larsson. | |
177 | +.PP | |
178 | +Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. | |
179 | +.SH "AUTHORS" | |
180 | +.PP | |
181 | +Alexander Larsson | |
182 | +.PP | |
183 | +This manual was written by | |
184 | +Fredrik Hallenberg. | |
185 | +.SH "AUTHOR" | |
186 | +Fredrik Hallenberg <hallon@lysator.liu.se>, W. Borgert <debacle@debian.org>. | |
187 | +.SH "REFERENCES" | |
188 | +.TP 3 | |
189 | +1.\ Pango | |
190 | +\%http://www.pango.org/ |
@@ -4,7 +4,7 @@ | ||
4 | 4 | |
5 | 5 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd" [ |
6 | 6 | |
7 | - <!ENTITY VERSION "0.95-pre4"> | |
7 | + <!ENTITY VERSION "0.95-pre5"> | |
8 | 8 | |
9 | 9 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
10 | 10 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
2 | 2 | |
3 | 3 | <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd"[ |
4 | -<!ENTITY VERSION "0.95-pre4"> | |
4 | +<!ENTITY VERSION "0.95-pre5"> | |
5 | 5 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
6 | 6 | <!ENTITY QUICKSTART SYSTEM "usage-quickstart.xml"> |
7 | 7 | <!ENTITY CANVAS SYSTEM "usage-canvas.xml"> |
@@ -0,0 +1,15 @@ | ||
1 | +This directory contains dia.spec files for various distributions. The | |
2 | +dia.spec file can be used as a template at first, but will be removed | |
3 | +later. Maintainers of Dia on various distributions should update the spec | |
4 | +files as things like package names change. The files should be named to | |
5 | +indicate which distribution they belong to, e.g. dia.spec.suse or | |
6 | +dia.spec.redhat.el3. | |
7 | + | |
8 | +This step has been necessary because distributions cannot agree to what | |
9 | +their packages are called, mainly, but also some other details differ, and | |
10 | +I will not spend my time trying to fix one file back and forth. If a | |
11 | +distribution maintainer does not have CVS access, I am willing to apply | |
12 | +patches for them. | |
13 | + | |
14 | +-Lars | |
15 | +11/3/2006 |
@@ -94,8 +94,8 @@ VIAddVersionKey "ProductName" "Dia for Windows" | ||
94 | 94 | VIAddVersionKey "CompanyName" "The Dia Developers" |
95 | 95 | VIAddVersionKey "LegalCopyright" "(c) 2003-2006 Alexander Larsson and others" |
96 | 96 | VIAddVersionKey "FileDescription" "Dia for Windows Installer" |
97 | -VIAddVersionKey "FileVersion" "0.95.0.4" | |
98 | -VIProductVersion "0.95.0.4" | |
97 | +VIAddVersionKey "FileVersion" "0.95.0.5" | |
98 | +VIProductVersion "0.95.0.5" | |
99 | 99 | |
100 | 100 | ;-------------------------------- |
101 | 101 | ;Modern UI Configuration |
@@ -26,6 +26,41 @@ | ||
26 | 26 | #include "connection.h" |
27 | 27 | #include "message.h" |
28 | 28 | |
29 | +/** Adjust connection endings for autogap. This function actually moves the | |
30 | + * ends of the connection, but only when the end is connected to | |
31 | + * a mainpoint. | |
32 | + */ | |
33 | +void | |
34 | +connection_adjust_for_autogap(Connection *connection) | |
35 | +{ | |
36 | + Point endpoints[2]; | |
37 | + ConnectionPoint *start_cp, *end_cp; | |
38 | + | |
39 | + start_cp = connection->endpoint_handles[0].connected_to; | |
40 | + end_cp = connection->endpoint_handles[1].connected_to; | |
41 | + | |
42 | + endpoints[0] = connection->endpoints[0]; | |
43 | + endpoints[1] = connection->endpoints[1]; | |
44 | + | |
45 | + if (connpoint_is_autogap(start_cp)) { | |
46 | + endpoints[0] = start_cp->pos; | |
47 | + } | |
48 | + if (connpoint_is_autogap(end_cp)) { | |
49 | + endpoints[1] = end_cp->pos; | |
50 | + } | |
51 | + | |
52 | + if (connpoint_is_autogap(start_cp)) { | |
53 | + connection->endpoints[0] = calculate_object_edge(&endpoints[0], | |
54 | + &endpoints[1], | |
55 | + start_cp->object); | |
56 | + } | |
57 | + if (connpoint_is_autogap(end_cp)) { | |
58 | + connection->endpoints[1] = calculate_object_edge(&endpoints[1], | |
59 | + &endpoints[0], | |
60 | + end_cp->object); | |
61 | + } | |
62 | +} | |
63 | + | |
29 | 64 | /** Function called to move one of the handles associated with the |
30 | 65 | * object. |
31 | 66 | * This is an object_ops function. |
@@ -51,6 +51,8 @@ ObjectChange* connection_move_handle(Connection *conn, HandleId id, | ||
51 | 51 | HandleMoveReason reason, |
52 | 52 | ModifierKeys modifiers); |
53 | 53 | |
54 | +void connection_adjust_for_autogap(Connection *conn); | |
55 | + | |
54 | 56 | /* base property stuff... */ |
55 | 57 | #define CONNECTION_COMMON_PROPERTIES \ |
56 | 58 | OBJECT_COMMON_PROPERTIES, \ |
@@ -965,7 +965,8 @@ draw_polygon (DiaRenderer *self, | ||
965 | 965 | static void |
966 | 966 | draw_object (DiaRenderer *renderer, DiaObject *object) |
967 | 967 | { |
968 | - if (object->highlight_color != NULL) { | |
968 | + if (renderer->is_interactive && | |
969 | + object->highlight_color != NULL) { | |
969 | 970 | DiaGdkRenderer *gdk_rend = DIA_GDK_RENDERER(renderer); |
970 | 971 | gdk_rend->highlight_color = object->highlight_color; |
971 | 972 | object->ops->draw(object, renderer); |
@@ -1331,7 +1331,8 @@ draw_image(DiaRenderer *self, | ||
1331 | 1331 | static void |
1332 | 1332 | draw_object (DiaRenderer *renderer, DiaObject *object) |
1333 | 1333 | { |
1334 | - if (object->highlight_color != NULL) { | |
1334 | + if (renderer->is_interactive && | |
1335 | + object->highlight_color != NULL) { | |
1335 | 1336 | DiaLibartRenderer *libart_rend = DIA_LIBART_RENDERER(renderer); |
1336 | 1337 | libart_rend->highlight_color = object->highlight_color; |
1337 | 1338 | object->ops->draw(object, renderer); |
@@ -889,7 +889,8 @@ dia_object_sanity_check(const DiaObject *obj, const gchar *msg) { | ||
889 | 889 | g_utf8_validate(cp->object->type->name, -1, NULL), |
890 | 890 | "%s: Handle %d (%p) on object %p connects to CP %p with untyped object %p\n", |
891 | 891 | msg, i, h, obj, cp, cp->object)) break; |
892 | - dia_assert_true(cp->pos.x == h->pos.x && cp->pos.y == h->pos.y, | |
892 | + dia_assert_true(fabs(cp->pos.x - h->pos.x) < 0.0000001 && | |
893 | + fabs(cp->pos.y - h->pos.y) < 0.0000001, | |
893 | 894 | "%s: Handle %d (%p) on object %p has pos %f, %f,\nbut its CP %p of object %p has pos %f, %f\n", |
894 | 895 | msg, i, h, obj, h->pos.x, h->pos.y, |
895 | 896 | cp, cp->object, cp->pos.x, cp->pos.y); |
@@ -470,6 +470,10 @@ flow_update_data(Flow *flow) | ||
470 | 470 | Rectangle rect; |
471 | 471 | Color* color = NULL; |
472 | 472 | |
473 | + if (connpoint_is_autogap(flow->connection.endpoint_handles[0].connected_to) || | |
474 | + connpoint_is_autogap(flow->connection.endpoint_handles[1].connected_to)) { | |
475 | + connection_adjust_for_autogap(flow); | |
476 | + } | |
473 | 477 | obj->position = conn->endpoints[0]; |
474 | 478 | |
475 | 479 | switch (flow->type) { |
@@ -629,6 +629,13 @@ link_update_data(Link *link) | ||
629 | 629 | Rectangle rect; |
630 | 630 | Point p1,p2,p3,p4,pa; |
631 | 631 | |
632 | +/* Too complex to easily decide */ | |
633 | +/* | |
634 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
635 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
636 | + connection_adjust_for_autogap(conn); | |
637 | + } | |
638 | +*/ | |
632 | 639 | obj->position = conn->endpoints[0]; |
633 | 640 | |
634 | 641 | link->pm_handle.pos = link->pm; |
@@ -377,6 +377,10 @@ message_update_data(Message *message) | ||
377 | 377 | DiaObject *obj = &conn->object; |
378 | 378 | Rectangle rect; |
379 | 379 | |
380 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
381 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
382 | + connection_adjust_for_autogap(conn); | |
383 | + } | |
380 | 384 | obj->position = conn->endpoints[0]; |
381 | 385 | |
382 | 386 | message->text_handle.pos = message->text_pos; |
@@ -578,7 +578,13 @@ maor_update_data(Maor *maor) | ||
578 | 578 | Rectangle rect; |
579 | 579 | Point p1,p2,p3,p4; |
580 | 580 | |
581 | - obj->position = conn->endpoints[0]; | |
581 | +/* Too complex to easily decide */ | |
582 | +/* | |
583 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
584 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
585 | + connection_adjust_for_autogap(conn); | |
586 | + } | |
587 | +*/ obj->position = conn->endpoints[0]; | |
582 | 588 | |
583 | 589 | maor->text_handle.pos = maor->text_pos; |
584 | 590 |
@@ -536,6 +536,13 @@ mbr_update_data(Mbr *mbr) | ||
536 | 536 | Point p3,p4; |
537 | 537 | gchar *text; |
538 | 538 | |
539 | +/* Too complex to easily decide */ | |
540 | +/* | |
541 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
542 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
543 | + connection_adjust_for_autogap(conn); | |
544 | + } | |
545 | +*/ | |
539 | 546 | obj->position = conn->endpoints[0]; |
540 | 547 | |
541 | 548 | mbr->pm_handle.pos = mbr->pm; |
@@ -399,6 +399,10 @@ annotation_update_data(Annotation *annotation) | ||
399 | 399 | DiaObject *obj = &conn->object; |
400 | 400 | Rectangle textrect; |
401 | 401 | |
402 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
403 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
404 | + connection_adjust_for_autogap(conn); | |
405 | + } | |
402 | 406 | obj->position = conn->endpoints[0]; |
403 | 407 | |
404 | 408 | annotation->text_handle.pos = annotation->text->position; |
@@ -909,18 +909,16 @@ umlclass_draw_operationbox(UMLClass *umlclass, DiaRenderer *renderer, Element *e | ||
909 | 909 | |
910 | 910 | wrapping_needed = 0; |
911 | 911 | if( umlclass->wrap_operations ) { |
912 | - wrapsublist = (GList*)g_list_nth( umlclass->operations_wrappos, i)->data; | |
913 | - wrapping_needed = GPOINTER_TO_INT( wrapsublist->data ); | |
912 | + wrapsublist = op->wrappos; | |
914 | 913 | } |
915 | 914 | |
916 | 915 | ascent = dia_font_ascent(opstr, font, font_height); |
916 | + op->ascent = ascent; | |
917 | 917 | renderer_ops->set_font(renderer, font, font_height); |
918 | 918 | |
919 | - if( umlclass->wrap_operations && wrapping_needed) { | |
920 | - | |
921 | - wrapsublist = g_list_next( wrapsublist); | |
922 | - ident = GPOINTER_TO_INT( wrapsublist->data); | |
923 | - wrapsublist = g_list_next( wrapsublist); | |
919 | + if( umlclass->wrap_operations && op->needs_wrapping) { | |
920 | + ident = op->wrap_indent; | |
921 | + wrapsublist = op->wrappos; | |
924 | 922 | wrap_pos = last_wrap_pos = 0; |
925 | 923 | |
926 | 924 | while( wrapsublist != NULL) { |
@@ -1192,10 +1190,15 @@ umlclass_update_data(UMLClass *umlclass) | ||
1192 | 1190 | op->right_connection->pos.y = y; |
1193 | 1191 | op->right_connection->directions = DIR_EAST; |
1194 | 1192 | |
1195 | - y += umlclass->font_height; | |
1193 | + if (op->needs_wrapping) { /* Wrapped */ | |
1194 | + int lines = g_list_length(op->wrappos); | |
1195 | + y += umlclass->font_height - op->ascent; | |
1196 | + y += op->ascent * lines; | |
1197 | + } else { | |
1198 | + y += umlclass->font_height; | |
1199 | + } | |
1196 | 1200 | if (umlclass->visible_comments && op->comment != NULL && op->comment[0] != '\0') |
1197 | - y += umlclass->comment_font_height; | |
1198 | - | |
1201 | + y += umlclass->comment_font_height; /* Not adjusted for wrap */ | |
1199 | 1202 | list = g_list_next(list); |
1200 | 1203 | } |
1201 | 1204 |
@@ -1292,12 +1295,6 @@ static real | ||
1292 | 1295 | umlclass_calculate_attribute_data(UMLClass *umlclass) |
1293 | 1296 | { |
1294 | 1297 | int i; |
1295 | - int pos_next_comma; | |
1296 | - int pos_brace; | |
1297 | - int wrap_pos; | |
1298 | - int last_wrap_pos; | |
1299 | - int maxlinewidth; | |
1300 | - int length; | |
1301 | 1298 | real maxwidth = 0.0; |
1302 | 1299 | real width = 0.0; |
1303 | 1300 | GList *list; |
@@ -1377,25 +1374,17 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1377 | 1374 | int pos_brace; |
1378 | 1375 | int wrap_pos; |
1379 | 1376 | int last_wrap_pos; |
1380 | - int ident; | |
1377 | + int indent; | |
1381 | 1378 | int offset; |
1382 | 1379 | int maxlinewidth; |
1383 | 1380 | int length; |
1384 | 1381 | real maxwidth = 0.0; |
1385 | 1382 | real width = 0.0; |
1386 | 1383 | GList *list; |
1387 | - GList *sublist; | |
1388 | 1384 | GList *wrapsublist; |
1389 | 1385 | |
1390 | 1386 | /* operations box: */ |
1391 | 1387 | umlclass->operationsbox_height = 2*0.1; |
1392 | - /* dont leak string wrappings */ | |
1393 | - if (umlclass->operations_wrappos != NULL) | |
1394 | - { | |
1395 | - g_list_foreach(umlclass->operations_wrappos, (GFunc)g_list_free, NULL); | |
1396 | - g_list_free(umlclass->operations_wrappos); | |
1397 | - umlclass->operations_wrappos = NULL; | |
1398 | - } | |
1399 | 1388 | |
1400 | 1389 | if (0 != g_list_length(umlclass->operations)) |
1401 | 1390 | { |
@@ -1405,35 +1394,60 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1405 | 1394 | { |
1406 | 1395 | UMLOperation *op = (UMLOperation *) list->data; |
1407 | 1396 | gchar *opstr = uml_get_operation_string(op); |
1397 | + DiaFont *Font; | |
1398 | + real FontHeight; | |
1399 | + | |
1400 | + length = strlen( (const gchar*)opstr); | |
1401 | + | |
1402 | + if (op->wrappos != NULL) { | |
1403 | + g_list_free(op->wrappos); | |
1404 | + } | |
1405 | + op->wrappos = NULL; | |
1406 | + | |
1407 | + switch(op->inheritance_type) | |
1408 | + { | |
1409 | + case UML_ABSTRACT: | |
1410 | + Font = umlclass->abstract_font; | |
1411 | + FontHeight = umlclass->abstract_font_height; | |
1412 | + break; | |
1413 | + case UML_POLYMORPHIC: | |
1414 | + Font = umlclass->polymorphic_font; | |
1415 | + FontHeight = umlclass->polymorphic_font_height; | |
1416 | + break; | |
1417 | + case UML_LEAF: | |
1418 | + default: | |
1419 | + Font = umlclass->normal_font; | |
1420 | + FontHeight = umlclass->font_height; | |
1421 | + } | |
1422 | + op->ascent = dia_font_ascent(opstr, Font, FontHeight); | |
1408 | 1423 | |
1409 | - length = 0; | |
1410 | 1424 | if( umlclass->wrap_operations ) |
1411 | 1425 | { |
1412 | - length = strlen( (const gchar*)opstr); | |
1413 | - sublist = NULL; | |
1414 | 1426 | if( length > umlclass->wrap_after_char) |
1415 | 1427 | { |
1416 | 1428 | gchar *part_opstr; |
1417 | - sublist = g_list_append( sublist, GINT_TO_POINTER( 1)); | |
1429 | + op->needs_wrapping = TRUE; | |
1418 | 1430 | |
1419 | 1431 | /* count maximal line width to create a secure buffer (part_opstr) |
1420 | 1432 | and build the sublist with the wrapping data for the current operation, which will be used by umlclass_draw(), too. |
1421 | - The content of the sublist is: | |
1422 | - 1st element: (bool) wrapping needed or not, 2nd: indentation in chars, 3rd-last: absolute wrapping positions */ | |
1423 | - pos_next_comma = pos_brace = wrap_pos = offset = maxlinewidth = umlclass->max_wrapped_line_width = 0; | |
1433 | + */ | |
1434 | + pos_next_comma = pos_brace = wrap_pos = offset | |
1435 | + = maxlinewidth = umlclass->max_wrapped_line_width = 0; | |
1424 | 1436 | while( wrap_pos + offset < length) |
1425 | 1437 | { |
1426 | 1438 | do |
1427 | 1439 | { |
1428 | 1440 | pos_next_comma = strcspn( (const gchar*)opstr + wrap_pos + offset, ","); |
1429 | 1441 | wrap_pos += pos_next_comma + 1; |
1430 | - } while( wrap_pos < umlclass->wrap_after_char - pos_brace && wrap_pos + offset < length); | |
1442 | + } while( wrap_pos < umlclass->wrap_after_char - pos_brace | |
1443 | + && wrap_pos + offset < length); | |
1431 | 1444 | |
1432 | 1445 | if( offset == 0){ |
1433 | 1446 | pos_brace = strcspn( opstr, "("); |
1434 | - sublist = g_list_append( sublist, GINT_TO_POINTER( pos_brace+1)); | |
1447 | + op->wrap_indent = pos_brace + 1; | |
1435 | 1448 | } |
1436 | - sublist = g_list_append( sublist, GINT_TO_POINTER( wrap_pos + offset)); | |
1449 | + op->wrappos = g_list_append(op->wrappos, | |
1450 | + GINT_TO_POINTER(wrap_pos + offset)); | |
1437 | 1451 | |
1438 | 1452 | maxlinewidth = MAX(maxlinewidth, wrap_pos); |
1439 | 1453 |
@@ -1442,17 +1456,13 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1442 | 1456 | } |
1443 | 1457 | umlclass->max_wrapped_line_width = MAX( umlclass->max_wrapped_line_width, maxlinewidth+1); |
1444 | 1458 | |
1445 | - wrapsublist = g_list_next( sublist); | |
1446 | - ident = GPOINTER_TO_INT( wrapsublist->data); | |
1447 | - part_opstr = g_alloca(umlclass->max_wrapped_line_width+ident+1); | |
1448 | - pos_next_comma = pos_brace = wrap_pos = offset = 0; | |
1459 | + indent = op->wrap_indent; | |
1460 | + part_opstr = g_alloca(umlclass->max_wrapped_line_width+indent+1); | |
1449 | 1461 | |
1450 | - wrapsublist = g_list_next( wrapsublist); | |
1462 | + wrapsublist = op->wrappos; | |
1451 | 1463 | wrap_pos = last_wrap_pos = 0; |
1452 | 1464 | |
1453 | 1465 | while( wrapsublist != NULL){ |
1454 | - DiaFont *Font; | |
1455 | - real FontHeight; | |
1456 | 1466 | wrap_pos = GPOINTER_TO_INT( wrapsublist->data); |
1457 | 1467 | if( last_wrap_pos == 0){ |
1458 | 1468 | strncpy( part_opstr, opstr, wrap_pos); |
@@ -1460,28 +1470,16 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1460 | 1470 | } |
1461 | 1471 | else |
1462 | 1472 | { |
1463 | - memset( part_opstr, ' ', ident); | |
1464 | - memset( part_opstr+ident, '\0', 1); | |
1473 | + memset( part_opstr, ' ', indent); | |
1474 | + memset( part_opstr+indent, '\0', 1); | |
1465 | 1475 | strncat( part_opstr, opstr+last_wrap_pos, wrap_pos-last_wrap_pos); |
1466 | 1476 | } |
1467 | 1477 | |
1468 | - switch(op->inheritance_type) | |
1469 | - { | |
1470 | - case UML_ABSTRACT: | |
1471 | - Font = umlclass->abstract_font; | |
1472 | - FontHeight = umlclass->abstract_font_height; | |
1473 | - break; | |
1474 | - case UML_POLYMORPHIC: | |
1475 | - Font = umlclass->polymorphic_font; | |
1476 | - FontHeight = umlclass->polymorphic_font_height; | |
1477 | - break; | |
1478 | - case UML_LEAF: | |
1479 | - default: | |
1480 | - Font = umlclass->normal_font; | |
1481 | - FontHeight = umlclass->font_height; | |
1482 | - } | |
1483 | 1478 | width = dia_font_string_width(part_opstr,Font,FontHeight); |
1484 | - umlclass->operationsbox_height += FontHeight; | |
1479 | + umlclass->operationsbox_height += op->ascent; | |
1480 | + if (last_wrap_pos == 0) { | |
1481 | + umlclass->operationsbox_height += (FontHeight - op->ascent); | |
1482 | + } | |
1485 | 1483 | |
1486 | 1484 | maxwidth = MAX(width, maxwidth); |
1487 | 1485 | last_wrap_pos = wrap_pos; |
@@ -1490,15 +1488,11 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1490 | 1488 | } |
1491 | 1489 | else |
1492 | 1490 | { |
1493 | - sublist = g_list_append( sublist, GINT_TO_POINTER( 0)); | |
1491 | + op->needs_wrapping = FALSE; | |
1494 | 1492 | } |
1495 | - umlclass->operations_wrappos = g_list_append( umlclass->operations_wrappos, sublist); | |
1496 | 1493 | } |
1497 | 1494 | |
1498 | - if( !umlclass->wrap_operations || !(length > umlclass->wrap_after_char)) { | |
1499 | - DiaFont *Font; | |
1500 | - real FontHeight; | |
1501 | - | |
1495 | + if (!(umlclass->wrap_operations && length > umlclass->wrap_after_char)) { | |
1502 | 1496 | switch(op->inheritance_type) |
1503 | 1497 | { |
1504 | 1498 | case UML_ABSTRACT: |
@@ -1532,7 +1526,8 @@ umlclass_calculate_operation_data(UMLClass *umlclass) | ||
1532 | 1526 | umlclass->comment_font_height); |
1533 | 1527 | |
1534 | 1528 | g_free(Wrapped); |
1535 | - umlclass->operationsbox_height += (umlclass->comment_font_height * (NumberOfLines+1)); | |
1529 | + umlclass->operationsbox_height += | |
1530 | + (umlclass->comment_font_height * (NumberOfLines+1)); | |
1536 | 1531 | |
1537 | 1532 | maxwidth = MAX(width, maxwidth); |
1538 | 1533 | } |
@@ -1568,21 +1563,10 @@ void | ||
1568 | 1563 | umlclass_calculate_data(UMLClass *umlclass) |
1569 | 1564 | { |
1570 | 1565 | int i; |
1571 | - int pos_next_comma; | |
1572 | - int pos_brace; | |
1573 | - int wrap_pos; | |
1574 | - int last_wrap_pos; | |
1575 | - int ident; | |
1576 | - int offset; | |
1577 | - int maxlinewidth; | |
1578 | - int length; | |
1579 | 1566 | int num_templates; |
1580 | 1567 | real maxwidth = 0.0; |
1581 | 1568 | real width; |
1582 | 1569 | GList *list; |
1583 | - GList *sublist; | |
1584 | - GList *wrapsublist; | |
1585 | - | |
1586 | 1570 | |
1587 | 1571 | if (!umlclass->destroyed) |
1588 | 1572 | { |
@@ -1748,7 +1732,6 @@ umlclass_create(Point *startpoint, | ||
1748 | 1732 | umlclass->formal_params = NULL; |
1749 | 1733 | |
1750 | 1734 | umlclass->stereotype_string = NULL; |
1751 | - umlclass->operations_wrappos = NULL; | |
1752 | 1735 | |
1753 | 1736 | umlclass->text_color = color_black; |
1754 | 1737 | umlclass->line_color = attributes_get_foreground(); |
@@ -1785,7 +1768,6 @@ umlclass_create(Point *startpoint, | ||
1785 | 1768 | static void |
1786 | 1769 | umlclass_destroy(UMLClass *umlclass) |
1787 | 1770 | { |
1788 | - int i; | |
1789 | 1771 | GList *list; |
1790 | 1772 | UMLAttribute *attr; |
1791 | 1773 | UMLOperation *op; |
@@ -1840,12 +1822,6 @@ umlclass_destroy(UMLClass *umlclass) | ||
1840 | 1822 | g_free(umlclass->stereotype_string); |
1841 | 1823 | } |
1842 | 1824 | |
1843 | - if (umlclass->operations_wrappos != NULL) { | |
1844 | - g_list_foreach(umlclass->operations_wrappos, (GFunc)g_list_free, NULL); | |
1845 | - g_list_free(umlclass->operations_wrappos); | |
1846 | - umlclass->operations_wrappos = NULL; | |
1847 | - } | |
1848 | - | |
1849 | 1825 | if (umlclass->properties_dialog != NULL) { |
1850 | 1826 | g_list_free(umlclass->properties_dialog->deleted_connections); |
1851 | 1827 | gtk_widget_destroy(umlclass->properties_dialog->dialog); |
@@ -1958,7 +1934,6 @@ umlclass_copy(UMLClass *umlclass) | ||
1958 | 1934 | newumlclass->properties_dialog = NULL; |
1959 | 1935 | |
1960 | 1936 | newumlclass->stereotype_string = NULL; |
1961 | - newumlclass->operations_wrappos = NULL; | |
1962 | 1937 | |
1963 | 1938 | for (i=0;i<UMLCLASS_CONNECTIONPOINTS;i++) { |
1964 | 1939 | newobj->connections[i] = &newumlclass->connections[i]; |
@@ -2250,7 +2225,6 @@ static DiaObject *umlclass_load(ObjectNode obj_node, int version, | ||
2250 | 2225 | fill_in_fontdata(umlclass); |
2251 | 2226 | |
2252 | 2227 | umlclass->stereotype_string = NULL; |
2253 | - umlclass->operations_wrappos = NULL; | |
2254 | 2228 | |
2255 | 2229 | umlclass_calculate_data(umlclass); |
2256 | 2230 |
@@ -126,7 +126,8 @@ struct _UMLClass { | ||
126 | 126 | real attributesbox_height; |
127 | 127 | |
128 | 128 | real operationsbox_height; |
129 | - GList *operations_wrappos; | |
129 | +/* | |
130 | + GList *operations_wrappos;*/ | |
130 | 131 | int max_wrapped_line_width; |
131 | 132 | |
132 | 133 | real templates_height; |
@@ -350,6 +350,10 @@ constraint_update_data(Constraint *constraint) | ||
350 | 350 | constraint->brtext = string_to_bracketted(constraint->text, "{", "}"); |
351 | 351 | } |
352 | 352 | |
353 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
354 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
355 | + connection_adjust_for_autogap(conn); | |
356 | + } | |
353 | 357 | obj->position = conn->endpoints[0]; |
354 | 358 | |
355 | 359 | constraint->text_width = dia_font_string_width(constraint->brtext, |
@@ -366,6 +366,10 @@ implements_update_data(Implements *implements) | ||
366 | 366 | implements_font, |
367 | 367 | IMPLEMENTS_FONTHEIGHT); |
368 | 368 | |
369 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
370 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
371 | + connection_adjust_for_autogap(conn); | |
372 | + } | |
369 | 373 | obj->position = conn->endpoints[0]; |
370 | 374 | |
371 | 375 | implements->text_handle.pos = implements->text_pos; |
@@ -420,6 +420,10 @@ message_update_data(Message *message) | ||
420 | 420 | DiaObject *obj = &conn->object; |
421 | 421 | Rectangle rect; |
422 | 422 | |
423 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
424 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
425 | + connection_adjust_for_autogap(conn); | |
426 | + } | |
423 | 427 | obj->position = conn->endpoints[0]; |
424 | 428 | |
425 | 429 | message->text_handle.pos = message->text_pos; |
@@ -92,8 +92,14 @@ struct _UMLOperation { | ||
92 | 92 | |
93 | 93 | ConnectionPoint* left_connection; /**< left */ |
94 | 94 | ConnectionPoint* right_connection; /**< right */ |
95 | + | |
96 | + gboolean needs_wrapping; /** Whether this operation needs wrapping */ | |
97 | + gint wrap_indent; /** The amount of indentation in chars */ | |
98 | + GList *wrappos; /** Absolute wrapping positions */ | |
99 | + real ascent; /** The ascent amount used for line distance in wrapping */ | |
95 | 100 | }; |
96 | 101 | |
102 | + | |
97 | 103 | /** \brief A list of UMLParameter is contained in UMLOperation |
98 | 104 | * Some would call them functions parameters ;) |
99 | 105 | */ |
@@ -108,15 +108,10 @@ uml_operation_new(void) | ||
108 | 108 | op = g_new0(UMLOperation, 1); |
109 | 109 | op->internal_id = next_id++; |
110 | 110 | op->name = g_strdup(""); |
111 | - op->type = NULL; | |
112 | - op->stereotype = NULL; | |
113 | 111 | op->comment = g_strdup(""); |
114 | 112 | op->visibility = UML_PUBLIC; |
115 | - op->class_scope = FALSE; | |
116 | 113 | op->inheritance_type = UML_LEAF; |
117 | - op->query = FALSE; | |
118 | 114 | |
119 | - op->parameters = NULL; | |
120 | 115 | #if 0 /* setup elsewhere */ |
121 | 116 | op->left_connection = g_new0(ConnectionPoint, 1); |
122 | 117 | op->right_connection = g_new0(ConnectionPoint, 1); |
@@ -238,6 +233,10 @@ uml_operation_destroy(UMLOperation *op) | ||
238 | 233 | uml_parameter_destroy(param); |
239 | 234 | list = g_list_next(list); |
240 | 235 | } |
236 | + if (op->wrappos) { | |
237 | + g_list_free(op->wrappos); | |
238 | + } | |
239 | + | |
241 | 240 | #if 0 /* freed elsewhere */ |
242 | 241 | /* These are merely temporary reminders, don't need to unconnect */ |
243 | 242 | g_free(op->left_connection); |
@@ -445,7 +445,16 @@ bus_update_data(Bus *bus) | ||
445 | 445 | Point *endpoints; |
446 | 446 | real ulen; |
447 | 447 | real min_par, max_par; |
448 | - | |
448 | + | |
449 | +/* | |
450 | + * This seems to break stuff wildly. | |
451 | + */ | |
452 | +/* | |
453 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
454 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
455 | + connection_adjust_for_autogap(conn); | |
456 | + } | |
457 | +*/ | |
449 | 458 | endpoints = &conn->endpoints[0]; |
450 | 459 | obj->position = endpoints[0]; |
451 | 460 |
@@ -380,6 +380,10 @@ wanlink_update_data(WanLink *wanlink) | ||
380 | 380 | width = wanlink->width; |
381 | 381 | width_2 = width / 2.0; |
382 | 382 | |
383 | + if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) || | |
384 | + connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) { | |
385 | + connection_adjust_for_autogap(conn); | |
386 | + } | |
383 | 387 | endpoints = &conn->endpoints[0]; |
384 | 388 | obj->position = endpoints[0]; |
385 | 389 |
@@ -85,8 +85,7 @@ static void line_save(Line *line, ObjectNode obj_node, const char *filename); | ||
85 | 85 | static DiaObject *line_load(ObjectNode obj_node, int version, const char *filename); |
86 | 86 | static DiaMenu *line_get_object_menu(Line *line, Point *clickedpoint); |
87 | 87 | |
88 | -void line_adjust_for_autogap(Line *line); | |
89 | -void line_adjust_for_absolute_gap(Line *line, Point *gap_endpoints); | |
88 | +void Line_adjust_for_absolute_gap(Line *line, Point *gap_endpoints); | |
90 | 89 | |
91 | 90 | static ObjectTypeOps line_type_ops = |
92 | 91 | { |
@@ -305,41 +304,6 @@ calculate_object_edge(Point *objmid, Point *end, DiaObject *obj) | ||
305 | 304 | } |
306 | 305 | |
307 | 306 | |
308 | -/** Adjust line endings for autogap. This function actually moves the | |
309 | - * ends of the line, but only when the end is connected to | |
310 | - * a mainpoint. | |
311 | - */ | |
312 | -void | |
313 | -line_adjust_for_autogap(Line *line) | |
314 | -{ | |
315 | - Point endpoints[2]; | |
316 | - ConnectionPoint *start_cp, *end_cp; | |
317 | - | |
318 | - start_cp = line->connection.endpoint_handles[0].connected_to; | |
319 | - end_cp = line->connection.endpoint_handles[1].connected_to; | |
320 | - | |
321 | - endpoints[0] = line->connection.endpoints[0]; | |
322 | - endpoints[1] = line->connection.endpoints[1]; | |
323 | - | |
324 | - if (connpoint_is_autogap(start_cp)) { | |
325 | - endpoints[0] = start_cp->pos; | |
326 | - } | |
327 | - if (connpoint_is_autogap(end_cp)) { | |
328 | - endpoints[1] = end_cp->pos; | |
329 | - } | |
330 | - | |
331 | - if (connpoint_is_autogap(start_cp)) { | |
332 | - line->connection.endpoints[0] = calculate_object_edge(&endpoints[0], | |
333 | - &endpoints[1], | |
334 | - start_cp->object); | |
335 | - } | |
336 | - if (connpoint_is_autogap(end_cp)) { | |
337 | - line->connection.endpoints[1] = calculate_object_edge(&endpoints[1], | |
338 | - &endpoints[0], | |
339 | - end_cp->object); | |
340 | - } | |
341 | -} | |
342 | - | |
343 | 307 | /** Calculate the absolute gap -- this gap is 'transient', in that |
344 | 308 | * the actual end of the line is not moved, but it is made to look like |
345 | 309 | * it is shorter. |
@@ -560,7 +524,7 @@ line_update_data(Line *line) | ||
560 | 524 | |
561 | 525 | if (connpoint_is_autogap(line->connection.endpoint_handles[0].connected_to) || |
562 | 526 | connpoint_is_autogap(line->connection.endpoint_handles[1].connected_to)) { |
563 | - line_adjust_for_autogap(line); | |
527 | + connection_adjust_for_autogap(line); | |
564 | 528 | } |
565 | 529 | if (line->absolute_start_gap || line->absolute_end_gap ) { |
566 | 530 | Point gap_endpoints[2]; |
@@ -441,11 +441,17 @@ create_standard_group(GList *items, DiagramData *dia) { | ||
441 | 441 | static Color |
442 | 442 | fig_color(int color_index) |
443 | 443 | { |
444 | - if (color_index == -1) | |
444 | + if (color_index <= -1) | |
445 | 445 | return color_black; /* Default color */ |
446 | - if (color_index < FIG_MAX_DEFAULT_COLORS) | |
446 | + else if (color_index < FIG_MAX_DEFAULT_COLORS) | |
447 | 447 | return fig_default_colors[color_index]; |
448 | - else return fig_colors[color_index-FIG_MAX_DEFAULT_COLORS]; | |
448 | + else if (color_index < FIG_MAX_USER_COLORS) | |
449 | + return fig_colors[color_index-FIG_MAX_DEFAULT_COLORS]; | |
450 | + else { | |
451 | + message_error(_("Color index %d too high, only 512 colors allowed. Using black instead."), | |
452 | + color_index); | |
453 | + return color_black; | |
454 | + } | |
449 | 455 | } |
450 | 456 | |
451 | 457 | static Color |
@@ -563,23 +569,25 @@ fig_simple_properties(DiaObject *obj, | ||
563 | 569 | static int |
564 | 570 | fig_read_n_points(FILE *file, int n, Point **points) { |
565 | 571 | int i; |
566 | - Point *new_points; | |
567 | - | |
568 | - new_points = (Point*)g_malloc(sizeof(Point)*n); | |
572 | + GArray *points_list = g_array_sized_new(FALSE, FALSE, sizeof(Point), n); | |
569 | 573 | |
570 | 574 | for (i = 0; i < n; i++) { |
571 | 575 | int x,y; |
576 | + Point p; | |
572 | 577 | if (fscanf(file, " %d %d ", &x, &y) != 2) { |
573 | 578 | message_error(_("Error while reading %dth of %d points: %s\n"), |
574 | 579 | i, n, strerror(errno)); |
575 | - g_free(new_points); | |
580 | + g_array_free(points, TRUE); | |
576 | 581 | return FALSE; |
577 | 582 | } |
578 | - new_points[i].x = x/FIG_UNIT; | |
579 | - new_points[i].y = y/FIG_UNIT; | |
583 | + p.x = x/FIG_UNIT; | |
584 | + p.y = y/FIG_UNIT; | |
585 | + g_array_append_val(points_list, p); | |
580 | 586 | } |
581 | 587 | fscanf(file, "\n"); |
582 | - *points = new_points; | |
588 | + | |
589 | + *points = (Point *)points_list->data; | |
590 | + g_array_free(points, FALSE); | |
583 | 591 | return TRUE; |
584 | 592 | } |
585 | 593 |
@@ -698,6 +706,26 @@ static GSList *compound_stack = NULL; | ||
698 | 706 | level. Best we can do now. */ |
699 | 707 | static int compound_depth; |
700 | 708 | |
709 | +/** Add an object at a given depth. This function checks for depth limits | |
710 | + * and updates the compound depth if needed. | |
711 | + * | |
712 | + * @param newobj An object to add. If we're inside a compound, this | |
713 | + * doesn't really add the object. | |
714 | + * @param depth A depth as in the Fig format, max 999 | |
715 | + */ | |
716 | +static void | |
717 | +add_at_depth(DiaObject *newobj, int depth) { | |
718 | + if (depth < 0 || depth >= FIG_MAX_DEPTHS) { | |
719 | + message_error(_("Depth %d of of range, only 0-%d allowed.\n"), | |
720 | + depth, FIG_MAX_DEPTHS-1); | |
721 | + depth = FIG_MAX_DEPTHS - 1; | |
722 | + } | |
723 | + if (compound_stack == NULL) | |
724 | + depths[depth] = g_list_append(depths[depth], newobj); | |
725 | + else | |
726 | + if (compound_depth > depth) compound_depth = depth; | |
727 | +} | |
728 | + | |
701 | 729 | static DiaObject * |
702 | 730 | fig_read_ellipse(FILE *file, DiagramData *dia) { |
703 | 731 | int sub_type; |
@@ -758,10 +786,7 @@ fig_read_ellipse(FILE *file, DiagramData *dia) { | ||
758 | 786 | /* Angle -- can't rotate yet */ |
759 | 787 | |
760 | 788 | /* Depth field */ |
761 | - if (compound_stack == NULL) | |
762 | - depths[depth] = g_list_append(depths[depth], newobj); | |
763 | - else | |
764 | - if (compound_depth > depth) compound_depth = depth; | |
789 | + add_at_depth(newobj, depth); | |
765 | 790 | |
766 | 791 | return newobj; |
767 | 792 | } |
@@ -896,10 +921,7 @@ fig_read_polyline(FILE *file, DiagramData *dia) { | ||
896 | 921 | /* Cap style */ |
897 | 922 | |
898 | 923 | /* Depth field */ |
899 | - if (compound_stack == NULL) | |
900 | - depths[depth] = g_list_append(depths[depth], newobj); | |
901 | - else | |
902 | - if (compound_depth > depth) compound_depth = depth; | |
924 | + add_at_depth(newobj, depth); | |
903 | 925 | exit: |
904 | 926 | setlocale(LC_NUMERIC, old_locale); |
905 | 927 | prop_list_free(props); |
@@ -1125,10 +1147,7 @@ fig_read_spline(FILE *file, DiagramData *dia) { | ||
1125 | 1147 | /* Cap style */ |
1126 | 1148 | |
1127 | 1149 | /* Depth field */ |
1128 | - if (compound_stack == NULL) | |
1129 | - depths[depth] = g_list_append(depths[depth], newobj); | |
1130 | - else | |
1131 | - if (compound_depth > depth) compound_depth = depth; | |
1150 | + add_at_depth(newobj, depth); | |
1132 | 1151 | exit: |
1133 | 1152 | setlocale(LC_NUMERIC, old_locale); |
1134 | 1153 | prop_list_free(props); |
@@ -1219,10 +1238,7 @@ fig_read_arc(FILE *file, DiagramData *dia) { | ||
1219 | 1238 | /* Cap style */ |
1220 | 1239 | |
1221 | 1240 | /* Depth field */ |
1222 | - if (compound_stack == NULL) | |
1223 | - depths[depth] = g_list_append(depths[depth], newobj); | |
1224 | - else | |
1225 | - if (compound_depth > depth) compound_depth = depth; | |
1241 | + add_at_depth(newobj, depth); | |
1226 | 1242 | |
1227 | 1243 | exit: |
1228 | 1244 | setlocale(LC_NUMERIC, old_locale); |
@@ -1319,10 +1335,7 @@ fig_read_text(FILE *file, DiagramData *dia) { | ||
1319 | 1335 | newobj->ops->set_props(newobj, props); |
1320 | 1336 | |
1321 | 1337 | /* Depth field */ |
1322 | - if (compound_stack == NULL) | |
1323 | - depths[depth] = g_list_append(depths[depth], newobj); | |
1324 | - else | |
1325 | - if (compound_depth > depth) compound_depth = depth; | |
1338 | + add_at_depth(newobj, depth); | |
1326 | 1339 | |
1327 | 1340 | exit: |
1328 | 1341 | setlocale(LC_NUMERIC, old_locale); |
@@ -1369,6 +1382,12 @@ fig_read_object(FILE *file, DiagramData *dia) { | ||
1369 | 1382 | return FALSE; |
1370 | 1383 | } |
1371 | 1384 | |
1385 | + if (colornumber < 0 || colornumber > FIG_MAX_USER_COLORS) { | |
1386 | + message_error(_("Color number %d out of range 0..%d. Discarding color.\n"), | |
1387 | + colornumber, FIG_MAX_USER_COLORS); | |
1388 | + return FALSE; | |
1389 | + } | |
1390 | + | |
1372 | 1391 | color.red = ((colorvalues & 0x00ff0000)>>16) / 255.0; |
1373 | 1392 | color.green = ((colorvalues & 0x0000ff00)>>8) / 255.0; |
1374 | 1393 | color.blue = (colorvalues & 0x000000ff) / 255.0; |
@@ -1415,7 +1434,7 @@ fig_read_object(FILE *file, DiagramData *dia) { | ||
1415 | 1434 | } |
1416 | 1435 | /* Group extends don't really matter */ |
1417 | 1436 | if (compound_stack == NULL) |
1418 | - compound_depth = 999; | |
1437 | + compound_depth = FIG_MAX_DEPTHS - 1; | |
1419 | 1438 | compound_stack = g_slist_append(compound_stack, NULL); |
1420 | 1439 | return TRUE; |
1421 | 1440 | break; |
@@ -1577,7 +1596,7 @@ import_fig(const gchar *filename, DiagramData *dia, void* user_data) { | ||
1577 | 1596 | for (i = 0; i < FIG_MAX_USER_COLORS; i++) { |
1578 | 1597 | fig_colors[i] = color_black; |
1579 | 1598 | } |
1580 | - for (i = 0; i < 1000; i++) { | |
1599 | + for (i = 0; i < FIG_MAX_DEPTHS; i++) { | |
1581 | 1600 | depths[i] = NULL; |
1582 | 1601 | } |
1583 | 1602 |
@@ -1633,7 +1652,7 @@ import_fig(const gchar *filename, DiagramData *dia, void* user_data) { | ||
1633 | 1652 | } while (TRUE); |
1634 | 1653 | |
1635 | 1654 | /* Now we can reorder for the depth fields */ |
1636 | - for (i = 0; i < 1000; i++) { | |
1655 | + for (i = 0; i < FIG_MAX_DEPTHS; i++) { | |
1637 | 1656 | if (depths[i] != NULL) |
1638 | 1657 | layer_add_objects_first(dia->active_layer, depths[i]); |
1639 | 1658 | } |
@@ -6,6 +6,7 @@ extern char *fig_fonts[]; | ||
6 | 6 | |
7 | 7 | #define FIG_MAX_DEFAULT_COLORS 32 |
8 | 8 | #define FIG_MAX_USER_COLORS 512 |
9 | +#define FIG_MAX_DEPTHS 1000 | |
9 | 10 | /* 1200 PPI */ |
10 | 11 | #define FIG_UNIT 472.440944881889763779527559055118 |
11 | 12 | /* 1/80 inch */ |