[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.4-20090830-5-g2197f77)
The branch, master has been updated
via 2197f7740aeef021c75504e82ad3004bb6a8e1b0 (commit)
via f850ee37983f27d48d0173b003e8377f0bac3f63 (commit)
via e70cfefcd69a9038ba12759e7f690bc3a041d98c (commit)
via 394425f81b0653fc8efa9f5890217ee4fae631e0 (commit)
via 399560caafde7046fe0e361712389e559969a424 (commit)
from 45002f0be0efb9638bcb96e67bbd1e5d3cd602c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/src/o_net.c | 14 --------------
gschem/src/o_undo.c | 22 +++++++++++++---------
gschem/src/x_preview.c | 5 -----
libgeda/include/libgeda/prototype.h | 5 -----
libgeda/src/f_basic.c | 6 ------
libgeda/src/o_bus_basic.c | 6 +++---
libgeda/src/o_net_basic.c | 20 ++++++++++----------
7 files changed, 26 insertions(+), 52 deletions(-)
=================
Commit Messages
=================
commit 2197f7740aeef021c75504e82ad3004bb6a8e1b0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Make some net consolidation routines private
Don't export the functions which are only used within libgeda.
:100644 100644 f5a4cf5... a716da5... M libgeda/include/libgeda/prototype.h
:100644 100644 4f41895... da5ac22... M libgeda/src/o_bus_basic.c
:100644 100644 55f1edf... 032fce1... M libgeda/src/o_net_basic.c
commit f850ee37983f27d48d0173b003e8377f0bac3f63
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Clarify code to re-select consolidated nets.
Minor re-write to make the logic clearer.
:100644 100644 4ba97b7... 55f1edf... M libgeda/src/o_net_basic.c
commit e70cfefcd69a9038ba12759e7f690bc3a041d98c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Don't explicitly consolidate nets as they are drawn
There is no need to do this here, since all nets are consolidated
in each call to o_undo_savestate().
:100644 100644 f2a68c5... d5f3a73... M gschem/src/o_net.c
commit 394425f81b0653fc8efa9f5890217ee4fae631e0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Don't consolidate nets when loading files.
Nets should be consolidated when placed, not when the file is loaded.
:100644 100644 ff27e62... dd83b68... M gschem/src/x_preview.c
:100644 100644 a4ec639... d5295bc... M libgeda/src/f_basic.c
commit 399560caafde7046fe0e361712389e559969a424
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Fix net consolidation (HACK)
Net consolidation was previously triggered at file save time, until
commit 1f05fb8e7b857c2bba2fbcaa4893ecbedcc478a9 removed the call to
o_net_consolidate() from o_save_buffer().
Unfortunately, gschem relied on this call to ensure net consolidation
behaviour worked as expected. When changes were made on the schematic,
o_undo_savestate() was called to save an undo state (to a temporary
file), which eventually called o_save_buffer(), and this caused nets
on in the schematic to be consolidated.
As a kludge to work around this regression, this commit adds a call
to o_net_consolidate() in o_undo_savestate(). This of course, is not
a nice place to put it! This issue should be revisited after 1.6.x
is released, ideally finding a cleaner place to trigger consolidations.
Notes on the problem:
Consolidate nets needs to happen when:
A new net is drawn (and added to the page)
A net end-point is rubber-banded
A net is moved / copied into place
A net sitting perpendicularly between two colinear nets
(preventing them consolidating) is removed (Cut/Move/Delete)
We want the "undo" state saved to be inclusive of the net
consolidation.. therefore it needs to happen _before_ the undo state
is saved, or we would have to cheat, and consolidate again after any
"undo" / "redo" operation.
Since o_undo_savestate() is called after modifications are made to
the page, it provides a useful (but kludgy) place to catch all of
the above cases before the undo state is saved.
:100644 100644 6465794... f5d26b0... M gschem/src/o_undo.c
=========
Changes
=========
commit 2197f7740aeef021c75504e82ad3004bb6a8e1b0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Make some net consolidation routines private
Don't export the functions which are only used within libgeda.
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index f5a4cf5..a716da5 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -142,8 +142,6 @@ OBJECT *o_bus_copy(TOPLEVEL *toplevel, OBJECT *o_current);
void o_bus_rotate_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object);
void o_bus_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object);
int o_bus_orientation(OBJECT *object);
-void o_bus_consolidate_lowlevel(OBJECT *object, OBJECT *del_object, int orient);
-int o_bus_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object);
void o_bus_consolidate(TOPLEVEL *toplevel);
void o_bus_modify(TOPLEVEL *toplevel, OBJECT *object, int x, int y, int whichone);
@@ -204,9 +202,6 @@ OBJECT *o_net_copy(TOPLEVEL *toplevel, OBJECT *o_current);
void o_net_rotate_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object);
void o_net_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object);
int o_net_orientation(OBJECT *object);
-void o_net_consolidate_lowlevel(OBJECT *object, OBJECT *del_object, int orient);
-int o_net_consolidate_nomidpoint(OBJECT *object, int x, int y);
-int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object);
void o_net_consolidate(TOPLEVEL *toplevel);
void o_net_modify(TOPLEVEL *toplevel, OBJECT *object, int x, int y, int whichone);
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 4f41895..da5ac22 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -412,8 +412,8 @@ int o_bus_orientation(OBJECT *object)
*
* \todo This function is currently not used. Check it before using it
*/
-void o_bus_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
- int orient)
+static void o_bus_consolidate_lowlevel (OBJECT *object,
+ OBJECT *del_object, int orient)
{
int temp1, temp2;
int final1, final2;
@@ -495,7 +495,7 @@ void o_bus_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
*
* \todo Not Implemented Yet
*/
-int o_bus_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
+static int o_bus_consolidate_segments (TOPLEVEL *toplevel, OBJECT *object)
{
return(0);
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 55f1edf..032fce1 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -404,8 +404,8 @@ int o_net_orientation(OBJECT *object)
* \note The first net \a object gets the attributes of the second net
* \a del_object if the two nets are merged together.
*/
-void o_net_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
- int orient)
+static void o_net_consolidate_lowlevel (OBJECT *object,
+ OBJECT *del_object, int orient)
{
int temp1, temp2;
int final1, final2;
@@ -488,7 +488,7 @@ void o_net_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
* \param y y-coord of the connection location
* \return TRUE if there's no midpoint connection, else return FALSE
*/
-int o_net_consolidate_nomidpoint(OBJECT *object, int x, int y)
+static int o_net_consolidate_nomidpoint (OBJECT *object, int x, int y)
{
GList *c_current;
CONN *conn;
@@ -523,7 +523,7 @@ int o_net_consolidate_nomidpoint(OBJECT *object, int x, int y)
* \return 0 if no consolidation was possible, -1 otherwise
*
*/
-int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
+static int o_net_consolidate_segments (TOPLEVEL *toplevel, OBJECT *object)
{
int object_orient;
int other_orient;
commit f850ee37983f27d48d0173b003e8377f0bac3f63
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Clarify code to re-select consolidated nets.
Minor re-write to make the logic clearer.
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 4ba97b7..55f1edf 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -531,7 +531,6 @@ int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
CONN *conn;
OBJECT *other_object;
int changed = 0;
- int reselect_new=FALSE;
if (object == NULL) {
return(0);
@@ -571,12 +570,13 @@ int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
changed++;
if (other_object->selected == TRUE ) {
o_selection_remove (toplevel, toplevel->page_current->selection_list, other_object);
- reselect_new=TRUE;
- }
- if (reselect_new == TRUE) {
- o_selection_remove (toplevel, toplevel->page_current->selection_list, object);
- o_selection_add (toplevel, toplevel->page_current->selection_list, object);
+ /* If we're consolidating with a selected object,
+ * ensure we select the resulting object.
+ */
+ if (object->selected == FALSE) {
+ o_selection_add (toplevel, toplevel->page_current->selection_list, object);
+ }
}
s_conn_remove_object (toplevel, other_object);
commit e70cfefcd69a9038ba12759e7f690bc3a041d98c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Don't explicitly consolidate nets as they are drawn
There is no need to do this here, since all nets are consolidated
in each call to o_undo_savestate().
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index f2a68c5..d5f3a73 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -635,13 +635,6 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
save_wx = w_current->second_wx;
save_wy = w_current->second_wy;
}
-
- /* you don't want to consolidate nets which are drawn non-ortho */
- if (toplevel->net_consolidate == TRUE && !w_current->CONTROLKEY) {
- /* CAUTION: Object list will change when nets are consolidated, don't
- * keep pointers to other objects than new_net after this. */
- o_net_consolidate_segments(toplevel, new_net);
- }
}
@@ -674,13 +667,6 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
g_list_free (prev_conn_objects);
prev_conn_objects = NULL;
-
- /* you don't want to consolidate nets which are drawn non-ortho */
- if (toplevel->net_consolidate == TRUE && !w_current->CONTROLKEY) {
- /* CAUTION: Object list will change when nets are consolidated, don't
- * keep pointers to other objects than new_net after this. */
- o_net_consolidate_segments(toplevel, new_net);
- }
}
toplevel->page_current->CHANGED = 1;
commit 394425f81b0653fc8efa9f5890217ee4fae631e0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Don't consolidate nets when loading files.
Nets should be consolidated when placed, not when the file is loaded.
diff --git a/gschem/src/x_preview.c b/gschem/src/x_preview.c
index ff27e62..dd83b68 100644
--- a/gschem/src/x_preview.c
+++ b/gschem/src/x_preview.c
@@ -232,11 +232,6 @@ preview_update (Preview *preview)
o_read_buffer (preview_toplevel,
NULL, preview->buffer, -1,
_("Preview Buffer")));
-
- /* Is this needed? */
- if (preview_toplevel->net_consolidate == TRUE) {
- o_net_consolidate(preview_toplevel);
- }
}
}
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index a4ec639..d5295bc 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -294,12 +294,6 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
else
g_propagate_error (err, tmp_err);
- /* make sure you init net_consolide to false (default) in all */
- /* programs */
- if (toplevel->net_consolidate == TRUE) {
- o_net_consolidate(toplevel);
- }
-
if (load_backup_file == 0) {
/* If it's not the backup file */
toplevel->page_current->CHANGED=0; /* added 4/7/98 */
commit 399560caafde7046fe0e361712389e559969a424
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Fix net consolidation (HACK)
Net consolidation was previously triggered at file save time, until
commit 1f05fb8e7b857c2bba2fbcaa4893ecbedcc478a9 removed the call to
o_net_consolidate() from o_save_buffer().
Unfortunately, gschem relied on this call to ensure net consolidation
behaviour worked as expected. When changes were made on the schematic,
o_undo_savestate() was called to save an undo state (to a temporary
file), which eventually called o_save_buffer(), and this caused nets
on in the schematic to be consolidated.
As a kludge to work around this regression, this commit adds a call
to o_net_consolidate() in o_undo_savestate(). This of course, is not
a nice place to put it! This issue should be revisited after 1.6.x
is released, ideally finding a cleaner place to trigger consolidations.
Notes on the problem:
Consolidate nets needs to happen when:
A new net is drawn (and added to the page)
A net end-point is rubber-banded
A net is moved / copied into place
A net sitting perpendicularly between two colinear nets
(preventing them consolidating) is removed (Cut/Move/Delete)
We want the "undo" state saved to be inclusive of the net
consolidation.. therefore it needs to happen _before_ the undo state
is saved, or we would have to cheat, and consolidate again after any
"undo" / "redo" operation.
Since o_undo_savestate() is called after modifications are made to
the page, it provides a useful (but kludgy) place to catch all of
the above cases before the undo state is saved.
diff --git a/gschem/src/o_undo.c b/gschem/src/o_undo.c
index 6465794..f5d26b0 100644
--- a/gschem/src/o_undo.c
+++ b/gschem/src/o_undo.c
@@ -89,7 +89,7 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
return;
}
- if (w_current->undo_type == UNDO_DISK && flag == UNDO_ALL) {
+ if (flag == UNDO_ALL) {
/* Increment the number of operations since last backup if
auto-save is enabled */
@@ -97,6 +97,18 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
toplevel->page_current->ops_since_last_backup++;
}
+ /* HACK */
+ /* Before we save the undo state, consolidate nets as necessary */
+
+ /* This is where the net consolidation call would have been
+ * triggered before it was removed from o_save_buffer().
+ */
+ if (toplevel->net_consolidate == TRUE)
+ o_net_consolidate (w_current->toplevel);
+ }
+
+ if (w_current->undo_type == UNDO_DISK && flag == UNDO_ALL) {
+
filename = g_strdup_printf("%s%cgschem.save%d_%d.sch",
tmp_path, G_DIR_SEPARATOR,
prog_pid, undo_file_index++);
@@ -107,15 +119,7 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
saving an undo backup copy */
o_save_curr_page (toplevel, filename);
-
} else if (w_current->undo_type == UNDO_MEMORY && flag == UNDO_ALL) {
-
- /* Increment the number of operations since last backup if
- auto-save is enabled */
- if (toplevel->auto_save_interval != 0) {
- toplevel->page_current->ops_since_last_backup++;
- }
-
object_list = o_glist_copy_all (toplevel,
s_page_objects (toplevel->page_current),
object_list, SELECTION_FLAG);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs