作図ソフト dia の改良版
Revision | f225364d27d9b450c9c91508049c3093c2463d9d (tree) |
---|---|
Time | 2004-05-21 22:58:46 |
Author | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Fixes from Hans, random bug fixes from bugzilla.
@@ -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 | + | |
1 | 47 | 2004-05-15 Lars Clausen <lars@raeder.dk> |
2 | 48 | |
3 | 49 | * plug-ins/xfig/xfig-import.c: Handle default fonts and illegal |
@@ -96,8 +96,9 @@ else: | ||
96 | 96 | dnl distinct variables so they can be overridden if need be. However, |
97 | 97 | dnl general consensus is that you shouldn't need this ability. |
98 | 98 | |
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}]) | |
101 | 102 | |
102 | 103 | dnl At times (like when building shared libraries) you may want |
103 | 104 | dnl to know which OS platform Python thinks this is. |
@@ -74,7 +74,7 @@ select_node(DiagramTree *tree, GtkCTreeNode *node, gboolean raise) | ||
74 | 74 | if (is_object_node(node)) { |
75 | 75 | if (o) { |
76 | 76 | update_object(tree, node, o); |
77 | - diagram_unselect_objects(d, d->data->selected); | |
77 | + diagram_remove_all_selected(d, FALSE); | |
78 | 78 | diagram_select(d, o); |
79 | 79 | } |
80 | 80 | } |
@@ -21,7 +21,6 @@ | ||
21 | 21 | |
22 | 22 | #include <config.h> |
23 | 23 | |
24 | -#include <ctype.h> | |
25 | 24 | #include <string.h> /* strcmp */ |
26 | 25 | #include "diaunitspinner.h" |
27 | 26 | #include "gdk/gdkkeysyms.h" |
@@ -23,7 +23,6 @@ | ||
23 | 23 | |
24 | 24 | #include "config.h" |
25 | 25 | |
26 | -#include <ctype.h> | |
27 | 26 | #include <locale.h> |
28 | 27 | #include <string.h> |
29 | 28 | #include <stdlib.h> |
@@ -289,6 +289,8 @@ dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback, | ||
289 | 289 | dia_arrow_chooser_dialog_new(NULL, chooser); |
290 | 290 | |
291 | 291 | menu = gtk_menu_new(); |
292 | + g_object_ref(G_OBJECT(menu)); | |
293 | + gtk_object_sink(GTK_OBJECT(menu)); | |
292 | 294 | gtk_object_set_data_full(GTK_OBJECT(chooser), button_menu_key, menu, |
293 | 295 | (GtkDestroyNotify)gtk_widget_unref); |
294 | 296 | for (i = 0; arrow_types[i].name != NULL; i++) { |
@@ -115,6 +115,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event) | ||
115 | 115 | GdkGC *gc; |
116 | 116 | GdkGCValues gcvalues; |
117 | 117 | char dash_list[6]; |
118 | + int line_width = 2; | |
118 | 119 | |
119 | 120 | if (GTK_WIDGET_DRAWABLE(widget)) { |
120 | 121 | width = widget->allocation.width - misc->xpad * 2; |
@@ -130,18 +131,18 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event) | ||
130 | 131 | gdk_gc_get_values(gc, &gcvalues); |
131 | 132 | switch (line->lstyle) { |
132 | 133 | 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, | |
134 | 135 | gcvalues.cap_style, gcvalues.join_style); |
135 | 136 | break; |
136 | 137 | 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, | |
138 | 139 | gcvalues.cap_style, gcvalues.join_style); |
139 | 140 | dash_list[0] = 10; |
140 | 141 | dash_list[1] = 10; |
141 | 142 | gdk_gc_set_dashes(gc, 0, dash_list, 2); |
142 | 143 | break; |
143 | 144 | 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, | |
145 | 146 | gcvalues.cap_style, gcvalues.join_style); |
146 | 147 | dash_list[0] = 10; |
147 | 148 | dash_list[1] = 4; |
@@ -150,7 +151,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event) | ||
150 | 151 | gdk_gc_set_dashes(gc, 0, dash_list, 4); |
151 | 152 | break; |
152 | 153 | 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, | |
154 | 155 | gcvalues.cap_style, gcvalues.join_style); |
155 | 156 | dash_list[0] = 10; |
156 | 157 | dash_list[1] = 2; |
@@ -161,7 +162,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event) | ||
161 | 162 | gdk_gc_set_dashes(gc, 0, dash_list, 6); |
162 | 163 | break; |
163 | 164 | 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, | |
165 | 166 | gcvalues.cap_style, gcvalues.join_style); |
166 | 167 | dash_list[0] = 2; |
167 | 168 | dash_list[1] = 2; |
@@ -314,6 +315,8 @@ dia_line_chooser_init (DiaLineChooser *lchooser) | ||
314 | 315 | lchooser->selector = DIALINESTYLESELECTOR(wid); |
315 | 316 | |
316 | 317 | menu = gtk_menu_new(); |
318 | + g_object_ref(G_OBJECT(menu)); | |
319 | + gtk_object_sink(GTK_OBJECT(menu)); | |
317 | 320 | g_object_set_data_full(G_OBJECT(lchooser), button_menu_key, menu, |
318 | 321 | (GDestroyNotify)gtk_widget_unref); |
319 | 322 | for (i = 0; i <= LINESTYLE_DOTTED; i++) { |
@@ -106,6 +106,7 @@ void | ||
106 | 106 | dia_font_push_context(PangoContext *pcontext) { |
107 | 107 | pango_contexts = g_list_prepend(pango_contexts, pango_context); |
108 | 108 | pango_context = pcontext; |
109 | + pango_context_set_language (pango_context, gtk_get_default_language ()); | |
109 | 110 | g_object_ref(pcontext); |
110 | 111 | } |
111 | 112 |
@@ -113,6 +114,7 @@ void | ||
113 | 114 | dia_font_pop_context() { |
114 | 115 | g_object_unref(pango_context); |
115 | 116 | pango_context = (PangoContext*)pango_contexts->data; |
117 | + pango_context_set_language (pango_context, gtk_get_default_language ()); | |
116 | 118 | pango_contexts = g_list_next(pango_contexts); |
117 | 119 | } |
118 | 120 |
@@ -20,7 +20,6 @@ | ||
20 | 20 | |
21 | 21 | #include <stdio.h> |
22 | 22 | #include <string.h> |
23 | -#include <ctype.h> | |
24 | 23 | |
25 | 24 | #include "paper.h" |
26 | 25 |
@@ -86,7 +85,7 @@ get_default_paper(void) | ||
86 | 85 | } |
87 | 86 | else if((papersize = fopen("/etc/papersize", "r")) != NULL) { |
88 | 87 | while(fgets(paper, sizeof(paper), papersize)) |
89 | - if(isalnum(paper[0])) { | |
88 | + if(g_ascii_isalnum(paper[0])) { | |
90 | 89 | break; |
91 | 90 | } |
92 | 91 | fclose(papersize); |
@@ -631,7 +631,7 @@ dia_font_selector_set_styles(DiaFontSelector *fs, FontSelectorEntry *fse, | ||
631 | 631 | int i=0, select = 0; |
632 | 632 | PangoFontFace **faces; |
633 | 633 | int nfaces; |
634 | - GtkWidget *menu = gtk_menu_new(); | |
634 | + GtkWidget *menu = NULL; | |
635 | 635 | long stylebits = 0; |
636 | 636 | int menu_item_nr = 0; |
637 | 637 | GSList *group = NULL; |
@@ -644,6 +644,7 @@ dia_font_selector_set_styles(DiaFontSelector *fs, FontSelectorEntry *fse, | ||
644 | 644 | return; |
645 | 645 | } |
646 | 646 | |
647 | + menu = gtk_menu_new (); | |
647 | 648 | pango_font_family_list_faces(fse->family, &faces, &nfaces); |
648 | 649 | |
649 | 650 | for (i = 0; i < nfaces; i++) { |
@@ -25,7 +25,6 @@ | ||
25 | 25 | #include <libxml/parser.h> |
26 | 26 | #include <libxml/xmlmemory.h> |
27 | 27 | #include <float.h> |
28 | -#include <ctype.h> | |
29 | 28 | #include <string.h> |
30 | 29 | #include <locale.h> |
31 | 30 | #include "dia_xml_libxml.h" |
@@ -59,7 +59,6 @@ typedef struct _Line { | ||
59 | 59 | struct _LineProperties { |
60 | 60 | real absolute_start_gap, absolute_end_gap; |
61 | 61 | real fractional_start_gap, fractional_end_gap; |
62 | - gboolean object_edge_start, object_edge_end; | |
63 | 62 | }; |
64 | 63 | |
65 | 64 | static LineProperties default_properties; |
@@ -141,7 +140,6 @@ static PropDescription line_props[] = { | ||
141 | 140 | N_("Start point"), NULL }, |
142 | 141 | { "end_point", PROP_TYPE_POINT, 0, |
143 | 142 | N_("End point"), NULL }, |
144 | - /* | |
145 | 143 | PROP_FRAME_BEGIN("gaps",0,N_("Line gaps")), |
146 | 144 | { "absolute_start_gap", PROP_TYPE_REAL, 0, |
147 | 145 | N_("Absolute start gap"), NULL, &gap_range }, |
@@ -151,12 +149,7 @@ static PropDescription line_props[] = { | ||
151 | 149 | N_("Fractional start gap"), NULL, &gap_range }, |
152 | 150 | { "fractional_end_gap", PROP_TYPE_REAL, 0, |
153 | 151 | 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"), }, | |
158 | 152 | PROP_FRAME_END("gaps",0), |
159 | - */ | |
160 | 153 | PROP_DESC_END |
161 | 154 | }; |
162 | 155 |
@@ -178,14 +171,10 @@ static PropOffset line_offsets[] = { | ||
178 | 171 | { "end_arrow", PROP_TYPE_ARROW, offsetof(Line, end_arrow) }, |
179 | 172 | { "start_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[0]) }, |
180 | 173 | { "end_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[1]) }, |
181 | - /* | |
182 | 174 | { "absolute_start_gap", PROP_TYPE_REAL, offsetof(Line, absolute_start_gap) }, |
183 | 175 | { "absolute_end_gap", PROP_TYPE_REAL, offsetof(Line, absolute_end_gap) }, |
184 | 176 | { "fractional_start_gap", PROP_TYPE_REAL, offsetof(Line, fractional_start_gap) }, |
185 | 177 | { "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 | - */ | |
189 | 178 | { NULL, 0, 0 } |
190 | 179 | }; |
191 | 180 |
@@ -213,8 +202,6 @@ line_init_defaults() { | ||
213 | 202 | default_properties.absolute_end_gap = 0.0; |
214 | 203 | default_properties.fractional_start_gap = 0; |
215 | 204 | default_properties.fractional_end_gap = 0; |
216 | - default_properties.object_edge_start = FALSE; | |
217 | - default_properties.object_edge_end = FALSE; | |
218 | 205 | defaults_initialized = 1; |
219 | 206 | } |
220 | 207 | } |
@@ -279,6 +266,7 @@ line_get_object_menu(Line *line, Point *clickedpoint) | ||
279 | 266 | length which could be optionally added to the object intersection |
280 | 267 | gap. |
281 | 268 | */ |
269 | +/* This is currently dead code, but may find new use in other places. */ | |
282 | 270 | Point |
283 | 271 | calculate_object_edge(Point *objmid, Point *end, DiaObject *obj) |
284 | 272 | { |
@@ -484,8 +472,6 @@ line_create(Point *startpoint, | ||
484 | 472 | line->absolute_end_gap = default_properties.absolute_end_gap; |
485 | 473 | line->fractional_start_gap = default_properties.fractional_start_gap; |
486 | 474 | 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; | |
489 | 475 | |
490 | 476 | conn = &line->connection; |
491 | 477 | conn->endpoints[0] = *startpoint; |
@@ -644,12 +630,6 @@ line_save(Line *line, ObjectNode obj_node, const char *filename) | ||
644 | 630 | if (line->fractional_end_gap) |
645 | 631 | data_add_real(new_attribute(obj_node, "fractional_end_gap"), |
646 | 632 | 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); | |
653 | 633 | |
654 | 634 | if (line->line_style != LINESTYLE_SOLID && line->dashlength != DEFAULT_LINESTYLE_DASHLEN) |
655 | 635 | data_add_real(new_attribute(obj_node, "dashlength"), |
@@ -731,14 +711,6 @@ line_load(ObjectNode obj_node, int version, const char *filename) | ||
731 | 711 | attr = object_find_attribute(obj_node, "fractional_end_gap"); |
732 | 712 | if (attr != NULL) |
733 | 713 | 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) ); | |
742 | 714 | |
743 | 715 | line->dashlength = DEFAULT_LINESTYLE_DASHLEN; |
744 | 716 | attr = object_find_attribute(obj_node, "dashlength"); |
@@ -59,8 +59,11 @@ pyplugindir = $(pkgdatadir)/python | ||
59 | 59 | pyplugin_DATA = \ |
60 | 60 | gtkcons.py \ |
61 | 61 | diasvg.py \ |
62 | + diasvg_import.py \ | |
62 | 63 | group_props.py \ |
63 | 64 | otypes.py \ |
65 | + scascale.py \ | |
66 | + select_by.py \ | |
64 | 67 | pydiadoc.py |
65 | 68 | ## are the other python plugins good for more than just testing purposes? |
66 | 69 |
@@ -72,7 +75,10 @@ EXTRA_DIST = \ | ||
72 | 75 | export-object.py \ |
73 | 76 | export-render.py \ |
74 | 77 | diasvg.py \ |
78 | + diasvg_import.py \ | |
75 | 79 | group_props.py \ |
76 | 80 | otypes.py \ |
81 | + scascale.py \ | |
82 | + select_by.py \ | |
77 | 83 | pydiadoc.py \ |
78 | 84 | gtkcons.py |
@@ -58,7 +58,7 @@ def Color(s) : | ||
58 | 58 | return string.strip(s) |
59 | 59 | class Object : |
60 | 60 | def __init__(self) : |
61 | - self.props = {"x" : 0, "y" : 0} | |
61 | + self.props = {"x" : 0, "y" : 0, "stroke" : none} | |
62 | 62 | # "line_width", "line_colour", "line_style" |
63 | 63 | def style(self, s) : |
64 | 64 | sp1 = string.split(s, ";") |
@@ -137,6 +137,7 @@ def SimpleScale(data, factor) : | ||
137 | 137 | sMsg = sMsg + "\n%s (%d)" % (s, scaleFailed[s]) |
138 | 138 | dia.message(1, sMsg) |
139 | 139 | data.update_extents () |
140 | + dia.active_display().add_update_all() | |
140 | 141 | |
141 | 142 | def scale_cb(data, flags) : |
142 | 143 | dlg = CScaleDialog(dia.active_display().diagram, data) |
@@ -34,7 +34,6 @@ | ||
34 | 34 | #include <libxml/parser.h> |
35 | 35 | #include <libxml/xmlmemory.h> |
36 | 36 | #include <float.h> |
37 | -#include <ctype.h> | |
38 | 37 | |
39 | 38 | #include "intl.h" |
40 | 39 | #include "message.h" |
@@ -320,7 +319,7 @@ read_poly_svg(xmlNodePtr node, DiagramData *dia, char *object_type) { | ||
320 | 319 | tmp = str = xmlGetProp(node, "points"); |
321 | 320 | while (tmp[0] != '\0') { |
322 | 321 | /* 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]!='-') | |
324 | 323 | tmp++; |
325 | 324 | if (tmp[0] == '\0') break; |
326 | 325 | old_locale = setlocale(LC_NUMERIC, "C"); |