作図ソフト dia の改良版
Revision | b8a358e4e2fc98cdb61c43bb0f2e623fa1a5736a (tree) |
---|---|
Zeit | 2004-07-23 06:56:10 |
Autor | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
0.94-pre2 fixes taken from head and release branches.
@@ -1,4 +1,35 @@ | ||
1 | +2004-07-22 Lars Clausen <lars@raeder.dk> | |
2 | + | |
3 | + * NEWS: | |
4 | + * config.h.win32: | |
5 | + * doc/en/dia.xml: | |
6 | + * doc/pl/dia.xml: | |
7 | + * dia.spec (Release): | |
8 | + * configure.in: Update to version 0.94-pre2. | |
9 | + | |
10 | + * app/load_save.c (diagram_data_write_doc): Use new namespace | |
11 | + here, too. | |
12 | + | |
13 | + * lib/object.h (OBJECT_COMMON_PROPERTIES): Remove 'Dia' from | |
14 | + hidden objects properties. | |
15 | + | |
16 | + * objects/standard/line.c: Remove halffinished line gap box from | |
17 | + properties list. | |
18 | + | |
19 | + * app/paginate_psprint.c: | |
20 | + * app/filedlg.c: Patch from kimmidi@novell.com (Kiran Kumar | |
21 | + Immidi): Close export and print dialog with diagram as well. | |
22 | + (#129520) | |
23 | + | |
24 | + * lib/diaarrowchooser.[ch]: Patch from pborelli@katamail.com (paolo | |
25 | + borelli): Remove deprecated stuff (#137693) | |
26 | + | |
27 | + * app/dia-props.c (create_diagram_properties_dialog): Patch from | |
28 | + kimmidi@novell.com (Kiran Kumar Immidi): Close properties dialog | |
29 | + on destroy. | |
30 | + | |
1 | 31 | 2004-07-21 Ray Strode <rstrode@redhat.com> |
32 | + | |
2 | 33 | * dia/dia.desktop.in: Add MimeType line to desktop file |
3 | 34 | new mime sytem. |
4 | 35 |
@@ -16,23 +47,17 @@ | ||
16 | 47 | |
17 | 48 | * app/app_procs.c : make the --size hack even uglier, but work again |
18 | 49 | |
19 | - * lib/libartrenderer.c (draw_line, draw_rect) : disable broken code | |
20 | - using art_vpath_affine_transform() | |
21 | - | |
22 | 50 | * lib/dia_dirs.c(dia_get_absolute_filename) : must not free() |
23 | 51 | but g_free() what is returned by g_build_filename() |
24 | 52 | |
25 | - * objects/custom_object.c(custom_destroy) : handle all enum values | |
26 | - in switch to get rid of the warning | |
53 | + * objects/custom/custom_object.c(custom_destroy) : handle all enum | |
54 | + values in switch to get rid of the warning | |
27 | 55 | |
28 | 56 | * objects/custom/shape_info.c : use g_ascii_strtod(), get rid |
29 | 57 | of setlocale()/strtod() |
30 | 58 | * lib/dia_svg.c : dito |
31 | 59 | * lib/dia_xml.c : almost |
32 | 60 | |
33 | - * lib/object.h : set PROP_FLAG_OPTIONAL for "obj_rotate" to stop | |
34 | - complaining on missing attribute | |
35 | - | |
36 | 61 | * plug-ins/python/group_props.py : use the string representation of |
37 | 62 | value to ensure "unique values". If the strings would not be different |
38 | 63 | the user cann't see the difference either |
@@ -46,28 +71,24 @@ | ||
46 | 71 | |
47 | 72 | * lib/persistence.c (persistence_save_type): Small fixes (#142663) |
48 | 73 | |
49 | - * doc/diagram.dtd: Add closing > to dia:diagram to make it parsable! | |
50 | - | |
51 | 74 | * objects/standard/image.c (image_load): Use path of diagram |
52 | 75 | rather than running directory as base for image file place. |
53 | 76 | |
77 | + * doc/{diagram,sheet}.dtd: Move DTD namespace to new site, and | |
78 | + syntactic fixes. | |
79 | + | |
54 | 80 | * app/disp_callbacks.c (ddisplay_canvas_events): Patch from |
55 | 81 | Ambrose Li <a.c.li@ieee.org>: Better IM context handling. |
56 | 82 | |
83 | + * Re-added new sample diagrams binarily. | |
84 | + | |
57 | 85 | 2004-07-17 Sagar Rastogi <rastogi@students.iiit.net> |
58 | 86 | |
59 | 87 | * app/disp_callbacks.c: Fixed #144962 (also in KNOWN_BUGS), |
60 | 88 | Disabled keyboard accels when dragging an object. |
61 | 89 | |
62 | -2004-07-16 Steffen Macke <sdteffen@web.de> | |
63 | - | |
64 | - * shapes/RDP/Makefile.am: Synchronized with 0_94_RELEASE branch | |
65 | - | |
66 | 90 | 2004-07-14 Lars Clausen <lars@raeder.dk> |
67 | 91 | |
68 | - * doc/diagram.dtd: | |
69 | - * doc/sheet.dtd: Move DTD namespace to new site, and syntactic fix. | |
70 | - | |
71 | 92 | * app/grid.c (snap_to_grid): Use diagrams grid setting to |
72 | 93 | determine hex grid snap. |
73 | 94 |
@@ -75,30 +96,8 @@ | ||
75 | 96 | |
76 | 97 | * app/interface.h: Avoid multiply defined symbols (#147396) |
77 | 98 | |
78 | -2004-07-13 Lars Clausen <lars@raeder.dk> | |
79 | - | |
80 | - * app/paginate_psprint.c (diagram_print_ps): Give usable type for | |
81 | - signal handler function -- Solaris uses a direct function type | |
82 | - that's different from what Linux has, but a void * will always | |
83 | - hold it. | |
84 | - | |
85 | -2004-07-13 Steffen Macke <sdteffen@web.de> | |
86 | - | |
87 | - * samples/Istar.dia: | |
88 | - * samples/KAOS.dia: | |
89 | - * samples/Jackson.dia: re-added to the CVS as binary files | |
90 | - | |
91 | -2004-07-11 Lars Clausen <lars@raeder.dk> | |
92 | - | |
93 | - * lib/dialibartrenderer.c: | |
94 | - * lib/dialibartrenderer.h (struct _DiaLibartRenderer): | |
95 | - * lib/object.c: | |
96 | - * lib/object.h (OBJECT_COMMON_PROPERTIES): First attempt at actual | |
97 | - rotation. Very primitive interface, only rect can rotate, only in | |
98 | - libart, and there the box collapses:( But it's progress. | |
99 | - | |
100 | 99 | 2004-07-10 Lars Clausen <lars@raeder.dk> |
101 | - | |
100 | + | |
102 | 101 | * app/sheets_dialog_callbacks.c (write_user_sheet): |
103 | 102 | * lib/sheet.c (load_register_sheet): Don't introduce double |
104 | 103 | slashes in namespace. |
@@ -106,15 +105,19 @@ | ||
106 | 105 | * lib/dia_xml.h (DIA_XML_NAME_SPACE_BASE): Keep consistent with |
107 | 106 | old diagrams, or XSLT will barf all over. |
108 | 107 | |
109 | -2004-07-10 Steffen Macke <sdteffen@web.de> | |
108 | + * shapes/RDP/place.shape: | |
109 | + * shapes/RDP/transition.shape: | |
110 | + * shapes/RDP/Makefile.am: Added .png entries to SHAPES and changed | |
111 | + shapes to use those. | |
110 | 112 | |
111 | - * makefile.msc: added doc target; updated for 0.94-pre1 release | |
112 | - * shapes/RDP/place.shape: | |
113 | - * shapes/RDP/transition.shape: use *.png instead of *.xpm | |
113 | +2004-07-07 Lars Clausen <lars@raeder.dk> | |
114 | 114 | |
115 | -2004-07-08 Steffen Macke <sdteffen@web.de> | |
116 | - | |
117 | - * plug-ins/wmf/wmf.cpp (UsePen): linewidth is now working for PS_SOLID | |
115 | + * config.h.win32: | |
116 | + * doc/{en,pl}/dia.xml: | |
117 | + * dia.spec: | |
118 | + * configure.in: | |
119 | + * NEWS: First prerelease of version 0.94. Now with release | |
120 | + versions in a branch and main devel in the trunk. | |
118 | 121 | |
119 | 122 | 2004-07-05 Hans Breuer <hans@breuer.org> |
120 | 123 |
@@ -1,3 +1,55 @@ | ||
1 | +dia-0.94-pre2: 17-Jul-2004 | |
2 | + | |
3 | +Second prerelease of version 0.94. Bunch of small fixes, but together | |
4 | +important enough to make a new prerelease. | |
5 | + | |
6 | +dia-0.94-pre1: 04-Jul-2004 | |
7 | + | |
8 | +First prerelease of version 0.94. News in this version: | |
9 | + | |
10 | +* Highlighting of objects when connecting to them makes it easier to | |
11 | + connect. | |
12 | + | |
13 | +* New shape sets include: | |
14 | + - RDP (Petri Networks shapes) | |
15 | + - KAOS (Goal-Directed Requirements Acquisition) | |
16 | + - I* (Intentional STrategic Actor Relationships modelling) | |
17 | + - Jackson (Jackson Diagrams) | |
18 | + - ChemEng (chemical engineering) | |
19 | + | |
20 | +* Hexagonal grid, for all you chemists out there. | |
21 | + | |
22 | +* Allow selection between layers, selectable in layers dialog. | |
23 | + | |
24 | +* Disparate persistence systems replaced by one combined system using XML, | |
25 | + leaves unknown preferences alone. | |
26 | + | |
27 | +* New renderer plug-in for Cairo rendering API. | |
28 | + | |
29 | +* New renderer plug-in for WMF outside of Windows. | |
30 | + | |
31 | +* New arrow head: Backslash. | |
32 | + | |
33 | +* Rounded corners on zigzaglines and polylines. | |
34 | + | |
35 | +* Automaticall open new diagram if now chosen at start. | |
36 | + | |
37 | +* Diagram modified status now based on undo information. | |
38 | + | |
39 | +* Wrapping operations arguments in UML objects. | |
40 | + | |
41 | +* Better positioning of association texts. | |
42 | + | |
43 | +* More persistence of toolbox selections and dialog entries. | |
44 | + | |
45 | +* Better handling of dialogs when parent dialogs close. | |
46 | + | |
47 | +* Changed from SGML to XML for docs, still DocBook. | |
48 | + | |
49 | +* Fix shape background color compatibility problem. | |
50 | + | |
51 | +* Many smaller bug fixes, leaks closed and stuff. | |
52 | + | |
1 | 53 | dia-0.93: 29-Apr-2004 |
2 | 54 | |
3 | 55 | Ready for release. |
@@ -105,7 +105,7 @@ create_diagram_properties_dialog(Diagram *dia) | ||
105 | 105 | NULL); |
106 | 106 | g_signal_connect(G_OBJECT(dialog), "delete_event", |
107 | 107 | G_CALLBACK(gtk_widget_hide), NULL); |
108 | - g_signal_connect(G_OBJECT(dialog), "destroy_event", | |
108 | + g_signal_connect(G_OBJECT(dialog), "destroy", | |
109 | 109 | G_CALLBACK(diagram_properties_dialog_destroyed), NULL); |
110 | 110 | |
111 | 111 | notebook = gtk_notebook_new(); |
@@ -332,6 +332,9 @@ file_save_as_callback(gpointer data, guint action, GtkWidget *widget) | ||
332 | 332 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compressbutton), |
333 | 333 | dia->data->is_compressed); |
334 | 334 | g_signal_handlers_unblock_by_func(G_OBJECT(compressbutton), toggle_compress_callback, NULL); |
335 | + diagram_remove_related_dialog(gtk_object_get_user_data(GTK_OBJECT(savedlg)), savedlg); | |
336 | + gtk_object_set_user_data(GTK_OBJECT(savedlg), dia); | |
337 | + diagram_add_related_dialog(dia, savedlg); | |
335 | 338 | if (GTK_WIDGET_VISIBLE(savedlg)) |
336 | 339 | return; |
337 | 340 | } |
@@ -524,6 +527,7 @@ file_export_callback(gpointer data, guint action, GtkWidget *widget) | ||
524 | 527 | |
525 | 528 | gtk_object_set_user_data(GTK_OBJECT(exportdlg), dia); |
526 | 529 | g_object_ref(dia); |
530 | + diagram_add_related_dialog(dia, exportdlg); | |
527 | 531 | gtk_widget_set_sensitive(exportdlg, TRUE); |
528 | 532 | if (GTK_WIDGET_VISIBLE(exportdlg)) |
529 | 533 | return; |
@@ -129,7 +129,7 @@ read_objects(xmlNodePtr objects, | ||
129 | 129 | list = NULL; |
130 | 130 | |
131 | 131 | obj_node = objects->xmlChildrenNode; |
132 | - | |
132 | + | |
133 | 133 | while ( obj_node != NULL) { |
134 | 134 | if (xmlIsBlankNode(obj_node)) { |
135 | 135 | obj_node = obj_node->next; |
@@ -193,6 +193,18 @@ pipe_handler(int signum) | ||
193 | 193 | sigpipe_received = TRUE; |
194 | 194 | } |
195 | 195 | |
196 | +static gboolean | |
197 | +diagram_print_destroy(GtkWidget *widget) | |
198 | +{ | |
199 | + Diagram **dia; | |
200 | + | |
201 | + if ((dia = gtk_object_get_user_data(GTK_OBJECT(widget))) != NULL) { | |
202 | + diagram_remove_related_dialog(*dia, widget); | |
203 | + *dia = NULL; | |
204 | + } | |
205 | + | |
206 | + return FALSE; | |
207 | +} | |
196 | 208 | |
197 | 209 | void |
198 | 210 | diagram_print_ps(Diagram *dia) |
@@ -217,6 +229,10 @@ diagram_print_ps(Diagram *dia) | ||
217 | 229 | |
218 | 230 | /* create the dialog */ |
219 | 231 | dialog = gtk_dialog_new(); |
232 | + diagram_add_related_dialog(dia, dialog); | |
233 | + gtk_object_set_user_data(GTK_OBJECT(dialog), &dia); | |
234 | + g_signal_connect(GTK_OBJECT(dialog), "delete_event", | |
235 | + G_CALLBACK(diagram_print_destroy), NULL); | |
220 | 236 | g_signal_connect(GTK_OBJECT(dialog), "delete_event", |
221 | 237 | G_CALLBACK(gtk_main_quit), NULL); |
222 | 238 | g_signal_connect(GTK_OBJECT(dialog), "delete_event", |
@@ -312,6 +328,11 @@ diagram_print_ps(Diagram *dia) | ||
312 | 328 | gtk_widget_show(dialog); |
313 | 329 | gtk_main(); |
314 | 330 | |
331 | + if(!dia) { | |
332 | + gtk_widget_destroy(dialog); | |
333 | + return; | |
334 | + } | |
335 | + | |
315 | 336 | if (!cont) { |
316 | 337 | persistence_change_string_entry("printer-command", orig_command, cmd); |
317 | 338 | persistence_change_string_entry("printer-file", orig_file, ofile); |
@@ -17,7 +17,7 @@ | ||
17 | 17 | #define GETTEXT_PACKAGE "dia" |
18 | 18 | #define LOCALEDIR "../lib/locale" |
19 | 19 | |
20 | -#define VERSION "0.93+cvs" | |
20 | +#define VERSION "0.94-pre2" | |
21 | 21 | |
22 | 22 | /* |
23 | 23 | * 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.93+cvs, http://bugzilla.gnome.org/enter_bug.cgi?product=dia) | |
3 | +AC_INIT(dia, 0.94-pre2, 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 |
@@ -451,6 +451,7 @@ shapes/Misc/Makefile | ||
451 | 451 | shapes/MSE/Makefile |
452 | 452 | shapes/network/Makefile |
453 | 453 | shapes/Pneumatic/Makefile |
454 | +shapes/RDP/Makefile | |
454 | 455 | shapes/SDL/Makefile |
455 | 456 | shapes/sybase/Makefile |
456 | 457 | app/Makefile |
@@ -1,12 +1,12 @@ | ||
1 | 1 | %define name dia |
2 | 2 | # This is the full Dia version |
3 | -%define ver 0.93 | |
3 | +%define ver 0.94 | |
4 | 4 | |
5 | 5 | Summary: A gtk+ based diagram creation program. |
6 | 6 | Name: %name |
7 | 7 | Version: %ver |
8 | 8 | # This indicates changes to the spec file after last time %ver has changed. |
9 | -Release: cvs | |
9 | +Release: pre2 | |
10 | 10 | Copyright: GPL |
11 | 11 | Group: Applications/ |
12 | 12 | Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz |
@@ -8,7 +8,7 @@ | ||
8 | 8 | |
9 | 9 | [ |
10 | 10 | |
11 | - <!ENTITY VERSION "0.94-devel"> | |
11 | + <!ENTITY VERSION "0.94-pre2"> | |
12 | 12 | |
13 | 13 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
14 | 14 |
@@ -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.94-devel"> | |
4 | +<!ENTITY VERSION "0.94-pre2"> | |
5 | 5 | <!ENTITY INTRODUCTION SYSTEM "intro.sgml"> |
6 | 6 | <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml"> |
7 | 7 | <!ENTITY CANVAS SYSTEM "usage-canvas.sgml"> |
@@ -19,8 +19,6 @@ | ||
19 | 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | */ |
21 | 21 | |
22 | -#undef GTK_DISABLE_DEPRECATED /* GtkTypeInfo, gtk_widget_queue_clear, ... */ | |
23 | - | |
24 | 22 | #include <gtk/gtk.h> |
25 | 23 | |
26 | 24 | #include "intl.h" |
@@ -31,12 +29,6 @@ | ||
31 | 29 | static const char *button_menu_key = "dia-button-menu"; |
32 | 30 | static const char *menuitem_enum_key = "dia-menuitem-value"; |
33 | 31 | |
34 | -static gint close_and_hide(GtkWidget *wid, GdkEventAny *event) | |
35 | -{ | |
36 | - gtk_widget_hide(wid); | |
37 | - return TRUE; | |
38 | -} | |
39 | - | |
40 | 32 | /* --------------- DiaArrowPreview -------------------------------- */ |
41 | 33 | static void dia_arrow_preview_set(DiaArrowPreview *arrow, |
42 | 34 | ArrowType atype, gboolean left); |
@@ -46,25 +38,28 @@ static void dia_arrow_preview_init (DiaArrowPreview *arrow); | ||
46 | 38 | static gint dia_arrow_preview_expose (GtkWidget *widget, |
47 | 39 | GdkEventExpose *event); |
48 | 40 | |
49 | -GtkType | |
41 | +GType | |
50 | 42 | dia_arrow_preview_get_type (void) |
51 | 43 | { |
52 | - static GtkType arrow_type = 0; | |
53 | - | |
54 | - if (!arrow_type) { | |
55 | - static const GtkTypeInfo arrow_info = { | |
56 | - "DiaArrowPreview", | |
57 | - sizeof (DiaArrowPreview), | |
58 | - sizeof (DiaArrowPreviewClass), | |
59 | - (GtkClassInitFunc) dia_arrow_preview_class_init, | |
60 | - (GtkObjectInitFunc) dia_arrow_preview_init, | |
61 | - /* reserved_1 */ NULL, | |
62 | - /* reserved_2 */ NULL, | |
63 | - (GtkClassInitFunc) NULL, | |
64 | - }; | |
65 | - arrow_type = gtk_type_unique (GTK_TYPE_MISC, &arrow_info); | |
66 | - } | |
67 | - return arrow_type; | |
44 | + static GType type = 0; | |
45 | + | |
46 | + if (!type) { | |
47 | + static const GTypeInfo info = { | |
48 | + sizeof (DiaArrowPreviewClass), | |
49 | + (GBaseInitFunc) NULL, | |
50 | + (GBaseFinalizeFunc) NULL, | |
51 | + (GClassInitFunc) dia_arrow_preview_class_init, | |
52 | + (GClassFinalizeFunc) NULL, | |
53 | + NULL, | |
54 | + sizeof (DiaArrowPreview), | |
55 | + 0, | |
56 | + (GInstanceInitFunc) dia_arrow_preview_init | |
57 | + }; | |
58 | + | |
59 | + type = g_type_register_static(GTK_TYPE_MISC, "DiaArrowPreview", &info, 0); | |
60 | + } | |
61 | + | |
62 | + return type; | |
68 | 63 | } |
69 | 64 | |
70 | 65 | static void |
@@ -72,7 +67,7 @@ dia_arrow_preview_class_init (DiaArrowPreviewClass *class) | ||
72 | 67 | { |
73 | 68 | GtkWidgetClass *widget_class; |
74 | 69 | |
75 | - widget_class = (GtkWidgetClass *)class; | |
70 | + widget_class = GTK_WIDGET_CLASS (class); | |
76 | 71 | widget_class->expose_event = dia_arrow_preview_expose; |
77 | 72 | } |
78 | 73 |
@@ -91,7 +86,7 @@ dia_arrow_preview_init (DiaArrowPreview *arrow) | ||
91 | 86 | GtkWidget * |
92 | 87 | dia_arrow_preview_new (ArrowType atype, gboolean left) |
93 | 88 | { |
94 | - DiaArrowPreview *arrow = gtk_type_new (dia_arrow_preview_get_type()); | |
89 | + DiaArrowPreview *arrow = g_object_new(DIA_TYPE_ARROW_PREVIEW, NULL); | |
95 | 90 | |
96 | 91 | arrow->atype = atype; |
97 | 92 | arrow->left = left; |
@@ -105,7 +100,7 @@ dia_arrow_preview_set(DiaArrowPreview *arrow, ArrowType atype, gboolean left) | ||
105 | 100 | arrow->atype = atype; |
106 | 101 | arrow->left = left; |
107 | 102 | if (GTK_WIDGET_DRAWABLE(arrow)) |
108 | - gtk_widget_queue_clear(GTK_WIDGET(arrow)); | |
103 | + gtk_widget_queue_draw(GTK_WIDGET(arrow)); | |
109 | 104 | } |
110 | 105 | } |
111 | 106 |
@@ -159,56 +154,60 @@ dia_arrow_preview_expose(GtkWidget *widget, GdkEventExpose *event) | ||
159 | 154 | |
160 | 155 | /* ------- Code for DiaArrowChooser ----------------------- */ |
161 | 156 | |
162 | - | |
163 | - | |
164 | - | |
165 | 157 | static void dia_arrow_chooser_class_init (DiaArrowChooserClass *klass); |
166 | 158 | static void dia_arrow_chooser_init (DiaArrowChooser *arrow); |
167 | -static gint dia_arrow_chooser_event (GtkWidget *widget, | |
168 | - GdkEvent *event); | |
169 | -static void dia_arrow_chooser_dialog_ok (DiaArrowChooser *arrow); | |
170 | -static void dia_arrow_chooser_dialog_cancel (DiaArrowChooser *arrow); | |
171 | -static void dia_arrow_chooser_dialog_destroy (DiaArrowChooser *arrow); | |
172 | -static void dia_arrow_chooser_change_arrow_type (GtkMenuItem *mi, | |
173 | - DiaArrowChooser *arrow); | |
174 | -static void dia_arrow_chooser_dialog_new(GtkWidget *widget, gpointer userdata); | |
175 | -static void dia_arrow_chooser_dialog_show(GtkWidget *widget, gpointer userdata); | |
176 | - | |
177 | -GtkType | |
159 | + | |
160 | +GType | |
178 | 161 | dia_arrow_chooser_get_type (void) |
179 | 162 | { |
180 | - static GtkType arrow_type = 0; | |
181 | - | |
182 | - if (!arrow_type) { | |
183 | - static const GtkTypeInfo arrow_info = { | |
184 | - "DiaArrowChooser", | |
185 | - sizeof (DiaArrowChooser), | |
186 | - sizeof (DiaArrowChooserClass), | |
187 | - (GtkClassInitFunc) dia_arrow_chooser_class_init, | |
188 | - (GtkObjectInitFunc) dia_arrow_chooser_init, | |
189 | - /* reserved_1 */ NULL, | |
190 | - /* reserved_2 */ NULL, | |
191 | - (GtkClassInitFunc) NULL, | |
192 | - }; | |
193 | - arrow_type = gtk_type_unique (GTK_TYPE_BUTTON, &arrow_info); | |
194 | - } | |
195 | - return arrow_type; | |
163 | + static GType type = 0; | |
164 | + | |
165 | + if (!type) { | |
166 | + static const GTypeInfo info = { | |
167 | + sizeof (DiaArrowChooserClass), | |
168 | + (GBaseInitFunc) NULL, | |
169 | + (GBaseFinalizeFunc) NULL, | |
170 | + (GClassInitFunc) dia_arrow_chooser_class_init, | |
171 | + (GClassFinalizeFunc) NULL, | |
172 | + NULL, | |
173 | + sizeof (DiaArrowChooser), | |
174 | + 0, | |
175 | + (GInstanceInitFunc) dia_arrow_chooser_init | |
176 | + }; | |
177 | + | |
178 | + type = g_type_register_static(GTK_TYPE_BUTTON, "DiaArrowChooser", &info, 0); | |
179 | + } | |
180 | + | |
181 | + return type; | |
182 | +} | |
183 | + | |
184 | +static gint | |
185 | +dia_arrow_chooser_event(GtkWidget *widget, GdkEvent *event) | |
186 | +{ | |
187 | + if (event->type == GDK_BUTTON_PRESS && event->button.button == 1) { | |
188 | + GtkMenu *menu = gtk_object_get_data(GTK_OBJECT(widget), button_menu_key); | |
189 | + gtk_menu_popup(menu, NULL, NULL, NULL, NULL, | |
190 | + event->button.button, event->button.time); | |
191 | + return TRUE; | |
192 | + } | |
193 | + | |
194 | + return FALSE; | |
196 | 195 | } |
197 | 196 | |
198 | 197 | static void |
199 | -dia_arrow_chooser_class_init (DiaArrowChooserClass *class) | |
198 | +dia_arrow_chooser_class_init(DiaArrowChooserClass *class) | |
200 | 199 | { |
201 | 200 | GtkWidgetClass *widget_class; |
202 | 201 | |
203 | - widget_class = (GtkWidgetClass *)class; | |
202 | + widget_class = GTK_WIDGET_CLASS(class); | |
204 | 203 | widget_class->event = dia_arrow_chooser_event; |
205 | 204 | } |
206 | 205 | |
207 | 206 | static void |
208 | -dia_arrow_chooser_init (DiaArrowChooser *arrow) | |
207 | +dia_arrow_chooser_init(DiaArrowChooser *arrow) | |
209 | 208 | { |
210 | 209 | GtkWidget *wid; |
211 | - | |
210 | + | |
212 | 211 | arrow->left = FALSE; |
213 | 212 | arrow->arrow.type = ARROW_NONE; |
214 | 213 | arrow->arrow.length = DEFAULT_ARROW_LENGTH; |
@@ -222,62 +221,86 @@ dia_arrow_chooser_init (DiaArrowChooser *arrow) | ||
222 | 221 | arrow->dialog = NULL; |
223 | 222 | } |
224 | 223 | |
225 | -/* Creating the dialog separately so we can handle destroy */ | |
226 | 224 | static void |
227 | -dia_arrow_chooser_dialog_new(GtkWidget *widget, gpointer userdata) | |
225 | +dia_arrow_chooser_dialog_response (GtkWidget *dialog, | |
226 | + gint response_id, | |
227 | + DiaArrowChooser *chooser) | |
228 | 228 | { |
229 | - DiaArrowChooser *chooser = DIA_ARROW_CHOOSER(userdata); | |
230 | - if (chooser->dialog == NULL) { | |
231 | - GtkWidget *wid; | |
232 | - chooser->dialog = wid = gtk_dialog_new(); | |
233 | - gtk_window_set_title(GTK_WINDOW(wid), _("Arrow Properties")); | |
234 | - g_signal_connect(GTK_OBJECT(wid), "delete_event", | |
235 | - G_CALLBACK(close_and_hide), NULL); | |
236 | - g_signal_connect(GTK_OBJECT(wid), "destroy", | |
237 | - G_CALLBACK(gtk_widget_destroyed), | |
238 | - &chooser->dialog); | |
239 | - | |
240 | - wid = dia_arrow_selector_new(); | |
241 | - gtk_container_set_border_width(GTK_CONTAINER(wid), 5); | |
242 | - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(chooser->dialog)->vbox), wid, | |
243 | - TRUE, TRUE, 0); | |
244 | - gtk_widget_show(wid); | |
245 | - chooser->selector = DIA_ARROW_SELECTOR(wid); | |
229 | + if (response_id == GTK_RESPONSE_OK) { | |
230 | + Arrow new_arrow = dia_arrow_selector_get_arrow(chooser->selector); | |
231 | + | |
232 | + if (new_arrow.type != chooser->arrow.type || | |
233 | + new_arrow.length != chooser->arrow.length || | |
234 | + new_arrow.width != chooser->arrow.width) { | |
235 | + chooser->arrow = new_arrow; | |
236 | + dia_arrow_preview_set(chooser->preview, new_arrow.type, chooser->left); | |
237 | + if (chooser->callback) | |
238 | + (* chooser->callback)(chooser->arrow, chooser->user_data); | |
239 | + } | |
240 | + } else { | |
246 | 241 | dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow); |
242 | + } | |
243 | + gtk_widget_hide(chooser->dialog); | |
244 | +} | |
245 | + | |
246 | +static void | |
247 | +dia_arrow_chooser_dialog_new(DiaArrowChooser *chooser) | |
248 | +{ | |
249 | + GtkWidget *wid; | |
250 | + | |
251 | + chooser->dialog = gtk_dialog_new_with_buttons(_("Arrow Properties"), | |
252 | + NULL, | |
253 | + GTK_DIALOG_NO_SEPARATOR, | |
254 | + GTK_STOCK_CANCEL, | |
255 | + GTK_RESPONSE_CANCEL, | |
256 | + GTK_STOCK_OK, | |
257 | + GTK_RESPONSE_OK, | |
258 | + NULL); | |
259 | + gtk_dialog_set_default_response(GTK_DIALOG(chooser->dialog), | |
260 | + GTK_RESPONSE_OK); | |
261 | + g_signal_connect(G_OBJECT(chooser->dialog), "response", | |
262 | + G_CALLBACK(dia_arrow_chooser_dialog_response), chooser); | |
263 | + g_signal_connect(G_OBJECT(chooser->dialog), "destroy", | |
264 | + G_CALLBACK(gtk_widget_destroyed), &chooser->dialog); | |
265 | + | |
266 | + wid = dia_arrow_selector_new(); | |
267 | + gtk_container_set_border_width(GTK_CONTAINER(wid), 5); | |
268 | + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(chooser->dialog)->vbox), wid, | |
269 | + TRUE, TRUE, 0); | |
270 | + gtk_widget_show(wid); | |
271 | + chooser->selector = DIA_ARROW_SELECTOR(wid); | |
272 | +} | |
247 | 273 | |
248 | - wid = gtk_button_new_with_label(_("OK")); | |
249 | - GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); | |
250 | - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(chooser->dialog)->action_area),wid); | |
251 | - gtk_widget_grab_default(wid); | |
252 | - g_signal_connect_swapped(GTK_OBJECT(wid), "clicked", | |
253 | - G_CALLBACK(dia_arrow_chooser_dialog_ok), | |
254 | - GTK_OBJECT(chooser)); | |
255 | - gtk_widget_show(wid); | |
256 | - | |
257 | - wid = gtk_button_new_with_label(_("Cancel")); | |
258 | - GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); | |
259 | - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(chooser->dialog)->action_area),wid); | |
260 | - g_signal_connect_swapped(GTK_OBJECT(wid), "clicked", | |
261 | - G_CALLBACK(dia_arrow_chooser_dialog_cancel), | |
262 | - GTK_OBJECT(chooser)); | |
263 | - gtk_widget_show(wid); | |
274 | +static void | |
275 | +dia_arrow_chooser_dialog_show(GtkWidget *widget, DiaArrowChooser *chooser) | |
276 | +{ | |
277 | + if (chooser->dialog) { | |
278 | + gtk_window_present(GTK_WINDOW(chooser->dialog)); | |
279 | + return; | |
264 | 280 | } |
281 | + | |
282 | + dia_arrow_chooser_dialog_new(chooser); | |
283 | + dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow); | |
284 | + gtk_widget_show(chooser->dialog); | |
265 | 285 | } |
266 | 286 | |
267 | 287 | static void |
268 | -dia_arrow_chooser_dialog_show(GtkWidget *widget, gpointer userdata) | |
288 | +dia_arrow_chooser_change_arrow_type(GtkMenuItem *mi, DiaArrowChooser *chooser) | |
269 | 289 | { |
270 | - DiaArrowChooser *chooser = DIA_ARROW_CHOOSER(userdata); | |
271 | - dia_arrow_chooser_dialog_new(widget, chooser); | |
272 | - dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow); | |
273 | - gtk_widget_show(chooser->dialog); | |
290 | + ArrowType atype = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mi), | |
291 | + menuitem_enum_key)); | |
292 | + Arrow arrow; | |
293 | + arrow.width = chooser->arrow.width; | |
294 | + arrow.length = chooser->arrow.length; | |
295 | + arrow.type = atype; | |
296 | + dia_arrow_chooser_set_arrow(chooser, &arrow); | |
274 | 297 | } |
275 | 298 | |
276 | 299 | GtkWidget * |
277 | 300 | dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback, |
278 | 301 | gpointer user_data, GtkTooltips *tool_tips) |
279 | 302 | { |
280 | - DiaArrowChooser *chooser = gtk_type_new(dia_arrow_chooser_get_type()); | |
303 | + DiaArrowChooser *chooser = g_object_new(DIA_TYPE_ARROW_CHOOSER, NULL); | |
281 | 304 | GtkWidget *menu, *mi, *ar; |
282 | 305 | gint i; |
283 | 306 |
@@ -286,17 +309,15 @@ dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback, | ||
286 | 309 | chooser->callback = callback; |
287 | 310 | chooser->user_data = user_data; |
288 | 311 | |
289 | - dia_arrow_chooser_dialog_new(NULL, chooser); | |
290 | - | |
291 | 312 | menu = gtk_menu_new(); |
292 | 313 | g_object_ref(G_OBJECT(menu)); |
293 | 314 | gtk_object_sink(GTK_OBJECT(menu)); |
294 | - gtk_object_set_data_full(GTK_OBJECT(chooser), button_menu_key, menu, | |
295 | - (GtkDestroyNotify)gtk_widget_unref); | |
315 | + g_object_set_data_full(G_OBJECT(chooser), button_menu_key, menu, | |
316 | + (GtkDestroyNotify)gtk_widget_unref); | |
296 | 317 | for (i = 0; arrow_types[i].name != NULL; i++) { |
297 | 318 | mi = gtk_menu_item_new(); |
298 | - gtk_object_set_data(GTK_OBJECT(mi), menuitem_enum_key, | |
299 | - GINT_TO_POINTER(arrow_types[i].enum_value)); | |
319 | + g_object_set_data(G_OBJECT(mi), menuitem_enum_key, | |
320 | + GINT_TO_POINTER(arrow_types[i].enum_value)); | |
300 | 321 | if (tool_tips) { |
301 | 322 | gtk_tooltips_set_tip(tool_tips, mi, arrow_types[i].name, NULL); |
302 | 323 | } |
@@ -304,82 +325,25 @@ dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback, | ||
304 | 325 | |
305 | 326 | gtk_container_add(GTK_CONTAINER(mi), ar); |
306 | 327 | gtk_widget_show(ar); |
307 | - g_signal_connect(GTK_OBJECT(mi), "activate", | |
308 | - G_CALLBACK(dia_arrow_chooser_change_arrow_type), | |
309 | - chooser); | |
310 | - gtk_container_add(GTK_CONTAINER(menu), mi); | |
328 | + g_signal_connect(G_OBJECT(mi), "activate", | |
329 | + G_CALLBACK(dia_arrow_chooser_change_arrow_type), chooser); | |
330 | + gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); | |
311 | 331 | gtk_widget_show(mi); |
312 | 332 | } |
313 | 333 | mi = gtk_menu_item_new_with_label(_("Details...")); |
314 | - g_signal_connect(GTK_OBJECT(mi), "activate", | |
315 | - G_CALLBACK(dia_arrow_chooser_dialog_show), | |
316 | - GTK_OBJECT(chooser)); | |
317 | - gtk_container_add(GTK_CONTAINER(menu), mi); | |
334 | + g_signal_connect(G_OBJECT(mi), "activate", | |
335 | + G_CALLBACK(dia_arrow_chooser_dialog_show), chooser); | |
336 | + gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); | |
318 | 337 | gtk_widget_show(mi); |
319 | 338 | |
320 | 339 | return GTK_WIDGET(chooser); |
321 | 340 | } |
322 | 341 | |
323 | -static gint | |
324 | -dia_arrow_chooser_event(GtkWidget *widget, GdkEvent *event) | |
325 | -{ | |
326 | - if (event->type == GDK_BUTTON_PRESS && event->button.button == 1) { | |
327 | - GtkMenu *menu = gtk_object_get_data(GTK_OBJECT(widget), button_menu_key); | |
328 | - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, | |
329 | - event->button.button, event->button.time); | |
330 | - return TRUE; | |
331 | - } | |
332 | - return FALSE; | |
333 | -} | |
334 | - | |
335 | -static void | |
336 | -dia_arrow_chooser_dialog_ok (DiaArrowChooser *arrow) | |
337 | -{ | |
338 | - Arrow new_arrow = dia_arrow_selector_get_arrow(arrow->selector); | |
339 | - | |
340 | - if (new_arrow.type != arrow->arrow.type || | |
341 | - new_arrow.length != arrow->arrow.length || | |
342 | - new_arrow.width != arrow->arrow.width) { | |
343 | - arrow->arrow = new_arrow; | |
344 | - dia_arrow_preview_set(arrow->preview, new_arrow.type, arrow->left); | |
345 | - if (arrow->callback) | |
346 | - (* arrow->callback)(arrow->arrow, arrow->user_data); | |
347 | - } | |
348 | - gtk_widget_hide(arrow->dialog); | |
349 | -} | |
350 | - | |
351 | -static void | |
352 | -dia_arrow_chooser_dialog_cancel (DiaArrowChooser *arrow) | |
353 | -{ | |
354 | - if (arrow->dialog != NULL) | |
355 | - dia_arrow_selector_set_arrow(arrow->selector, arrow->arrow); | |
356 | - gtk_widget_hide(arrow->dialog); | |
357 | -} | |
358 | - | |
359 | -static void | |
360 | -dia_arrow_chooser_dialog_destroy (DiaArrowChooser *chooser) | |
361 | -{ | |
362 | - /* dia_arrow_selector_set_arrow(arrow->selector, arrow->arrow);*/ | |
363 | - chooser->dialog = NULL; | |
364 | - chooser->selector = NULL; | |
365 | -} | |
366 | - | |
367 | -static void | |
368 | -dia_arrow_chooser_change_arrow_type(GtkMenuItem *mi, DiaArrowChooser *chooser) | |
369 | -{ | |
370 | - ArrowType atype = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(mi), | |
371 | - menuitem_enum_key)); | |
372 | - Arrow arrow; | |
373 | - arrow.width = chooser->arrow.width; | |
374 | - arrow.length = chooser->arrow.length; | |
375 | - arrow.type = atype; | |
376 | - dia_arrow_chooser_set_arrow(chooser, &arrow); | |
377 | -} | |
378 | - | |
379 | 342 | /** Set the type of arrow shown by the arrow chooser. |
380 | 343 | */ |
381 | 344 | void |
382 | -dia_arrow_chooser_set_arrow(DiaArrowChooser *chooser, Arrow *arrow) { | |
345 | +dia_arrow_chooser_set_arrow(DiaArrowChooser *chooser, Arrow *arrow) | |
346 | +{ | |
383 | 347 | if (chooser->arrow.type != arrow->type) { |
384 | 348 | dia_arrow_preview_set(chooser->preview, arrow->type, chooser->left); |
385 | 349 | chooser->arrow.type = arrow->type; |
@@ -392,6 +356,9 @@ dia_arrow_chooser_set_arrow(DiaArrowChooser *chooser, Arrow *arrow) { | ||
392 | 356 | chooser->arrow.length = arrow->length; |
393 | 357 | } |
394 | 358 | |
395 | -ArrowType dia_arrow_chooser_get_arrow_type(DiaArrowChooser *arrow) { | |
359 | +ArrowType | |
360 | +dia_arrow_chooser_get_arrow_type(DiaArrowChooser *arrow) | |
361 | +{ | |
396 | 362 | return arrow->arrow.type; |
397 | 363 | } |
364 | + |
@@ -19,8 +19,6 @@ | ||
19 | 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | */ |
21 | 21 | |
22 | - | |
23 | - | |
24 | 22 | #ifndef _DIAARROWCHOOSER_H_ |
25 | 23 | #define _DIAARROWCHOOSER_H_ |
26 | 24 |
@@ -31,14 +29,17 @@ | ||
31 | 29 | |
32 | 30 | |
33 | 31 | /* --------------- DiaArrowPreview -------------------------------- */ |
34 | -typedef struct _DiaArrowPreview DiaArrowPreview; | |
35 | -typedef struct _DiaArrowPreviewClass DiaArrowPreviewClass; | |
32 | +GType dia_arrow_preview_get_type (void); | |
36 | 33 | |
37 | -GtkType dia_arrow_preview_get_type (void); | |
38 | -GtkWidget *dia_arrow_preview_new (ArrowType atype, gboolean left); | |
34 | +#define DIA_TYPE_ARROW_PREVIEW (dia_arrow_preview_get_type ()) | |
35 | +#define DIA_ARROW_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_ARROW_PREVIEW, DiaArrowPreview)) | |
36 | +#define DIA_ARROW_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIA_TYPE_ARROW_PREVIEW, DiaArrowPreviewClass)) | |
37 | +#define DIA_IS_ARROW_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_ARROW_PREVIEW)) | |
38 | +#define DIA_IS_ARROW_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIA_TYPE_ARROW_PREVIEW)) | |
39 | +#define DIA_ARROW_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIA_TYPE_ARROW_PREVIEW, DiaArrowPreviewClass)) | |
39 | 40 | |
40 | -#define DIA_ARROW_PREVIEW(obj) (GTK_CHECK_CAST((obj),dia_arrow_preview_get_type(), DiaArrowPreview)) | |
41 | -#define DIA_ARROW_PREVIEW_CLASS(obj) (GTK_CHECK_CLASS_CAST((obj), dia_arrow_preview_get_type(), DiaArrowPreviewClass)) | |
41 | +typedef struct _DiaArrowPreview DiaArrowPreview; | |
42 | +typedef struct _DiaArrowPreviewClass DiaArrowPreviewClass; | |
42 | 43 | |
43 | 44 | struct _DiaArrowPreview |
44 | 45 | { |
@@ -46,24 +47,30 @@ struct _DiaArrowPreview | ||
46 | 47 | ArrowType atype; |
47 | 48 | gboolean left; |
48 | 49 | }; |
50 | + | |
49 | 51 | struct _DiaArrowPreviewClass |
50 | 52 | { |
51 | 53 | GtkMiscClass parent_class; |
52 | 54 | }; |
53 | 55 | |
56 | +GtkWidget *dia_arrow_preview_new (ArrowType atype, gboolean left); | |
57 | + | |
54 | 58 | |
55 | 59 | /* ------- Code for DiaArrowChooser ----------------------- */ |
60 | +GType dia_arrow_chooser_get_type (void); | |
61 | + | |
62 | +#define DIA_TYPE_ARROW_CHOOSER (dia_arrow_chooser_get_type ()) | |
63 | +#define DIA_ARROW_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_ARROW_CHOOSER, DiaArrowChooser)) | |
64 | +#define DIA_ARROW_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIA_TYPE_ARROW_CHOOSER, DiaArrowChooserClass)) | |
65 | +#define DIA_IS_ARROW_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_ARROW_CHOOSER)) | |
66 | +#define DIA_IS_ARROW_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIA_TYPE_ARROW_CHOOSER)) | |
67 | +#define DIA_ARROW_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIA_TYPE_ARROW_CHOOSER, DiaArrowChooserClass)) | |
56 | 68 | |
57 | 69 | typedef struct _DiaArrowChooser DiaArrowChooser; |
58 | 70 | typedef struct _DiaArrowChooserClass DiaArrowChooserClass; |
59 | 71 | |
60 | 72 | typedef void (*DiaChangeArrowCallback) (Arrow atype, gpointer user_data); |
61 | 73 | |
62 | -GtkType dia_arrow_chooser_get_type (void); | |
63 | - | |
64 | -#define DIA_ARROW_CHOOSER(obj) (GTK_CHECK_CAST((obj),dia_arrow_chooser_get_type(), DiaArrowChooser)) | |
65 | -#define DIA_ARROW_CHOOSER_CLASS(obj) (GTK_CHECK_CLASS_CAST((obj), dia_arrow_chooser_get_type(), DiaArrowChooserClass)) | |
66 | - | |
67 | 74 | struct _DiaArrowChooser |
68 | 75 | { |
69 | 76 | GtkButton button; |
@@ -77,6 +84,7 @@ struct _DiaArrowChooser | ||
77 | 84 | GtkWidget *dialog; |
78 | 85 | DiaArrowSelector *selector; |
79 | 86 | }; |
87 | + | |
80 | 88 | struct _DiaArrowChooserClass |
81 | 89 | { |
82 | 90 | GtkButtonClass parent_class; |
@@ -88,4 +96,4 @@ GtkWidget *dia_arrow_chooser_new (gboolean left, | ||
88 | 96 | void dia_arrow_chooser_set_arrow(DiaArrowChooser *chooser, Arrow *arrow); |
89 | 97 | ArrowType dia_arrow_chooser_get_arrow_type(DiaArrowChooser *chooser); |
90 | 98 | |
91 | -#endif | |
99 | +#endif /* _DIAARROWCHOOSER_H_ */ |
@@ -108,14 +108,6 @@ get_height_pixels (DiaRenderer *self) | ||
108 | 108 | static void |
109 | 109 | begin_render(DiaRenderer *self) |
110 | 110 | { |
111 | - DiaLibartRenderer *renderer = DIA_LIBART_RENDERER (self); | |
112 | - double* transmatrix; | |
113 | - | |
114 | - transmatrix = g_new0(double, 6); | |
115 | - transmatrix[0] = 1.0; | |
116 | - transmatrix[4] = 1.0; | |
117 | - | |
118 | - renderer->matrices = g_list_prepend(renderer->matrices, transmatrix); | |
119 | 111 | #ifdef HAVE_FREETYPE |
120 | 112 | /* pango_ft2_get_context API docs : |
121 | 113 | * ... Use of this function is discouraged, ... |
@@ -137,10 +129,6 @@ begin_render(DiaRenderer *self) | ||
137 | 129 | static void |
138 | 130 | end_render(DiaRenderer *self) |
139 | 131 | { |
140 | - DiaLibartRenderer *renderer = DIA_LIBART_RENDERER (self); | |
141 | - double* transmatrix; | |
142 | - | |
143 | - g_free(renderer->matrices->data); | |
144 | 132 | dia_font_pop_context(); |
145 | 133 | } |
146 | 134 |
@@ -317,7 +305,7 @@ draw_line(DiaRenderer *self, | ||
317 | 305 | Color *line_color) |
318 | 306 | { |
319 | 307 | DiaLibartRenderer *renderer = DIA_LIBART_RENDERER (self); |
320 | - ArtVpath *vpath, *vpath_dashed, *vpath_transformed; | |
308 | + ArtVpath *vpath, *vpath_dashed; | |
321 | 309 | ArtSVP *svp; |
322 | 310 | guint32 rgba; |
323 | 311 | double x,y; |
@@ -346,24 +334,14 @@ draw_line(DiaRenderer *self, | ||
346 | 334 | vpath = vpath_dashed; |
347 | 335 | } |
348 | 336 | |
349 | -#if 0 /* if only someone would initialized the matrices or is my liabrt broken ? --hb */ | |
350 | - vpath_transformed = | |
351 | - art_vpath_affine_transform(vpath, renderer->matrices->data); | |
352 | - | |
353 | - art_free(vpath); | |
354 | -#else | |
355 | - /* just to have minimal changes */ | |
356 | - vpath_transformed = vpath; | |
357 | -#endif | |
358 | - | |
359 | - svp = art_svp_vpath_stroke (vpath_transformed, | |
337 | + svp = art_svp_vpath_stroke (vpath, | |
360 | 338 | renderer->join_style, |
361 | 339 | renderer->cap_style, |
362 | 340 | renderer->line_width, |
363 | 341 | 4, |
364 | 342 | 0.25); |
365 | 343 | |
366 | - art_free( vpath_transformed ); | |
344 | + art_free( vpath ); | |
367 | 345 | |
368 | 346 | art_rgb_svp_alpha (svp, |
369 | 347 | 0, 0, |
@@ -545,11 +523,10 @@ draw_rect(DiaRenderer *self, | ||
545 | 523 | Color *color) |
546 | 524 | { |
547 | 525 | DiaLibartRenderer *renderer = DIA_LIBART_RENDERER (self); |
548 | - ArtVpath *vpath, *vpath_dashed, *vpath_transformed; | |
526 | + ArtVpath *vpath, *vpath_dashed; | |
549 | 527 | ArtSVP *svp; |
550 | 528 | guint32 rgba; |
551 | 529 | double top, bottom, left, right; |
552 | - real translate[6]; | |
553 | 530 | |
554 | 531 | dia_transform_coords_double(renderer->transform, |
555 | 532 | ul_corner->x, ul_corner->y, &left, &top); |
@@ -564,20 +541,20 @@ draw_rect(DiaRenderer *self, | ||
564 | 541 | vpath = art_new (ArtVpath, 6); |
565 | 542 | |
566 | 543 | vpath[0].code = ART_MOVETO; |
567 | - vpath[0].x = 0; | |
568 | - vpath[0].y = 0; | |
544 | + vpath[0].x = left; | |
545 | + vpath[0].y = top; | |
569 | 546 | vpath[1].code = ART_LINETO; |
570 | - vpath[1].x = right-left; | |
571 | - vpath[1].y = 0; | |
547 | + vpath[1].x = right; | |
548 | + vpath[1].y = top; | |
572 | 549 | vpath[2].code = ART_LINETO; |
573 | - vpath[2].x = right-left; | |
574 | - vpath[2].y = bottom-top; | |
550 | + vpath[2].x = right; | |
551 | + vpath[2].y = bottom; | |
575 | 552 | vpath[3].code = ART_LINETO; |
576 | - vpath[3].x = 0; | |
577 | - vpath[3].y = bottom-top; | |
553 | + vpath[3].x = left; | |
554 | + vpath[3].y = bottom; | |
578 | 555 | vpath[4].code = ART_LINETO; |
579 | - vpath[4].x = 0; | |
580 | - vpath[4].y = 0; | |
556 | + vpath[4].x = left; | |
557 | + vpath[4].y = top; | |
581 | 558 | vpath[5].code = ART_END; |
582 | 559 | vpath[5].x = 0; |
583 | 560 | vpath[5].y = 0; |
@@ -588,22 +565,6 @@ draw_rect(DiaRenderer *self, | ||
588 | 565 | vpath = vpath_dashed; |
589 | 566 | } |
590 | 567 | |
591 | -#if 0 /* if only someone would initialized the matrices or is my libart broken ? --hb */ | |
592 | - { | |
593 | - vpath_transformed = | |
594 | - art_vpath_affine_transform(vpath, renderer->matrices->data); | |
595 | - art_free(vpath); | |
596 | - vpath = vpath_transformed; | |
597 | - } | |
598 | -#endif | |
599 | - { | |
600 | - art_affine_translate(translate, left, top); | |
601 | - vpath_transformed = | |
602 | - art_vpath_affine_transform(vpath, translate); | |
603 | - art_free(vpath); | |
604 | - vpath = vpath_transformed; | |
605 | - } | |
606 | - | |
607 | 568 | svp = art_svp_vpath_stroke (vpath, |
608 | 569 | renderer->join_style, |
609 | 570 | renderer->cap_style, |
@@ -611,7 +572,7 @@ draw_rect(DiaRenderer *self, | ||
611 | 572 | 4, |
612 | 573 | 0.25); |
613 | 574 | |
614 | - art_free( vpath_transformed ); | |
575 | + art_free( vpath ); | |
615 | 576 | |
616 | 577 | art_rgb_svp_alpha (svp, |
617 | 578 | 0, 0, |
@@ -634,8 +595,6 @@ fill_rect(DiaRenderer *self, | ||
634 | 595 | ArtSVP *svp; |
635 | 596 | guint32 rgba; |
636 | 597 | double top, bottom, left, right; |
637 | - ArtVpath *vpath_transformed; | |
638 | - double translate[6]; | |
639 | 598 | |
640 | 599 | dia_transform_coords_double(renderer->transform, |
641 | 600 | ul_corner->x, ul_corner->y, &left, &top); |
@@ -650,38 +609,24 @@ fill_rect(DiaRenderer *self, | ||
650 | 609 | vpath = art_new (ArtVpath, 6); |
651 | 610 | |
652 | 611 | vpath[0].code = ART_MOVETO; |
653 | - vpath[0].x = 0; | |
654 | - vpath[0].y = 0; | |
612 | + vpath[0].x = left; | |
613 | + vpath[0].y = top; | |
655 | 614 | vpath[1].code = ART_LINETO; |
656 | - vpath[1].x = right-left; | |
657 | - vpath[1].y = 0; | |
615 | + vpath[1].x = right; | |
616 | + vpath[1].y = top; | |
658 | 617 | vpath[2].code = ART_LINETO; |
659 | - vpath[2].x = right-left; | |
660 | - vpath[2].y = bottom-top; | |
618 | + vpath[2].x = right; | |
619 | + vpath[2].y = bottom; | |
661 | 620 | vpath[3].code = ART_LINETO; |
662 | - vpath[3].x = 0; | |
663 | - vpath[3].y = bottom-top; | |
621 | + vpath[3].x = left; | |
622 | + vpath[3].y = bottom; | |
664 | 623 | vpath[4].code = ART_LINETO; |
665 | - vpath[4].x = 0; | |
666 | - vpath[4].y = 0; | |
624 | + vpath[4].x = left; | |
625 | + vpath[4].y = top; | |
667 | 626 | vpath[5].code = ART_END; |
668 | 627 | vpath[5].x = 0; |
669 | 628 | vpath[5].y = 0; |
670 | 629 | |
671 | - /* { | |
672 | - vpath_transformed = | |
673 | - art_vpath_affine_transform(vpath, renderer->matrices->data); | |
674 | - art_free(vpath); | |
675 | - vpath = vpath_transformed; | |
676 | - }*/ | |
677 | - { | |
678 | - art_affine_translate(translate, left, top); | |
679 | - vpath_transformed = | |
680 | - art_vpath_affine_transform(vpath, translate); | |
681 | - art_free(vpath); | |
682 | - vpath = vpath_transformed; | |
683 | - } | |
684 | - | |
685 | 630 | svp = art_svp_from_vpath (vpath); |
686 | 631 | |
687 | 632 | art_free( vpath ); |
@@ -1412,27 +1357,13 @@ draw_image(DiaRenderer *self, | ||
1412 | 1357 | static void |
1413 | 1358 | draw_object (DiaRenderer *renderer, DiaObject *object) |
1414 | 1359 | { |
1415 | - DiaLibartRenderer *libart_rend = DIA_LIBART_RENDERER(renderer); | |
1416 | - | |
1417 | 1360 | if (object->highlight_color != NULL) { |
1361 | + DiaLibartRenderer *libart_rend = DIA_LIBART_RENDERER(renderer); | |
1418 | 1362 | libart_rend->highlight_color = object->highlight_color; |
1419 | 1363 | object->ops->draw(object, renderer); |
1420 | 1364 | libart_rend->highlight_color = NULL; |
1421 | 1365 | } |
1422 | - if (object->affine.rotation != 0.0) { | |
1423 | - double rotmatrix[6]; | |
1424 | - double* transmatrix = g_new0(double, 6); | |
1425 | - | |
1426 | - art_affine_rotate(rotmatrix, object->affine.rotation); | |
1427 | - art_affine_multiply(transmatrix, (double*)libart_rend->matrices->data, rotmatrix); | |
1428 | - libart_rend->matrices = g_list_prepend(libart_rend->matrices, transmatrix); | |
1429 | - } | |
1430 | 1366 | object->ops->draw(object, renderer); |
1431 | - if (object->affine.rotation != 0.0) { | |
1432 | - g_free(libart_rend->matrices->data); | |
1433 | - libart_rend->matrices = g_list_delete_link(libart_rend->matrices, | |
1434 | - libart_rend->matrices); | |
1435 | - } | |
1436 | 1367 | } |
1437 | 1368 | |
1438 | 1369 | static void |
@@ -46,10 +46,6 @@ struct _DiaLibartRenderer | ||
46 | 46 | double dash_length; |
47 | 47 | double dot_length; |
48 | 48 | Color *highlight_color; |
49 | - /** Stack of matrices of rotation/translation/scaling. | |
50 | - * Is a stack to allow groups to easily rotate. | |
51 | - */ | |
52 | - GList *matrices; | |
53 | 49 | #endif |
54 | 50 | }; |
55 | 51 |
@@ -27,8 +27,6 @@ | ||
27 | 27 | |
28 | 28 | #include "dummy_dep.h" |
29 | 29 | |
30 | -PropNumData rotation_data = {0.0, 360.0, 1.0 }; | |
31 | - | |
32 | 30 | void object_init(DiaObject *obj, int num_handles, int num_connections); |
33 | 31 | |
34 | 32 | void |
@@ -438,21 +438,16 @@ struct _DiaObjectType { | ||
438 | 438 | the .sheet file */ |
439 | 439 | }; |
440 | 440 | |
441 | -PropNumData rotation_data; | |
442 | - | |
443 | 441 | /* base property stuff ... */ |
444 | 442 | #define OBJECT_COMMON_PROPERTIES \ |
445 | 443 | { "obj_pos", PROP_TYPE_POINT, 0, \ |
446 | - "DiaObject position", "Where the object is located"}, \ | |
444 | + "Object position", "Where the object is located"}, \ | |
447 | 445 | { "obj_bb", PROP_TYPE_RECT, 0, \ |
448 | - "DiaObject bounding box", "The bounding box of the object"}, \ | |
449 | - { "obj_rotate", PROP_TYPE_REAL, PROP_FLAG_VISIBLE|PROP_FLAG_OPTIONAL, \ | |
450 | - N_("Rotation"), "Degrees of rotation", &rotation_data } | |
446 | + "Object bounding box", "The bounding box of the object"} | |
451 | 447 | |
452 | 448 | #define OBJECT_COMMON_PROPERTIES_OFFSETS \ |
453 | 449 | { "obj_pos", PROP_TYPE_POINT, offsetof(DiaObject, position) }, \ |
454 | - { "obj_bb", PROP_TYPE_RECT, offsetof(DiaObject, bounding_box) }, \ | |
455 | - { "obj_rotate", PROP_TYPE_REAL, offsetof(DiaObject, affine.rotation) } | |
450 | + { "obj_bb", PROP_TYPE_RECT, offsetof(DiaObject, bounding_box) } | |
456 | 451 | |
457 | 452 | |
458 | 453 | gboolean dia_object_defaults_load (const gchar *filename, |
@@ -140,6 +140,7 @@ static PropDescription line_props[] = { | ||
140 | 140 | N_("Start point"), NULL }, |
141 | 141 | { "end_point", PROP_TYPE_POINT, 0, |
142 | 142 | N_("End point"), NULL }, |
143 | + /* | |
143 | 144 | PROP_FRAME_BEGIN("gaps",0,N_("Line gaps")), |
144 | 145 | { "absolute_start_gap", PROP_TYPE_REAL, 0, |
145 | 146 | N_("Absolute start gap"), NULL, &gap_range }, |
@@ -150,6 +151,7 @@ static PropDescription line_props[] = { | ||
150 | 151 | { "fractional_end_gap", PROP_TYPE_REAL, 0, |
151 | 152 | N_("Fractional end gap"), NULL, &gap_range }, |
152 | 153 | PROP_FRAME_END("gaps",0), |
154 | + */ | |
153 | 155 | PROP_DESC_END |
154 | 156 | }; |
155 | 157 |
@@ -171,10 +173,12 @@ static PropOffset line_offsets[] = { | ||
171 | 173 | { "end_arrow", PROP_TYPE_ARROW, offsetof(Line, end_arrow) }, |
172 | 174 | { "start_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[0]) }, |
173 | 175 | { "end_point", PROP_TYPE_POINT, offsetof(Connection, endpoints[1]) }, |
176 | + /* | |
174 | 177 | { "absolute_start_gap", PROP_TYPE_REAL, offsetof(Line, absolute_start_gap) }, |
175 | 178 | { "absolute_end_gap", PROP_TYPE_REAL, offsetof(Line, absolute_end_gap) }, |
176 | 179 | { "fractional_start_gap", PROP_TYPE_REAL, offsetof(Line, fractional_start_gap) }, |
177 | 180 | { "fractional_end_gap", PROP_TYPE_REAL, offsetof(Line, fractional_end_gap) }, |
181 | + */ | |
178 | 182 | { NULL, 0, 0 } |
179 | 183 | }; |
180 | 184 |
@@ -149,9 +149,6 @@ UsePen(WmfRenderer* renderer, Color* colour) | ||
149 | 149 | |
150 | 150 | switch (renderer->fnPenStyle & PS_STYLE_MASK) { |
151 | 151 | case PS_SOLID : |
152 | - num_dashes = 2; | |
153 | - dashes[0] = dashlen; | |
154 | - dashes[1] = 0; | |
155 | 152 | break; |
156 | 153 | case PS_DASH : |
157 | 154 | num_dashes = 2; |
@@ -1,7 +1,7 @@ | ||
1 | 1 | |
2 | 2 | SUBDIRS = Circuit flowchart Contact network Pneumatic Electric \ |
3 | 3 | Civil jigsaw MSE SDL Logic sybase Misc Assorted Cisco \ |
4 | - Cybernetics Map ChemEng | |
4 | + Cybernetics Map ChemEng RDP | |
5 | 5 | |
6 | 6 | |
7 | 7 |
@@ -66,7 +66,7 @@ SHAPES = \ | ||
66 | 66 | digitizing_board.shape \ |
67 | 67 | digitizing_board.png \ |
68 | 68 | patch-panel.shape \ |
69 | - patch-panel.png | |
69 | + patch-panel.xpm | |
70 | 70 | |
71 | 71 | EXTRA_DIST = $(SHAPES) |
72 | 72 |