Commit 6462e439 authored by Hans Breuer's avatar Hans Breuer Committed by Hans Breuer
Browse files

global usage of GTK_DISABLE_DEPRECATED broke this file with gtk+-2-14

2008-09-20  Hans Breuer  <hans@breuer.org>

	* app/filedlg.c : global usage of GTK_DISABLE_DEPRECATED broke
	this file with gtk+-2-14

	* app/prefernces.c : avoid setting uninitialized (NULL) units, 
	fixes a crash when starting with an old configuation file

	* lib/text.c : also accept GDK_KP_Enter to ccreate a new line. 
	Fixes bug #539476

	* lib/makefile.msc : reflect renaming of libdia.c to dialib.c

	* NEWS : mention Find&Replace feature

	* plug-ins/python/autolayoutforce.py : more comment

	* samples/render-test.dia samples/Self/PyDiaObjects.dia : update


svn path=/trunk/; revision=4117
parent 77585480
2008-09-20 Hans Breuer <hans@breuer.org>
 
* app/filedlg.c : global usage of GTK_DISABLE_DEPRECATED broke
this file with gtk+-2-14
* app/prefernces.c : avoid setting uninitialized (NULL) units,
fixes a crash when starting with an old configuation file
* lib/text.c : also accept GDK_KP_Enter to ccreate a new line.
Fixes bug #539476
 
* lib/makefile.msc : reflect renaming of libdia.c to dialib.c
* NEWS : mention Find&Replace feature
* plug-ins/python/autolayoutforce.py : more comment
* samples/render-test.dia samples/Self/PyDiaObjects.dia : update
2008-08-10 Hans Breuer <hans@breuer.org>
 
* app/prefernces.c : don't call pref_set_*_unit with NULL
* objects/custom/custom_object.c : add user configurable text padding
and properly consider it during bounding box calculation. Additionally
<svg:text/> elements (fixed text parts) are finally tinted and scaled
......
......@@ -4,6 +4,8 @@
* improved rendering with cairo (PS, PDF, SVG, PNG, EMF) and also some
experimental print through Gtk+/cairo support
* simple Find & Replace for diagram objects names
* dedicated text editing mode finally allows to use 'Del' while editing
text and/or for whole object removal
......
......@@ -21,7 +21,6 @@
#include <config.h>
#include "filedlg.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
......@@ -31,6 +30,7 @@
#include <stdio.h>
#include <glib/gstdio.h>
#undef GTK_DISABLE_DEPRECATED /* gtk_file_chooser_dialog_new_with_backend */
#include <gtk/gtk.h>
#include "intl.h"
#include "filter.h"
......@@ -44,6 +44,8 @@
#include "interface.h"
#include "recent_files.h"
#include "filedlg.h"
static GtkWidget *opendlg = NULL;
static GtkWidget *savedlg = NULL;
static GtkWidget *exportdlg = NULL;
......
......@@ -679,8 +679,10 @@ prefs_update_dialog_from_prefs(void)
static void
update_internal_prefs(DiaPrefData *pref, char *ptr)
{
prefs_set_length_unit(prefs.length_unit);
prefs_set_fontsize_unit(prefs.fontsize_unit);
if (prefs.length_unit)
prefs_set_length_unit(prefs.length_unit);
if (prefs.fontsize_unit)
prefs_set_fontsize_unit(prefs.fontsize_unit);
}
static void
......
......@@ -74,7 +74,7 @@ OBJECTS = \
geometry.obj \
group.obj \
intl.obj \
libdia.obj \
dialib.obj \
message.obj \
newgroup.obj \
neworth_conn.obj \
......
......@@ -2,7 +2,8 @@
# dummy sissi
PLUGINS = gprint cairo cgm dxf hpgl libart metapost pgf pixbuf \
postscript pstricks shape svg vdx wmf wpg xfig xslt
postscript pstricks shape svg vdx wmf wpg xfig xslt \
autolayout
#broken since StdProp overhaul : diaimport
......@@ -45,6 +46,14 @@ PKG_LINK = $(GTK2_LIBS) $(GLIB_LIBS) \
#
# Special object definitions for the various plugins, if needed
#
!IFDEF OBJ_autolayout
PKG_CFLAGS = $(PKG_CFLAGS) -I $(PRJ_TOP)\app
PKG_LINK = $(PKG_LINK) $(PRJ_TOP)\app\dia-app.lib
OBJECTS = \
autolayout.obj \
autolayout-force.obj \
autolayout-register.obj
!ENDIF
!IFDEF OBJ_cairo
PKG_CFLAGS = $(PKG_CFLAGS) $(CAIRO_CFLAGS) -DHAVE_PANGOCAIRO_H
......
......@@ -5,6 +5,7 @@
#
# Playground for the "force based autolayout" algorithm initially implemented
# for Dia in C by Fred Morcos
# See also: http://en.wikipedia.org/wiki/Force-based_algorithms
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -70,11 +71,12 @@ def layout_force (nodes, rconst, aconst, timestep, damping) :
for co in cpt.connected : # connected objects in this point
edge = co
oo = None
for h in edge.handles :
cto = h.connected_to # the other objects connection point
if cto and cto.object != o :
for h in edge.handles : # the edge handles are connected to ...
cto = h.connected_to # ... the other objects connection point
if cto and cto.object != o : # ... one of it being the current
oo = cto.object
# we usually only find _one_ other handle
# we usually only find _one_ other handle but there are exception
# e.g. "Network - Bus"
a = attraction (aconst, o, oo)
netforce[0] += a[0]
netforce[1] += a[1]
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment