1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "connectionpoint.h"
28 /* The number of regular connectionpoints on the class (not cps for
29 * attributes and operands and not the mainpoint). */
30 #define UMLCLASS_CONNECTIONPOINTS 8
31 #define UMLCLASS_WRAP_AFTER_CHAR 40
33 /* The code behind the following preprocessor symbol should stay disabled until
34 * the dynamic relocation of connection points (caused by attribute and
35 * operation changes) is taken into account. It probably has other issues we are
36 * not aware of yet. Some more information maybe available at
37 * http://bugzilla.gnome.org/show_bug.cgi?id=303301
39 * Enabling 29/7 2005: Not known to cause any problems.
41 #define UML_MAINPOINT 1
44 typedef struct _UMLClass UMLClass
;
45 typedef struct _UMLClassDialog UMLClassDialog
;
51 ConnectionPoint connections
[UMLCLASS_CONNECTIONPOINTS
+ 1];
53 ConnectionPoint connections
[UMLCLASS_CONNECTIONPOINTS
];
59 real abstract_font_height
;
60 real polymorphic_font_height
;
61 real classname_font_height
;
62 real abstract_classname_font_height
;
63 real comment_font_height
;
66 DiaFont
*abstract_font
;
67 DiaFont
*polymorphic_font
;
68 DiaFont
*classname_font
;
69 DiaFont
*abstract_classname_font
;
70 DiaFont
*comment_font
;
73 char *stereotype
; /* NULL if no stereotype */
74 char *comment
; /* Comments on the class */
76 int suppress_attributes
;
77 int suppress_operations
;
78 int visible_attributes
; /* ie. don't draw strings. */
79 int visible_operations
;
82 int wrap_operations
; /* wrap operations with many parameters */
99 /* Calculated variables: */
102 char *stereotype_string
;
104 real attributesbox_height
;
105 GList
*attributes_strings
;
107 real operationsbox_height
;
108 GList
*operations_strings
;
109 GList
*operations_wrappos
;
110 int max_wrapped_line_width
;
112 real templates_height
;
113 real templates_width
;
115 char **templates_strings
;
118 UMLClassDialog
*properties_dialog
;
120 /** Until GtkList replaced by something better, set this when being
121 * destroyed, and don't do umlclass_calculate_data when it is set.
122 * This is to avoid a half-way destroyed list being updated.
127 struct _UMLClassDialog
{
131 GtkEntry
*stereotype
;
134 GtkToggleButton
*abstract_class
;
135 GtkToggleButton
*attr_vis
;
136 GtkToggleButton
*attr_supp
;
137 GtkToggleButton
*op_vis
;
138 GtkToggleButton
*op_supp
;
139 GtkToggleButton
*comments_vis
;
140 GtkToggleButton
*op_wrap
;
141 DiaFontSelector
*normal_font
;
142 DiaFontSelector
*abstract_font
;
143 DiaFontSelector
*polymorphic_font
;
144 DiaFontSelector
*classname_font
;
145 DiaFontSelector
*abstract_classname_font
;
146 DiaFontSelector
*comment_font
;
147 GtkSpinButton
*normal_font_height
;
148 GtkSpinButton
*abstract_font_height
;
149 GtkSpinButton
*polymorphic_font_height
;
150 GtkSpinButton
*classname_font_height
;
151 GtkSpinButton
*abstract_classname_font_height
;
152 GtkSpinButton
*comment_font_height
;
153 GtkSpinButton
*wrap_after_char
;
154 DiaColorSelector
*text_color
;
155 DiaColorSelector
*line_color
;
156 DiaColorSelector
*fill_color
;
157 GtkLabel
*max_length_label
;
159 GList
*disconnected_connections
;
160 GList
*added_connections
;
161 GList
*deleted_connections
;
163 GtkList
*attributes_list
;
164 GtkListItem
*current_attr
;
167 GtkEntry
*attr_value
;
168 GtkEntry
*attr_comment
;
169 GtkMenu
*attr_visible
;
170 GtkOptionMenu
*attr_visible_button
;
171 GtkToggleButton
*attr_class_scope
;
173 GtkList
*operations_list
;
174 GtkListItem
*current_op
;
177 GtkEntry
*op_stereotype
;
178 GtkEntry
*op_comment
;
181 GtkOptionMenu
*op_visible_button
;
182 GtkToggleButton
*op_class_scope
;
183 GtkMenu
*op_inheritance_type
;
184 GtkOptionMenu
*op_inheritance_type_button
;
185 GtkToggleButton
*op_query
;
187 GtkList
*parameters_list
;
188 GtkListItem
*current_param
;
189 GtkEntry
*param_name
;
190 GtkEntry
*param_type
;
191 GtkEntry
*param_value
;
192 GtkEntry
*param_comment
;
194 GtkOptionMenu
*param_kind_button
;
195 GtkWidget
*param_new_button
;
196 GtkWidget
*param_delete_button
;
197 GtkWidget
*param_up_button
;
198 GtkWidget
*param_down_button
;
200 GtkList
*templates_list
;
201 GtkListItem
*current_templ
;
202 GtkToggleButton
*templ_template
;
203 GtkEntry
*templ_name
;
204 GtkEntry
*templ_type
;
207 extern GtkWidget
*umlclass_get_properties(UMLClass
*umlclass
, gboolean is_default
);
208 extern ObjectChange
*umlclass_apply_props_from_dialog(UMLClass
*umlclass
, GtkWidget
*widget
);
209 extern void umlclass_calculate_data(UMLClass
*umlclass
);
210 extern void umlclass_update_data(UMLClass
*umlclass
);