• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

作図ソフト dia の改良版


Commit MetaInfo

修訂f225364d27d9b450c9c91508049c3093c2463d9d (tree)
時間2004-05-21 22:58:46
作者Lars Clausen <lclausen@src....>
CommiterLars Clausen

Log Message

Fixes from Hans, random bug fixes from bugzilla.

Change Summary

差異

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
1+2004-05-20 Hans Breuer <hans@breuer.org>
2+
3+ * acinclude.m4 : disable setting of PYTHON_PREFIX
4+ and PYTHON_EXEC_PREFIX from prefix and exec_prefix
5+ as workaround for bug #142032 (the real fix would
6+ involve some auto* knowledge which I don't have
7+ either;)
8+
9+ * plug-ins/python/Makefile.am : more python
10+ plug-ins to be installed (especially svg import,
11+ but also 'simple scale' should be useable
12+ sometimes)
13+
14+ * plug-ins/python/scascale.py : update display
15+ after modifying selected objects
16+
17+ * plug-ins/python/diasvg_import.py : initialize
18+ stroke to none
19+
20+2004-05-18 Lars Clausen <larsrc@linux.local>
21+
22+ * app/diagram_tree.c (select_node): Use
23+ diagram_remove_all_selected to kill selected list.
24+
25+ * lib/font.c: Set language when using a different context.
26+
27+ * plug-ins/svg/svg-import.c: Changed isdigit to g_ascii_isdigit
28+ and removed ctype include (#142661).
29+
30+ * lib/paper.c (get_default_paper): Changed isalnum to
31+ g_ascii_isalnum and removed ctype include. (#142661)
32+
33+ * objects/custom/shape_info.c:
34+ * lib/dia_svg.c:
35+ * app/diaunitspinner.c: Removed unrequired ctype.h include. (#142661)
36+
37+2004-05-17 Hans Breuer <hans@breuer.org>
38+
39+ * lib/object_defaults.c : don't 'failed to load external
40+ entity "NULL"' when the defaults file does not exist,
41+ bug #108764
42+
43+ * lib/widgets.c : fixed possible menu leak
44+ * lib/dialinechooser.c lib/diaarrowchooser.c : finally
45+ avoid finalization of floating references, bug #142307
46+
147 2004-05-15 Lars Clausen <lars@raeder.dk>
248
349 * plug-ins/xfig/xfig-import.c: Handle default fonts and illegal
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -96,8 +96,9 @@ else:
9696 dnl distinct variables so they can be overridden if need be. However,
9797 dnl general consensus is that you shouldn't need this ability.
9898
99- AC_SUBST([PYTHON_PREFIX], [${prefix}])
100- AC_SUBST([PYTHON_EXEC_PREFIX], [${exec_prefix}])
99+ dnl FIXME: with this you'll get NONE/lib/sitepackages below
100+ dnl AC_SUBST([PYTHON_PREFIX], [${prefix}])
101+ dnl AC_SUBST([PYTHON_EXEC_PREFIX], [${exec_prefix}])
101102
102103 dnl At times (like when building shared libraries) you may want
103104 dnl to know which OS platform Python thinks this is.
--- a/app/diagram_tree.c
+++ b/app/diagram_tree.c
@@ -74,7 +74,7 @@ select_node(DiagramTree *tree, GtkCTreeNode *node, gboolean raise)
7474 if (is_object_node(node)) {
7575 if (o) {
7676 update_object(tree, node, o);
77- diagram_unselect_objects(d, d->data->selected);
77+ diagram_remove_all_selected(d, FALSE);
7878 diagram_select(d, o);
7979 }
8080 }
--- a/app/diaunitspinner.c
+++ b/app/diaunitspinner.c
@@ -21,7 +21,6 @@
2121
2222 #include <config.h>
2323
24-#include <ctype.h>
2524 #include <string.h> /* strcmp */
2625 #include "diaunitspinner.h"
2726 #include "gdk/gdkkeysyms.h"
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -23,7 +23,6 @@
2323
2424 #include "config.h"
2525
26-#include <ctype.h>
2726 #include <locale.h>
2827 #include <string.h>
2928 #include <stdlib.h>
--- a/lib/diaarrowchooser.c
+++ b/lib/diaarrowchooser.c
@@ -289,6 +289,8 @@ dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback,
289289 dia_arrow_chooser_dialog_new(NULL, chooser);
290290
291291 menu = gtk_menu_new();
292+ g_object_ref(G_OBJECT(menu));
293+ gtk_object_sink(GTK_OBJECT(menu));
292294 gtk_object_set_data_full(GTK_OBJECT(chooser), button_menu_key, menu,
293295 (GtkDestroyNotify)gtk_widget_unref);
294296 for (i = 0; arrow_types[i].name != NULL; i++) {
--- a/lib/dialinechooser.c
+++ b/lib/dialinechooser.c
@@ -115,6 +115,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
115115 GdkGC *gc;
116116 GdkGCValues gcvalues;
117117 char dash_list[6];
118+ int line_width = 2;
118119
119120 if (GTK_WIDGET_DRAWABLE(widget)) {
120121 width = widget->allocation.width - misc->xpad * 2;
@@ -130,18 +131,18 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
130131 gdk_gc_get_values(gc, &gcvalues);
131132 switch (line->lstyle) {
132133 case LINESTYLE_SOLID:
133- gdk_gc_set_line_attributes(gc, 1, GDK_LINE_SOLID,
134+ gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_SOLID,
134135 gcvalues.cap_style, gcvalues.join_style);
135136 break;
136137 case LINESTYLE_DASHED:
137- gdk_gc_set_line_attributes(gc, 1, GDK_LINE_ON_OFF_DASH,
138+ gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_ON_OFF_DASH,
138139 gcvalues.cap_style, gcvalues.join_style);
139140 dash_list[0] = 10;
140141 dash_list[1] = 10;
141142 gdk_gc_set_dashes(gc, 0, dash_list, 2);
142143 break;
143144 case LINESTYLE_DASH_DOT:
144- gdk_gc_set_line_attributes(gc, 1, GDK_LINE_ON_OFF_DASH,
145+ gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_ON_OFF_DASH,
145146 gcvalues.cap_style, gcvalues.join_style);
146147 dash_list[0] = 10;
147148 dash_list[1] = 4;
@@ -150,7 +151,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
150151 gdk_gc_set_dashes(gc, 0, dash_list, 4);
151152 break;
152153 case LINESTYLE_DASH_DOT_DOT:
153- gdk_gc_set_line_attributes(gc, 1, GDK_LINE_ON_OFF_DASH,
154+ gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_ON_OFF_DASH,
154155 gcvalues.cap_style, gcvalues.join_style);
155156 dash_list[0] = 10;
156157 dash_list[1] = 2;
@@ -161,7 +162,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
161162 gdk_gc_set_dashes(gc, 0, dash_list, 6);
162163 break;
163164 case LINESTYLE_DOTTED:
164- gdk_gc_set_line_attributes(gc, 1, GDK_LINE_ON_OFF_DASH,
165+ gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_ON_OFF_DASH,
165166 gcvalues.cap_style, gcvalues.join_style);
166167 dash_list[0] = 2;
167168 dash_list[1] = 2;
@@ -314,6 +315,8 @@ dia_line_chooser_init (DiaLineChooser *lchooser)
314315 lchooser->selector = DIALINESTYLESELECTOR(wid);
315316
316317 menu = gtk_menu_new();
318+ g_object_ref(G_OBJECT(menu));
319+ gtk_object_sink(GTK_OBJECT(menu));
317320 g_object_set_data_full(G_OBJECT(lchooser), button_menu_key, menu,
318321 (GDestroyNotify)gtk_widget_unref);
319322 for (i = 0; i <= LINESTYLE_DOTTED; i++) {
--- a/lib/font.c
+++ b/lib/font.c
@@ -106,6 +106,7 @@ void
106106 dia_font_push_context(PangoContext *pcontext) {
107107 pango_contexts = g_list_prepend(pango_contexts, pango_context);
108108 pango_context = pcontext;
109+ pango_context_set_language (pango_context, gtk_get_default_language ());
109110 g_object_ref(pcontext);
110111 }
111112
@@ -113,6 +114,7 @@ void
113114 dia_font_pop_context() {
114115 g_object_unref(pango_context);
115116 pango_context = (PangoContext*)pango_contexts->data;
117+ pango_context_set_language (pango_context, gtk_get_default_language ());
116118 pango_contexts = g_list_next(pango_contexts);
117119 }
118120
--- a/lib/paper.c
+++ b/lib/paper.c
@@ -20,7 +20,6 @@
2020
2121 #include <stdio.h>
2222 #include <string.h>
23-#include <ctype.h>
2423
2524 #include "paper.h"
2625
@@ -86,7 +85,7 @@ get_default_paper(void)
8685 }
8786 else if((papersize = fopen("/etc/papersize", "r")) != NULL) {
8887 while(fgets(paper, sizeof(paper), papersize))
89- if(isalnum(paper[0])) {
88+ if(g_ascii_isalnum(paper[0])) {
9089 break;
9190 }
9291 fclose(papersize);
--- a/lib/widgets.c
+++ b/lib/widgets.c
@@ -631,7 +631,7 @@ dia_font_selector_set_styles(DiaFontSelector *fs, FontSelectorEntry *fse,
631631 int i=0, select = 0;
632632 PangoFontFace **faces;
633633 int nfaces;
634- GtkWidget *menu = gtk_menu_new();
634+ GtkWidget *menu = NULL;
635635 long stylebits = 0;
636636 int menu_item_nr = 0;
637637 GSList *group = NULL;
@@ -644,6 +644,7 @@ dia_font_selector_set_styles(DiaFontSelector *fs, FontSelectorEntry *fse,
644644 return;
645645 }
646646
647+ menu = gtk_menu_new ();
647648 pango_font_family_list_faces(fse->family, &faces, &nfaces);
648649
649650 for (i = 0; i < nfaces; i++) {
--- a/objects/custom/shape_info.c
+++ b/objects/custom/shape_info.c
@@ -25,7 +25,6 @@
2525 #include <libxml/parser.h>
2626 #include <libxml/xmlmemory.h>
2727 #include <float.h>
28-#include <ctype.h>
2928 #include <string.h>
3029 #include <locale.h>
3130 #include "dia_xml_libxml.h"
--- a/objects/standard/line.c
+++ b/objects/standard/line.c
@@ -59,7 +59,6 @@ typedef struct _Line {
5959 struct _LineProperties {
6060 real absolute_start_gap, absolute_end_gap;
6161 real fractional_start_gap, fractional_end_gap;
62- gboolean object_edge_start, object_edge_end;
6362 };
6463
6564 static LineProperties default_properties;
@@ -141,7 +140,6 @@ static PropDescription line_props[] = {
141140 N_("Start point"), NULL },
142141 { "end_point", PROP_TYPE_POINT, 0,
143142 N_("End point"), NULL },
144- /*
145143 PROP_FRAME_BEGIN("gaps",0,N_("Line gaps")),
146144 { "absolute_start_gap", PROP_TYPE_REAL, 0,
147145 N_("Absolute start gap"), NULL, &gap_range },
@@ -151,12 +149,7 @@ static PropDescription line_props[] = {
151149 N_("Fractional start gap"), NULL, &gap_range },
152150 { "fractional_end_gap", PROP_TYPE_REAL, 0,
153151 N_("Fractional end gap"), NULL, &gap_range },
154- { "object_edge_start", PROP_TYPE_BOOL, 0,
155- N_("Start at object edge"), },
156- { "object_edge_end", PROP_TYPE_BOOL, 0,
157- N_("End at object edge"), },
158152 PROP_FRAME_END("gaps",0),
159- */
160153 PROP_DESC_END
161154 };
162155
@@ -178,14 +171,10 @@ static PropOffset line_offsets[] = {
178171 { "end_arrow", PROP_TYPE_ARROW, offsetof(Line, end_arrow) },
179172 { "start_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[0]) },
180173 { "end_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[1]) },
181- /*
182174 { "absolute_start_gap", PROP_TYPE_REAL, offsetof(Line, absolute_start_gap) },
183175 { "absolute_end_gap", PROP_TYPE_REAL, offsetof(Line, absolute_end_gap) },
184176 { "fractional_start_gap", PROP_TYPE_REAL, offsetof(Line, fractional_start_gap) },
185177 { "fractional_end_gap", PROP_TYPE_REAL, offsetof(Line, fractional_end_gap) },
186- { "object_edge_start", PROP_TYPE_BOOL, offsetof(Line, object_edge_start) },
187- { "object_edge_end", PROP_TYPE_BOOL, offsetof(Line, object_edge_end) },
188- */
189178 { NULL, 0, 0 }
190179 };
191180
@@ -213,8 +202,6 @@ line_init_defaults() {
213202 default_properties.absolute_end_gap = 0.0;
214203 default_properties.fractional_start_gap = 0;
215204 default_properties.fractional_end_gap = 0;
216- default_properties.object_edge_start = FALSE;
217- default_properties.object_edge_end = FALSE;
218205 defaults_initialized = 1;
219206 }
220207 }
@@ -279,6 +266,7 @@ line_get_object_menu(Line *line, Point *clickedpoint)
279266 length which could be optionally added to the object intersection
280267 gap.
281268 */
269+/* This is currently dead code, but may find new use in other places. */
282270 Point
283271 calculate_object_edge(Point *objmid, Point *end, DiaObject *obj)
284272 {
@@ -484,8 +472,6 @@ line_create(Point *startpoint,
484472 line->absolute_end_gap = default_properties.absolute_end_gap;
485473 line->fractional_start_gap = default_properties.fractional_start_gap;
486474 line->fractional_end_gap = default_properties.fractional_end_gap;
487- line->object_edge_start = default_properties.object_edge_start;
488- line->object_edge_end = default_properties.object_edge_end;
489475
490476 conn = &line->connection;
491477 conn->endpoints[0] = *startpoint;
@@ -644,12 +630,6 @@ line_save(Line *line, ObjectNode obj_node, const char *filename)
644630 if (line->fractional_end_gap)
645631 data_add_real(new_attribute(obj_node, "fractional_end_gap"),
646632 line->fractional_end_gap);
647- if (line->object_edge_start)
648- data_add_boolean(new_attribute(obj_node, "object_edge_start"),
649- line->object_edge_start);
650- if (line->object_edge_end)
651- data_add_boolean(new_attribute(obj_node, "object_edge_end"),
652- line->object_edge_end);
653633
654634 if (line->line_style != LINESTYLE_SOLID && line->dashlength != DEFAULT_LINESTYLE_DASHLEN)
655635 data_add_real(new_attribute(obj_node, "dashlength"),
@@ -731,14 +711,6 @@ line_load(ObjectNode obj_node, int version, const char *filename)
731711 attr = object_find_attribute(obj_node, "fractional_end_gap");
732712 if (attr != NULL)
733713 line->fractional_end_gap = data_real( attribute_first_data(attr) );
734- line->object_edge_start = FALSE;
735- attr = object_find_attribute(obj_node, "object_edge_start");
736- if (attr != NULL)
737- line->object_edge_start = data_boolean( attribute_first_data(attr) );
738- line->object_edge_end = FALSE;
739- attr = object_find_attribute(obj_node, "object_edge_end");
740- if (attr != NULL)
741- line->object_edge_end = data_boolean( attribute_first_data(attr) );
742714
743715 line->dashlength = DEFAULT_LINESTYLE_DASHLEN;
744716 attr = object_find_attribute(obj_node, "dashlength");
--- a/plug-ins/python/Makefile.am
+++ b/plug-ins/python/Makefile.am
@@ -59,8 +59,11 @@ pyplugindir = $(pkgdatadir)/python
5959 pyplugin_DATA = \
6060 gtkcons.py \
6161 diasvg.py \
62+ diasvg_import.py \
6263 group_props.py \
6364 otypes.py \
65+ scascale.py \
66+ select_by.py \
6467 pydiadoc.py
6568 ## are the other python plugins good for more than just testing purposes?
6669
@@ -72,7 +75,10 @@ EXTRA_DIST = \
7275 export-object.py \
7376 export-render.py \
7477 diasvg.py \
78+ diasvg_import.py \
7579 group_props.py \
7680 otypes.py \
81+ scascale.py \
82+ select_by.py \
7783 pydiadoc.py \
7884 gtkcons.py
--- a/plug-ins/python/diasvg_import.py
+++ b/plug-ins/python/diasvg_import.py
@@ -58,7 +58,7 @@ def Color(s) :
5858 return string.strip(s)
5959 class Object :
6060 def __init__(self) :
61- self.props = {"x" : 0, "y" : 0}
61+ self.props = {"x" : 0, "y" : 0, "stroke" : none}
6262 # "line_width", "line_colour", "line_style"
6363 def style(self, s) :
6464 sp1 = string.split(s, ";")
--- a/plug-ins/python/scascale.py
+++ b/plug-ins/python/scascale.py
@@ -137,6 +137,7 @@ def SimpleScale(data, factor) :
137137 sMsg = sMsg + "\n%s (%d)" % (s, scaleFailed[s])
138138 dia.message(1, sMsg)
139139 data.update_extents ()
140+ dia.active_display().add_update_all()
140141
141142 def scale_cb(data, flags) :
142143 dlg = CScaleDialog(dia.active_display().diagram, data)
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -34,7 +34,6 @@
3434 #include <libxml/parser.h>
3535 #include <libxml/xmlmemory.h>
3636 #include <float.h>
37-#include <ctype.h>
3837
3938 #include "intl.h"
4039 #include "message.h"
@@ -320,7 +319,7 @@ read_poly_svg(xmlNodePtr node, DiagramData *dia, char *object_type) {
320319 tmp = str = xmlGetProp(node, "points");
321320 while (tmp[0] != '\0') {
322321 /* skip junk */
323- while (tmp[0] != '\0' && !isdigit(tmp[0]) && tmp[0]!='.'&&tmp[0]!='-')
322+ while (tmp[0] != '\0' && !g_ascii_isdigit(tmp[0]) && tmp[0]!='.'&&tmp[0]!='-')
324323 tmp++;
325324 if (tmp[0] == '\0') break;
326325 old_locale = setlocale(LC_NUMERIC, "C");