• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revisiond91dbf3ca984722463db8d5e27bcef08a584b991 (tree)
Time2004-05-26 16:09:34
AuthorLars Clausen <lclausen@src....>
CommiterLars Clausen

Log Message

Fix shape bug, help bug, and man page generation bug.

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
1+2004-05-26 Lars Clausen <lars@raeder.dk>
2+
3+ * config.h.win32:
4+ * NEWS:
5+ * configure.in:
6+ * dia.spec (Release):
7+ * doc/pl/dia.xml:
8+ * doc/en/dia.xml:
9+ Brown-bag release 0.93.1
10+
11+ * app/Makefile.am (run_dia.sh$(EXEEXT)): Use $@ instead of $* to
12+ allow more than one argument along with arguments with spaces.
13+
14+2004-05-25 Lars Clausen <lars@raeder.dk>
15+
16+ * app/app_procs.c (app_init): Make --help and other options work
17+ without popt installed.
18+
19+ * doc/pl/Makefile.am (EXTRA_DIST): Distribute all the xml pages.
20+
21+ * doc/en/Makefile.am (dia.1): Make the manpages automagically.
22+ Also distribute all of the xml pages.
23+
24+ * configure.in (DB2MAN): Check for docbook.xsl in several
25+ different places where itøs been known to appear, in lieu of a
26+ proper way to ask for its presence.
27+
28+ * objects/custom/custom_object.c (custom_load_using_properties):
29+ Up the version and handle reading old version diagrams. Now uses
30+ correct names for the standard properties.
31+
132 2004-05-17 Hans Breuer <hans@breuer.org>
233
334 * lib/object_defaults.c : don't 'failed to load external
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
1+dia-0.93.1: 25-May-2004
2+
3+Brown bag release due to shapes properties bug. Also fixes problems
4+with options when no popt is present, and distribution of docs.
5+
6+dia-0.93: 29-Apr-2004
7+
8+Ready for release.
9+
110 dia-0.93-pre2: 04-Apr-2004
211
312 Fixed crash bug in ellipse, plus various compilation problems. Also
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -244,9 +244,9 @@ run_dia.sh$(EXEEXT): Makefile.am
244244 echo " echo \"please run \$$0 once without a debugger.\"" >> run_dia.sh
245245 echo " exit 1" >> run_dia.sh
246246 echo " fi" >> run_dia.sh
247- echo " \$$DEBUGGER \"\$$DIA_LIBS_PATH/lt-dia\" \"\$$*\"" >> run_dia.sh
247+ echo " \$$DEBUGGER \"\$$DIA_LIBS_PATH/lt-dia\" \"\$$@\"" >> run_dia.sh
248248 echo "else" >> run_dia.sh
249- echo " \"\$$DIA_APP_PATH/dia\" \"\$$*\"" >> run_dia.sh
249+ echo " \"\$$DIA_APP_PATH/dia\" \"\$$@\"" >> run_dia.sh
250250 echo "fi" >> run_dia.sh
251251 chmod a+x run_dia.sh
252252
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -102,6 +102,9 @@ static PluginInitResult internal_plugin_init(PluginInfo *info);
102102 static void process_opts(int argc, char **argv,
103103 #ifdef HAVE_POPT
104104 poptContext poptCtx, struct poptOption options[],
105+#else
106+ gboolean *nosplash, gboolean *credits,
107+ gboolean *version, gboolean *logtostderr,
105108 #endif
106109 GSList **files, char **export_file_name,
107110 char **export_file_format, char **size);
@@ -428,6 +431,9 @@ app_init (int argc, char **argv)
428431 process_opts(argc, argv,
429432 #ifdef HAVE_POPT
430433 poptCtx, options,
434+#else
435+ &nosplash, &credits,
436+ &version, &log_to_stderr,
431437 #endif
432438 &files,
433439 &export_file_name, &export_file_format, &size);
@@ -737,6 +743,9 @@ static void
737743 process_opts(int argc, char **argv,
738744 #ifdef HAVE_POPT
739745 poptContext poptCtx, struct poptOption options[],
746+#else
747+ gboolean *nosplash, gboolean *credits,
748+ gboolean *version, gboolean *logtostderr,
740749 #endif
741750 GSList **files, char **export_file_name,
742751 char **export_file_format, char **size)
@@ -774,26 +783,69 @@ process_opts(int argc, char **argv,
774783
775784 for (i=1; i<argc; i++) {
776785 char *in_file_name = argv[i]; /* unless it's an option... */
777-
786+ printf("Arg %i: `%s'\n", i, argv[i]);
778787 if (0==strcmp(argv[i],"-t")) {
779788 if (i < (argc-1)) {
780789 i++;
781790 *export_file_format = argv[i];
782791 continue;
783792 }
793+ } else if (0==strncmp(argv[i],"--export-to-format=",19)) {
794+ *export_file_format = &argv[i][19];
795+ continue;
784796 } else if (0 == strcmp(argv[i],"-e")) {
785797 if (i < (argc-1)) {
786798 i++;
787799 *export_file_name = argv[i];
788800 continue;
789801 }
802+ } else if (0==strncmp(argv[i],"--export=", 9)) {
803+ *export_file_name = &argv[i][9];
804+ continue;
790805 } else if (0 == strcmp(argv[i],"-s")) {
791806 if (i < (argc-1)) {
792807 i++;
793808 *size = argv[i];
794809 continue;
795810 }
796- }
811+ } else if (0==strncmp(argv[i],"--size=",7)) {
812+ *size = &argv[i][7];
813+ continue;
814+ } else if (0 == strcmp(argv[i],"-n") ||
815+ 0 == strcmp(argv[i],"--nosplash")) {
816+ *nosplash = TRUE;
817+ continue;
818+ } else if (0 == strcmp(argv[i],"-l") ||
819+ 0 == strcmp(argv[i],"--log-to-stderr")) {
820+ *logtostderr = TRUE;
821+ continue;
822+ } else if (0 == strcmp(argv[i],"-c") ||
823+ 0 == strcmp(argv[i],"--credits")) {
824+ *credits = TRUE;
825+ continue;
826+ } else if (0 == strcmp(argv[i],"-v") ||
827+ 0 == strcmp(argv[i],"--version")) {
828+ *version = TRUE;
829+ continue;
830+ } else if (0 == strcmp(argv[i],"-h") ||
831+ 0==strcmp(argv[i],"--help")) {
832+ /* Taken by running dia --help with popt enabled */
833+ printf("Usage: dia [OPTION...] [FILE...]
834+ -e, --export=OUTPUT Export loaded file and exit
835+ -t, --export-to-format=FORMAT Export to file format and exit. Supported
836+ formats are: cgm, dia, dxf, eps,
837+ eps-pango, fig, mp, plt, hpgl, png, shape,
838+ svg, tex, wpg
839+ -s, --size=WxH Export graphics size
840+ -n, --nosplash Don't show the splash screen
841+ -l, --log-to-stderr Send error messages to stderr instead of
842+ showing dialogs.
843+ -c, --credits Display credits list and exit
844+ -v, --version Display version and exit
845+ -h, --help Show this help message
846+");
847+ exit(0);
848+ }
797849 *files = g_slist_append(*files, in_file_name);
798850 }
799851 #endif
--- a/config.h.win32
+++ b/config.h.win32
@@ -15,7 +15,7 @@
1515 #define GETTEXT_PACKAGE "dia"
1616 #define LOCALEDIR "../lib/locale"
1717
18-#define VERSION "0.93-pre2"
18+#define VERSION "0.93.1"
1919
2020 /*
2121 * We are linking libxml as DLL with either msvc or mingw, but this
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
11 dnl Process this -*- autoconf -*- file with autoconf to produce a
22 dnl configure script.
3-AC_INIT(dia, 0.93-pre2, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
3+AC_INIT(dia, 0.93.1, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
44 AC_CONFIG_SRCDIR(app/diagram.c)
55 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
66
@@ -148,10 +148,10 @@ dnl
148148 dnl Popt
149149 dnl
150150
151-AC_CHECK_LIB(popt, poptSetOtherOptionHelp, [
151+AC_CHECK_LIB(popt, potSetOtherOptionHelp, [
152152 AC_DEFINE(HAVE_LIBPOPT,,[popt library available])
153153 POPT_LIBS="-lpopt"])
154-AC_CHECK_HEADERS(popt.h)
154+AC_CHECK_HEADERS(pot.h)
155155 AC_SUBST(POPT_LIBS)
156156 APP_LIBS="$APP_LIBS $POPT_LIBS"
157157
@@ -369,6 +369,20 @@ AC_PATH_PROG(DB2HTML, db2html, no)
369369 AM_CONDITIONAL(HAVE_DB2HTML,
370370 test "x$enable_db2html" != xno && test "x$DB2HTML" != xno)
371371
372+dnl Only enable man page generation if we have db2man
373+
374+AC_SUBST(DB2MAN)
375+dnl Have to have the nwalsh docbook.xsl, which does manpages.
376+dnl RedHat installs it in a version-numbered place. Grumpf.
377+db2man_file=
378+for file in \
379+ /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl \
380+ /usr/share/sgml/docbook/xsl-stylesheets-\*/manpages/docbook.xsl; do
381+ if test -f $file; then db2man_file=$file; break; fi
382+done
383+AM_CONDITIONAL(HAVE_DB2MAN, test "x$db2man_file" != x)
384+AC_SUBST(DB2MAN, "$db2man_file")
385+
372386 dnl Handling for Python
373387 AC_ARG_WITH(python,
374388 [ --with-python compile python plug-in],,with_python=no)
--- a/dia.spec
+++ b/dia.spec
@@ -1,12 +1,12 @@
11 %define name dia
22 # This is the full Dia version
3-%define ver 0.93
3+%define ver 0.93.1
44
55 Summary: A gtk+ based diagram creation program.
66 Name: %name
77 Version: %ver
88 # This indicates changes to the spec file after last time %ver has changed.
9-Release: pre2
9+Release: 1
1010 Copyright: GPL
1111 Group: Applications/
1212 Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz
--- a/doc/en/Makefile.am
+++ b/doc/en/Makefile.am
@@ -9,10 +9,30 @@ dist-hook: app-dist-hook
99
1010 EXTRA_DIST += \
1111 dia.1 \
12+ dia.dbk \
13+ authors.xml \
1214 dia.xml \
15+ entities.xml \
16+ intro.xml \
17+ license.xml \
18+ usage-canvas.xml \
19+ usage-customization.xml \
20+ usage-layers.xml \
21+ usage-loadsave.xml \
22+ usage-objects-basic.xml \
23+ usage-objects-selecting.xml \
24+ usage-objects-special.xml \
25+ usage-objects.xml \
26+ usage-quickstart.xml \
1327 graphics/line_props.png \
1428 graphics/home_network.png \
1529 graphics/line_icon.png \
1630 graphics/greendots.png
1731
1832 man_MANS = dia.1
33+
34+# Can't have dia.1 automatically created from dia.dbk if we have no DB2MAN
35+if HAVE_DB2MAN
36+dia.1: dia.dbk
37+ xsltproc --nonet --novalid $(DB2MAN) dia.dbk >dia.1
38+endif
--- a/doc/en/dia.1
+++ b/doc/en/dia.1
@@ -21,13 +21,12 @@
2121 .SH NAME
2222 dia \- a diagram drawing program
2323 .SH "SYNOPSIS"
24-
25-.nf
26-\fBdia\fR [\fB-c\fR] [\fB--credits\fR] [\fB-e \fIOUTPUT\fR\fR] [\fB--export=\fIOUTPUT\fR\fR]
27- [\fB-h\fR] [\fB--help\fR] [\fB-n\fR] [\fB--nosplash\fR] [\fB-t \fIFORMAT\fR\fR]
28- [\fB--export-to-format=\fIFORMAT\fR\fR] [\fB-v\fR] [\fB--version\fR] [file
29- \&.\&.\&.]
30-.fi
24+.ad l
25+.hy 0
26+.HP 4
27+\fBdia\fR [\fB\-c\fR] [\fB\-\-credits\fR] [\fB\-e\ \fIOUTPUT\fR\fR] [\fB\-\-export=\fIOUTPUT\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
3130
3231 .SH "DESCRIPTION"
3332
@@ -46,27 +45,32 @@ Diagrams drawn in \fBDia\fR can be exported PostScript\&.
4645 \fBDia\fR accepts the following options:
4746
4847 .TP
49-\fB-c\fR \fB--credits\fR
48+\fB\-c\fR \fB\-\-credits\fR
5049 Display credits list and exit\&.
5150
5251 .TP
53-\fB-e \fIOUTPUT\fR\fR \fB--export=\fIOUTPUT\fR\fR
52+\fB\-e \fIOUTPUT\fR\fR \fB\-\-export=\fIOUTPUT\fR\fR
5453 Export loaded file to OUTPUT and exit\&.
5554
5655 .TP
57-\fB-h\fR \fB--help\fR
56+\fB\-h\fR \fB\-\-help\fR
5857 Display a list of all commandline options\&.
5958
6059 .TP
61-\fB-n\fR \fB--nosplash\fR
60+\fB\-n\fR \fB\-\-nosplash\fR
6261 Do not show the splash screen\&.
6362
6463 .TP
65-\fB-t \fIFORMAT\fR\fR \fB--export-to-format=\fIFORMAT\fR\fR
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+This option is currently only implemented for the PNG export filter\&.
67+
68+.TP
69+\fB\-t \fIFORMAT\fR\fR \fB\-\-export\-to\-format=\fIFORMAT\fR\fR
6670 Export loaded file in FORMAT and exit\&. Format are described below\&.
6771
6872 .TP
69-\fB-v\fR \fB--version\fR
73+\fB\-v\fR \fB\-\-version\fR
7074 Display \fBdia\fR version and exit\&.
7175
7276 .SH "EXPORT FORMATS"
@@ -85,9 +89,9 @@ dia (Native dia diagram)
8589 dxf (Drawing Interchange File)
8690 .TP
8791 \(bu
88-eps or epsi or eps-builtin or eps-pango (Encapsulated PostScript)
92+eps or epsi or eps\-builtin or eps\-pango (Encapsulated PostScript)
8993
90-The format specifications eps, epsi, and eps-pango all use the font renderer of the Pango library, while eps-builtin uses a dia specific font renderer\&. If you have problems with Pango rendering, e\&.g\&. Unicode, try eps-builtin instead\&.
94+The format specifications eps, epsi, and eps\-pango all use the font renderer of the Pango library, while eps\-builtin uses a dia specific font renderer\&. If you have problems with Pango rendering, e\&.g\&. Unicode, try eps\-builtin instead\&.
9195 .TP
9296 \(bu
9397 fig (XFig format)
--- a/doc/en/dia.xml
+++ b/doc/en/dia.xml
@@ -8,7 +8,7 @@
88
99 [
1010
11- <!ENTITY VERSION "0.93-pre2">
11+ <!ENTITY VERSION "0.93.1">
1212
1313 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
1414
--- a/doc/pl/Makefile.am
+++ b/doc/pl/Makefile.am
@@ -8,7 +8,18 @@ include $(top_srcdir)/xmldocs.make
88 dist-hook: app-dist-hook
99
1010 EXTRA_DIST += \
11+ authors.xml \
1112 dia.xml \
13+ intro.xml \
14+ license.xml \
15+ usage-canvas.xml \
16+ usage-customization.xml \
17+ usage-layers.xml \
18+ usage-loadsave.xml \
19+ usage-objects-selecting.xml \
20+ usage-objects-special.xml \
21+ usage-objects.xml \
22+ usage-quickstart.xml \
1223 graphics/line_props.png \
1324 graphics/home_network.png \
1425 graphics/greendots.png
--- a/doc/pl/dia.xml
+++ b/doc/pl/dia.xml
@@ -1,7 +1,7 @@
11 <?xml version="1.0" encoding="iso-8859-1"?>
22
33 <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd"[
4-<!ENTITY VERSION "0.93-pre2">
4+<!ENTITY VERSION "0.93.1">
55 <!ENTITY INTRODUCTION SYSTEM "intro.sgml">
66 <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml">
77 <!ENTITY CANVAS SYSTEM "usage-canvas.sgml">
--- a/objects/custom/custom_object.c
+++ b/objects/custom/custom_object.c
@@ -138,6 +138,13 @@ static ObjectTypeOps custom_type_ops =
138138 (ApplyDefaultsFunc) NULL
139139 };
140140
141+/* Version history for save file format for custom objects:
142+0: Initial version
143+1: Changed to use standard names for standard properties
144+ (border_width -> line_width, inner_color->fill_colour,
145+ border_color -> line_colour, line_style+dashlength -> line_style)
146+*/
147+
141148 /* This looks like it could be static, but it can't because we key
142149 on it to determine if an ObjectType is a custom/SVG shape */
143150
@@ -145,7 +152,7 @@ G_MODULE_EXPORT
145152 ObjectType custom_type =
146153 {
147154 "Custom - Generic", /* name */
148- 0, /* version */
155+ 1, /* version */
149156 (char **) custom_xpm, /* pixmap */
150157
151158 &custom_type_ops /* ops */
@@ -1340,10 +1347,39 @@ custom_load_using_properties(ObjectNode obj_node, int version, const char *filen
13401347 Point startpoint = {0.0,0.0};
13411348 Handle *handle1,*handle2;
13421349 Text *init_text;
1343-
1350+ AttributeNode attr;
1351+
13441352 obj = custom_type.ops->create(&startpoint, shape_info_get(obj_node), &handle1, &handle2);
13451353 custom = (Custom*)obj;
13461354 object_load_props(obj,obj_node);
1355+
1356+ if (version < 1) {
1357+ /* Version 0 misnamed the standard attributes in the savefile. */
1358+ custom->border_width = 0.1;
1359+ attr = object_find_attribute(obj_node, "border_width");
1360+ if (attr != NULL)
1361+ custom->border_width = data_real( attribute_first_data(attr) );
1362+
1363+ custom->border_color = color_black;
1364+ attr = object_find_attribute(obj_node, "border_color");
1365+ if (attr != NULL)
1366+ data_color(attribute_first_data(attr), &custom->border_color);
1367+
1368+ custom->inner_color = color_white;
1369+ attr = object_find_attribute(obj_node, "inner_color");
1370+ if (attr != NULL)
1371+ data_color(attribute_first_data(attr), &custom->inner_color);
1372+
1373+ custom->line_style = LINESTYLE_SOLID;
1374+ attr = object_find_attribute(obj_node, "line_style");
1375+ if (attr != NULL)
1376+ custom->line_style = data_enum( attribute_first_data(attr) );
1377+
1378+ custom->dashlength = DEFAULT_LINESTYLE_DASHLEN;
1379+ attr = object_find_attribute(obj_node, "dashlength");
1380+ if (attr != NULL)
1381+ custom->dashlength = data_real(attribute_first_data(attr));
1382+ }
13471383
13481384 custom_update_data(custom, ANCHOR_MIDDLE, ANCHOR_MIDDLE);
13491385