dia r4269 - in trunk: . app app/pixmaps lib objects/AADL objects/Misc objects/SISSI objects/UML objects/custom objects/custom_lines objects/standard plug-ins/cairo plug-ins/dxf plug-ins/libart plug-ins/postscript plug-ins/python plug-ins/svg



Author: hans
Date: Sun Feb  8 20:57:59 2009
New Revision: 4269
URL: http://svn.gnome.org/viewvc/dia?rev=4269&view=rev

Log:
2009-02-08  Hans Breuer  <hans breuer org>

	[ warningectomy  - about 40 left ]
	* configure.in : disable -Wunused, add a lot more useful, see:
	http://blogs.gnome.org/otte/2008/12/22/warning-options/
	* lib/dia_xml.c plug-ins/svg/render_svg.c : pointers differ in signedness
	* lib/diagramdata.c : declared static but never defined
	* lib/prop_dict.c lib/plug-ins.c : unused variable
	* plug-ins/python/diamodule.c : dereferencing type-punned pointer will
	break strict-aliasing rules, unused variables
	* plug-ins/custom_line/line_info.c : mostly pointer targets differ in 
	signedness, but also some superfluous allocations
	* lib/prop_sdarray.c lib/prefs.c objects/standard/line.c 
	  plug-ins/libart/dialibartrenderer.[ch] plug-ins/libart/render_libart.c
	  objects/AADL/aadl.c app/layer_dialog.c : no previous prototype 
	(aka: should be static, prototyped or deleted)
	* plug-ins/dxf/autocad_pal.c : maybe used uninitialized
	* app/confirm.c : format not a string literal and no format arguments
	* plug-ins/postscript/paginate_psprint.c : use g_object_(g|s)et_data()
	* (diagram_print_ps) : format not a string literal and no format arguments
	  and g_free(g_get_home_dir()) - agood reason for crashing later on
	* app/load_save.c(diagram_data_save) : may be used uninitialized
	* objects/UML/association.c : removed unused functions
	* app/exit_dialog.c : unused variable, format not a string literal and 
	no format arguments
	* app/menus.c : format not a string literal and no format arguments
	* persistence.c : defined but not used
	* objects/SISSI/*.[ch] : from around 100 warnings down to 2 ...
	* objects/standard/arc.c : removed unused function
	* lib/message.c : assignment discards qualifiers from pointer target type

	* app/pixmaps/magnify.xpm app/pixmaps/scroll.xpm app/pixmaps.h : removed
	* app/Makefile.am : adapted
	* app/interfaces.c : added remaining XPMs directly



Removed:
   trunk/app/pixmaps.h
   trunk/app/pixmaps/magnify.xpm
   trunk/app/pixmaps/scroll.xpm
Modified:
   trunk/ChangeLog
   trunk/app/Makefile.am
   trunk/app/confirm.c
   trunk/app/display.c
   trunk/app/exit_dialog.c
   trunk/app/interface.c
   trunk/app/layer_dialog.c
   trunk/app/load_save.c
   trunk/app/menus.c
   trunk/app/textedit.c
   trunk/configure.in
   trunk/lib/dia_xml.c
   trunk/lib/diagramdata.c
   trunk/lib/font.c
   trunk/lib/group.c
   trunk/lib/message.c
   trunk/lib/neworth_conn.c
   trunk/lib/orth_conn.c
   trunk/lib/persistence.c
   trunk/lib/plug-ins.c
   trunk/lib/prefs.c
   trunk/lib/prefs.h
   trunk/lib/prop_dict.c
   trunk/lib/prop_sdarray.c
   trunk/objects/AADL/aadl.c
   trunk/objects/AADL/edit_port_declaration.c
   trunk/objects/Misc/measure.c
   trunk/objects/SISSI/area.c
   trunk/objects/SISSI/faraday.c
   trunk/objects/SISSI/room.c
   trunk/objects/SISSI/sissi.c
   trunk/objects/SISSI/sissi.h
   trunk/objects/SISSI/sissi_dialog.c
   trunk/objects/SISSI/sissi_dialog.h
   trunk/objects/SISSI/sissi_object.c
   trunk/objects/SISSI/sissi_object.h
   trunk/objects/SISSI/site.c
   trunk/objects/UML/association.c
   trunk/objects/custom/custom_object.h
   trunk/objects/custom_lines/line_info.c
   trunk/objects/standard/arc.c
   trunk/objects/standard/line.c
   trunk/plug-ins/cairo/diacairo-print.c
   trunk/plug-ins/dxf/autocad_pal.c
   trunk/plug-ins/dxf/dxf-export.c
   trunk/plug-ins/libart/dialibartrenderer.c
   trunk/plug-ins/libart/dialibartrenderer.h
   trunk/plug-ins/postscript/paginate_psprint.c
   trunk/plug-ins/python/diamodule.c
   trunk/plug-ins/svg/render_svg.c

Modified: trunk/app/Makefile.am
==============================================================================
--- trunk/app/Makefile.am	(original)
+++ trunk/app/Makefile.am	Sun Feb  8 20:57:59 2009
@@ -142,7 +142,6 @@
 	render_gdk.h \
 	tool.c \
 	tool.h \
-	pixmaps.h \
 	diapagelayout.c \
 	diapagelayout.h \
 	pagesetup.c \
@@ -238,8 +237,6 @@
 	pixmaps/arrow.xpm \
 	pixmaps/swap.xpm \
 	pixmaps/default.xpm \
-	pixmaps/magnify.xpm \
-	pixmaps/scroll.xpm \
 	\
 	pixmaps/portrait.xpm \
 	pixmaps/landscape.xpm \

Modified: trunk/app/confirm.c
==============================================================================
--- trunk/app/confirm.c	(original)
+++ trunk/app/confirm.c	Sun Feb  8 20:57:59 2009
@@ -76,12 +76,12 @@
 				   GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
 				   GTK_MESSAGE_WARNING,
 				   GTK_BUTTONS_OK_CANCEL,
-				   msg);
+				   "%s", msg);
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), 
 					    _("You can adjust the size of the diagram by changing "
 					      "the 'Scaling' in the 'Page Setup' dialog.\n"
 					      "Alternatively use 'Select All' and 'Best Fit' "
-					      "to move objects/handles into the intended bounds."), NULL);
+					      "to move objects/handles into the intended bounds."));
   gtk_window_set_title (GTK_WINDOW (dialog), _("Confirm Diagram Size"));
   g_free (size);
 

Modified: trunk/app/display.c
==============================================================================
--- trunk/app/display.c	(original)
+++ trunk/app/display.c	Sun Feb  8 20:57:59 2009
@@ -1465,6 +1465,7 @@
 
         display_update_menu_state (ddisp);
 
+        gtk_window_present (GTK_WINDOW(ddisp->shell));
       }
     } else {
       /* TODO: Prevent gtk_window_set_transient_for() in Integrated UI case */

Modified: trunk/app/exit_dialog.c
==============================================================================
--- trunk/app/exit_dialog.c	(original)
+++ trunk/app/exit_dialog.c	Sun Feb  8 20:57:59 2009
@@ -86,7 +86,6 @@
 
     GtkWidget * label = gtk_label_new (_("The following are not saved:"));
 
-    GSList *    list;
     GtkWidget * scrolled;
     GtkWidget * button;
     GtkWidget * hbox;
@@ -226,13 +225,11 @@
     
         if (count == 0)
         {
-           const gchar * msg = _("Nothing selected for saving.  Would you like to try again?");
-
            GtkWidget * msg_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
                                                             GTK_DIALOG_MODAL,
                                                             GTK_MESSAGE_WARNING,
                                                             GTK_BUTTONS_YES_NO,
-                                                            msg);
+                                                            _("Nothing selected for saving.  Would you like to try again?"));
 
            gint yes_or_no = gtk_dialog_run (GTK_DIALOG (msg_dialog));
 

Modified: trunk/app/interface.c
==============================================================================
--- trunk/app/interface.c	(original)
+++ trunk/app/interface.c	Sun Feb  8 20:57:59 2009
@@ -36,7 +36,6 @@
 #include "layer_dialog.h"
 #include "interface.h"
 #include "display.h"
-#include "pixmaps.h"
 #include "preferences.h"
 #include "commands.h"
 #include "dia_dirs.h"
@@ -53,6 +52,8 @@
 #include "dia-app-icons.h"
 #include "diacanvas.h"
 
+#include "pixmaps/swap.xpm"
+#include "pixmaps/default.xpm"
 #include "pixmaps/missing.xpm"
 
 /* HB: file dnd stuff lent by The Gimp, not fully understood but working ...

Modified: trunk/app/layer_dialog.c
==============================================================================
--- trunk/app/layer_dialog.c	(original)
+++ trunk/app/layer_dialog.c	Sun Feb  8 20:57:59 2009
@@ -273,7 +273,8 @@
   return TRUE;
 }
 
-void layer_view_hide_button_clicked (void * not_used)
+static void
+layer_view_hide_button_clicked (void * not_used)
 {
   integrated_ui_layer_view_hide ();
 }

Modified: trunk/app/load_save.c
==============================================================================
--- trunk/app/load_save.c	(original)
+++ trunk/app/load_save.c	Sun Feb  8 20:57:59 2009
@@ -984,7 +984,7 @@
   char *filename = (char *)user_filename;
   int mode,_umask;
   int fildes;
-  int ret;
+  int ret = 0;
 
   /* Once we depend on GTK 2.8+, we can use these tests. */
 #if GLIB_CHECK_VERSION(2,8,0) && !defined G_OS_WIN32

Modified: trunk/app/menus.c
==============================================================================
--- trunk/app/menus.c	(original)
+++ trunk/app/menus.c	Sun Feb  8 20:57:59 2009
@@ -743,7 +743,7 @@
 
   pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_group_icon), dia_group_icon, FALSE, &err);
   if (err) {
-    g_warning (err->message);
+    g_warning ("%s", err->message);
     g_error_free (err);
     err = NULL;
   }
@@ -754,7 +754,7 @@
 
   pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_ungroup_icon), dia_ungroup_icon, FALSE, &err);
   if (err) {
-    g_warning (err->message);
+    g_warning ("%s", err->message);
     g_error_free (err);
     err = NULL;
   }

Modified: trunk/app/textedit.c
==============================================================================
--- trunk/app/textedit.c	(original)
+++ trunk/app/textedit.c	Sun Feb  8 20:57:59 2009
@@ -73,7 +73,7 @@
 
  * @param ddisp The display to set according to mode.
  */
-void
+static void
 textedit_display_change(DDisplay *ddisp)
 {
 }
@@ -393,3 +393,4 @@
 {
   change->new_text = text_get_string_copy(change->text);
 }
+

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sun Feb  8 20:57:59 2009
@@ -398,7 +398,7 @@
   dnl getting poor stack traces with bug-buddy because of this)
 
   DIA_CHECK_CFLAG(-Wall)
-  DIA_CHECK_CFLAG(-Wunused)
+  dnl DIA_CHECK_CFLAG(-Wunused)
   DIA_CHECK_CFLAG(--std=c89)
   DIA_CHECK_CFLAG(-Wdeclaration-after-statement)
   dnl I'd rather like to enable this but it fails on isnan() with -std=c89
@@ -410,6 +410,11 @@
   DIA_CHECK_CFLAG(-Wmissing-declarations)
   DIA_CHECK_CFLAG(-finline-functions)
   DIA_CHECK_CFLAG(-fstrict-aliasing)
+  dnl DIA_CHECK_CFLAG(-Wshadow)
+  DIA_CHECK_CFLAG(-Wpointer-arith)
+  dnl DIA_CHECK_CFLAG(-Wswitch-enum)
+  DIA_CHECK_CFLAG(-Winit-self)
+  DIA_CHECK_CFLAG(-Wformat-nonliteral)
 fi
 
 AM_CONDITIONAL(HAVE_GCC, test "$GCC" = yes)

Modified: trunk/lib/dia_xml.c
==============================================================================
--- trunk/lib/dia_xml.c	(original)
+++ trunk/lib/dia_xml.c	Sun Feb  8 20:57:59 2009
@@ -642,9 +642,9 @@
   }
   val = xmlGetProp(data, (const xmlChar *)"type");
   if (val) {
-     if (strcmp(val, "moveto") == 0)
+     if (strcmp((char *)val, "moveto") == 0)
        point->type = BEZ_MOVE_TO;
-     else if (strcmp(val, "lineto") == 0)
+     else if (strcmp((char *)val, "lineto") == 0)
        point->type = BEZ_LINE_TO;
      else
        point->type = BEZ_CURVE_TO;
@@ -1060,8 +1060,6 @@
 {
   DataNode data_node;
   gchar *buffer;
-  gchar px_buf[G_ASCII_DTOSTR_BUF_SIZE];
-  gchar py_buf[G_ASCII_DTOSTR_BUF_SIZE];
   
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"bezpoint", NULL);
   switch (point->type) {

Modified: trunk/lib/diagramdata.c
==============================================================================
--- trunk/lib/diagramdata.c	(original)
+++ trunk/lib/diagramdata.c	Sun Feb  8 20:57:59 2009
@@ -35,7 +35,6 @@
 
 
 static const Rectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
-static void set_parent_layer(gpointer layer, gpointer object);
 
 static void diagram_data_class_init (DiagramDataClass *klass);
 static void diagram_data_init (DiagramData *object);

Modified: trunk/lib/font.c
==============================================================================
--- trunk/lib/font.c	(original)
+++ trunk/lib/font.c	Sun Feb  8 20:57:59 2009
@@ -223,7 +223,6 @@
 {
   
   if (font->height != height || !font->metrics || recalc_alwways) {
-    PangoFontMetrics *metrics;
     PangoFont *loaded;
 
     dia_pfd_set_height (font->pfd, height);
@@ -489,9 +488,8 @@
 void 
 dia_font_set_family(DiaFont* font, DiaFontFamily family)
 {
-  gboolean changed;
-
   g_return_if_fail(font != NULL);
+
   dia_pfd_set_family(font->pfd,family);  
   if (font->legacy_name) {
     g_free(font->legacy_name);
@@ -666,7 +664,6 @@
   PangoAttrList* list;
   PangoAttribute* attr;
   guint length;
-  gchar *desc = NULL;
   PangoFontDescription *pfd;
   real factor;
 

Modified: trunk/lib/group.c
==============================================================================
--- trunk/lib/group.c	(original)
+++ trunk/lib/group.c	Sun Feb  8 20:57:59 2009
@@ -205,8 +205,8 @@
 
   g_list_free(group->objects);
 
-  prop_desc_list_free_handler_chain(group->pdesc);
-  g_free(group->pdesc);
+  prop_desc_list_free_handler_chain((PropDescription *)group->pdesc);
+  g_free((PropDescription *)group->pdesc);
 
   g_free(group);
 }
@@ -222,8 +222,8 @@
      been unconnected and freed. */
   obj->num_connections = 0;
   
-  prop_desc_list_free_handler_chain(group->pdesc);
-  g_free(group->pdesc);
+  prop_desc_list_free_handler_chain((PropDescription *)group->pdesc);
+  g_free((PropDescription *)group->pdesc);
 
   object_destroy(obj);
 }
@@ -415,7 +415,7 @@
       /* hijack event delivery */
       for (i=0; group->pdesc[i].name != NULL; i++) {
         if (group->pdesc[i].event_handler) 
-          prop_desc_insert_handler(&group->pdesc[i],
+          prop_desc_insert_handler((PropDescription *)&group->pdesc[i],
                                    (PropEventHandler)group_prop_event_deliver);
       }
     }

Modified: trunk/lib/message.c
==============================================================================
--- trunk/lib/message.c	(original)
+++ trunk/lib/message.c	Sun Feb  8 20:57:59 2009
@@ -33,7 +33,7 @@
 static GHashTable *message_hash_table;
 
 typedef struct {
-  gchar *title;
+  const gchar *title;
   GtkWidget *dialog;
   GtkWidget *repeat_label;
   GList *repeats;

Modified: trunk/lib/neworth_conn.c
==============================================================================
--- trunk/lib/neworth_conn.c	(original)
+++ trunk/lib/neworth_conn.c	Sun Feb  8 20:57:59 2009
@@ -334,7 +334,6 @@
   if (connpoint_is_autogap(start_cp) || 
       connpoint_is_autogap(end_cp)) {
     Point* new_points = g_new(Point, orth->numpoints);
-    int i;
     for (i = 0; i < orth->numpoints; i++) {
       new_points[i] = points[i];
     }

Modified: trunk/lib/orth_conn.c
==============================================================================
--- trunk/lib/orth_conn.c	(original)
+++ trunk/lib/orth_conn.c	Sun Feb  8 20:57:59 2009
@@ -326,7 +326,6 @@
       (connpoint_is_autogap(start_cp) || 
        connpoint_is_autogap(end_cp))) {
     Point* new_points = g_new(Point, orth->numpoints);
-    int i;
     for (i = 0; i < orth->numpoints; i++) {
       new_points[i] = points[i];
     }

Modified: trunk/lib/persistence.c
==============================================================================
--- trunk/lib/persistence.c	(original)
+++ trunk/lib/persistence.c	Sun Feb  8 20:57:59 2009
@@ -51,25 +51,6 @@
   /* the key is const, the value gets freed */
   return g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
 }
-/* *********************** GENERAL INTERNAL FUNCTIONS ************** */
-/** Lookup an entry in any of the type tables, ensuring existence on the way.
- * @param type_table A pointer to one of the above type tables.
- * @param role The role (name) within the table.
- * @return The value of the role in the table, or NULL if either role is
- * NULL or the table does not contain the value.
- */
-static gchar *
-persistence_lookup(GHashTable **type_table, gchar *role)
-{
-  if (role == NULL) {
-    return NULL;
-  }
-  if (*type_table == NULL) {
-    *type_table = _dia_hash_table_str_any_new();
-  }
-  return g_hash_table_lookup(*type_table, role);
-}
-
 
 /* *********************** LOADING FUNCTIONS *********************** */
 
@@ -221,14 +202,6 @@
   }
 }
 
-static xmlNodePtr
-find_node_named (xmlNodePtr p, const char *name)
-{
-  while (p && 0 != strcmp((char *)p->name, name))
-    p = p->next;
-  return p;
-}
-
 static GHashTable *type_handlers;
 
 /** Load the named type of entries using the given function.
@@ -379,18 +352,6 @@
 }
 
 static void
-persistence_save_entrystring(gpointer key, gpointer value, gpointer data)
-{  
-  xmlNodePtr tree = (xmlNodePtr)data;
-  ObjectNode stringnode;
-
-  stringnode = (ObjectNode)xmlNewChild(tree, NULL, (const xmlChar *)"entrystring", NULL);
-
-  xmlSetProp(stringnode, (const xmlChar *)"role", (xmlChar *)key);
-  data_add_string(new_attribute(stringnode, "stringvalue"), (char *)value);
-}
-
-static void
 persistence_save_integer(gpointer key, gpointer value, gpointer data)
 {  
   xmlNodePtr tree = (xmlNodePtr)data;
@@ -918,28 +879,6 @@
   }
 }
 
-/** When changing the list, call the listeners.
- */
-static void
-persistent_list_invoke_listeners(gchar *role)
-{
-  GList *tmp;
-  PersistentList *plist = persistent_list_get(role);
-  if (plist != NULL) {
-    for (tmp = plist->listeners; tmp != NULL; tmp = g_list_next(tmp)) {
-      ListenerData *listener = (ListenerData*)tmp->data;
-      if (listener->watch == NULL) {
-	/* Listener died */
-	plist->listeners = g_list_remove_link(plist->listeners, tmp->data);
-	g_free(listener);
-      } else {
-	/* Still listening */
-	(listener->func)(listener->watch, listener->userdata);
-      }
-    }
-  }
-}
-
 /* ********* INTEGERS ********** */
 gint
 persistence_register_integer(gchar *role, int defaultvalue)

Modified: trunk/lib/plug-ins.c
==============================================================================
--- trunk/lib/plug-ins.c	(original)
+++ trunk/lib/plug-ins.c	Sun Feb  8 20:57:59 2009
@@ -333,8 +333,6 @@
 static gboolean 
 dia_plugin_filter(const gchar *name) 
 {
-  gint len = strlen(name);
-
   if (!g_file_test (name, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_DIR))
     return FALSE;
 

Modified: trunk/lib/prefs.c
==============================================================================
--- trunk/lib/prefs.c	(original)
+++ trunk/lib/prefs.c	Sun Feb  8 20:57:59 2009
@@ -56,12 +56,14 @@
 }
 
 DiaUnit
-prefs_get_length_unit() {
+prefs_get_length_unit(void) 
+{
   return length_unit;
 }
 
 DiaUnit
-prefs_get_fontsize_unit() {
+prefs_get_fontsize_unit(void) 
+{
   return fontsize_unit;
 }
 

Modified: trunk/lib/prefs.h
==============================================================================
--- trunk/lib/prefs.h	(original)
+++ trunk/lib/prefs.h	Sun Feb  8 20:57:59 2009
@@ -31,7 +31,7 @@
 void prefs_set_length_unit(gchar* unit);
 void prefs_set_fontsize_unit(gchar* unit);
 
-DiaUnit prefs_get_length_unit();
-DiaUnit prefs_get_fontsize_unit();
+DiaUnit prefs_get_length_unit(void);
+DiaUnit prefs_get_fontsize_unit(void);
 
 #endif

Modified: trunk/lib/prop_dict.c
==============================================================================
--- trunk/lib/prop_dict.c	(original)
+++ trunk/lib/prop_dict.c	Sun Feb  8 20:57:59 2009
@@ -75,7 +75,7 @@
   gchar *val = (gchar *)value;
   GHashTable *dest = (GHashTable *)user_data;
   
-  g_hash_table_insert (dest, g_strdup (key), g_strdup (value));
+  g_hash_table_insert (dest, g_strdup (name), g_strdup (val));
 }
 static DictProperty *
 dictprop_copy(DictProperty *src) 

Modified: trunk/lib/prop_sdarray.c
==============================================================================
--- trunk/lib/prop_sdarray.c	(original)
+++ trunk/lib/prop_sdarray.c	Sun Feb  8 20:57:59 2009
@@ -258,12 +258,12 @@
   return ret;  
 }
 
-void 
+static void 
 arrayprop_reset_widget(NoopProperty *prop, WIDGET *widget)
 {
 }
 
-void 
+static void 
 arrayprop_set_from_widget(NoopProperty *prop, WIDGET *widget) 
 {
 }

Modified: trunk/objects/AADL/aadl.c
==============================================================================
--- trunk/objects/AADL/aadl.c	(original)
+++ trunk/objects/AADL/aadl.c	Sun Feb  8 20:57:59 2009
@@ -68,76 +68,3 @@
   return DIA_PLUGIN_INIT_OK;
 }
 
-
-
-
-
-/***********************************************
- **              MISC FUNCTIONS               **
- ***********************************************/
-
-
-/* CENTER */
-
-void aadlbox_center_text_position(Aadlbox *aadlbox,  Point *p)
-{
-  /* Center */
-  Element *elem = &aadlbox->element;
-  Point center;
-  real h, w;
-
-  text_calc_boundingbox(aadlbox->name, NULL);
-  h = aadlbox->name->height * aadlbox->name->numlines;
-  w = aadlbox->name->max_width;
-
-  center.x = elem->corner.x + 0.5*elem->width;
-  center.y = elem->corner.y + 0.5*elem->height;
-
-  p->x = center.x - 0.5*w;
-  p->y = center.y - 0.5*h + AADLBOX_TEXT_MARGIN; /* + aadlbox->name->ascent; */
-}
-
-
-/* MEMORY  */
-
-void aadlbox_memory_update_text_position(Aadlbox *aadlbox)
-{
-  Element *elem = &aadlbox->element;
-  Point p1;
-  real h = 0;
-
-  text_calc_boundingbox(aadlbox->name, NULL);
-  h = elem->corner.y + AADLBOX_TEXT_MARGIN;
-  p1.x = elem->corner.x + AADLBOX_TEXT_MARGIN;
-  p1.y = h + aadlbox->name->ascent + 2*AADL_MEMORY_FACTOR*elem->height;
-  text_set_position(aadlbox->name, &p1);
-}
-
-
-/* INCLINED */
-
-void aadlbox_inclined_update_text_position(Aadlbox *aadlbox)
-{
-  Element *elem = &aadlbox->element;
-  Point p1;
-  real h = 0;
-  
-  text_calc_boundingbox(aadlbox->name, NULL);
-  h = elem->corner.y + AADLBOX_TEXT_MARGIN;
-  p1.x = elem->corner.x + AADLBOX_TEXT_MARGIN
-                                   + AADLBOX_INCLINE_FACTOR*elem->width;
-  p1.y = h + aadlbox->name->ascent;
-  text_set_position(aadlbox->name, &p1);
-
-}
-void aadlbox_subprogram_update_text_position(Aadlbox *aadlbox)
-{
-  Element *elem = &aadlbox->element;
-  DiaObject *obj = &elem->object;
-  Point p;
-
-  p.x = 0.5*(obj->handles[3]->pos.x + obj->handles[1]->pos.x) ;
-  p.y = 0.5*(obj->handles[3]->pos.y + obj->handles[1]->pos.y) + aadlbox->name->ascent;
-  text_set_position(aadlbox->name, &p);
-}
-

Modified: trunk/objects/AADL/edit_port_declaration.c
==============================================================================
--- trunk/objects/AADL/edit_port_declaration.c	(original)
+++ trunk/objects/AADL/edit_port_declaration.c	Sun Feb  8 20:57:59 2009
@@ -18,10 +18,13 @@
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
+#include <config.h>
 
+#undef GTK_DISABLE_DEPRECATED
 #include <gtk/gtk.h>
 #include <string.h>
 #include "aadl.h"
+#include "edit_port_declaration.h"
 
 int aadlbox_point_near_port(Aadlbox *aadlbox, Point *p);
 

Modified: trunk/objects/Misc/measure.c
==============================================================================
--- trunk/objects/Misc/measure.c	(original)
+++ trunk/objects/Misc/measure.c	Sun Feb  8 20:57:59 2009
@@ -261,7 +261,6 @@
 static void 
 measure_draw(Measure *measure, DiaRenderer *renderer)
 {
-  DiaObject *obj = &measure->connection.object;
   Arrow arrow = MEASURE_ARROW(measure);
 
   DIA_RENDERER_GET_CLASS (renderer)->set_linewidth (renderer, measure->line_width);
@@ -328,7 +327,6 @@
 static ObjectChange* 
 measure_move (Measure *measure, Point *to)
 {
-  DiaObject *obj = &measure->connection.object;
   Point start_to_end;
   Point *ends = &measure->connection.endpoints[0]; 
 

Modified: trunk/objects/SISSI/area.c
==============================================================================
--- trunk/objects/SISSI/area.c	(original)
+++ trunk/objects/SISSI/area.c	Sun Feb  8 20:57:59 2009
@@ -65,6 +65,8 @@
 #define TEXT_HEIGHT (2.0)
 #define NUM_CONNECTIONS 9
 
+static Color color_gris_clear = { 0.95f, 0.95f, 0.95f };
+
 #ifdef G_OS_WIN32
 #include <io.h>
 #define mkstemp(s) _open(_mktemp(s), O_CREAT | O_TRUNC | O_WRONLY | _O_BINARY, 0644)

Modified: trunk/objects/SISSI/faraday.c
==============================================================================
--- trunk/objects/SISSI/faraday.c	(original)
+++ trunk/objects/SISSI/faraday.c	Sun Feb  8 20:57:59 2009
@@ -66,6 +66,8 @@
 #define TEXT_HEIGHT (2.0)
 #define NUM_CONNECTIONS 9
 
+static Color color_red = { 1.0f, 0.0f, 0.0f };
+
 #ifdef G_OS_WIN32
 #include <io.h>
 #define mkstemp(s) _open(_mktemp(s), O_CREAT | O_TRUNC | O_WRONLY | _O_BINARY, 0644)
@@ -260,7 +262,6 @@
   ObjetSISSI *object_sissi;
   Element *elem;
   DiaObject *obj;
-  gchar *file_name;
   DiaFont* action_font;
   Point pos;
   

Modified: trunk/objects/SISSI/room.c
==============================================================================
--- trunk/objects/SISSI/room.c	(original)
+++ trunk/objects/SISSI/room.c	Sun Feb  8 20:57:59 2009
@@ -66,6 +66,8 @@
 #define TEXT_HEIGHT (2.0)
 #define NUM_CONNECTIONS 9
 
+static Color color_gris = { 0.5f, 0.5f, 0.5f };
+
 #ifdef G_OS_WIN32
 #include <io.h>
 #define mkstemp(s) _open(_mktemp(s), O_CREAT | O_TRUNC | O_WRONLY | _O_BINARY, 0644)
@@ -257,7 +259,6 @@
   ObjetSISSI *object_sissi;
   Element *elem;
   DiaObject *obj;
-  gchar *file_name;
   DiaFont* action_font;
   Point pos;
   

Modified: trunk/objects/SISSI/sissi.c
==============================================================================
--- trunk/objects/SISSI/sissi.c	(original)
+++ trunk/objects/SISSI/sissi.c	Sun Feb  8 20:57:59 2009
@@ -76,10 +76,6 @@
   return DIA_PLUGIN_INIT_OK;
 }
 
-extern GtkWidget *object_sissi_get_properties_dialog(ObjetSISSI *object_sissi, gboolean is_default);
-extern ObjectChange *object_sissi_apply_properties_dialog(ObjetSISSI *object_sissi);
-
-
 void 
 url_doc_write(AttributeNode attr_node, Url_Docs *url_docs)
 {

Modified: trunk/objects/SISSI/sissi.h
==============================================================================
--- trunk/objects/SISSI/sissi.h	(original)
+++ trunk/objects/SISSI/sissi.h	Sun Feb  8 20:57:59 2009
@@ -80,12 +80,6 @@
   ANCHOR_END
 } AnchorShape;
 
-static struct _ImageProperties {
-  gchar *file;
-  gboolean draw_border;
-  gboolean keep_aspect;
-} default_properties = { "", FALSE, TRUE };
-
 
 struct _ObjetSISSI {
   Element element;
@@ -216,173 +210,8 @@
 gchar *sissi_get_sheets_directory(const gchar* subdir);
 xmlDocPtr sissi_read_object_from_xml(int data);
 
-/************* creation of variable repeat for each object based on EBIOS method */
-
-static SISSI_Property property_classification_data[] = {
-  { N_("No Protection"), "NO_PROTECTION" ,NULL},
-  { N_("Restricted Diffusion"), "RESTRICTED_DIFFUSION" ,NULL},
-  { N_("Special Country Confidential"), "SPECIAL_COUNTRY_CONFIDENTIAL" ,NULL},
-  { N_("NATO Confidential"), "NATO_CONFIDENTIAL" ,NULL},
-  { N_("Personal Confidential"), "PERSONAL_CONFIDENTIAL" ,NULL},
-  { N_("Medical Confidential"), "MEDICAL_CONFIDENTIAL" ,NULL},
-  { N_("Industrial Confidential"), "INDUSTRIE_CONFIDENTIAL" ,NULL},
-  { N_("Secret"), "SECRET" ,NULL},
-  { N_("Secret special country"), "SECRET_SPECIAL_COUNTRY" ,NULL},
-  { N_("NATO Secret"), "NATO_SECRET" ,NULL},
-  { N_("Very Secret"), "VERY_SECRET" ,NULL},
-  { N_("NATO Very Secret"), "NATO_VERY_SECRET" ,NULL},
-  { NULL,0,NULL}
-};
-
-static SISSI_Property property_integrity_data[] = {
-  { N_("No integrity"), "NULL" ,NULL},
-  { N_("Low integrity"), "LOW_INTEGRITY" ,NULL},
-  { N_("Average software integrity"), "AVERAGE_SOFTWARE_INTEGRITY" ,NULL},
-  { N_("High software integrity"), "HIGHT_SOFTWARE_INTEGRITY" ,NULL},
-  { N_("Average hardware integrity"), "AVERAGE_HARDWARE_INTEGRITY" ,NULL},
-  { N_("High hardware integrity"), "HIGHT_HARDWARE_INTEGRITY" ,NULL},
-  { NULL,0,NULL}
-};
-
-static SISSI_Property property_disponibility_level_data[] = {
-  { N_("Millisecond"), "MILLISECOND" ,NULL},
-  { N_("Second"), "SECOND" ,NULL},
-  { N_("Minute"), "MINUTE" ,NULL},
-  { N_("Hour"), "HOUR" ,NULL},
-  { N_("Day"), "DAY" ,NULL},
-  { N_("Week"), "WEEK" ,NULL},
-  { NULL,0,NULL}
-};
-
-static SISSI_Property property_system_data[] = {
-  { N_("SYSTEM"), "SYS",NULL},
-  { N_("Internet access device"), "SYS_INT",NULL},
-  { N_("Electronic messaging"), "SYS_MAIL",NULL},
-  { N_("Intranet"), "SYS_ITR",NULL},
-  { N_("Company directory"), "SYS_DIRECTORY",NULL},
-  { N_("External portal"), "SYS_WEB",NULL},
-  { NULL,0,NULL}
-};
-
-static SISSI_Property property_organisation_data[] = {
-  { N_("ORGANISATION"), "ORG",NULL},
-     { N_("Higher-tier organisation"), "ORG_DEP",NULL},
-     { N_("Structure of the organisation"), "ORG_GEN",NULL},
-     { N_("Project or system organisation"), "ORG_PRO",NULL},
-     { N_("Subcontractors / Suppliers / Manufacturers"),"ORG_EXT",NULL},
-  { NULL,0,NULL}
-};
-
-static SISSI_Property property_physic_data[] = {
-  { N_("SITE"), "PHY",NULL},
-   { N_("Places"), "PHY_LIE",NULL},
-     { N_("External environment"), "PHY_LIE1",NULL},
-     { N_("Premises"), "PHY_LIE2",NULL},
-     { N_("Zone"), "PHY_LIE3",NULL},
-   { N_("Essential Services"), "PHY_SRV",NULL},
-     { N_("Communication"), "PHY_SRV1",NULL},
-     { N_("Power"), "PHY_SRV2",NULL},
-     { N_("Cooling / Pollution"), "PHY_SRV3",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecTHERMIC_data[] = {
-  { N_("Thermal detection"), "PHY_DETECTION_THERMIC",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecFIRE_data[] = {
-  { N_("Fire detection"), "PHY_DETECTION_FIRE",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecWATER_data[] = {
-  { N_("Water detection"), "PHY_DETECTION_WATER",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecAIR_data[] = {
-  { N_("Air detection"), "PHY_DETECTION_AIR",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecENERGY_data[] = {
-  { N_("Energy detection"), "PHY_DETECTION_ENERGY",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_detecINTRUSION_data[] = {
-  { N_("Intrusion detection"), "PHY__DETECTION_INTRUSION",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionTHERMIC_data[] = {
-  { N_("Thermal action"), "PHY_ACTION_THERMIC",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionFIRE_data[] = {
-  { N_("Fire action"), "PHY_ACTION_FIRE",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionWATER_data[] = {
- { N_("Water action"), "PHY_ACTION_WATER",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionAIR_data[] = {
-  { N_("Air action"), "PHY_ACTION_AIR",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionENERGY_data[] = {
-  { N_("Energy action"), "PHY_ACTION_ENERGY",NULL},
-  { NULL, 0,NULL}
-};
-static SISSI_Property property_physic_actionINTRUSION_data[] = {
-  { N_("Intrusion action"), "PHY_ACTION_INTRUSION",NULL},
-  { NULL, 0,NULL}
-};
-
-static SISSI_Property property_personnel_data[] = {
-  { N_("Personal"), "PER",NULL},
-   { N_("Decision maker"), "PER_DEC",NULL},
-   { N_("SSI Responsible"), "PER_RESP_SSI",NULL},
-   { N_("Users"), "PER_UTI",NULL},
-   { N_("Functional administrator"), "PER_FONC_ADMIN",NULL},
-   { N_("Technical administrator"), "PER_TECH_ADMIN",NULL},
-   { N_("SSI administrator"), "PER_SSI_ADMIN",NULL},
-   { N_("Developer"), "PER_DEV",NULL},
-   { N_("Operator / Maintenance"), "PER_EXP",NULL},
-  { NULL, 0,NULL}
-};
-
-static SISSI_Property property_reseau_data[] = {
-  { N_("Network"), "RES",NULL},
-   { N_("Medium and support"), "RES_INF",NULL},
-   { N_("Passive or active relay"), "RES_REL",NULL},
-   { N_("Communication interface"), "RES_INT",NULL},
-  { NULL, 0,NULL}
-};
-
-static SISSI_Property property_logiciel_data[] = {
-  { N_("Software"), "LOG",NULL},
-    { N_("Operating System"), "LOG_OS",NULL},
-    { N_("Service - maintenance or administration software"), "LOG_SRV",NULL},
-    { N_("Packaged software or standard software"), "LOG_STD",NULL},
-    { N_("Business application"), "LOG_APP",NULL},
-      { N_("Standard business application"), "LOG_APP1",NULL},
-      { N_("Specific business application"), "LOG_APP2",NULL},
-  { NULL, 0,NULL}
-};
-
-static SISSI_Property property_material_data[] = {
-  { N_("HARDWARE"), "MAT",NULL},
-  { N_("Data-processing equipment (active)"), "MAT_ACT",NULL},
-  { N_("Mobile equipment"), "MAT_ACT1",NULL},
-  { N_("Fixed equipment"), "MAT_ACT2",NULL},
-  { N_("Peripheral processing"), "MAT_ACT3",NULL},
-  { N_("Electronic medium"), "MAT_PAS1",NULL},
-  { N_("Other media"), "MAT_PAS2",NULL},  
-  { N_("Data medium (passive)"), "MAT_PAS",NULL},
-  { NULL, 0,NULL}
-};
+ObjectChange *object_sissi_apply_properties_dialog(ObjetSISSI *object_sissi);
+GtkWidget *object_sissi_get_properties_dialog(ObjetSISSI *object_sissi, gboolean is_default);
 
-/*///////////////dïinition of color types  ////////////////*/
-static Color color_red = { 1.0f, 0.0f, 0.0f };
-static Color color_gris = { 0.5f, 0.5f, 0.5f };
-static Color color_gris_clear = { 0.95f, 0.95f, 0.95f };
-static Color color_green = { 0.0f, 1.0f, 0.0f };
-static Color color_green_clear = { 0.87, 0.98f, 0.91 };
 
 #endif /* SISSI_H */

Modified: trunk/objects/SISSI/sissi_dialog.c
==============================================================================
--- trunk/objects/SISSI/sissi_dialog.c	(original)
+++ trunk/objects/SISSI/sissi_dialog.c	Sun Feb  8 20:57:59 2009
@@ -36,46 +36,168 @@
 
 #include "sissi_dialog.h"
 
-/************ function of menace list copy*******/
-extern GList *menace_list_copy(GList *list_old, GList *list_new)
-{
-  unsigned int i;
-  const gchar *s; 
+/************* creation of variable repeat for each object based on EBIOS method */
 
-  for (i=0;i<g_list_length(list_old);i++)
-  {
+static SISSI_Property property_classification_data[] = {
+  { N_("No Protection"), "NO_PROTECTION" ,NULL},
+  { N_("Restricted Diffusion"), "RESTRICTED_DIFFUSION" ,NULL},
+  { N_("Special Country Confidential"), "SPECIAL_COUNTRY_CONFIDENTIAL" ,NULL},
+  { N_("NATO Confidential"), "NATO_CONFIDENTIAL" ,NULL},
+  { N_("Personal Confidential"), "PERSONAL_CONFIDENTIAL" ,NULL},
+  { N_("Medical Confidential"), "MEDICAL_CONFIDENTIAL" ,NULL},
+  { N_("Industrial Confidential"), "INDUSTRIE_CONFIDENTIAL" ,NULL},
+  { N_("Secret"), "SECRET" ,NULL},
+  { N_("Secret special country"), "SECRET_SPECIAL_COUNTRY" ,NULL},
+  { N_("NATO Secret"), "NATO_SECRET" ,NULL},
+  { N_("Very Secret"), "VERY_SECRET" ,NULL},
+  { N_("NATO Very Secret"), "NATO_VERY_SECRET" ,NULL},
+  { NULL,0,NULL}
+};
 
-   SISSI_Property_Menace *new_property_menace;
-   new_property_menace=g_new0(SISSI_Property_Menace,1);
-		/*Label*/
-   s = ((SISSI_Property_Menace *)(g_list_nth(list_old,i)->data))->label;
-   if (s && s[0])
-      new_property_menace->label = g_strdup (s);
-   else
-      new_property_menace->label = NULL;
-		/* comments */
-   s = ((SISSI_Property_Menace *)(g_list_nth(list_old,i)->data))->comments;
-   if (s && s[0])
-      new_property_menace->comments = g_strdup (s);
-   else
-      new_property_menace->comments = NULL;
+static SISSI_Property property_integrity_data[] = {
+  { N_("No integrity"), "NULL" ,NULL},
+  { N_("Low integrity"), "LOW_INTEGRITY" ,NULL},
+  { N_("Average software integrity"), "AVERAGE_SOFTWARE_INTEGRITY" ,NULL},
+  { N_("High software integrity"), "HIGHT_SOFTWARE_INTEGRITY" ,NULL},
+  { N_("Average hardware integrity"), "AVERAGE_HARDWARE_INTEGRITY" ,NULL},
+  { N_("High hardware integrity"), "HIGHT_HARDWARE_INTEGRITY" ,NULL},
+  { NULL,0,NULL}
+};
 
-   new_property_menace->action = ((SISSI_Property_Menace *)(g_list_nth(list_old,i)->data))->action;
-   
-   new_property_menace->detection = ((SISSI_Property_Menace *)(g_list_nth(list_old,i)->data))->detection;
+static SISSI_Property property_disponibility_level_data[] = {
+  { N_("Millisecond"), "MILLISECOND" ,NULL},
+  { N_("Second"), "SECOND" ,NULL},
+  { N_("Minute"), "MINUTE" ,NULL},
+  { N_("Hour"), "HOUR" ,NULL},
+  { N_("Day"), "DAY" ,NULL},
+  { N_("Week"), "WEEK" ,NULL},
+  { NULL,0,NULL}
+};
 
-   new_property_menace->vulnerability = ((SISSI_Property_Menace *)(g_list_nth(list_old,i)->data))->vulnerability;
-   
-   list_new=g_list_append(list_new,new_property_menace);
-  }
-  return list_new;
-}
+static SISSI_Property property_system_data[] = {
+  { N_("SYSTEM"), "SYS",NULL},
+  { N_("Internet access device"), "SYS_INT",NULL},
+  { N_("Electronic messaging"), "SYS_MAIL",NULL},
+  { N_("Intranet"), "SYS_ITR",NULL},
+  { N_("Company directory"), "SYS_DIRECTORY",NULL},
+  { N_("External portal"), "SYS_WEB",NULL},
+  { NULL,0,NULL}
+};
+
+static SISSI_Property property_organisation_data[] = {
+  { N_("ORGANISATION"), "ORG",NULL},
+     { N_("Higher-tier organisation"), "ORG_DEP",NULL},
+     { N_("Structure of the organisation"), "ORG_GEN",NULL},
+     { N_("Project or system organisation"), "ORG_PRO",NULL},
+     { N_("Subcontractors / Suppliers / Manufacturers"),"ORG_EXT",NULL},
+  { NULL,0,NULL}
+};
+
+static SISSI_Property property_physic_data[] = {
+  { N_("SITE"), "PHY",NULL},
+   { N_("Places"), "PHY_LIE",NULL},
+     { N_("External environment"), "PHY_LIE1",NULL},
+     { N_("Premises"), "PHY_LIE2",NULL},
+     { N_("Zone"), "PHY_LIE3",NULL},
+   { N_("Essential Services"), "PHY_SRV",NULL},
+     { N_("Communication"), "PHY_SRV1",NULL},
+     { N_("Power"), "PHY_SRV2",NULL},
+     { N_("Cooling / Pollution"), "PHY_SRV3",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecTHERMIC_data[] = {
+  { N_("Thermal detection"), "PHY_DETECTION_THERMIC",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecFIRE_data[] = {
+  { N_("Fire detection"), "PHY_DETECTION_FIRE",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecWATER_data[] = {
+  { N_("Water detection"), "PHY_DETECTION_WATER",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecAIR_data[] = {
+  { N_("Air detection"), "PHY_DETECTION_AIR",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecENERGY_data[] = {
+  { N_("Energy detection"), "PHY_DETECTION_ENERGY",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_detecINTRUSION_data[] = {
+  { N_("Intrusion detection"), "PHY__DETECTION_INTRUSION",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionTHERMIC_data[] = {
+  { N_("Thermal action"), "PHY_ACTION_THERMIC",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionFIRE_data[] = {
+  { N_("Fire action"), "PHY_ACTION_FIRE",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionWATER_data[] = {
+ { N_("Water action"), "PHY_ACTION_WATER",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionAIR_data[] = {
+  { N_("Air action"), "PHY_ACTION_AIR",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionENERGY_data[] = {
+  { N_("Energy action"), "PHY_ACTION_ENERGY",NULL},
+  { NULL, 0,NULL}
+};
+static SISSI_Property property_physic_actionINTRUSION_data[] = {
+  { N_("Intrusion action"), "PHY_ACTION_INTRUSION",NULL},
+  { NULL, 0,NULL}
+};
+
+static SISSI_Property property_personnel_data[] = {
+  { N_("Personal"), "PER",NULL},
+   { N_("Decision maker"), "PER_DEC",NULL},
+   { N_("SSI Responsible"), "PER_RESP_SSI",NULL},
+   { N_("Users"), "PER_UTI",NULL},
+   { N_("Functional administrator"), "PER_FONC_ADMIN",NULL},
+   { N_("Technical administrator"), "PER_TECH_ADMIN",NULL},
+   { N_("SSI administrator"), "PER_SSI_ADMIN",NULL},
+   { N_("Developer"), "PER_DEV",NULL},
+   { N_("Operator / Maintenance"), "PER_EXP",NULL},
+  { NULL, 0,NULL}
+};
+
+static SISSI_Property property_reseau_data[] = {
+  { N_("Network"), "RES",NULL},
+   { N_("Medium and support"), "RES_INF",NULL},
+   { N_("Passive or active relay"), "RES_REL",NULL},
+   { N_("Communication interface"), "RES_INT",NULL},
+  { NULL, 0,NULL}
+};
+
+static SISSI_Property property_logiciel_data[] = {
+  { N_("Software"), "LOG",NULL},
+    { N_("Operating System"), "LOG_OS",NULL},
+    { N_("Service - maintenance or administration software"), "LOG_SRV",NULL},
+    { N_("Packaged software or standard software"), "LOG_STD",NULL},
+    { N_("Business application"), "LOG_APP",NULL},
+      { N_("Standard business application"), "LOG_APP1",NULL},
+      { N_("Specific business application"), "LOG_APP2",NULL},
+  { NULL, 0,NULL}
+};
+
+static SISSI_Property property_material_data[] = {
+  { N_("HARDWARE"), "MAT",NULL},
+  { N_("Data-processing equipment (active)"), "MAT_ACT",NULL},
+  { N_("Mobile equipment"), "MAT_ACT1",NULL},
+  { N_("Fixed equipment"), "MAT_ACT2",NULL},
+  { N_("Peripheral processing"), "MAT_ACT3",NULL},
+  { N_("Electronic medium"), "MAT_PAS1",NULL},
+  { N_("Other media"), "MAT_PAS2",NULL},  
+  { N_("Data medium (passive)"), "MAT_PAS",NULL},
+  { NULL, 0,NULL}
+};
 
-/************ copy function of menace list in dailog box *******/
-extern void menace_list_copy_gtk(GList *list_old, GList *list_dialog)
-{
-/*  */
-}
 
 static GList *clear_list_property_widget(GList *list)
 {  
@@ -107,13 +229,6 @@
   return list;
 }
 
-static void
-object_sissi_set_state(ObjetSISSI *object_sissi, SISSIState *state)
-{
-  g_free(state);
-  object_sissi_update_data(object_sissi, ANCHOR_MIDDLE, ANCHOR_MIDDLE);
-}
-
 
 static void
 object_sissi_change_apply(SISSIChange *change, DiaObject *obj)
@@ -983,7 +1098,7 @@
 
 }
 /* apply the properties of dialog box to Object */
-extern ObjectChange *
+ObjectChange *
 object_sissi_apply_properties_dialog(ObjetSISSI *object_sissi)
 {
   SISSIDialog *prop_dialog;
@@ -1067,13 +1182,3 @@
   return object_sissi->properties_dialog->dialog;
 }
 
-static SISSI_Property *property_copy(SISSI_Property *prop)
-{
-  SISSI_Property *newprop;
-  newprop = g_new0(SISSI_Property, 1);
-  
-  newprop->label = g_strdup(prop->label);
-  newprop->value = g_strdup(prop->value);
-  newprop->description = g_strdup(prop->description);
-  return newprop;
-};

Modified: trunk/objects/SISSI/sissi_dialog.h
==============================================================================
--- trunk/objects/SISSI/sissi_dialog.h	(original)
+++ trunk/objects/SISSI/sissi_dialog.h	Sun Feb  8 20:57:59 2009
@@ -40,10 +40,6 @@
 
 #include "plug-ins.h"
 
-extern GList *menace_list_copy(GList *list_old, GList *list_new);
-extern void menace_list_copy_gtk(GList *list_old, GList *list_dialog);
-
-static SISSIState *object_sissi_get_state(ObjetSISSI *object_sissi);
 static Propriete *propriete_copy(Propriete *Prop);
 static ObjectChange *new_sissi_change(ObjetSISSI *object_sissi, SISSIState *state, GList *added, GList *deleted, GList *disconnected);
 

Modified: trunk/objects/SISSI/sissi_object.c
==============================================================================
--- trunk/objects/SISSI/sissi_object.c	(original)
+++ trunk/objects/SISSI/sissi_object.c	Sun Feb  8 20:57:59 2009
@@ -163,11 +163,7 @@
   SISSI_Property *properties_others;
   Url_Docs *url_doc;
   Point pos;
-  int fd;
-  gchar *filename = NULL;
-  char composition_filename[255];
   xmlDocPtr doc;
-  xmlNsPtr namespace;
   /* DiagramData *data; */
   xmlNodePtr diagramdata,composite;
   AttributeNode attr;
@@ -311,7 +307,6 @@
   ObjetSISSI *object_sissi;
   Element *elem;
   DiaObject *obj;
-  gchar *file_name;
   DiaFont* action_font;
 /*  Point defaultlen  = {1.0,0.0}, pos;*/
   Point pos;

Modified: trunk/objects/SISSI/sissi_object.h
==============================================================================
--- trunk/objects/SISSI/sissi_object.h	(original)
+++ trunk/objects/SISSI/sissi_object.h	Sun Feb  8 20:57:59 2009
@@ -38,7 +38,6 @@
 static DiaObject *sissi_object_load(ObjectNode obj_node, int version, const char *filename);
 static void sissi_object_get_props(ObjetSISSI *object_sissi, GPtrArray *props);
 static void sissi_object_set_props(ObjetSISSI *object_sissi, GPtrArray *props);
-static GList *create_list_properties_others(GList *list_propriete_other);
 
 #endif /* GENERIC_H */
 

Modified: trunk/objects/SISSI/site.c
==============================================================================
--- trunk/objects/SISSI/site.c	(original)
+++ trunk/objects/SISSI/site.c	Sun Feb  8 20:57:59 2009
@@ -66,6 +66,8 @@
 #define TEXT_HEIGHT (2.0)
 #define NUM_CONNECTIONS 9
 
+static Color color_green_clear = { 0.87, 0.98f, 0.91 };
+
 #ifdef G_OS_WIN32
 #include <io.h>
 #define mkstemp(s) _open(_mktemp(s), O_CREAT | O_TRUNC | O_WRONLY | _O_BINARY, 0644)

Modified: trunk/objects/UML/association.c
==============================================================================
--- trunk/objects/UML/association.c	(original)
+++ trunk/objects/UML/association.c	Sun Feb  8 20:57:59 2009
@@ -173,8 +173,6 @@
 static void association_set_state(Association *assoc,
 				  AssociationState *state);
 
-static void association_save(Association *assoc, ObjectNode obj_node,
-			     const char *filename);
 static DiaObject *association_load(ObjectNode obj_node, int version,
 				const char *filename);
 
@@ -928,39 +926,6 @@
   return &newassoc->orth.object;
 }
 
-
-static void
-association_save(Association *assoc, ObjectNode obj_node,
-		 const char *filename)
-{
-  int i;
-  AttributeNode attr;
-  DataNode composite;
-  
-  orthconn_save(&assoc->orth, obj_node);
-
-  data_add_string(new_attribute(obj_node, "name"),
-		  assoc->name);
-  data_add_enum(new_attribute(obj_node, "direction"),
-		assoc->direction);
-
-  attr = new_attribute(obj_node, "ends");
-  for (i=0;i<2;i++) {
-    composite = data_add_composite(attr, NULL);
-
-    data_add_string(composite_add_attribute(composite, "role"),
-		    assoc->end[i].role);
-    data_add_string(composite_add_attribute(composite, "multiplicity"),
-		    assoc->end[i].multiplicity);
-    data_add_boolean(composite_add_attribute(composite, "arrow"),
-		  assoc->end[i].arrow);
-    data_add_enum(composite_add_attribute(composite, "aggregate"),
-		  assoc->end[i].aggregate);
-    data_add_enum(composite_add_attribute(composite, "visibility"),
-		assoc->end[i].visibility);
-  }
-}
-
 static DiaObject *
 association_load(ObjectNode obj_node, int version, const char *filename)
 {
@@ -1062,21 +1027,3 @@
   return &assoc->orth.object;
 }
 
-static ObjectChange *
-association_apply_properties(Association *assoc)
-{
-  const char *str;
-  GtkWidget *menuitem;
-  int i;
-  ObjectState *old_state;
-
-  old_state = (ObjectState *)association_get_state(assoc);
-  
-  /* Read from dialog and put in object: */
-  /* ... */
-
-  association_set_state(assoc, association_get_state(assoc));
-  return new_object_state_change(&assoc->orth.object, old_state, 
-				 (GetStateFunc)association_get_state,
-				 (SetStateFunc)association_set_state);
-}

Modified: trunk/objects/custom/custom_object.h
==============================================================================
--- trunk/objects/custom/custom_object.h	(original)
+++ trunk/objects/custom/custom_object.h	Sun Feb  8 20:57:59 2009
@@ -22,4 +22,5 @@
 #ifndef CUSTOM_OBJECT_H
 #define CUSTOM_OBJECT_H
 void custom_setup_properties (ShapeInfo *info, xmlNodePtr node);
+void custom_object_new(ShapeInfo *info, DiaObjectType **otype);
 #endif /* CUSTOM_OBJECT_H */

Modified: trunk/objects/custom_lines/line_info.c
==============================================================================
--- trunk/objects/custom_lines/line_info.c	(original)
+++ trunk/objects/custom_lines/line_info.c	Sun Feb  8 20:57:59 2009
@@ -65,18 +65,19 @@
   return tmp;
 }
 
-guint line_info_get_line_type( const gchar* filename, xmlNodePtr node )
+static guint 
+line_info_get_line_type( const gchar* filename, xmlNodePtr node )
 {
   guint res = CUSTOM_LINETYPE_ZIGZAGLINE;
-  char* tmp = xmlNodeGetContent(node);
+  xmlChar* tmp = xmlNodeGetContent(node);
 
-  if( !strcmp(tmp, "Zigzagline") )
+  if( !strcmp((char*)tmp, "Zigzagline") )
   	res = CUSTOM_LINETYPE_ZIGZAGLINE;
-  else if( !strcmp(tmp, "Polyline") )
+  else if( !strcmp((char*)tmp, "Polyline") )
   	res = CUSTOM_LINETYPE_POLYLINE;
-  else if( !strcmp(tmp, "Bezierline") )
+  else if( !strcmp((char*)tmp, "Bezierline") )
   	res = CUSTOM_LINETYPE_BEZIERLINE;
-  else if( !strcmp(tmp, "All") )
+  else if( !strcmp((char*)tmp, "All") )
   	res = CUSTOM_LINETYPE_ALL;
   else
   	g_warning("%s: `%s' is not a valid line type",filename,tmp);
@@ -87,198 +88,178 @@
 }
 
 
-guint line_info_get_line_style( const gchar* filename, xmlNodePtr node )
+static guint 
+line_info_get_line_style( const gchar* filename, xmlNodePtr node )
 {
   guint res = LINESTYLE_SOLID;
-  char* tmp = xmlNodeGetContent(node);
+  xmlChar* tmp = xmlNodeGetContent(node);
 
-  if( !strcmp(tmp, "Solid") )
+  if( !strcmp((char*)tmp, "Solid") )
   	res = LINESTYLE_SOLID;
-  else if( !strcmp(tmp, "Dashed") )
+  else if( !strcmp((char*)tmp, "Dashed") )
   	res = LINESTYLE_DASHED;
-  else if( !strcmp(tmp, "Dash-Dot") )
+  else if( !strcmp((char*)tmp, "Dash-Dot") )
   	res = LINESTYLE_DASH_DOT;
-  else if( !strcmp(tmp, "Dash-Dot-Dot") )
+  else if( !strcmp((char*)tmp, "Dash-Dot-Dot") )
   	res = LINESTYLE_DASH_DOT_DOT;
-  else if( !strcmp(tmp, "Dotted") )
+  else if( !strcmp((char*)tmp, "Dotted") )
   	res = LINESTYLE_DOTTED;
   else
-  	g_warning("%s: `%s' is not a valid line style",filename,tmp);
+  	g_warning("%s: `%s' is not a valid line style", filename, tmp);
 	
   xmlFree(tmp);
   
   return( res );
 }
 
-gfloat line_info_get_as_float( const gchar* filename, xmlNodePtr node )
+static gfloat 
+line_info_get_as_float( const gchar* filename, xmlNodePtr node )
 {
   gfloat res = 1.0f;
-  char* tmp = xmlNodeGetContent(node);
+  xmlChar* tmp = xmlNodeGetContent(node);
 
-  res = g_ascii_strtod( tmp, NULL );
+  res = g_ascii_strtod( (char*)tmp, NULL );
     
   xmlFree(tmp);
   return( res );  
 }
 
-guint line_info_get_arrow_type( const gchar* filename, xmlNodePtr node )
+static guint 
+line_info_get_arrow_type( const gchar* filename, xmlNodePtr node )
 {
   guint res = ARROW_NONE;
-  char* tmp = xmlNodeGetContent(node);
+  xmlChar* tmp = xmlNodeGetContent(node);
 
-  if( !strcmp(tmp, "None") )
+  if( !strcmp((char*)tmp, "None") )
   	res = ARROW_NONE;
-  else if( !strcmp(tmp, "Lines") )
+  else if( !strcmp((char*)tmp, "Lines") )
   	res = ARROW_LINES;
-  else if( !strcmp(tmp, "Hollow-Triangle") )
+  else if( !strcmp((char*)tmp, "Hollow-Triangle") )
   	res = ARROW_HOLLOW_TRIANGLE;
-  else if( !strcmp(tmp, "Filled-Triangle") )
+  else if( !strcmp((char*)tmp, "Filled-Triangle") )
   	res = ARROW_FILLED_TRIANGLE;
-  else if( !strcmp(tmp, "Hollow-Diamond") )
+  else if( !strcmp((char*)tmp, "Hollow-Diamond") )
   	res = ARROW_HOLLOW_DIAMOND;
-  else if( !strcmp(tmp, "Filled-Diamond") )
+  else if( !strcmp((char*)tmp, "Filled-Diamond") )
   	res = ARROW_FILLED_DIAMOND;
-  else if( !strcmp(tmp, "Half-Head") )
+  else if( !strcmp((char*)tmp, "Half-Head") )
   	res = ARROW_HALF_HEAD;
-  else if( !strcmp(tmp, "Slashed-Cross") )
+  else if( !strcmp((char*)tmp, "Slashed-Cross") )
   	res = ARROW_SLASHED_CROSS;
-  else if( !strcmp(tmp, "Filled-Ellipse") )
+  else if( !strcmp((char*)tmp, "Filled-Ellipse") )
   	res = ARROW_FILLED_ELLIPSE;
-  else if( !strcmp(tmp, "Hollow-Ellipse") )
+  else if( !strcmp((char*)tmp, "Hollow-Ellipse") )
   	res = ARROW_HOLLOW_ELLIPSE;
-  else if( !strcmp(tmp, "Double-Hollow-Triangle ") )
+  else if( !strcmp((char*)tmp, "Double-Hollow-Triangle ") )
   	res = ARROW_DOUBLE_HOLLOW_TRIANGLE;
-  else if( !strcmp(tmp, "Double-Filled-Triangle") )
+  else if( !strcmp((char*)tmp, "Double-Filled-Triangle") )
   	res = ARROW_DOUBLE_FILLED_TRIANGLE;
-  else if( !strcmp(tmp, "Unfilled-Triangle ") )
+  else if( !strcmp((char*)tmp, "Unfilled-Triangle ") )
   	res = ARROW_UNFILLED_TRIANGLE;
-  else if( !strcmp(tmp, "Filled-Dot") )
+  else if( !strcmp((char*)tmp, "Filled-Dot") )
   	res = ARROW_FILLED_DOT;
-  else if( !strcmp(tmp, "Dimension-Origin") )
+  else if( !strcmp((char*)tmp, "Dimension-Origin") )
   	res = ARROW_DIMENSION_ORIGIN;
-  else if( !strcmp(tmp, "Blanked-Dot") )
+  else if( !strcmp((char*)tmp, "Blanked-Dot") )
   	res = ARROW_BLANKED_DOT;
-  else if( !strcmp(tmp, "Filled-Box") )
+  else if( !strcmp((char*)tmp, "Filled-Box") )
   	res = ARROW_FILLED_BOX;
-  else if( !strcmp(tmp, "Blanked-Box") )
+  else if( !strcmp((char*)tmp, "Blanked-Box") )
   	res = ARROW_BLANKED_BOX;
-  else if( !strcmp(tmp, "Slash-Arrow") )
+  else if( !strcmp((char*)tmp, "Slash-Arrow") )
   	res = ARROW_SLASH_ARROW;
-  else if( !strcmp(tmp, "Integral-Symbol") )
+  else if( !strcmp((char*)tmp, "Integral-Symbol") )
   	res = ARROW_INTEGRAL_SYMBOL;
-  else if( !strcmp(tmp, "Crow-Foot") )
+  else if( !strcmp((char*)tmp, "Crow-Foot") )
   	res = ARROW_CROW_FOOT;
-  else if( !strcmp(tmp, "Cross") )
+  else if( !strcmp((char*)tmp, "Cross") )
   	res = ARROW_CROSS;
-  else if( !strcmp(tmp, "Filled-Concave") )
+  else if( !strcmp((char*)tmp, "Filled-Concave") )
   	res = ARROW_FILLED_CONCAVE;
-  else if( !strcmp(tmp, "Blanked-Concave") )
+  else if( !strcmp((char*)tmp, "Blanked-Concave") )
   	res = ARROW_BLANKED_CONCAVE;
-  else if( !strcmp(tmp, "Rounded") )
+  else if( !strcmp((char*)tmp, "Rounded") )
   	res = ARROW_ROUNDED;
-  else if( !strcmp(tmp, "Half-Diamond") )
+  else if( !strcmp((char*)tmp, "Half-Diamond") )
   	res = ARROW_HALF_DIAMOND;
-  else if( !strcmp(tmp, "Open-Rounded") )
+  else if( !strcmp((char*)tmp, "Open-Rounded") )
   	res = ARROW_OPEN_ROUNDED;
-  else if( !strcmp(tmp, "Filled-Dot-N-Triangle") )
+  else if( !strcmp((char*)tmp, "Filled-Dot-N-Triangle") )
   	res = ARROW_FILLED_DOT_N_TRIANGLE;
-  else if( !strcmp(tmp, "One-Or-Many") )
+  else if( !strcmp((char*)tmp, "One-Or-Many") )
   	res = ARROW_ONE_OR_MANY;
-  else if( !strcmp(tmp, "None-Or-Many") )
+  else if( !strcmp((char*)tmp, "None-Or-Many") )
   	res = ARROW_NONE_OR_MANY;
-  else if( !strcmp(tmp, "One-Or-None") )
+  else if( !strcmp((char*)tmp, "One-Or-None") )
   	res = ARROW_ONE_OR_NONE;
-  else if( !strcmp(tmp, "One-Exactly") )
+  else if( !strcmp((char*)tmp, "One-Exactly") )
   	res = ARROW_ONE_EXACTLY;
-  else if( !strcmp(tmp, "Backslash") )
+  else if( !strcmp((char*)tmp, "Backslash") )
   	res = ARROW_BACKSLASH;
-  else if( !strcmp(tmp, "Three-Dots") )
+  else if( !strcmp((char*)tmp, "Three-Dots") )
   	res = ARROW_THREE_DOTS;
   else
-  	g_warning("%s: `%s' is not a valid arrow style",filename,tmp);
+  	g_warning("%s: `%s' is not a valid arrow style", filename, tmp);
 	
   xmlFree(tmp);
   
   return( res );
 }
 
-void line_info_get_arrow( const gchar* filename, xmlNodePtr node, Arrow* arrow )
+static void 
+line_info_get_arrow( const gchar* filename, xmlNodePtr node, Arrow* arrow )
 {
   xmlNodePtr child_node = NULL;
-  char* tmp = xmlNodeGetContent(node);
 
   for( child_node = node->xmlChildrenNode;
        child_node != NULL;
-	   child_node = child_node->next )
-  {
+       child_node = child_node->next ) {
     if( xmlIsBlankNode(child_node) )
       continue;
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "type")) {
-	  arrow->type = line_info_get_arrow_type(filename, child_node);
-	}
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "length")) {
-	  arrow->length = line_info_get_as_float(filename, child_node);
-	}
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "width")) {
-	  arrow->width = line_info_get_as_float(filename, child_node);
-	}
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "type"))
+      arrow->type = line_info_get_arrow_type(filename, child_node);
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "length"))
+      arrow->length = line_info_get_as_float(filename, child_node);
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "width"))
+      arrow->width = line_info_get_as_float(filename, child_node);
   }
-  
-  /* res = g_ascii_strtod( tmp, NULL ); */
-    
-  xmlFree(tmp);
 }
 
-void line_info_get_arrows( const gchar* filename, xmlNodePtr node, LineInfo* info )
+static void 
+line_info_get_arrows( const gchar* filename, xmlNodePtr node, LineInfo* info )
 {
   xmlNodePtr child_node = NULL;
-  char* tmp = xmlNodeGetContent(node);
 
   for( child_node = node->xmlChildrenNode;
        child_node != NULL;
-	   child_node = child_node->next )
-  {
+       child_node = child_node->next ) {
     if( xmlIsBlankNode(child_node) )
       continue;
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "start")) {
-	  line_info_get_arrow(filename, child_node, &(info->start_arrow));
-	}
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "end")) {
-	  line_info_get_arrow(filename, child_node, &(info->end_arrow));
-	}
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "start"))
+      line_info_get_arrow(filename, child_node, &(info->start_arrow));
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "end"))
+      line_info_get_arrow(filename, child_node, &(info->end_arrow));
   }
-  
-  /* res = g_ascii_strtod( tmp, NULL ); */
-    
-  xmlFree(tmp);
 }
 
 
-void line_info_get_line_color( const gchar* filename, xmlNodePtr node, LineInfo* info )
+static void 
+line_info_get_line_color( const gchar* filename, xmlNodePtr node, LineInfo* info )
 {
   xmlNodePtr child_node = NULL;
-  char* tmp = xmlNodeGetContent(node);
 
   for( child_node = node->xmlChildrenNode;
        child_node != NULL;
-	   child_node = child_node->next )
-  {
+       child_node = child_node->next ) {
     if( xmlIsBlankNode(child_node) )
       continue;
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "red")) {
-	  info->line_color.red = line_info_get_as_float(filename, child_node);
-	}
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "green")) {
-	  info->line_color.green = line_info_get_as_float(filename, child_node);
-	}
-	else if (/*node->ns == shape_ns &&*/ !strcmp(child_node->name, "blue")) {
-	  info->line_color.blue = line_info_get_as_float(filename, child_node);
-	}
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "red"))
+      info->line_color.red = line_info_get_as_float(filename, child_node);
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "green"))
+      info->line_color.green = line_info_get_as_float(filename, child_node);
+    else if (/*node->ns == shape_ns &&*/ !strcmp((char*)child_node->name, "blue"))
+      info->line_color.blue = line_info_get_as_float(filename, child_node);
   }
-  
-  /* res = g_ascii_strtod( tmp, NULL ); */
-    
-  xmlFree(tmp);
 }
 
 LineInfo* line_info_load_and_apply_from_xmlfile(const gchar *filename, LineInfo* info);
@@ -287,7 +268,7 @@
 {
   LineInfo* res = g_new0(LineInfo, 1);
   
-  res->line_info_filename = filename;  
+  res->line_info_filename = g_strdup(filename);
 
   res->name = "CustomLines - Default";
   res->icon_filename = NULL;
@@ -312,28 +293,28 @@
 {
   LineInfo* res = g_new0(LineInfo, 1);
   
-  res->line_info_filename 	= info->line_info_filename;  
+  res->line_info_filename = g_strdup(info->line_info_filename);
 
-  res->name 				= info->name;
-  res->icon_filename 		= info->icon_filename;
-  res->type 				= info->type;
-  res->line_color.red   	= info->line_color.red;
-  res->line_color.green 	= info->line_color.green;
-  res->line_color.blue  	= info->line_color.blue;
-  res->line_style 			= info->line_style;
-  res->dashlength 			= info->dashlength;
-  res->line_width 			= info->line_width;
-  res->corner_radius 		= info->corner_radius;
-  res->start_arrow.type 	= info->start_arrow.type;
-  res->start_arrow.length 	= (info->start_arrow.length > 0) ?
-                                    info->start_arrow.length : 1.0;
-  res->start_arrow.width 	= (info->start_arrow.width > 0) ? 
-                                    info->start_arrow.width : 1.0;
-  res->end_arrow.type 		= info->end_arrow.type;
-  res->end_arrow.length 	= (info->end_arrow.length > 0) ? 
-                                    info->end_arrow.length : 1.0;
-  res->end_arrow.width 		= (info->end_arrow.width > 0) ? 
-                                    info->end_arrow.width : 1.0;
+  res->name 		  = info->name;
+  res->icon_filename 	  = info->icon_filename;
+  res->type 		  = info->type;
+  res->line_color.red     = info->line_color.red;
+  res->line_color.green   = info->line_color.green;
+  res->line_color.blue    = info->line_color.blue;
+  res->line_style 	  = info->line_style;
+  res->dashlength 	  = info->dashlength;
+  res->line_width 	  = info->line_width;
+  res->corner_radius 	  = info->corner_radius;
+  res->start_arrow.type   = info->start_arrow.type;
+  res->start_arrow.length = (info->start_arrow.length > 0) ?
+                                  info->start_arrow.length : 1.0;
+  res->start_arrow.width  = (info->start_arrow.width > 0) ? 
+                                  info->start_arrow.width : 1.0;
+  res->end_arrow.type     = info->end_arrow.type;
+  res->end_arrow.length   = (info->end_arrow.length > 0) ? 
+                                  info->end_arrow.length : 1.0;
+  res->end_arrow.width 	  = (info->end_arrow.width > 0) ? 
+                                  info->end_arrow.width : 1.0;
 
   return( res );
 }
@@ -341,9 +322,8 @@
 LineInfo* line_info_load_and_apply_from_xmlfile(const gchar *filename, LineInfo* info)
 {
   xmlDocPtr doc = xmlDoParseFile(filename);
-  xmlNsPtr shape_ns, svg_ns;
-  xmlNodePtr node, root, ext_node = NULL;
-  char *tmp;
+  xmlNodePtr node, root;
+  xmlChar *tmp;
   int i;
 
   if (!doc) {
@@ -359,33 +339,33 @@
   i = 0;
   for (node = root->xmlChildrenNode; node != NULL; node = node->next) {
     if (xmlIsBlankNode(node))
-		continue;
+      continue;
     else if (node->type != XML_ELEMENT_NODE)
-		continue;
-    else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "name")) {
+      continue;
+    else if (!strcmp((char*)node->name, "name")) {
       tmp = xmlNodeGetContent(node);
 /*      g_free(info->name);*/
-      info->name = g_strdup(tmp);
+      info->name = g_strdup((char*)tmp);
 /*	  fprintf( stderr, "New shape of type: `%s'\n", info->name ); */
       xmlFree(tmp);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "icon")) {
+    } else if ( !strcmp((char*)node->name, "icon")) {
       tmp = xmlNodeGetContent(node);
       g_free(info->icon_filename);
-      info->icon_filename = custom_get_relative_filename(filename, tmp);
+      info->icon_filename = custom_get_relative_filename(filename, (char*)tmp);
       xmlFree(tmp);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "type")) {
+    } else if ( !strcmp((char*)node->name, "type")) {
       info->type = line_info_get_line_type(filename, node);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "line-style")) {
+    } else if ( !strcmp((char*)node->name, "line-style")) {
       info->line_style = line_info_get_line_style(filename, node);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "dash-length")) {
+    } else if ( !strcmp((char*)node->name, "dash-length")) {
       info->dashlength = line_info_get_as_float(filename, node);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "line-width")) {
+    } else if ( !strcmp((char*)node->name, "line-width")) {
       info->line_width = line_info_get_as_float(filename, node);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "corner-radius")) {
+    } else if ( !strcmp((char*)node->name, "corner-radius")) {
       info->corner_radius = line_info_get_as_float(filename, node);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "arrows")) {
+    } else if ( !strcmp((char*)node->name, "arrows")) {
       line_info_get_arrows(filename, node, info);
-    } else if (/*node->ns == shape_ns &&*/ !strcmp(node->name, "line-color")) {
+    } else if ( !strcmp((char*)node->name, "line-color")) {
       line_info_get_line_color(filename, node, info);
     }
   }

Modified: trunk/objects/standard/arc.c
==============================================================================
--- trunk/objects/standard/arc.c	(original)
+++ trunk/objects/standard/arc.c	Sun Feb  8 20:57:59 2009
@@ -252,68 +252,6 @@
     middle_pos->y += arc->curve_distance*dx/dist;
   }
 }
-/** returns the number of intersection the circle has with the horizontal line at y=horiz
- * if 1 point intersects then *int1 is that point
- * if 2 points intersect then *int1 and *int2 are these points
- */
-static int
-arc_circle_intersects_horiz(const Arc *arc, real horiz, Point *int1, Point *int2){
-  /* inject y=horiz into r^2 = (x-x_c)^2 + (y-y_c)^2 
-   * this is r^2 = (x-x_c)^2 + (horiz-y_c)^2 
-   * translate to x^2 + b*x + c = 0 
-   * b = -2 x_c 
-   * c = x_c^2 - r^2 + (horiz-y_c)^2 
-   * and solve classically */
-  real b, c, delta;
-  b = -2.0 * arc->center.x;
-  c =  arc->center.x * arc->center.x + (horiz - arc->center.y) * (horiz - arc->center.y) - arc->radius * arc->radius;
-  delta = b*b - 4 * c;
-  if (delta < 0)
-          return 0;
-  else if (delta == 0){
-         int1->x = -b/2; 
-         int1->y = horiz;
-         return 1; 
-  }
-  else {
-         int1->x = (sqrt(delta)-b)/2; 
-         int1->y = horiz;
-         int2->x = (-sqrt(delta)-b)/2; 
-         int2->y = horiz;
-          return 2;
-  }
-}
-/** returns the number of intersection the circle has with the vertical line at x=vert
- * if 1 point intersects then *int1 is that point
- * if 2 points intersect then *int1 and *int2 are these points
- */
-static int
-arc_circle_intersects_vert(const Arc *arc, real vert, Point *int1, Point *int2){
-  /* inject x=vert into r^2 = (x-x_c)^2 + (y-y_c)^2 
-   * this is r^2 = (vert-x_c)^2 + (y-y_c)^2 
-   * translate to y^2 + b*y + c = 0 and solve classically */
-  real b, c, delta;
-  b = -2*arc->center.y;
-  c =  arc->center.y * arc->center.y + (vert - arc->center.x) * (vert - arc->center.x) - arc->radius * arc->radius;
-  delta = b*b - 4 * c;
-  if (delta < 0)
-          return 0;
-  else if (delta == 0){
-         int1->y = -b/2; 
-         int1->x = vert;
-         return 1; 
-  }
-  else {
-         int1->y = (sqrt(delta)-b)/2; 
-         int1->x = vert;
-         int2->y = (-sqrt(delta)-b)/2; 
-         int2->x = vert;
-         return 2;
-  }
-}
-        
-        
-            
 
 static real
 arc_compute_curve_distance(const Arc *arc, const Point *start, const Point *end, const Point *mid)
@@ -370,33 +308,6 @@
         
 }
 
-/* finds the closest point intersecting the full circle 
- * at any position on the vertical and horizontal lines going through Point to
- * that point is returned in Point *best if 1 is returned */
-static int
-arc_find_closest_vert_horiz(const Arc *arc, const Point *to, Point *best){
-     Point i1,i2;
-     int nh,nv;
-        nh = arc_circle_intersects_horiz(arc, to->y, &i1, &i2);
-        if (nh==2){
-           *best = *closest_to(to,&i1,&i2);
-        }
-        else if (nh==1) {
-           *best = i1;
-        }
-        nv = arc_circle_intersects_vert(arc, to->x, &i1, &i2);
-        if (nv==2){
-           Point tmp;
-           tmp = *closest_to(to,&i1,&i2);
-           *best = *closest_to(to,&tmp,best);
-        }
-        else if (nv==1) {
-           *best = *closest_to(to,&i1,best);
-        }
-        if (nv|nh)
-                return 1;
-        return 0;
-}
 static ObjectChange*
 arc_move_handle(Arc *arc, Handle *handle,
 		Point *to, ConnectionPoint *cp,

Modified: trunk/objects/standard/line.c
==============================================================================
--- trunk/objects/standard/line.c	(original)
+++ trunk/objects/standard/line.c	Sun Feb  8 20:57:59 2009
@@ -252,7 +252,7 @@
  * the actual end of the line is not moved, but it is made to look like
  * it is shorter.
  */
-void
+static void
 line_adjust_for_absolute_gap(Line *line, Point *gap_endpoints)
 {
   Point endpoints[2];

Modified: trunk/plug-ins/cairo/diacairo-print.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-print.c	(original)
+++ trunk/plug-ins/cairo/diacairo-print.c	Sun Feb  8 20:57:59 2009
@@ -100,7 +100,6 @@
 	   PrintData *print_data)
 {
   Rectangle bounds;
-  int nobjs = 0;
   DiagramData *data = print_data->data;
   int x, y;
   /* the effective sizes - dia already applied is_portrait */
@@ -121,7 +120,6 @@
     bounds.bottom = bounds.top + dp_height;
   } else {
     int nx = ceil((data->extents.right - data->extents.left) / dp_width);
-    int ny = ceil((data->extents.bottom - data->extents.top) / dp_height);
     x = page_nr % nx;
     y = page_nr / nx; 
   }

Modified: trunk/plug-ins/dxf/autocad_pal.c
==============================================================================
--- trunk/plug-ins/dxf/autocad_pal.c	(original)
+++ trunk/plug-ins/dxf/autocad_pal.c	Sun Feb  8 20:57:59 2009
@@ -300,7 +300,7 @@
 int
 pal_get_index (const RGB_t rgb)
 {
-  int i, n;
+  int i, n = 0;
   int dist, last = 256*3;
   
   for (i = 0; i < num_colors; ++i) {

Modified: trunk/plug-ins/dxf/dxf-export.c
==============================================================================
--- trunk/plug-ins/dxf/dxf-export.c	(original)
+++ trunk/plug-ins/dxf/dxf-export.c	Sun Feb  8 20:57:59 2009
@@ -327,7 +327,7 @@
     renderer->tcurrent.font_height = height;
 }
 
-int
+static int
 dxf_color (const Color *color)
 {
     /* Fixed colors

Modified: trunk/plug-ins/libart/dialibartrenderer.c
==============================================================================
--- trunk/plug-ins/libart/dialibartrenderer.c	(original)
+++ trunk/plug-ins/libart/dialibartrenderer.c	Sun Feb  8 20:57:59 2009
@@ -1372,9 +1372,6 @@
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-extern void 
-dia_libart_renderer_iface_init (DiaInteractiveRendererInterface* iface);
-
 GType
 dia_libart_renderer_get_type (void)
 {

Modified: trunk/plug-ins/libart/dialibartrenderer.h
==============================================================================
--- trunk/plug-ins/libart/dialibartrenderer.h	(original)
+++ trunk/plug-ins/libart/dialibartrenderer.h	Sun Feb  8 20:57:59 2009
@@ -54,6 +54,8 @@
   DiaRendererClass parent_class;
 };
 
+void dia_libart_renderer_iface_init (DiaInteractiveRendererInterface* iface);
+
 G_END_DECLS
 
 #endif /* DIA_LIBART_RENDERER_H */

Modified: trunk/plug-ins/postscript/paginate_psprint.c
==============================================================================
--- trunk/plug-ins/postscript/paginate_psprint.c	(original)
+++ trunk/plug-ins/postscript/paginate_psprint.c	Sun Feb  8 20:57:59 2009
@@ -223,9 +223,9 @@
 {
   DiagramData *dia;
 
-  if ((dia = gtk_object_get_user_data(GTK_OBJECT(widget))) != NULL) {
+  if ((dia = g_object_get_data(G_OBJECT(widget), "diagram")) != NULL) {
     g_object_unref(dia);
-    gtk_object_set_user_data(GTK_OBJECT(widget), NULL);
+    g_object_set_data(G_OBJECT(widget), "diagram", NULL);
   }
 
   return FALSE;
@@ -261,7 +261,7 @@
   dialog = gtk_dialog_new();
   /* the dialog has it's own reference to the diagram */
   g_object_ref(dia);
-  gtk_object_set_user_data(GTK_OBJECT(dialog), dia);
+  g_object_set_data(G_OBJECT(dialog), "diagram", dia);
   g_signal_connect(GTK_OBJECT(dialog), "destroy",
 		   G_CALLBACK(diagram_print_destroy), NULL);
   g_signal_connect(GTK_OBJECT(dialog), "delete_event",
@@ -399,7 +399,6 @@
 
       if (g_stat(filename, &statbuf) == 0) {	/* Output file exists */
         GtkWidget *confirm_overwrite_dialog = NULL;
-        char buffer[300];
         char *utf8filename = NULL;
 
         if (!g_utf8_validate(filename, -1, NULL)) {
@@ -411,15 +410,14 @@
           }
         }
 
-        if (utf8filename == NULL) utf8filename = g_strdup(filename);
-        g_snprintf(buffer, 300,
-           _("The file '%s' already exists.\n"
-             "Do you want to overwrite it?"), utf8filename);
-        g_free(utf8filename);
+        if (utf8filename == NULL) 
+	  utf8filename = g_strdup(filename);
         confirm_overwrite_dialog = gtk_message_dialog_new(GTK_WINDOW (dialog),
                        GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
                        GTK_BUTTONS_YES_NO,
-                       buffer);
+                       _("The file '%s' already exists.\n"
+                         "Do you want to overwrite it?"), utf8filename);
+        g_free(utf8filename);
         gtk_window_set_title(GTK_WINDOW (confirm_overwrite_dialog), 
 	                   _("File already exists"));
         gtk_dialog_set_default_response (GTK_DIALOG (confirm_overwrite_dialog),
@@ -434,23 +432,17 @@
         gtk_widget_destroy(confirm_overwrite_dialog);
       }
 
-	  if (write_file) {
+      if (write_file) {
         if (!g_path_is_absolute(filename)) {
-          const char *dirname;
           char *full_filename;
-#if 0
-          dirname = g_path_get_dirname(dia->filename);
-#else
-	  dirname = g_get_home_dir ();
-#endif
-          full_filename = g_build_filename(dirname, filename, NULL);
+
+          full_filename = g_build_filename(g_get_home_dir(), filename, NULL);
           file = g_fopen(full_filename, "w");
           g_free(full_filename);
-          g_free(dirname);
         } else {
           file = g_fopen(filename, "w");
         }
-	  }
+      }
 
       is_pipe = FALSE;
     }

Modified: trunk/plug-ins/python/diamodule.c
==============================================================================
--- trunk/plug-ins/python/diamodule.c	(original)
+++ trunk/plug-ins/python/diamodule.c	Sun Feb  8 20:57:59 2009
@@ -400,7 +400,6 @@
     gchar *menupath;
     gchar *path;
     PyObject *func;
-    DiaCallbackFilter *filter;
     gchar *action;
     PyObject *ret;
 
@@ -436,7 +435,6 @@
     gchar *desc;
     gchar *menupath;
     PyObject *func;
-    DiaCallbackFilter *filter;
 
     if (!PyArg_ParseTuple(args, "sssO:dia.register_action",
 			  &action, &desc, &menupath, &func))
@@ -573,48 +571,51 @@
      * The extra namespacing (prefix 'Dia') isn't necessary either, we use the
      * pythonesque namespacing instead.
      */
+    /* instead to cast to PyObject* we use void* just to silence the ugly
+     * warning: dereferencing type-punned pointer will break strict-aliasing rules
+     */
     PyDict_SetItemString(d, "Diagram",
-			 (PyObject *)&PyDiaDiagram_Type);
+			 (void *)&PyDiaDiagram_Type);
     PyDict_SetItemString(d, "Display",
-			 (PyObject *)&PyDiaDisplay_Type);
+			 (void *)&PyDiaDisplay_Type);
     PyDict_SetItemString(d, "Layer",
-			 (PyObject *)&PyDiaLayer_Type);
+			 (void *)&PyDiaLayer_Type);
     PyDict_SetItemString(d, "Object",
-			 (PyObject *)&PyDiaObject_Type);
+			 (void *)&PyDiaObject_Type);
     PyDict_SetItemString(d, "ObjectType",
-			 (PyObject *)&PyDiaObjectType_Type);
+			 (void *)&PyDiaObjectType_Type);
     PyDict_SetItemString(d, "ConnectionPoint",
-			 (PyObject *)&PyDiaConnectionPoint_Type);
+			 (void *)&PyDiaConnectionPoint_Type);
     PyDict_SetItemString(d, "Handle",
-			 (PyObject *)&PyDiaHandle_Type);
+			 (void *)&PyDiaHandle_Type);
     PyDict_SetItemString(d, "ExportFilter",
-			 (PyObject *)&PyDiaExportFilter_Type);
+			 (void *)&PyDiaExportFilter_Type);
     PyDict_SetItemString(d, "DiagramData",
-			 (PyObject *)&PyDiaDiagramData_Type);
+			 (void *)&PyDiaDiagramData_Type);
     PyDict_SetItemString(d, "Point",
-			 (PyObject *)&PyDiaPoint_Type);
+			 (void *)&PyDiaPoint_Type);
     PyDict_SetItemString(d, "Rectangle",
-			 (PyObject *)&PyDiaRectangle_Type);
+			 (void *)&PyDiaRectangle_Type);
     PyDict_SetItemString(d, "BezPoint",
-			 (PyObject *)&PyDiaBezPoint_Type);
+			 (void *)&PyDiaBezPoint_Type);
     PyDict_SetItemString(d, "Font",
-			 (PyObject *)&PyDiaFont_Type);
+			 (void *)&PyDiaFont_Type);
     PyDict_SetItemString(d, "Color",
-			 (PyObject *)&PyDiaColor_Type);
+			 (void *)&PyDiaColor_Type);
     PyDict_SetItemString(d, "Image",
-			 (PyObject *)&PyDiaImage_Type);
+			 (void *)&PyDiaImage_Type);
     PyDict_SetItemString(d, "Property",
-			 (PyObject *)&PyDiaProperty_Type);
+			 (void *)&PyDiaProperty_Type);
     PyDict_SetItemString(d, "Properties",
-			 (PyObject *)&PyDiaProperties_Type);
+			 (void *)&PyDiaProperties_Type);
     PyDict_SetItemString(d, "Error",
-			 (PyObject *)&PyDiaError_Type);
+			 (void *)&PyDiaError_Type);
     PyDict_SetItemString(d, "Arrow",
-			 (PyObject *)&PyDiaArrow_Type);
+			 (void *)&PyDiaArrow_Type);
     PyDict_SetItemString(d, "Text",
-			 (PyObject *)&PyDiaText_Type);
+			 (void *)&PyDiaText_Type);
     PyDict_SetItemString(d, "Paperinfo",
-			 (PyObject *)&PyDiaPaperinfo_Type);
+			 (void *)&PyDiaPaperinfo_Type);
 
     if (PyErr_Occurred())
 	Py_FatalError("can't initialise module dia");

Modified: trunk/plug-ins/svg/render_svg.c
==============================================================================
--- trunk/plug-ins/svg/render_svg.c	(original)
+++ trunk/plug-ins/svg/render_svg.c	Sun Feb  8 20:57:59 2009
@@ -418,7 +418,7 @@
 
   /* have to do something about fonts here ... */
 
-  xmlSetProp(node, "style", style);
+  xmlSetProp(node, (xmlChar *)"style", (xmlChar *)style);
   g_free(style);
 }
 
@@ -432,14 +432,14 @@
   xmlNodePtr node;
   gchar d_buf[G_ASCII_DTOSTR_BUF_SIZE];
 
-  node = xmlNewChild(renderer->root, renderer->svg_name_space, "text", text);
+  node = xmlNewChild(renderer->root, renderer->svg_name_space, (xmlChar *)"text", (xmlChar *)text);
 
   node_set_text_style(node, renderer, self->font, self->font_height, alignment, colour);
   
   dia_svg_dtostr(d_buf, pos->x);
-  xmlSetProp(node, "x", d_buf);
+  xmlSetProp(node, (xmlChar *)"x", (xmlChar *)d_buf);
   dia_svg_dtostr(d_buf, pos->y);
-  xmlSetProp(node, "y", d_buf);
+  xmlSetProp(node, (xmlChar *)"y", (xmlChar *)d_buf);
 }
 
 static void
@@ -488,7 +488,7 @@
     TextLine *text_line = text->lines[i];
 
     node_tspan = xmlNewChild(node_text, renderer->svg_name_space, (const xmlChar *)"tspan",
-                             text_line_get_string(text_line));
+                             (const xmlChar *)text_line_get_string(text_line));
     dia_svg_dtostr(d_buf, pos.x);
     xmlSetProp(node_tspan, (const xmlChar *)"x", (xmlChar *) d_buf);
     dia_svg_dtostr(d_buf, pos.y);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]